lims: add two digits year to sequence substitutions
This commit is contained in:
parent
280163bcd7
commit
ffb222bbe7
|
@ -39,6 +39,7 @@ def register():
|
|||
configuration.LabWorkYearSequence,
|
||||
configuration.LabWorkYearHoliday,
|
||||
configuration.Cron,
|
||||
configuration.Sequence,
|
||||
laboratory.LaboratoryProfessional,
|
||||
laboratory.Laboratory,
|
||||
laboratory.LabMethod,
|
||||
|
|
|
@ -672,3 +672,17 @@ class Cron(metaclass=PoolMeta):
|
|||
('lims.trend.chart|clean',
|
||||
"Lims Clean Inactive Trend Charts"),
|
||||
])
|
||||
|
||||
|
||||
class Sequence(metaclass=PoolMeta):
|
||||
__name__ = 'ir.sequence'
|
||||
|
||||
@classmethod
|
||||
def _get_substitutions(cls, date):
|
||||
pool = Pool()
|
||||
Date = pool.get('ir.date')
|
||||
res = super(Sequence, cls)._get_substitutions(date)
|
||||
if not date:
|
||||
date = Date.today()
|
||||
res['year2'] = date.strftime('%y')
|
||||
return res
|
||||
|
|
|
@ -211,5 +211,13 @@
|
|||
<field name="group" ref="group_attachments_global"/>
|
||||
</record>
|
||||
|
||||
<!-- Sequence -->
|
||||
|
||||
<record model="ir.ui.view" id="sequence_view_form">
|
||||
<field name="model">ir.sequence</field>
|
||||
<field name="inherit" ref="ir.sequence_view_form"/>
|
||||
<field name="name">sequence_form</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</tryton>
|
||||
|
|
|
@ -15327,6 +15327,14 @@ msgctxt "view:res.user:"
|
|||
msgid "LIMS"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:ir.sequence:"
|
||||
msgid "${year2}"
|
||||
msgstr "${year2}"
|
||||
|
||||
msgctxt "view:ir.sequence:"
|
||||
msgid "Year (two digits):"
|
||||
msgstr "Año (dos dígitos):"
|
||||
|
||||
msgctxt "wizard_button:lims.analysis.family.duplicate,start,duplicate:"
|
||||
msgid "Duplicate"
|
||||
msgstr "Duplicar"
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<data>
|
||||
<xpath expr="/form/label[@id='year']" position="after">
|
||||
<label string="Year (two digits):" id="label_year2"/>
|
||||
<label string="${year2}" colspan="3" xalign="0.0" xexpand="1" id="year2"/>
|
||||
</xpath>
|
||||
</data>
|
Loading…
Reference in New Issue