mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[13.0][IMP] mrp_multi_level: index llc
This commit is contained in:
committed by
davidborromeo
parent
af3ce97a59
commit
bc37971d76
@@ -10,7 +10,7 @@ from odoo import fields, models
|
||||
class Product(models.Model):
|
||||
_inherit = "product.product"
|
||||
|
||||
llc = fields.Integer(string="Low Level Code", default=0)
|
||||
llc = fields.Integer(string="Low Level Code", default=0, index=True)
|
||||
manufacturing_order_ids = fields.One2many(
|
||||
comodel_name="mrp.production",
|
||||
inverse_name="product_id",
|
||||
|
||||
@@ -297,8 +297,7 @@ class MultiLevelMrp(models.TransientModel):
|
||||
)
|
||||
products = bom_lines.mapped("product_id")
|
||||
products.write({"llc": llc})
|
||||
products = self.env["product.product"].search([("llc", "=", llc)])
|
||||
counter = len(products)
|
||||
counter = self.env["product.product"].search_count([("llc", "=", llc)])
|
||||
log_msg = "Low level code {} finished - Nbr. products: {}".format(
|
||||
llc, counter
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user