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
cbbe536c52
commit
1e0b5798f3
4 changed files with 30 additions and 4 deletions
11
locale/ca.po
11
locale/ca.po
|
@ -2,11 +2,11 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
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"
|
msgid "Purchase Homologation Required"
|
||||||
msgstr "Requereix homologació"
|
msgstr "Requereix homologació"
|
||||||
|
|
||||||
msgctxt "field:product.product,purchase_homologation_required:"
|
msgctxt "field:product.template,purchase_homologation_required:"
|
||||||
msgid "Purchase Homologation Required"
|
msgid "Purchase Homologation Required"
|
||||||
msgstr "Requereix homologació"
|
msgstr "Requereix homologació"
|
||||||
|
|
||||||
|
@ -17,3 +17,10 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"No es pot finalitzar la compra \"%(purchase)s\" perquè la línia \"%(line)s\""
|
"No es pot finalitzar la compra \"%(purchase)s\" perquè la línia \"%(line)s\""
|
||||||
" necessita un proveïdor."
|
" 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 ""
|
msgid ""
|
||||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
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"
|
msgid "Purchase Homologation Required"
|
||||||
msgstr "Requiere homologación"
|
msgstr "Requiere homologación"
|
||||||
|
|
||||||
msgctxt "field:product.product,purchase_homologation_required:"
|
msgctxt "field:product.template,purchase_homologation_required:"
|
||||||
msgid "Purchase Homologation Required"
|
msgid "Purchase Homologation Required"
|
||||||
msgstr "Requiere homologación"
|
msgstr "Requiere homologación"
|
||||||
|
|
||||||
|
@ -17,3 +17,10 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"No se puede finalizar la compra \"%(purchase)s\" porque la línia "
|
"No se puede finalizar la compra \"%(purchase)s\" porque la línia "
|
||||||
"\"%(line)s\" necessita un proveedor."
|
"\"%(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">
|
<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>
|
<field name="text">Cannot end the purchase "%(purchase)s" because the line "%(line)s" needs a supplier.</field>
|
||||||
</record>
|
</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>
|
</data>
|
||||||
</tryton>
|
</tryton>
|
|
@ -20,3 +20,12 @@ class Purchase(metaclass=PoolMeta):
|
||||||
'product_purchase_homologation.cannot_end_purchase',
|
'product_purchase_homologation.cannot_end_purchase',
|
||||||
purchase=purchase.id,
|
purchase=purchase.id,
|
||||||
line=line.rec_name))
|
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