Product Cost Plan Line rename products_tree to all_products

162382
This commit is contained in:
Raimon Esteve 2023-10-17 16:36:51 +02:00
parent 61d2471b48
commit 664514567a
6 changed files with 83 additions and 360 deletions

View File

@ -2,9 +2,9 @@
msgid "" msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n" msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.cost.plan,active:" msgctxt "field:product.cost.plan,all_products:"
msgid "Active" msgid "All Products"
msgstr "Actiu" msgstr "Tots els productes"
msgctxt "field:product.cost.plan,bom:" msgctxt "field:product.cost.plan,bom:"
msgid "BOM" msgid "BOM"
@ -22,18 +22,6 @@ msgctxt "field:product.cost.plan,costs:"
msgid "Costs" msgid "Costs"
msgstr "Costos" msgstr "Costos"
msgctxt "field:product.cost.plan,create_date:"
msgid "Create Date"
msgstr "Data de creació"
msgctxt "field:product.cost.plan,create_uid:"
msgid "Create User"
msgstr "Usuari de creació"
msgctxt "field:product.cost.plan,id:"
msgid "ID"
msgstr "ID"
msgctxt "field:product.cost.plan,name:" msgctxt "field:product.cost.plan,name:"
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
@ -66,18 +54,10 @@ msgctxt "field:product.cost.plan,products_cost:"
msgid "Products Cost" msgid "Products Cost"
msgstr "Cost dels materials" msgstr "Cost dels materials"
msgctxt "field:product.cost.plan,products_tree:"
msgid "Products"
msgstr "Productes"
msgctxt "field:product.cost.plan,quantity:" msgctxt "field:product.cost.plan,quantity:"
msgid "Quantity" msgid "Quantity"
msgstr "Quantitat" msgstr "Quantitat"
msgctxt "field:product.cost.plan,rec_name:"
msgid "Record Name"
msgstr "Nom del registre"
msgctxt "field:product.cost.plan,uom:" msgctxt "field:product.cost.plan,uom:"
msgid "UoM" msgid "UoM"
msgstr "UdM" msgstr "UdM"
@ -86,30 +66,10 @@ msgctxt "field:product.cost.plan,uom_digits:"
msgid "UoM Digits" msgid "UoM Digits"
msgstr "Digits UdM" msgstr "Digits UdM"
msgctxt "field:product.cost.plan,write_date:"
msgid "Write Date"
msgstr "Data de modificació"
msgctxt "field:product.cost.plan,write_uid:"
msgid "Write User"
msgstr "Usuari de modificació"
msgctxt "field:product.cost.plan.bom_line,bom:" msgctxt "field:product.cost.plan.bom_line,bom:"
msgid "BOM" msgid "BOM"
msgstr "Llista de materials" msgstr "Llista de materials"
msgctxt "field:product.cost.plan.bom_line,create_date:"
msgid "Create Date"
msgstr "Data de creació"
msgctxt "field:product.cost.plan.bom_line,create_uid:"
msgid "Create User"
msgstr "Usuari de creació"
msgctxt "field:product.cost.plan.bom_line,id:"
msgid "ID"
msgstr "ID"
msgctxt "field:product.cost.plan.bom_line,plan:" msgctxt "field:product.cost.plan.bom_line,plan:"
msgid "Plan" msgid "Plan"
msgstr "Pla" msgstr "Pla"
@ -118,34 +78,10 @@ msgctxt "field:product.cost.plan.bom_line,product:"
msgid "Product" msgid "Product"
msgstr "Producte" msgstr "Producte"
msgctxt "field:product.cost.plan.bom_line,rec_name:"
msgid "Record Name"
msgstr "Nom del registre"
msgctxt "field:product.cost.plan.bom_line,write_date:"
msgid "Write Date"
msgstr "Data de modificació"
msgctxt "field:product.cost.plan.bom_line,write_uid:"
msgid "Write User"
msgstr "Usuari de modificació"
msgctxt "field:product.cost.plan.cost,cost:" msgctxt "field:product.cost.plan.cost,cost:"
msgid "Cost" msgid "Cost"
msgstr "Cost" msgstr "Cost"
msgctxt "field:product.cost.plan.cost,create_date:"
msgid "Create Date"
msgstr "Data de creació"
msgctxt "field:product.cost.plan.cost,create_uid:"
msgid "Create User"
msgstr "Usuari de creació"
msgctxt "field:product.cost.plan.cost,id:"
msgid "ID"
msgstr "ID"
msgctxt "field:product.cost.plan.cost,internal_cost:" msgctxt "field:product.cost.plan.cost,internal_cost:"
msgid "Cost (Internal Use)" msgid "Cost (Internal Use)"
msgstr "Cost (ús intern)" msgstr "Cost (ús intern)"
@ -154,10 +90,6 @@ msgctxt "field:product.cost.plan.cost,plan:"
msgid "Plan" msgid "Plan"
msgstr "Pla" msgstr "Pla"
msgctxt "field:product.cost.plan.cost,rec_name:"
msgid "Record Name"
msgstr "Nom del registre"
msgctxt "field:product.cost.plan.cost,sequence:" msgctxt "field:product.cost.plan.cost,sequence:"
msgid "Sequence" msgid "Sequence"
msgstr "Seqüència" msgstr "Seqüència"
@ -170,26 +102,6 @@ msgctxt "field:product.cost.plan.cost,type:"
msgid "Type" msgid "Type"
msgstr "Tipus" msgstr "Tipus"
msgctxt "field:product.cost.plan.cost,write_date:"
msgid "Write Date"
msgstr "Data de modificació"
msgctxt "field:product.cost.plan.cost,write_uid:"
msgid "Write User"
msgstr "Usuari de modificació"
msgctxt "field:product.cost.plan.cost.type,create_date:"
msgid "Create Date"
msgstr "Data de creació"
msgctxt "field:product.cost.plan.cost.type,create_uid:"
msgid "Create User"
msgstr "Usuari de creació"
msgctxt "field:product.cost.plan.cost.type,id:"
msgid "ID"
msgstr "ID"
msgctxt "field:product.cost.plan.cost.type,name:" msgctxt "field:product.cost.plan.cost.type,name:"
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
@ -198,26 +110,10 @@ msgctxt "field:product.cost.plan.cost.type,plan_field_name:"
msgid "Plan Field Name" msgid "Plan Field Name"
msgstr "Nom camp del pla" msgstr "Nom camp del pla"
msgctxt "field:product.cost.plan.cost.type,rec_name:"
msgid "Record Name"
msgstr "Nom del registre"
msgctxt "field:product.cost.plan.cost.type,system:" msgctxt "field:product.cost.plan.cost.type,system:"
msgid "System Managed" msgid "System Managed"
msgstr "Gestionat pel sistema" msgstr "Gestionat pel sistema"
msgctxt "field:product.cost.plan.cost.type,write_date:"
msgid "Write Date"
msgstr "Data de modificació"
msgctxt "field:product.cost.plan.cost.type,write_uid:"
msgid "Write User"
msgstr "Usuari de modificació"
msgctxt "field:product.cost.plan.create_bom.start,id:"
msgid "ID"
msgstr "ID"
msgctxt "field:product.cost.plan.create_bom.start,name:" msgctxt "field:product.cost.plan.create_bom.start,name:"
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
@ -230,18 +126,6 @@ msgctxt "field:product.cost.plan.product_line,cost_price:"
msgid "Cost Price" msgid "Cost Price"
msgstr "Preu de cost" msgstr "Preu de cost"
msgctxt "field:product.cost.plan.product_line,create_date:"
msgid "Create Date"
msgstr "Data de creació"
msgctxt "field:product.cost.plan.product_line,create_uid:"
msgid "Create User"
msgstr "Usuari de creació"
msgctxt "field:product.cost.plan.product_line,id:"
msgid "ID"
msgstr "ID"
msgctxt "field:product.cost.plan.product_line,name:" msgctxt "field:product.cost.plan.product_line,name:"
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
@ -270,10 +154,6 @@ msgctxt "field:product.cost.plan.product_line,quantity:"
msgid "Quantity" msgid "Quantity"
msgstr "Quantitat" msgstr "Quantitat"
msgctxt "field:product.cost.plan.product_line,rec_name:"
msgid "Record Name"
msgstr "Nom del registre"
msgctxt "field:product.cost.plan.product_line,sequence:" msgctxt "field:product.cost.plan.product_line,sequence:"
msgid "Sequence" msgid "Sequence"
msgstr "Seqüència" msgstr "Seqüència"
@ -298,14 +178,6 @@ msgctxt "field:product.cost.plan.product_line,uom_digits:"
msgid "UoM Digits" msgid "UoM Digits"
msgstr "Digits UdM" msgstr "Digits UdM"
msgctxt "field:product.cost.plan.product_line,write_date:"
msgid "Write Date"
msgstr "Data de modificació"
msgctxt "field:product.cost.plan.product_line,write_uid:"
msgid "Write User"
msgstr "Usuari de modificació"
msgctxt "field:production.configuration,product_cost_plan_sequence:" msgctxt "field:production.configuration,product_cost_plan_sequence:"
msgid "Product Cost Plan Sequence" msgid "Product Cost Plan Sequence"
msgstr "Seqüencia pla de costsos de producte" msgstr "Seqüencia pla de costsos de producte"
@ -314,34 +186,10 @@ msgctxt "field:production.configuration.cost_plan,company:"
msgid "Company" msgid "Company"
msgstr "Empresa" msgstr "Empresa"
msgctxt "field:production.configuration.cost_plan,create_date:"
msgid "Create Date"
msgstr "Data de creació"
msgctxt "field:production.configuration.cost_plan,create_uid:"
msgid "Create User"
msgstr "Usuari de creació"
msgctxt "field:production.configuration.cost_plan,id:"
msgid "ID"
msgstr "ID"
msgctxt "field:production.configuration.cost_plan,product_cost_plan_sequence:" msgctxt "field:production.configuration.cost_plan,product_cost_plan_sequence:"
msgid "Product Cost Plan Sequence" msgid "Product Cost Plan Sequence"
msgstr "Seqüencia pla de costsos de producte" msgstr "Seqüencia pla de costsos de producte"
msgctxt "field:production.configuration.cost_plan,rec_name:"
msgid "Record Name"
msgstr "Nom del registre"
msgctxt "field:production.configuration.cost_plan,write_date:"
msgid "Write Date"
msgstr "Data de modificació"
msgctxt "field:production.configuration.cost_plan,write_uid:"
msgid "Write User"
msgstr "Usuari de modificació"
msgctxt "help:product.cost.plan.product_line,party_stock:" msgctxt "help:product.cost.plan.product_line,party_stock:"
msgid "Use stock owned by party instead of company stock." msgid "Use stock owned by party instead of company stock."
msgstr "" msgstr ""
@ -396,6 +244,12 @@ msgctxt "model:ir.message,text:lacks_the_product"
msgid "The Cost Plan \"%(cost_plan)s\" lacks the product." msgid "The Cost Plan \"%(cost_plan)s\" lacks the product."
msgstr "El pla de costos \"%(cost_plan)s\" no té producte." msgstr "El pla de costos \"%(cost_plan)s\" no té producte."
msgctxt "model:ir.message,text:msg_product_line_plan_parent"
msgid "The line \"%(line)s\" can only set plan or parent, not both options."
msgstr ""
"La línia \"%(line)s\" només es pot relacionar amb un pla de cost o un pare, "
"no les dues opcions."
msgctxt "model:ir.message,text:product_already_has_bom" msgctxt "model:ir.message,text:product_already_has_bom"
msgid "Product \"%(product)s\" already has a BOM assigned." msgid "Product \"%(product)s\" already has a BOM assigned."
msgstr "El producte \"%(product)s\" ja té una llista de materials assignada." msgstr "El producte \"%(product)s\" ja té una llista de materials assignada."
@ -492,10 +346,6 @@ msgctxt "view:product.cost.plan:"
msgid "Costs" msgid "Costs"
msgstr "Costos" msgstr "Costos"
msgctxt "view:product.cost.plan:"
msgid "Initialize Cost Plan"
msgstr "Inicialitza el pla de costos"
msgctxt "view:product.cost.plan:" msgctxt "view:product.cost.plan:"
msgid "" msgid ""
"It will modify the product's field loosing the current value. Are you sure?" "It will modify the product's field loosing the current value. Are you sure?"

