lims: allows to define "Report trace" in the party

This commit is contained in:
Adrián Bernardi 2022-05-04 17:26:36 -03:00
parent 4452a09bb0
commit cc31f7a5a9
4 changed files with 16 additions and 1 deletions

View File

@ -6547,6 +6547,10 @@ msgctxt "field:party.party,single_sending_report:"
msgid "Single sending of report per Sample"
msgstr "Envío único de Informe por Muestra"
msgctxt "field:party.party,trace_report:"
msgid "Trace report"
msgstr "Informar traza"
msgctxt "field:product.uom,maximum_concentration:"
msgid "Maximum concentration"
msgstr "Concentración máxima"

View File

@ -34,6 +34,7 @@ class Party(metaclass=PoolMeta):
entry_zone = fields.Many2One('lims.zone', 'Entry Zone')
block_entry_confirmation = fields.Boolean('Block Entry Confirmation')
carrier = fields.Many2One('carrier', 'Carrier')
trace_report = fields.Boolean('Trace report')
@classmethod
def __setup__(cls):
@ -103,6 +104,10 @@ class Party(metaclass=PoolMeta):
def default_no_acknowledgment_of_receipt():
return False
@staticmethod
def default_trace_report():
return False
def get_results_report_address(self):
pool = Pool()
Address = pool.get('party.address')

View File

@ -2695,6 +2695,10 @@ class Sample(ModelSQL, ModelView):
@staticmethod
def default_trace_report():
Party = Pool().get('party.party')
if (Transaction().context.get('party', 0) > 0):
party = Party(Transaction().context.get('party'))
return party.trace_report
return False
@staticmethod
@ -6162,7 +6166,6 @@ class CreateSample(Wizard):
'date': datetime.now(),
'restricted_entry': False,
'zone_required': config_.zone_required,
'trace_report': False,
'storage_time': 3,
'without_services': False,
}
@ -6181,6 +6184,7 @@ class CreateSample(Wizard):
party_domain = [entry.party.id]
party_id = entry.party.id
defaults['trace_report'] = entry.party.trace_report
if entry.party.entry_zone:
defaults['zone'] = entry.party.entry_zone.id

View File

@ -13,6 +13,8 @@
<field name="entry_single_sending_report"/>
<label name="no_acknowledgment_of_receipt"/>
<field name="no_acknowledgment_of_receipt"/>
<label name="trace_report"/>
<field name="trace_report"/>
</group>
<label name="report_language"/>
<field name="report_language" widget="selection"/>