mirror of
https://github.com/NaN-tic/trytond-product_purchase_homologation.git
synced 2023-12-14 02:33:10 +01:00
Now check if a purchase supplier are deactivate before quote the purc… (#2)
* Now check if a purchase supplier are deactivate before quote the purchase. Task #048267
This commit is contained in:
parent
6112d342f7
commit
4eaa8756c1
4 changed files with 30 additions and 4 deletions
11
locale/ca.po
11
locale/ca.po
|
@ -2,11 +2,11 @@
|
|||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:product.template,purchase_homologation_required:"
|
||||
msgctxt "field:product.product,purchase_homologation_required:"
|
||||
msgid "Purchase Homologation Required"
|
||||
msgstr "Requereix homologació"
|
||||
|
||||
msgctxt "field:product.product,purchase_homologation_required:"
|
||||
msgctxt "field:product.template,purchase_homologation_required:"
|
||||
msgid "Purchase Homologation Required"
|
||||
msgstr "Requereix homologació"
|
||||
|
||||
|
@ -17,3 +17,10 @@ msgid ""
|
|||
msgstr ""
|
||||
"No es pot finalitzar la compra \"%(purchase)s\" perquè la línia \"%(line)s\""
|
||||
" necessita un proveïdor."
|
||||
|
||||
msgctxt "model:ir.message,text:product_purchase_deactivate"
|
||||
msgid ""
|
||||
"Cannot end the purchase \"%(purchase)s\" because have a deactivate supplier."
|
||||
msgstr ""
|
||||
"No es pot finalitzar la compra \"%(purchase)s\" perquè un proveïdor "
|
||||
"desactivat."
|
||||
|
|
11
locale/es.po
11
locale/es.po
|
@ -2,11 +2,11 @@
|
|||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:product.template,purchase_homologation_required:"
|
||||
msgctxt "field:product.product,purchase_homologation_required:"
|
||||
msgid "Purchase Homologation Required"
|
||||
msgstr "Requiere homologación"
|
||||
|
||||
msgctxt "field:product.product,purchase_homologation_required:"
|
||||
msgctxt "field:product.template,purchase_homologation_required:"
|
||||
msgid "Purchase Homologation Required"
|
||||
msgstr "Requiere homologación"
|
||||
|
||||
|
@ -17,3 +17,10 @@ msgid ""
|
|||
msgstr ""
|
||||
"No se puede finalizar la compra \"%(purchase)s\" porque la línia "
|
||||
"\"%(line)s\" necessita un proveedor."
|
||||
|
||||
msgctxt "model:ir.message,text:product_purchase_deactivate"
|
||||
msgid ""
|
||||
"Cannot end the purchase \"%(purchase)s\" because have a deactivate supplier."
|
||||
msgstr ""
|
||||
"No se puede finalizar la compra \"%(purchase)s\" porque tiene un proveedor "
|
||||
"desactivado."
|
||||
|
|
|
@ -6,5 +6,8 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<record model="ir.message" id="cannot_end_purchase">
|
||||
<field name="text">Cannot end the purchase "%(purchase)s" because the line "%(line)s" needs a supplier.</field>
|
||||
</record>
|
||||
<record model="ir.message" id="product_purchase_deactivate">
|
||||
<field name="text">Cannot end the purchase "%(purchase)s" because have a deactivate supplier.</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
|
@ -23,3 +23,12 @@ class Purchase(metaclass=PoolMeta):
|
|||
'product_purchase_homologation.cannot_end_purchase',
|
||||
purchase=purchase.id,
|
||||
line=line.rec_name))
|
||||
if (line.product and
|
||||
line.product.purchase_homologation_required and
|
||||
line.product_supplier and
|
||||
line.product_supplier.active == False and
|
||||
line.type == 'line'):
|
||||
raise UserError(gettext(
|
||||
'product_purchase_homologation.product_purchase_deactivate',
|
||||
purchase=purchase.id,
|
||||
))
|
||||
|
|
Loading…
Reference in a new issue