View File

@ -2,9 +2,9 @@
msgid "" msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n" msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.cost.plan,active:" msgctxt "field:product.cost.plan,all_products:"
msgid "Active" msgid "All Products"
msgstr "Activo" msgstr "Todos los productos"
msgctxt "field:product.cost.plan,bom:" msgctxt "field:product.cost.plan,bom:"
msgid "BOM" msgid "BOM"
@ -22,18 +22,6 @@ msgctxt "field:product.cost.plan,costs:"
msgid "Costs" msgid "Costs"
msgstr "Costes" msgstr "Costes"
msgctxt "field:product.cost.plan,create_date:"
msgid "Create Date"
msgstr "Fecha de creación"
msgctxt "field:product.cost.plan,create_uid:"
msgid "Create User"
msgstr "Usuario de creación"
msgctxt "field:product.cost.plan,id:"
msgid "ID"
msgstr "ID"
msgctxt "field:product.cost.plan,name:" msgctxt "field:product.cost.plan,name:"
msgid "Name" msgid "Name"
msgstr "Nombre" msgstr "Nombre"
@ -66,18 +54,10 @@ msgctxt "field:product.cost.plan,products_cost:"
msgid "Products Cost" msgid "Products Cost"
msgstr "Coste materiales" msgstr "Coste materiales"
msgctxt "field:product.cost.plan,products_tree:"
msgid "Products"
msgstr "Productos"
msgctxt "field:product.cost.plan,quantity:" msgctxt "field:product.cost.plan,quantity:"
msgid "Quantity" msgid "Quantity"
msgstr "Cantidad" msgstr "Cantidad"
msgctxt "field:product.cost.plan,rec_name:"
msgid "Record Name"
msgstr "Nombre del registro"
msgctxt "field:product.cost.plan,uom:" msgctxt "field:product.cost.plan,uom:"
msgid "UoM" msgid "UoM"
msgstr "UdM" msgstr "UdM"
@ -86,30 +66,10 @@ msgctxt "field:product.cost.plan,uom_digits:"
msgid "UoM Digits" msgid "UoM Digits"
msgstr "Dígitos UdM" msgstr "Dígitos UdM"
msgctxt "field:product.cost.plan,write_date:"
msgid "Write Date"
msgstr "Fecha de modificación"
msgctxt "field:product.cost.plan,write_uid:"
msgid "Write User"
msgstr "Usuario de modificación"
msgctxt "field:product.cost.plan.bom_line,bom:" msgctxt "field:product.cost.plan.bom_line,bom:"
msgid "BOM" msgid "BOM"
msgstr "Lista de material" msgstr "Lista de material"
msgctxt "field:product.cost.plan.bom_line,create_date:"
msgid "Create Date"
msgstr "Fecha de creación"
msgctxt "field:product.cost.plan.bom_line,create_uid:"
msgid "Create User"
msgstr "Usuario de creación"
msgctxt "field:product.cost.plan.bom_line,id:"
msgid "ID"
msgstr "ID"
msgctxt "field:product.cost.plan.bom_line,plan:" msgctxt "field:product.cost.plan.bom_line,plan:"
msgid "Plan" msgid "Plan"
msgstr "Plan" msgstr "Plan"
@ -118,34 +78,10 @@ msgctxt "field:product.cost.plan.bom_line,product:"
msgid "Product" msgid "Product"
msgstr "Producto" msgstr "Producto"
msgctxt "field:product.cost.plan.bom_line,rec_name:"
msgid "Record Name"
msgstr "Nombre del registro"
msgctxt "field:product.cost.plan.bom_line,write_date:"
msgid "Write Date"
msgstr "Fecha de modificación"
msgctxt "field:product.cost.plan.bom_line,write_uid:"
msgid "Write User"
msgstr "Usuario de modificación"
msgctxt "field:product.cost.plan.cost,cost:" msgctxt "field:product.cost.plan.cost,cost:"
msgid "Cost" msgid "Cost"
msgstr "Coste" msgstr "Coste"
msgctxt "field:product.cost.plan.cost,create_date:"
msgid "Create Date"
msgstr "Fecha de creación"
msgctxt "field:product.cost.plan.cost,create_uid:"
msgid "Create User"
msgstr "Usuario de creación"
msgctxt "field:product.cost.plan.cost,id:"
msgid "ID"
msgstr "ID"
msgctxt "field:product.cost.plan.cost,internal_cost:" msgctxt "field:product.cost.plan.cost,internal_cost:"
msgid "Cost (Internal Use)" msgid "Cost (Internal Use)"
msgstr "Coste (uso interno)" msgstr "Coste (uso interno)"
@ -154,10 +90,6 @@ msgctxt "field:product.cost.plan.cost,plan:"
msgid "Plan" msgid "Plan"
msgstr "Plan" msgstr "Plan"
msgctxt "field:product.cost.plan.cost,rec_name:"
msgid "Record Name"
msgstr "Nombre del registro"
msgctxt "field:product.cost.plan.cost,sequence:" msgctxt "field:product.cost.plan.cost,sequence:"
msgid "Sequence" msgid "Sequence"
msgstr "Secuencia" msgstr "Secuencia"
@ -170,26 +102,6 @@ msgctxt "field:product.cost.plan.cost,type:"
msgid "Type" msgid "Type"
msgstr "Tipo" msgstr "Tipo"
msgctxt "field:product.cost.plan.cost,write_date:"
msgid "Write Date"
msgstr "Fecha de modificación"
msgctxt "field:product.cost.plan.cost,write_uid:"
msgid "Write User"
msgstr "Usuario de modificación"
msgctxt "field:product.cost.plan.cost.type,create_date:"
msgid "Create Date"
msgstr "Fecha de creación"
msgctxt "field:product.cost.plan.cost.type,create_uid:"
msgid "Create User"
msgstr "Usuario de creación"
msgctxt "field:product.cost.plan.cost.type,id:"
msgid "ID"
msgstr "ID"
msgctxt "field:product.cost.plan.cost.type,name:" msgctxt "field:product.cost.plan.cost.type,name:"
msgid "Name" msgid "Name"
msgstr "Nombre" msgstr "Nombre"
@ -198,26 +110,10 @@ msgctxt "field:product.cost.plan.cost.type,plan_field_name:"
msgid "Plan Field Name" msgid "Plan Field Name"
msgstr "Nombre campo del plan" msgstr "Nombre campo del plan"
msgctxt "field:product.cost.plan.cost.type,rec_name:"
msgid "Record Name"
msgstr "Nombre del registro"
msgctxt "field:product.cost.plan.cost.type,system:" msgctxt "field:product.cost.plan.cost.type,system:"
msgid "System Managed" msgid "System Managed"
msgstr "Gestinado por el sistema" msgstr "Gestinado por el sistema"
msgctxt "field:product.cost.plan.cost.type,write_date:"
msgid "Write Date"
msgstr "Fecha de modificación"
msgctxt "field:product.cost.plan.cost.type,write_uid:"
msgid "Write User"
msgstr "Usuario de modificación"
msgctxt "field:product.cost.plan.create_bom.start,id:"
msgid "ID"
msgstr "ID"
msgctxt "field:product.cost.plan.create_bom.start,name:" msgctxt "field:product.cost.plan.create_bom.start,name:"
msgid "Name" msgid "Name"
msgstr "Nombre" msgstr "Nombre"
@ -230,18 +126,6 @@ msgctxt "field:product.cost.plan.product_line,cost_price:"
msgid "Cost Price" msgid "Cost Price"
msgstr "Precio de coste" msgstr "Precio de coste"
msgctxt "field:product.cost.plan.product_line,create_date:"
msgid "Create Date"
msgstr "Fecha de creación"
msgctxt "field:product.cost.plan.product_line,create_uid:"
msgid "Create User"
msgstr "Usuario de creación"
msgctxt "field:product.cost.plan.product_line,id:"
msgid "ID"
msgstr "ID"
msgctxt "field:product.cost.plan.product_line,name:" msgctxt "field:product.cost.plan.product_line,name:"
msgid "Name" msgid "Name"
msgstr "Nombre" msgstr "Nombre"
@ -270,10 +154,6 @@ msgctxt "field:product.cost.plan.product_line,quantity:"
msgid "Quantity" msgid "Quantity"
msgstr "Cantidad" msgstr "Cantidad"
msgctxt "field:product.cost.plan.product_line,rec_name:"
msgid "Record Name"
msgstr "Nombre del registro"
msgctxt "field:product.cost.plan.product_line,sequence:" msgctxt "field:product.cost.plan.product_line,sequence:"
msgid "Sequence" msgid "Sequence"
msgstr "Secuencia" msgstr "Secuencia"
@ -298,14 +178,6 @@ msgctxt "field:product.cost.plan.product_line,uom_digits:"
msgid "UoM Digits" msgid "UoM Digits"
msgstr "Dígitos UdM" msgstr "Dígitos UdM"
msgctxt "field:product.cost.plan.product_line,write_date:"
msgid "Write Date"
msgstr "Fecha de modificación"
msgctxt "field:product.cost.plan.product_line,write_uid:"
msgid "Write User"
msgstr "Usuario de modificación"
msgctxt "field:production.configuration,product_cost_plan_sequence:" msgctxt "field:production.configuration,product_cost_plan_sequence:"
msgid "Product Cost Plan Sequence" msgid "Product Cost Plan Sequence"
msgstr "Sequencia plan de coste del producto" msgstr "Sequencia plan de coste del producto"
@ -314,34 +186,10 @@ msgctxt "field:production.configuration.cost_plan,company:"
msgid "Company" msgid "Company"
msgstr "Empresa" msgstr "Empresa"
msgctxt "field:production.configuration.cost_plan,create_date:"
msgid "Create Date"
msgstr "Fecha de creación"
msgctxt "field:production.configuration.cost_plan,create_uid:"
msgid "Create User"
msgstr "Usuario de creación"
msgctxt "field:production.configuration.cost_plan,id:"
msgid "ID"
msgstr "ID"
msgctxt "field:production.configuration.cost_plan,product_cost_plan_sequence:" msgctxt "field:production.configuration.cost_plan,product_cost_plan_sequence:"
msgid "Product Cost Plan Sequence" msgid "Product Cost Plan Sequence"
msgstr "Sequencia plan de coste del producto" msgstr "Sequencia plan de coste del producto"
msgctxt "field:production.configuration.cost_plan,rec_name:"
msgid "Record Name"
msgstr "Nombre del registro"
msgctxt "field:production.configuration.cost_plan,write_date:"
msgid "Write Date"
msgstr "Fecha de modificación"
msgctxt "field:production.configuration.cost_plan,write_uid:"
msgid "Write User"
msgstr "Usuario de modificación"
msgctxt "help:product.cost.plan.product_line,party_stock:" msgctxt "help:product.cost.plan.product_line,party_stock:"
msgid "Use stock owned by party instead of company stock." msgid "Use stock owned by party instead of company stock."
msgstr "" msgstr ""
@ -396,6 +244,14 @@ msgctxt "model:ir.message,text:lacks_the_product"
msgid "The Cost Plan \"%(cost_plan)s\" lacks the product." msgid "The Cost Plan \"%(cost_plan)s\" lacks the product."
msgstr "El plan de costes \"%(cost_plan)s\" carece de producto." msgstr "El plan de costes \"%(cost_plan)s\" carece de producto."
msgctxt "model:ir.message,text:msg_product_line_plan_parent"
msgid ""
"The line \"%(line)s\" can only set plan or parent in each line, not both "
"options."
msgstr ""
"La línea \"%(line)s\" sólo se puede relacionar con un plan de coste o un "
"padre, no las dos opciones."
msgctxt "model:ir.message,text:product_already_has_bom" msgctxt "model:ir.message,text:product_already_has_bom"
msgid "Product \"%(product)s\" already has a BOM assigned." msgid "Product \"%(product)s\" already has a BOM assigned."
msgstr "El producto \"%(product)s\" ya tiene una lista de materiales asignada." msgstr "El producto \"%(product)s\" ya tiene una lista de materiales asignada."
@ -492,10 +348,6 @@ msgctxt "view:product.cost.plan:"
msgid "Costs" msgid "Costs"
msgstr "Costes" msgstr "Costes"
msgctxt "view:product.cost.plan:"
msgid "Initialize Cost Plan"
msgstr "Inicializar el plan de costes"
msgctxt "view:product.cost.plan:" msgctxt "view:product.cost.plan:"
msgid "" msgid ""
"It will modify the product's field loosing the current value. Are you sure?" "It will modify the product's field loosing the current value. Are you sure?"

View File

@ -18,5 +18,8 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.message" id="delete_system_cos"> <record model="ir.message" id="delete_system_cos">
<field name="text">You can not delete cost "%(cost)s" from plan "%(plan)s" because it's managed by system.</field> <field name="text">You can not delete cost "%(cost)s" from plan "%(plan)s" because it's managed by system.</field>
</record> </record>
<record model="ir.message" id="msg_product_line_plan_parent">
<field name="text">The line "%(line)s" can only set plan or parent, not both options.</field>
</record>
</data> </data>
</tryton> </tryton>

77
plan.py
View File

@ -1,7 +1,8 @@
# The COPYRIGHT file at the top level of this repository contains the full # The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms. # copyright notices and license terms.
from decimal import Decimal from decimal import Decimal
from trytond.model import ModelSQL, ModelView, DeactivableMixin, fields, tree # from sql import Null
from trytond.model import Check, ModelSQL, ModelView, DeactivableMixin, fields, tree
from trytond.pool import Pool from trytond.pool import Pool
from trytond.pyson import Eval, Bool, If from trytond.pyson import Eval, Bool, If
from trytond.transaction import Transaction from trytond.transaction import Transaction
@ -9,6 +10,7 @@ from trytond.wizard import Wizard, StateView, StateAction, Button
from trytond.i18n import gettext from trytond.i18n import gettext
from trytond.exceptions import UserWarning from trytond.exceptions import UserWarning
from trytond.modules.product import price_digits, round_price from trytond.modules.product import price_digits, round_price
from trytond.exceptions import UserError
__all__ = ['PlanCostType', 'Plan', 'PlanBOM', 'PlanProductLine', 'PlanCost', __all__ = ['PlanCostType', 'Plan', 'PlanBOM', 'PlanProductLine', 'PlanCost',
'CreateBomStart', 'CreateBom'] 'CreateBomStart', 'CreateBom']
@ -51,16 +53,8 @@ class Plan(DeactivableMixin, ModelSQL, ModelView):
boms = fields.One2Many('product.cost.plan.bom_line', 'plan', 'BOMs') boms = fields.One2Many('product.cost.plan.bom_line', 'plan', 'BOMs')
products = fields.One2Many('product.cost.plan.product_line', 'plan', products = fields.One2Many('product.cost.plan.product_line', 'plan',
'Products') 'Products')
products_tree = fields.Function( all_products = fields.Function(fields.One2Many(
fields.One2Many('product.cost.plan.product_line', 'plan', 'Products', 'product.cost.plan.product_line', None, 'All Products'), 'get_all_products')
domain=[
('parent', '=', None),
],
states={
'readonly': ~Bool(Eval('costs', [0])),
},
depends=['costs']),
'get_products_tree', setter='set_products_tree')
products_cost = fields.Function(fields.Numeric('Products Cost', products_cost = fields.Function(fields.Numeric('Products Cost',
digits=price_digits), digits=price_digits),
'get_products_cost') 'get_products_cost')
@ -163,14 +157,19 @@ class Plan(DeactivableMixin, ModelSQL, ModelView):
)) ))
return res return res
def get_products_tree(self, name): def get_all_products(self, name):
return [x.id for x in self.products if not x.parent] # return all lines in product cost plan (parent and children)
product_lines = []
@classmethod def _get_children(line):
def set_products_tree(cls, lines, name, value): product_lines.append(line)
cls.write(lines, { for child in line.children:
'products': value, _get_children(child)
})
for line in self.products:
_get_children(line)
return [x.id for x in product_lines]
def get_products_cost(self, name): def get_products_cost(self, name):
if not self.quantity: if not self.quantity:
@ -455,11 +454,25 @@ class Plan(DeactivableMixin, ModelSQL, ModelView):
def _copy_plan(self, default): def _copy_plan(self, default):
ProductLine = Pool().get('product.cost.plan.product_line') ProductLine = Pool().get('product.cost.plan.product_line')
product_lines = []
def _get_children(line):
product_lines.append(line)
for child in line.children:
_get_children(child)
new_plan, = super(Plan, self).copy([self], default=default) new_plan, = super(Plan, self).copy([self], default=default)
ProductLine.copy(self.products_tree, default={ lines = ProductLine.copy(self.products, default={
'plan': new_plan.id, 'plan': new_plan.id,
'children': None,
}) })
# sure product.cost_plan.product_line that has parent, set null the plan
for line in lines:
for child in line.children:
_get_children(child)
ProductLine.write(product_lines, {'plan': None})
return new_plan return new_plan
@classmethod @classmethod
@ -494,8 +507,7 @@ class PlanProductLine(ModelSQL, ModelView, tree(separator='/')):
parent = fields.Many2One('product.cost.plan.product_line', 'Parent') parent = fields.Many2One('product.cost.plan.product_line', 'Parent')
children = fields.One2Many('product.cost.plan.product_line', 'parent', children = fields.One2Many('product.cost.plan.product_line', 'parent',
'Children') 'Children')
plan = fields.Many2One('product.cost.plan', 'Plan', required=False, plan = fields.Many2One('product.cost.plan', 'Plan', ondelete='CASCADE')
ondelete='CASCADE')
product = fields.Many2One('product.product', 'Product', domain=[ product = fields.Many2One('product.product', 'Product', domain=[
('type', '!=', 'service'), ('type', '!=', 'service'),
If(Bool(Eval('children')), If(Bool(Eval('children')),
@ -561,15 +573,14 @@ class PlanProductLine(ModelSQL, ModelView, tree(separator='/')):
self.uom = None self.uom = None
self.product_cost_price = None self.product_cost_price = None
@fields.depends('children', '_parent_plan.uom', 'product', 'uom', 'plan') @fields.depends('children', 'product', 'plan', '_parent_plan.uom')
def on_change_with_uom_category(self, name=None): def on_change_with_uom_category(self, name=None):
if self.children: if self.children and self.children[0].uom:
# If product line has children, it must be have computable return self.children[0].uom.category.id
# quantities of plan product elif self.product:
if self.plan and self.plan.uom:
return self.plan.uom.category.id
if self.product:
return self.product.default_uom.category.id return self.product.default_uom.category.id
elif self.plan and self.plan.uom:
return self.plan.uom.category.id
@fields.depends('uom') @fields.depends('uom')
def on_change_with_uom_digits(self, name=None): def on_change_with_uom_digits(self, name=None):
@ -665,6 +676,14 @@ class PlanProductLine(ModelSQL, ModelView, tree(separator='/')):
cls.copy(line.children, default=new_default) cls.copy(line.children, default=new_default)
return new_lines return new_lines
@classmethod
def validate(cls, lines):
super().validate(lines)
for line in lines:
if ((line.parent and line.plan) or (not line.parent and not line.plan)):
raise UserError(gettext(
'product_cost_plan.msg_product_line_plan_parent',
line=line.rec_name))
STATES = { STATES = {
'readonly': Eval('system', False), 'readonly': Eval('system', False),

View File

@ -97,7 +97,7 @@ Create Components::
>>> template1 = ProductTemplate() >>> template1 = ProductTemplate()
>>> template1.name = 'component 1' >>> template1.name = 'component 1'
>>> template1.default_uom = unit >>> template1.default_uom = meter
>>> template1.producible = True >>> template1.producible = True
>>> template1.type = 'goods' >>> template1.type = 'goods'
>>> template1.list_price = Decimal(5) >>> template1.list_price = Decimal(5)
@ -139,7 +139,7 @@ Create Bill of Material::
>>> input1 = bom.inputs.new() >>> input1 = bom.inputs.new()
>>> input1.product = component1 >>> input1.product = component1
>>> input1.quantity = 5 >>> input1.quantity = 5
>>> input2 = bom.inputs.new() >>> input2 = bom.inputs.new()
>>> input2.product = component2 >>> input2.product = component2
>>> input2.quantity = 150 >>> input2.quantity = 150
>>> input2.unit = centimeter >>> input2.unit = centimeter
@ -249,7 +249,7 @@ Create BoM from cost plan::
2 2
>>> sorted([(i.quantity, i.product.rec_name, i.unit.symbol) >>> sorted([(i.quantity, i.product.rec_name, i.unit.symbol)
... for i in plan2.bom.inputs]) ... for i in plan2.bom.inputs])
[(5.0, 'component 1', 'u'), (150.0, 'component 2', 'cm')] [(5.0, 'component 1', 'm'), (150.0, 'component 2', 'cm')]
>>> len(plan2.bom.outputs) >>> len(plan2.bom.outputs)
1 1
>>> plan2.bom.outputs[0].product == product2 >>> plan2.bom.outputs[0].product == product2
@ -273,15 +273,14 @@ Create plan from scratch::
0 0
>>> len(plan3.costs) >>> len(plan3.costs)
1 1
>>> product_line = plan3.products_tree.new() >>> product_line = plan3.products.new()
>>> product_line.product = component1 >>> product_line.product = component1
>>> product_line.cost_price == Decimal('2') >>> product_line.cost_price == Decimal('2')
True True
>>> product_line.quantity = 14 >>> product_line.quantity = 14
>>> product_line.uom.symbol >>> product_line.uom.symbol
'u' 'm'
>>> product_line2 = product_line.children.new() >>> product_line2 = product_line.children.new()
>>> product_line2.plan = plan3
>>> product_line2.product = component2 >>> product_line2.product = component2
>>> product_line2.cost_price == Decimal('5') >>> product_line2.cost_price == Decimal('5')
True True
@ -295,11 +294,11 @@ Create plan from scratch::
>>> product_line2.uom.symbol >>> product_line2.uom.symbol
'cm' 'cm'
>>> plan3.save() >>> plan3.save()
>>> product_line, = plan3.products_tree >>> product_line, = plan3.products
>>> product_line.unit_cost == Decimal('14') >>> product_line.unit_cost
True Decimal('14.0000')
>>> product_line.total_cost == Decimal('28') >>> product_line.total_cost
True Decimal('28.0000')
>>> product_line2, = product_line.children >>> product_line2, = product_line.children
>>> product_line2.unit_cost == Decimal('1.26') >>> product_line2.unit_cost == Decimal('1.26')
True True
@ -325,7 +324,7 @@ Create BoM from Cost Plan::
2 2
>>> sorted([(i.quantity, i.product.rec_name, i.unit.symbol) >>> sorted([(i.quantity, i.product.rec_name, i.unit.symbol)
... for i in plan3.bom.inputs]) ... for i in plan3.bom.inputs])
[(14.0, 'component 1', 'u'), (56.0, 'component 2', 'cm')] [(14.0, 'component 1', 'm'), (56.0, 'component 2', 'cm')]
>>> len(plan3.bom.outputs) >>> len(plan3.bom.outputs)
1 1
>>> plan3.bom.outputs[0].product == product3 >>> plan3.bom.outputs[0].product == product3

View File

@ -20,7 +20,7 @@
<button name="compute" colspan="2"/> <button name="compute" colspan="2"/>
<notebook colspan="6"> <notebook colspan="6">
<page string="Products" id="products"> <page string="Products" id="products">
<field name="products_tree" colspan="4"/> <field name="products" colspan="4"/>
<label name="products_cost"/> <label name="products_cost"/>
<field name="products_cost"/> <field name="products_cost"/>
</page> </page>