lims: entry: pre-assign sample numbers (2)

This commit is contained in:
Adrián Bernardi 2022-02-17 18:51:06 -03:00
parent a7f0a22ed3
commit c5193dff6b
3 changed files with 13 additions and 0 deletions

View file

@ -134,6 +134,8 @@ class Entry(Workflow, ModelSQL, ModelView):
block_entry_confirmation = fields.Function(fields.Boolean(
'Block Entry Confirmation'), 'get_block_entry_confirmation')
multi_party = fields.Boolean('Multi Party', readonly=True, select=True)
pre_assigned_samples = fields.Function(fields.Integer(
'Pre-Assigned Samples'), 'get_pre_assigned_samples')
@classmethod
def __setup__(cls):
@ -768,6 +770,11 @@ class Entry(Workflow, ModelSQL, ModelView):
return (self.invoice_party and
self.invoice_party.block_entry_confirmation or False)
def get_pre_assigned_samples(self, name=None):
pool = Pool()
EntryPreAssignedSample = pool.get('lims.entry.pre_assigned_sample')
return EntryPreAssignedSample.search_count([('entry', '=', self.id)])
class EntryInvoiceContact(ModelSQL, ModelView):
'Entry Invoice Contact'

View file

@ -1379,6 +1379,10 @@ msgctxt "field:lims.entry,pending_reason:"
msgid "Pending reason"
msgstr "Razón de la espera"
msgctxt "field:lims.entry,pre_assigned_samples:"
msgid "Pre-Assigned Samples"
msgstr "Muestras preasignadas"
msgctxt "field:lims.entry,report_comments:"
msgid "Report comments"
msgstr "Observaciones informe"

View file

@ -36,6 +36,8 @@
<field name="package_state"/>
<label name="packages_quantity"/>
<field name="packages_quantity"/>
<label name="pre_assigned_samples"/>
<field name="pre_assigned_samples"/>
</page>
<page string="Contacts" id="contacts">
<field name="invoice_contacts" colspan="4"/>