lims_sale:Improve warning message adding services without quotation

This commit is contained in:
Ignacio Parszyk 2023-08-15 19:05:03 -03:00
parent 9523e2a580
commit 1d732df598
3 changed files with 12 additions and 2 deletions

View File

@ -312,6 +312,10 @@ msgctxt "model:ir.message,text:msg_party_services_without_quotation"
msgid "This party does not allow services without quotation."
msgstr "Esta entidad no permite servicios sin presupuesto."
msgctxt "model:ir.message,text:msg_adding_services_without_quotation"
msgid "Services without quotation will be added."
msgstr "Se añadirán servicios sin presupuesto."
msgctxt "model:ir.message,text:msg_sale_completed_manual"
msgid "The quote will change to 'done' with all services completed."
msgstr ""

View File

@ -7,6 +7,9 @@
<record model="ir.message" id="msg_party_services_without_quotation">
<field name="text">This party does not allow services without quotation.</field>
</record>
<record model="ir.message" id="msg_adding_services_without_quotation">
<field name="text">Services without quotation will be added.</field>
</record>
<record model="ir.message" id="msg_sale_completed_manual">
<field name="text">The quote will change to 'done' with all services completed.</field>
</record>

View File

@ -388,10 +388,11 @@ class AddSampleService(metaclass=PoolMeta):
sample = Sample(Transaction().context['active_id'])
error_key = 'lims_services_without_quotation@%s' % sample.entry.number
error_msg = 'lims_sale.msg_party_services_without_quotation'
warning_msg = 'lims_sale.msg_adding_services_without_quotation'
if not sample.entry.allow_services_without_quotation:
raise UserError(gettext(error_msg))
if Warning.check(error_key):
raise UserWarning(error_key, gettext(error_msg))
raise UserWarning(error_key, gettext(warning_msg))
return service_create
@ -409,10 +410,12 @@ class EditSampleService(metaclass=PoolMeta):
sample = Sample(Transaction().context['active_id'])
error_key = 'lims_services_without_quotation@%s' % sample.entry.number
error_msg = 'lims_sale.msg_party_services_without_quotation'
warning_msg = 'lims_sale.msg_adding_services_without_quotation'
if not sample.entry.allow_services_without_quotation:
raise UserError(gettext(error_msg))
if Warning.check(error_key):
raise UserWarning(error_key, gettext(error_msg))
raise UserWarning(error_key, gettext(warning_msg))
return service_create