lims: manage service: add report grouping reminder

This commit is contained in:
Adrián Bernardi 2022-02-02 13:11:06 -03:00
parent 7b53e96687
commit 16e85474a2
4 changed files with 38 additions and 11 deletions

View File

@ -5730,6 +5730,10 @@ msgctxt "field:lims.service,method_view:"
msgid "Method"
msgstr "Método"
msgctxt "field:lims.service,not_divided_message:"
msgid "Message"
msgstr "Mensaje"
msgctxt "field:lims.service,number:"
msgid "Number"
msgstr "Número"
@ -6507,13 +6511,21 @@ msgctxt "field:res.user,printer:"
msgid "Printer"
msgstr "Impresora"
msgctxt "field:stock.location,internal_shipment_to_location_restrictions:"
msgid "Internal Shipment To Location Restrictions"
msgstr "Restricciones de Destinos de Envíos Internos"
msgctxt "field:stock.location,storage_time:"
msgid "Storage time (in months)"
msgstr "Tiempo de almacenamiento (en meses)"
msgctxt "field:stock.location,internal_shipment_to_location_restrictions:"
msgid "Internal Shipment To Location Restrictions"
msgstr "Restricciones de Destinos de Envíos Internos"
msgctxt "field:stock.location-stock.location,from_location:"
msgid "Input location"
msgstr "Origen"
msgctxt "field:stock.location-stock.location,to_location:"
msgid "Output location"
msgstr "Destino"
msgctxt "field:stock.move,fraction:"
msgid "Fraction"
@ -6527,14 +6539,6 @@ msgctxt "field:stock.shipment.internal,to_location_domain:"
msgid "Internal Shipment To Location Restrictions Domain"
msgstr "Dominio de Restricciones de Destinos de Envíos Internos"
msgctxt "field:stock.location-stock.location,from_location:"
msgid "Input location"
msgstr "Origen"
msgctxt "field:stock.location-stock.location,to_location:"
msgid "Output location"
msgstr "Destino"
msgctxt "field:user.department,default:"
msgid "By default"
msgstr "Por defecto"
@ -7783,6 +7787,10 @@ msgctxt "model:ir.message,text:msg_device_type_code_unique_id"
msgid "Device type code must be unique"
msgstr "El código del tipo de equipo debe ser único"
msgctxt "model:ir.message,text:msg_divide_report"
msgid "Remember to load the report grouper in the analyzes"
msgstr "Recuerde cargar el agrupador de informe en los análisis"
msgctxt "model:ir.message,text:msg_division_zero"
msgid "Division by 0 (occured at index %(index)s)"
msgstr "División por 0 (producido en el índice %(index)s)"
@ -10002,6 +10010,10 @@ msgctxt "model:res.group,name:group_notebook_repeat_analysis"
msgid "Lims Analysis repetition"
msgstr "Lims Repetición de análisis"
msgctxt "model:stock.location-stock.location,name:"
msgid "Location restriction"
msgstr "Restricción de Destino"
msgctxt "model:user.department,name:"
msgid "User Department"
msgstr "Usuario Departamento"

View File

@ -400,6 +400,9 @@
<record model="ir.message" id="msg_not_divided">
<field name="text">You can not confirm fraction because is not yet divided</field>
</record>
<record model="ir.message" id="msg_divide_report">
<field name="text">Remember to load the report grouper in the analyzes</field>
</record>
<record model="ir.message" id="msg_no_sample_sequence">
<field name="text">There is no sample sequence for the work year "%(work_year)s".</field>
</record>

View File

@ -393,6 +393,8 @@ class Service(ModelSQL, ModelView):
searcher='search_confirmed')
confirmation_date = fields.Date('Confirmation date', readonly=True)
divide = fields.Boolean('Divide Report')
not_divided_message = fields.Char('Message', readonly=True,
states={'invisible': Not(Bool(Eval('not_divided_message')))})
has_results_report = fields.Function(fields.Boolean('Results Report'),
'get_has_results_report')
manage_service_available = fields.Function(fields.Boolean(
@ -530,6 +532,8 @@ class Service(ModelSQL, ModelView):
super().write(*args)
actions = iter(args)
for services, vals in zip(actions, actions):
if vals.get('not_divided_message'):
cls.write(services, {'not_divided_message': None})
check_duplicated = False
for field in ('analysis', 'method'):
if vals.get(field):
@ -1187,6 +1191,13 @@ class Service(ModelSQL, ModelView):
return []
return [x[0] for x in res]
@fields.depends('divide')
def on_change_divide(self):
if self.divide:
self.not_divided_message = gettext('lims.msg_divide_report')
else:
self.not_divided_message = ''
@classmethod
def get_views_field(cls, services, names):
result = {}

View File

@ -36,6 +36,7 @@
<field name="divide"/>
<label name="confirmation_date"/>
<field name="confirmation_date"/>
<field name="not_divided_message" colspan="4" yexpand="0"/>
<group id="estimated_waiting_laboratory" colspan="2" col="2">
<label name="estimated_waiting_laboratory"/>
<field name="estimated_waiting_laboratory"/>