lims_sale:Improve warning message adding services without quotation
This commit is contained in:
parent
9523e2a580
commit
1d732df598
|
@ -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 ""
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue