Skip to content

Commit

Permalink
[14.0][IMP] custom_mrp_descarga: Change quartering compute function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tu Nombre committed Jul 5, 2024
1 parent afa50b4 commit 1ea8647
Show file tree
Hide file tree
Showing 20 changed files with 691 additions and 1,226 deletions.
1 change: 0 additions & 1 deletion custom_mrp_descarga/data/ir_sequence.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo noupdate="1">
<record id="quartering_sequence" model="ir.sequence">
<field name="name">Secuencia para órdenes de producción de despiece</field>
Expand Down
11 changes: 2 additions & 9 deletions custom_mrp_descarga/data/mrp_bom_category.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo noupdate="1">
<record id="quartering_category" model="mrp.bom.category">
<field name="name">Despiece</field>
<field
name="sequence_id"
eval="ref('custom_mrp_descarga.quartering_sequence')"
/>
<field name="sequence_id" eval="ref('custom_mrp_descarga.quartering_sequence')"/>
</record>
<record id="classified_category" model="mrp.bom.category">
<field name="name">Clasificado</field>
<field
name="sequence_id"
eval="ref('custom_mrp_descarga.classified_sequence')"
/>
<field name="sequence_id" eval="ref('custom_mrp_descarga.classified_sequence')"/>
</record>
</odoo>
1 change: 0 additions & 1 deletion custom_mrp_descarga/data/quartering_product.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo noupdate="1">
<record id="quartering_product" model="product.product">
<field name="name">Despiece</field>
Expand Down
8 changes: 5 additions & 3 deletions custom_mrp_descarga/models/mrp_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class MrpBom(models.Model):
_inherit = "mrp.bom"

quartering = fields.Boolean(
string="Quartering", compute="_compute_quartering", store=True
string="Quartering", compute="_compute_quartering", store=True
)
no_duplicate_lines = fields.Boolean(string="No Duplicate Lines", default=False)
no_produce_product = fields.Boolean(
Expand All @@ -19,8 +19,10 @@ def _compute_quartering(self):
for line in self:
quartering = False
try:
quartering = self.env.ref("custom_mrp_descarga.quartering_category")
if line.category_id == quartering:
quartering_type = self.env.ref(
"custom_mrp_descarga.quartering_category"
)
if line.category_id == quartering_type:
quartering = True
except Exception:
quartering = False
Expand Down
Loading

0 comments on commit 1ea8647

Please sign in to comment.