lims_interface: avoid deleting compilations in done state
This commit is contained in:
parent
45f216e286
commit
4681402127
|
@ -1379,6 +1379,9 @@ class Compilation(Workflow, ModelSQL, ModelView):
|
|||
def delete(cls, compilations):
|
||||
Data = Pool().get('lims.interface.data')
|
||||
for c in compilations:
|
||||
if c.state == 'done':
|
||||
raise UserError(gettext(
|
||||
'lims_interface.delete_done_compilation'))
|
||||
with Transaction().set_context(lims_interface_table=c.table):
|
||||
lines = Data.search([('compilation', '=', c.id)])
|
||||
Data.delete(lines)
|
||||
|
|
|
@ -478,6 +478,10 @@ msgctxt "model:ir.action,name:wiz_interface_formula_test"
|
|||
msgid "Test Formula"
|
||||
msgstr "Probar Fórmula"
|
||||
|
||||
msgctxt "model:ir.message,text:delete_done_compilation"
|
||||
msgid "You cannot delete a Compilation in \"Done\" state"
|
||||
msgstr "No puede eliminar una Compilación en estado \"Realizada\""
|
||||
|
||||
msgctxt "model:ir.message,text:duplicated_origin_file"
|
||||
msgid "File \"%(file_name)s\" already exists as origin."
|
||||
msgstr "El archivo \"%(file_name)s\" ya existe como origen de datos."
|
||||
|
|
|
@ -27,5 +27,8 @@
|
|||
<record model="ir.message" id="msg_interface_column_alias_unique">
|
||||
<field name="text">There cannot be two columns with the same alias in an interface.</field>
|
||||
</record>
|
||||
<record model="ir.message" id="delete_done_compilation">
|
||||
<field name="text">You cannot delete a Compilation in "Done" state</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
|
|
Loading…
Reference in New Issue