lims: referral: add sent date

This commit is contained in:
Adrián Bernardi 2021-07-21 20:08:31 -03:00
parent 1329ec53e3
commit c9291dc4ad
4 changed files with 27 additions and 21 deletions

View file

@ -4900,6 +4900,10 @@ msgctxt "field:lims.referral,number:"
msgid "Number"
msgstr "Número"
msgctxt "field:lims.referral,sent_date:"
msgid "Sent date"
msgstr "Fecha de enviado"
msgctxt "field:lims.referral,services:"
msgid "Services"
msgstr "Servicios"
@ -7632,6 +7636,23 @@ msgctxt ""
msgid "In progress"
msgstr "En curso"
msgctxt "model:ir.action.act_window.domain,name:act_referral_list_domain_all"
msgid "All"
msgstr "Todo"
msgctxt "model:ir.action.act_window.domain,name:act_referral_list_domain_done"
msgid "Done"
msgstr "Hecho"
msgctxt ""
"model:ir.action.act_window.domain,name:act_referral_list_domain_draft"
msgid "Draft"
msgstr "Borrador"
msgctxt "model:ir.action.act_window.domain,name:act_referral_list_domain_sent"
msgid "Sent"
msgstr "Enviado"
msgctxt "model:ir.message,text:msg_abs"
msgid "Absence"
msgstr "Ausencia"
@ -15671,23 +15692,3 @@ msgstr "Confirmar"
msgctxt "wizard_button:lims.typification.update,start,end:"
msgid "Cancel"
msgstr "Cancelar"
msgctxt ""
"model:ir.action.act_window.domain,name:act_referral_list_domain_draft"
msgid "Draft"
msgstr "Borrador"
msgctxt ""
"model:ir.action.act_window.domain,name:act_referral_list_domain_sent"
msgid "Sent"
msgstr "Enviado"
msgctxt ""
"model:ir.action.act_window.domain,name:act_referral_list_domain_done"
msgid "Done"
msgstr "Hecho"
msgctxt ""
"model:ir.action.act_window.domain,name:act_referral_list_domain_all"
msgid "All"
msgstr "Todo"

View file

@ -6355,6 +6355,7 @@ class Referral(ModelSQL, ModelView):
number = fields.Char('Number', select=True, readonly=True)
date = fields.Date('Date', required=True,
states=_states, depends=_depends)
sent_date = fields.Date('Sent date', readonly=True)
laboratory = fields.Many2One('party.party', 'Destination Laboratory',
required=True, states=_states, depends=_depends)
carrier = fields.Many2One('carrier', 'Carrier',
@ -6413,6 +6414,7 @@ class Referral(ModelSQL, ModelView):
pool = Pool()
NotebookLine = pool.get('lims.notebook.line')
EntryDetailAnalysis = pool.get('lims.entry.detail.analysis')
Date = pool.get('ir.date')
for referral in referrals:
details = [s for s in referral.services]
@ -6422,7 +6424,7 @@ class Referral(ModelSQL, ModelView):
NotebookLine.write(lines, {'start_date': referral.date})
EntryDetailAnalysis.write(details, {'state': 'referred'})
cls.write(referrals, {'state': 'sent'})
cls.write(referrals, {'state': 'sent', 'sent_date': Date.today()})
@classmethod
def create(cls, vlist):

View file

@ -8,6 +8,8 @@
<field name="date"/>
<label name="carrier"/>
<field name="carrier"/>
<label name="sent_date"/>
<field name="sent_date"/>
<notebook>
<page string="General" id="general">
<field name="services" colspan="4"

View file

@ -4,4 +4,5 @@
<field name="date"/>
<field name="laboratory"/>
<field name="state"/>
<field name="sent_date"/>
</tree>