From 1ea8647bcd07d726bb7032b09ba1578f88484740 Mon Sep 17 00:00:00 2001 From: Tu Nombre Date: Tue, 2 Jul 2024 08:14:56 +0200 Subject: [PATCH] [14.0][IMP] custom_mrp_descarga: Change quartering compute function. --- custom_mrp_descarga/data/ir_sequence.xml | 1 - custom_mrp_descarga/data/mrp_bom_category.xml | 11 +- .../data/quartering_product.xml | 1 - custom_mrp_descarga/models/mrp_bom.py | 8 +- custom_mrp_descarga/models/mrp_production.py | 485 ++++++----- custom_mrp_descarga/models/project_task.py | 4 +- custom_mrp_descarga/models/stock_move_line.py | 13 +- .../models/stock_production_lot.py | 29 +- custom_mrp_descarga/models/stock_quant.py | 20 +- ...mrp_production_quartering_summary_xlsx.xml | 4 +- .../report/mrp_production_summary_xlsx.py | 200 ++--- .../report/mrp_production_summary_xlsx.xml | 4 +- .../views/killing_cost_view.xml | 7 +- custom_mrp_descarga/views/mrp_bom_view.xml | 36 +- .../views/mrp_production_view.xml | 805 +++++------------- .../views/product_template_view.xml | 6 +- custom_mrp_descarga/views/saca_line_view.xml | 35 +- .../views/stock_move_line_view.xml | 234 ++--- .../views/stock_production_lot_view.xml | 12 +- .../views/stock_quant_view.xml | 2 +- 20 files changed, 691 insertions(+), 1226 deletions(-) diff --git a/custom_mrp_descarga/data/ir_sequence.xml b/custom_mrp_descarga/data/ir_sequence.xml index 0092c2f4d..12532e592 100644 --- a/custom_mrp_descarga/data/ir_sequence.xml +++ b/custom_mrp_descarga/data/ir_sequence.xml @@ -1,4 +1,3 @@ - Secuencia para órdenes de producción de despiece diff --git a/custom_mrp_descarga/data/mrp_bom_category.xml b/custom_mrp_descarga/data/mrp_bom_category.xml index 5a23d0839..c1b8cec54 100644 --- a/custom_mrp_descarga/data/mrp_bom_category.xml +++ b/custom_mrp_descarga/data/mrp_bom_category.xml @@ -1,17 +1,10 @@ - Despiece - + Clasificado - + diff --git a/custom_mrp_descarga/data/quartering_product.xml b/custom_mrp_descarga/data/quartering_product.xml index 9d3c57998..95c2023e0 100644 --- a/custom_mrp_descarga/data/quartering_product.xml +++ b/custom_mrp_descarga/data/quartering_product.xml @@ -1,4 +1,3 @@ - Despiece diff --git a/custom_mrp_descarga/models/mrp_bom.py b/custom_mrp_descarga/models/mrp_bom.py index aeba76507..a5d7a6931 100644 --- a/custom_mrp_descarga/models/mrp_bom.py +++ b/custom_mrp_descarga/models/mrp_bom.py @@ -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( @@ -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 diff --git a/custom_mrp_descarga/models/mrp_production.py b/custom_mrp_descarga/models/mrp_production.py index 6197ccf34..b39e6e098 100644 --- a/custom_mrp_descarga/models/mrp_production.py +++ b/custom_mrp_descarga/models/mrp_production.py @@ -16,116 +16,154 @@ def _default_production_date(self): return result saca_line_id = fields.Many2one( - string="Saca Line", comodel_name="saca.line", copy=False - ) + string="Saca Line", + comodel_name="saca.line", + copy=False) saca_id = fields.Many2one( - string="Saca", comodel_name="saca", related="saca_line_id.saca_id", store=True - ) + string="Saca", + comodel_name="saca", + related="saca_line_id.saca_id", + store=True) origin_qty = fields.Float( - string="Origin Qty", related="saca_line_id.net_origin", store=True - ) - dest_qty = fields.Float(related="saca_line_id.net_dest", store=True) - purchase_price = fields.Float(related="saca_line_id.purchase_price", store=True) + string="Origin Qty", + related="saca_line_id.net_origin", + store=True) + dest_qty = fields.Float( + related="saca_line_id.net_dest", + store=True) + purchase_price = fields.Float( + related="saca_line_id.purchase_price", + store=True) purchase_unit_price = fields.Float( - related="saca_line_id.purchase_unit_price", store=True - ) - saca_date = fields.Date(string="Saca Date", related="saca_line_id.date", store=True) + related="saca_line_id.purchase_unit_price", + store=True) + saca_date = fields.Date( + string="Saca Date", + related="saca_line_id.date", + store=True) reproductor_quant_ids = fields.One2many( string="Reproductor", comodel_name="stock.quant", - compute="_compute_reproductor_quant_ids", - ) + compute="_compute_reproductor_quant_ids") batch_id = fields.Many2one( - string="Mother", comodel_name="stock.picking.batch", copy=False - ) + string="Mother", + comodel_name="stock.picking.batch", + copy=False) chick_production = fields.Boolean( string="Chick Production", related="picking_type_id.chick_production", - store=True, - ) - production_date = fields.Datetime(default=_default_production_date) + store=True) + production_date = fields.Datetime( + default=_default_production_date) birth_week = fields.Integer( - string="Birth Week", compute="_compute_birth_week", store=True - ) - paasa = fields.Boolean(string="PAASA", related="company_id.paasa", store=True) - tolvasa = fields.Boolean(string="Tolvasa", related="company_id.tolvasa", store=True) + string="Birth Week", + compute="_compute_birth_week", + store=True) + paasa = fields.Boolean( + string="PAASA", + related="company_id.paasa", + store=True) + tolvasa = fields.Boolean( + string="Tolvasa", + related="company_id.tolvasa", + store=True) guide_number = fields.Char( - string="Guide Number", related="saca_line_id.guide_number", store=True - ) + string="Guide Number", + related="saca_line_id.guide_number", + store=True) channel_temperature = fields.Float( string="Channel Temperature", related="saca_line_id.channel_temperature", - store=True, - ) - staff = fields.Integer(string="Staff", related="saca_line_id.staff", store=True) - product_qty = fields.Float(copy=False) + store=True) + staff = fields.Integer( + string="Staff", + related="saca_line_id.staff", + store=True) + product_qty = fields.Float( + copy=False) hen_unit = fields.Integer( - string="Hen Units", related="batch_id.hen_unit", store=True - ) + string="Hen Units", + related="batch_id.hen_unit", + store=True) birth_rate = fields.Float( - string="Birth %", compute="_compute_birth_rate", store=True - ) + string="Birth %", + compute="_compute_birth_rate", + store=True) expected_birth = fields.Float( - string="Expected Births", compute="_compute_expected_birth", store=True - ) + string="Expected Births", + compute="_compute_expected_birth", + store=True) expected_rate = fields.Float( - string="Expected %", compute="_compute_expected_birth", store=True - ) + string="Expected %", + compute="_compute_expected_birth", + store=True) birth_difference = fields.Float( - string="Difference", compute="_compute_birth_difference", store=True - ) + string="Difference", + compute="_compute_birth_difference", + store=True) difference_rate = fields.Float( - string="Difference %", compute="_compute_difference_rate", store=True - ) + string="Difference %", + compute="_compute_difference_rate", + store=True) batch_location_id = fields.Many2one( - string="Mother Location", related="batch_id.location_id", store=True - ) + string="Mother Location", + related="batch_id.location_id", + store=True) clasified_date = fields.Date( - string="Clasified Date", compute="_compute_clasified_date" - ) + string="Clasified Date", + compute="_compute_clasified_date") clasified_time_start = fields.Float( - string="Clasified Time Start", compute="_compute_clasified_date" - ) + string="Clasified Time Start", + compute="_compute_clasified_date") clasified_time_stop = fields.Float( - string="Clasified Time Stop", compute="_compute_clasified_date" - ) + string="Clasified Time Stop", + compute="_compute_clasified_date") real_average_weight = fields.Float( string="Real Average Weight", compute="_compute_real_average_weight", store=True, - digits="Weight Decimal Precision", - ) + digits="Weight Decimal Precision") unload_date = fields.Datetime( - string="Unload Date", related="saca_line_id.unload_date", store=True - ) + string="Unload Date", + related="saca_line_id.unload_date", + store=True) download_unit = fields.Integer( - string="Download Unit", related="saca_line_id.download_unit", store=True - ) + string="Download Unit", + related="saca_line_id.download_unit", + store=True) unit_difference = fields.Integer( - string="Unit Difference", compute="_compute_unit_difference", store=True - ) - total_unit = fields.Float(string="Units", compute="_compute_total_unit", store=True) + string="Unit Difference", + compute="_compute_unit_difference", + store=True) + total_unit = fields.Float( + string="Units", + compute="_compute_total_unit", + store=True) average_weight = fields.Float( string="Average Weight", related="saca_line_id.average_weight_origin", - store=True, - ) + store=True) gross_yield = fields.Float( - string="Gross Yield", compute="_compute_gross_yield", store=True - ) + string="Gross Yield", + compute="_compute_gross_yield", + store=True) descarga_order = fields.Char( - string="Descarga Order", related="saca_line_id.descarga_order" - ) + string="Descarga Order", + related="saca_line_id.descarga_order") produced_qty = fields.Float( - string="Produced Qty", compute="_compute_produced_qty", store=True - ) + string="Produced Qty", + compute="_compute_produced_qty", + store=True) qty_difference = fields.Float( - string="Difference", compute="_compute_qty_difference", store=True - ) - quartering = fields.Boolean(string="Quartering") + string="Difference", + compute="_compute_qty_difference", + store=True) + quartering = fields.Boolean( + string="Quartering") no_duplicate_lines = fields.Boolean( - string="No Duplicate Lines", related="bom_id.no_duplicate_lines", store=True - ) + string="No Duplicate Lines", + related="bom_id.no_duplicate_lines", + store=True) bom_id = fields.Many2one( domain="""[ '&', @@ -138,142 +176,123 @@ def _default_production_date(self): '&', ('product_tmpl_id.product_variant_ids','=',product_id), ('product_id','=',False), - ('type', '=', 'normal')]""" - ) + ('type', '=', 'normal')]""") clasification = fields.Selection( - string="Clasification", - selection=[ + string="Clasification", selection=[ ("normal", "Normal"), ("relaxed", "Relaxed"), - ("demanding", "Demanding"), - ], - ) - channel_temperature = fields.Float(string="Channel Temperature") + ("demanding", "Demanding")]) + channel_temperature = fields.Float( + string="Channel Temperature") waiting_time = fields.Float(string="Waiting Time") clasified_ids = fields.One2many( string="Classified", comodel_name="account.analytic.line", - inverse_name="production_id", - ) + inverse_name="production_id") farm_warehouse_id = fields.Many2one( string="Farm", comodel_name="stock.warehouse", related="saca_line_id.farm_warehouse_id", - store=True, - ) + store=True) farm_id = fields.Many2one( string="Farm", comodel_name="res.partner", related="saca_line_id.farm_id", - store=True, - ) + store=True) vehicle_id = fields.Many2one( string="Vehicle", comodel_name="fleet.vehicle", related="saca_line_id.vehicle_id", - store=True, - ) + store=True) remolque_id = fields.Many2one( string="Remolque", comodel_name="fleet.vehicle", related="saca_line_id.remolque_id", - store=True, - ) + store=True) breeding_id = fields.Many2one( string="Breeding", comodel_name="stock.picking.batch", related="saca_line_id.breeding_id", - store=True, - ) + store=True) asphyxiation_units = fields.Integer( - string="Asphyxiated", compute="_compute_asphyxiation_units", store=True - ) + string="Asphyxiated", + compute="_compute_asphyxiation_units", + store=True) seized_units = fields.Integer( - string="Seized", compute="_compute_seized_units", store=True - ) + string="Seized", + compute="_compute_seized_units", + store=True) rto_percentage = fields.Float( - string="Rto. %", compute="_compute_rto_percentage", store=True - ) + string="Rto. %", + compute="_compute_rto_percentage", + store=True) bom_category_id = fields.Many2one( - string="Category", related="bom_id.category_id", store=True - ) + string="Category", + related="bom_id.category_id", + store=True) no_produce_product = fields.Boolean( string="Don't produce the header product", related="bom_id.no_produce_product", - store=True, - ) + store=True) @api.depends("move_line_ids.percentage") def _compute_rto_percentage(self): for line in self: rto_percentage = 0 if line.move_line_ids: - rto_percentage = sum(line.move_line_ids.mapped("percentage")) + rto_percentage = sum( + line.move_line_ids.mapped("percentage")) line.rto_percentage = rto_percentage - @api.depends( - "move_line_ids.product_id", - "move_line_ids.product_id.chicken_seized", - "move_line_ids.unit", - "quartering", - ) + @api.depends("move_line_ids.product_id", + "move_line_ids.product_id.chicken_seized", + "move_line_ids.unit", "quartering") def _compute_seized_units(self): for line in self: seized_units = 0 - if ( - line.move_line_ids - and line.move_line_ids.filtered(lambda c: c.product_id.chicken_seized) - and not (line.quartering) - ): + if line.move_line_ids and line.move_line_ids.filtered( + lambda c: c.product_id.chicken_seized) and not ( + line.quartering): seized_units = sum( line.move_line_ids.filtered( - lambda c: c.product_id.chicken_seized - ).mapped("unit") - ) + lambda c: c.product_id.chicken_seized).mapped("unit")) line.seized_units = seized_units - @api.depends( - "move_line_ids.product_id", - "move_line_ids.product_id.asphyxiated", - "quartering", - "move_line_ids.unit", - ) + @api.depends("move_line_ids.product_id", + "move_line_ids.product_id.asphyxiated", "quartering", + "move_line_ids.unit") def _compute_asphyxiation_units(self): for line in self: asphyxiation_units = 0 - if ( - line.move_line_ids - and line.move_line_ids.filtered(lambda c: c.product_id.asphyxiated) - and not (line.quartering) - ): + if line.move_line_ids and line.move_line_ids.filtered( + lambda c: c.product_id.asphyxiated) and not ( + line.quartering): asphyxiation_units = sum( line.move_line_ids.filtered( - lambda c: c.product_id.asphyxiated - ).mapped("unit") - ) + lambda c: c.product_id.asphyxiated).mapped("unit")) line.asphyxiation_units = asphyxiation_units def _compute_classified_ids(self): for line in self: - cond = [("production_id", "=", line.id), ("classified", "=", True)] + cond = [("production_id", "=", line.id), ( + "classified", "=", True)] classified = self.env["account.analytic.line"].search(cond) line.clasified_ids = [(6, 0, classified.ids)] @api.depends("produced_qty", "consume_qty") def _compute_qty_difference(self): for production in self: - production.qty_difference = production.consume_qty - production.produced_qty + production.qty_difference = ( + production.consume_qty - production.produced_qty) @api.depends("finished_move_line_ids.qty_done") def _compute_produced_qty(self): for production in self: produced_qty = 0 if production.finished_move_line_ids: - produced_qty = sum( - production.finished_move_line_ids.filtered( - lambda c: c.product_uom_id == production.product_uom_id - ).mapped("qty_done") - ) + produced_qty = sum(production.finished_move_line_ids.filtered( + lambda c: c.product_uom_id == production.product_uom_id + ).mapped("qty_done")) production.produced_qty = produced_qty @api.depends("move_line_ids.qty_done", "origin_qty") @@ -281,9 +300,8 @@ def _compute_gross_yield(self): for line in self: gross_yield = 0 if line.origin_qty != 0: - gross_yield = ( - sum(line.move_line_ids.mapped("qty_done")) / line.origin_qty - ) + gross_yield = sum( + line.move_line_ids.mapped("qty_done")) / line.origin_qty line.gross_yield = gross_yield @api.depends("move_line_ids.unit") @@ -299,9 +317,8 @@ def _compute_unit_difference(self): for line in self: unit_difference = line.download_unit if line.move_line_ids: - unit_difference = ( - sum(line.move_line_ids.mapped("unit")) - line.download_unit - ) + unit_difference = sum( + line.move_line_ids.mapped("unit")) - line.download_unit line.unit_difference = unit_difference @api.depends("origin_qty", "move_line_ids.unit") @@ -332,7 +349,8 @@ def _compute_difference_rate(self): for line in self: difference_rate = 0 if line.product_qty != 0: - difference_rate = line.birth_difference * 100 / line.product_qty + difference_rate = ( + line.birth_difference * 100 / line.product_qty) line.difference_rate = difference_rate @api.depends("product_qty", "expected_birth") @@ -340,20 +358,21 @@ def _compute_birth_difference(self): for line in self: line.birth_difference = line.product_qty - line.expected_birth - @api.depends("batch_id.birth_rate_ids", "product_qty", "production_date") + @api.depends("batch_id.birth_rate_ids", "product_qty", + "production_date") def _compute_expected_birth(self): for line in self: expected_birth = 0 if line.production_date: rate = line.batch_id.birth_rate_ids.filtered( - lambda c: c.birth_start_date - and c.birth_start_date <= (line.production_date.date()) - and (c.birth_start_date + timedelta(days=7)) - > (line.production_date.date()) - ) + lambda c: c.birth_start_date and c.birth_start_date <= ( + line.production_date.date()) and ( + c.birth_start_date + timedelta(days=7)) > ( + line.production_date.date())) if rate: line.expected_rate = rate[0].percentage_birth - expected_birth = (line.product_qty * rate[0].percentage_birth) / 100 + expected_birth = ( + line.product_qty * rate[0].percentage_birth) / 100 line.expected_birth = expected_birth @api.depends("product_qty", "consume_qty") @@ -369,15 +388,16 @@ def _compute_birth_week(self): for line in self: week = 0 if line.production_date: - start_date = datetime(line.production_date.year, 1, 1, 0, 0).date() + start_date = datetime( + line.production_date.year, 1, 1, 0, 0).date() start_date = line.calculate_weeks_start(start_date) end_date = line.production_date.date() if end_date < start_date: start_date = datetime( - line.production_date.year - 1, 1, 1, 0, 0 - ).date() + line.production_date.year - 1, 1, 1, 0, 0).date() start_date = line.calculate_weeks_start(start_date) - end_date = datetime(line.production_date.year, 1, 1, 0, 0).date() + end_date = datetime( + line.production_date.year, 1, 1, 0, 0).date() week = line.weeks_between(start_date, end_date) if week == 53: week = 1 @@ -390,24 +410,20 @@ def weeks_between(self, start_date, end_date): def _compute_reproductor_quant_ids(self): for production in self: production.reproductor_quant_ids = ( - self.env["stock.quant"].sudo().search([]) - ).filtered( - lambda c: c.product_id.egg is True - and (c.location_id.is_hatchery is True) - ) + self.env["stock.quant"].sudo().search([])).filtered( + lambda c: c.product_id.egg is True and ( + c.location_id.is_hatchery is True)) @api.onchange("picking_type_id") def onchange_picking_type(self): result = super(MrpProduction, self).onchange_picking_type() product = self.env["product.product"].search( - [("one_day_chicken", "=", True)], limit=1 - ) + [("one_day_chicken", "=", True)], limit=1) if self.chick_production and product: self.product_id = product.id elif self.env.company.paasa: - product = self.env["product.product"].search( - [("download_product", "=", True)] - ) + product = self.env["product.product"].search([ + ("download_product", "=", True)]) if product and len(product) == 1: self.product_id = product.id else: @@ -443,43 +459,43 @@ def _onchange_product_id(self): def action_emptying_hatchers(self): for production in self: if not production.batch_id: - raise ValidationError(_("No mother has been put on.")) + raise ValidationError( + _("No mother has been put on.") + ) if not production.lot_producing_id: - raise ValidationError(_("No lot has been put on.")) + raise ValidationError( + _("No lot has been put on.") + ) production.move_line_ids.unlink() for quant in production.reproductor_quant_ids: - if (quant.available_quantity > 0) and ( - quant.lot_id.batch_id == production.batch_id - ): + if ( + quant.available_quantity > 0) and ( + quant.lot_id.batch_id == production.batch_id): line = production.move_line_ids.filtered( - lambda c: c.product_id == quant.product_id - and (c.location_id == quant.location_id) - and (c.lot_id == quant.lot_id) - ) + lambda c: c.product_id == quant.product_id and ( + c.location_id == quant.location_id) and ( + c.lot_id == quant.lot_id)) if line: line.qty_done += quant.available_quantity if not line: self.env["stock.move.line"].create( - { - "product_id": quant.product_id.id, - "location_id": quant.location_id.id, - "location_dest_id": ( - production.production_location_id.id - ), - "product_uom_id": quant.product_id.uom_id.id, - "qty_done": quant.available_quantity, - "lot_id": quant.lot_id.id, - "batch_id": production.batch_id.id, - "standard_price": quant.product_id.standard_price, - "amount": (quant.available_quantity) - * (quant.product_id.standard_price), - "company_id": production.company_id.id, - "production_id": production.id, - "move_id": production.move_raw_ids.filtered( - lambda c: c.product_id == quant.product_id - ).id, - } - ) + {"product_id": quant.product_id.id, + "location_id": quant.location_id.id, + "location_dest_id": ( + production.production_location_id.id), + "product_uom_id": quant.product_id.uom_id.id, + "qty_done": quant.available_quantity, + "lot_id": quant.lot_id.id, + "batch_id": production.batch_id.id, + "standard_price": quant.product_id.standard_price, + "amount": ( + quant.available_quantity) * ( + quant.product_id.standard_price), + "company_id": production.company_id.id, + "production_id": production.id, + "move_id": production.move_raw_ids.filtered( + lambda c: c.product_id == quant.product_id + ).id}) def action_view_reproductor_quant_ids(self): context = self.env.context.copy() @@ -490,7 +506,7 @@ def action_view_reproductor_quant_ids(self): "res_model": "stock.quant", "domain": [("id", "in", self.reproductor_quant_ids.ids)], "type": "ir.actions.act_window", - "context": context, + "context": context } def action_confirm(self): @@ -502,12 +518,9 @@ def button_mark_done(self): if self.move_finished_ids: self.move_finished_ids._do_unreserve() result = super(MrpProduction, self).button_mark_done() - if ( - result is not True - and "res_model" in result - and result["res_model"] == "mrp.consumption.warning" - and self.no_duplicate_lines - ): + if result is not True and "res_model" in result and result[ + "res_model" + ] == "mrp.consumption.warning" and self.no_duplicate_lines: entry_qty = sum(self.move_line_ids.mapped("qty_done")) out_qty = sum(self.finished_move_line_ids.mapped("qty_done")) for move in self.move_raw_ids: @@ -531,8 +544,8 @@ def action_delete_producing_line(self): for line in self: if line.no_produce_product: for move in line.move_finished_ids.filtered( - lambda c: c.product_id == (line.product_id) - ): + lambda c: c.product_id == ( + line.product_id)): move.do_cancel_done() move.state = "cancel" @@ -542,41 +555,31 @@ def action_generate_serial(self): if not self.lot_producing_id: super(MrpProduction, self).action_generate_serial() if self.batch_id: - self.lot_producing_id.name = "{}{}{}".format( - self.batch_id.name, date.strftime("%d%m"), (date.strftime("%Y")[2:]) - ) + self.lot_producing_id.name = u"{}{}{}".format( + self.batch_id.name, date.strftime("%d%m"), ( + date.strftime("%Y")[2:])) if self.batch_id and self.lot_producing_id: - self.lot_producing_id.name = "{}{}{}".format( - self.batch_id.name, date.strftime("%d%m"), (date.strftime("%Y")[2:]) - ) + self.lot_producing_id.name = u"{}{}{}".format( + self.batch_id.name, date.strftime("%d%m"), ( + date.strftime("%Y")[2:])) self.lot_producing_id.batch_id = self.batch_id.id def action_assign_serials(self): for production in self: if production.move_line_ids and production.lot_producing_id: for line in production.move_line_ids: - if line.product_id.tracking != "none" and not (line.lot_id): - lot = ( - self.env["stock.production.lot"] - .search( - [ - ("name", "=", production.lot_producing_id.name), - ("product_id", "=", line.product_id.id), - ], - limit=1, - ) - .id - ) + if line.product_id.tracking != "none" and not ( + line.lot_id): + lot = self.env["stock.production.lot"].search( + [("name", "=", production.lot_producing_id.name), + ("product_id", "=", line.product_id.id)], + limit=1).id if not lot: - lot = ( - self.env[("stock.production.lot")] - .action_create_lot( + lot = self.env[( + "stock.production.lot")].action_create_lot( line.product_id, production.lot_producing_id.name, - production.company_id, - ) - .id - ) + production.company_id).id line.lot_id = lot def action_delete_moves_with_qty_zero(self): @@ -591,29 +594,23 @@ def calculate_weeks_start(self, start_date): if weekday <= 3: return start_date - timedelta(days=weekday) else: - return start_date + timedelta(days=(7 - weekday)) + return start_date + timedelta(days=(7-weekday)) @api.model - def read_group( - self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True - ): + def read_group(self, domain, fields, groupby, offset=0, limit=None, + orderby=False, lazy=True): result = super(MrpProduction, self).read_group( - domain, - fields, - groupby, - offset=offset, - limit=limit, - orderby=orderby, - lazy=lazy, + domain, fields, groupby, offset=offset, limit=limit, + orderby=orderby, lazy=lazy ) for line in result: - if "__domain" in line: + if '__domain' in line: lines = self.search(line["__domain"]) - average_weight = sum(lines.mapped("average_weight")) / len(lines) - rto_percentage = sum(lines.mapped("rto_percentage")) / len(lines) - purchase_unit_price = sum(lines.mapped("purchase_unit_price")) / len( - lines - ) + average_weight = sum(lines.mapped("average_weight"))/len(lines) + rto_percentage = sum(lines.mapped("rto_percentage"))/len(lines) + purchase_unit_price = sum( + lines.mapped("purchase_unit_price") + )/len(lines) line["average_weight"] = average_weight line["rto_percentage"] = rto_percentage line["purchase_unit_price"] = purchase_unit_price diff --git a/custom_mrp_descarga/models/project_task.py b/custom_mrp_descarga/models/project_task.py index 52146bcb3..88869e332 100644 --- a/custom_mrp_descarga/models/project_task.py +++ b/custom_mrp_descarga/models/project_task.py @@ -6,4 +6,6 @@ class ProjectTask(models.Model): _inherit = "project.task" - production_id = fields.Many2one(string="Production", comodel_name="mrp.production") + production_id = fields.Many2one( + string="Production", + comodel_name="mrp.production") diff --git a/custom_mrp_descarga/models/stock_move_line.py b/custom_mrp_descarga/models/stock_move_line.py index 9910924f6..f62c7bb25 100644 --- a/custom_mrp_descarga/models/stock_move_line.py +++ b/custom_mrp_descarga/models/stock_move_line.py @@ -16,7 +16,7 @@ class StockMoveLine(models.Model): string="Sequence", compute="_compute_sequence", store=True ) quartering = fields.Boolean( - string="Quartering", related="production_id.quartering", store=True + string="Sequence", compute="_compute_sequence", store=True ) saca_date = fields.Date(string="Saca Date", related="saca_line_id.date", store=True) @@ -175,4 +175,15 @@ def write(self, values): if line.move_id.state == "cancel" and values.get("qty_done") != 0: line.move_id.state = "done" line.state = "done" + if "qty_done" or "amount" or "state" in values: + for line in self: + if line.lot_id and line.company_id.paasa: + quartering = line.lot_id.move_line_ids.filtered( + lambda c: c.production_id + and c.production_id.quartering + and (c.location_id == c.production_id.location_src_id) + ) + for record in quartering: + if record.standard_price != line.lot_id.average_price: + record.standard_price = line.lot_id.average_price return result diff --git a/custom_mrp_descarga/models/stock_production_lot.py b/custom_mrp_descarga/models/stock_production_lot.py index 3deacb182..364ea3ed6 100644 --- a/custom_mrp_descarga/models/stock_production_lot.py +++ b/custom_mrp_descarga/models/stock_production_lot.py @@ -10,33 +10,22 @@ class StockProductionLot(models.Model): string="Average Price", digits="MRP Price Decimal Precision", compute="_compute_average_price", - store=True, - ) + store=True) - @api.depends( - "move_line_ids.amount", "move_line_ids.qty_done", "move_line_ids.state" - ) + @api.depends("move_line_ids.amount", "move_line_ids.qty_done", + "move_line_ids.state") def _compute_average_price(self): for line in self: average_price = 0 clasified = line.move_line_ids.filtered( - lambda c: c.state == "done" and (c.location_dest_id.usage == "internal") - ) - quartering = line.move_line_ids.filtered( - lambda c: c.production_id - and c.production_id.quartering - and (c.location_id == c.production_id.location_src_id) - ) + lambda c: c.state == "done" and ( + c.location_dest_id.usage == "internal")) if clasified: amount_total = sum(clasified.mapped("amount")) qty_done = sum(clasified.mapped("qty_done")) if qty_done != 0: average_price = amount_total / qty_done line.average_price = average_price - if line.company_id.paasa and average_price: - for record in quartering: - if record.standard_price != line.average_price: - record.standard_price = line.average_price def action_view_move_lines(self): context = self.env.context.copy() @@ -45,10 +34,8 @@ def action_view_move_lines(self): "name": _("Move Lines"), "view_mode": "tree,form", "res_model": "stock.move.line", - "domain": [ - ("product_id", "=", self.product_id.id), - ("id", "in", self.move_line_ids.ids), - ], + "domain": [("product_id", "=", self.product_id.id), + ("id", "in", self.move_line_ids.ids)], "type": "ir.actions.act_window", - "context": context, + "context": context } diff --git a/custom_mrp_descarga/models/stock_quant.py b/custom_mrp_descarga/models/stock_quant.py index 22f481610..f1211f848 100644 --- a/custom_mrp_descarga/models/stock_quant.py +++ b/custom_mrp_descarga/models/stock_quant.py @@ -7,17 +7,17 @@ class StockQuant(models.Model): _inherit = "stock.quant" is_incubator = fields.Boolean( - string="Incubator", related="location_id.is_incubator", store=True - ) + string="Incubator", + related="location_id.is_incubator", store=True) is_integration = fields.Boolean( - string="Integration", related="location_id.is_integration", store=True - ) + string="Integration", + related="location_id.is_integration", store=True) is_reproductor = fields.Boolean( - string="Reproductor", related="location_id.is_reproductor", store=True - ) + string="Reproductor", + related="location_id.is_reproductor", store=True) is_feed_flour = fields.Boolean( - string="Feed/Flour", related="location_id.is_feed_flour", store=True - ) + string="Feed/Flour", + related="location_id.is_feed_flour", store=True) is_medicine = fields.Boolean( - string="Medicine", related="location_id.is_medicine", store=True - ) + string="Medicine", + related="location_id.is_medicine", store=True) diff --git a/custom_mrp_descarga/report/mrp_production_quartering_summary_xlsx.xml b/custom_mrp_descarga/report/mrp_production_quartering_summary_xlsx.xml index 0ae1f490f..df20254f3 100644 --- a/custom_mrp_descarga/report/mrp_production_quartering_summary_xlsx.xml +++ b/custom_mrp_descarga/report/mrp_production_quartering_summary_xlsx.xml @@ -1,4 +1,4 @@ - + Resumen de despiece XLSX @@ -6,7 +6,7 @@ xlsx mrp_production_quartering_summary_xlsx mrp_production_quartering_summary_xlsx - + report diff --git a/custom_mrp_descarga/report/mrp_production_summary_xlsx.py b/custom_mrp_descarga/report/mrp_production_summary_xlsx.py index 0dcebf0cd..29a5bc1a7 100644 --- a/custom_mrp_descarga/report/mrp_production_summary_xlsx.py +++ b/custom_mrp_descarga/report/mrp_production_summary_xlsx.py @@ -9,68 +9,48 @@ class ReportMrpProductionsummaryXlsx(models.AbstractModel): _description = "MRP Production Summary Report" def generate_xlsx_report(self, workbook, data, objects): - table_header = workbook.add_format( - { - "bold": True, - "align": "center", - "valign": "vcenter", - "fg_color": "#D7E4BC", - } - ) - summary = workbook.add_format( - { - "bold": True, - "num_format": "#,##0.00;(#,##0.00)", - } - ) - int_format = workbook.add_format( - { - "num_format": "#,##0;(#,##0)", - } - ) - two_decimal_format = workbook.add_format( - { - "num_format": "#,##0.00;(#,##0.00)", - } - ) - three_decimal_format = workbook.add_format( - { - "num_format": "#,##0.000;(#,##0.000)", - } - ) - eight_decimal_format = workbook.add_format( - { - "num_format": "#,##0.00000000;(#,##0.00000000)", - } - ) - result_int_format = workbook.add_format( - { - "bold": True, - "fg_color": "#afd095", - "num_format": "#,##0;(#,##0)", - } - ) - result_two_decimal = workbook.add_format( - { - "bold": True, - "fg_color": "#afd095", - "num_format": "#,##0.00;(#,##0.00)", - } - ) - result_three_decimal = workbook.add_format( - { - "bold": True, - "fg_color": "#afd095", - "num_format": "#,##0.000;(#,##0.000)", - } - ) - result_summary = workbook.add_format( - { - "bold": True, - "fg_color": "#afd095", - "num_format": "#,##0.000;(#,##0.000)", - } - ) + table_header = workbook.add_format({ + 'bold': True, + 'align': 'center', + 'valign': 'vcenter', + 'fg_color': '#D7E4BC', + }) + summary = workbook.add_format({ + 'bold': True, + 'num_format': '#,##0.00;(#,##0.00)', + }) + int_format = workbook.add_format({ + 'num_format': '#,##0;(#,##0)', + }) + two_decimal_format = workbook.add_format({ + 'num_format': '#,##0.00;(#,##0.00)', + }) + three_decimal_format = workbook.add_format({ + 'num_format': '#,##0.000;(#,##0.000)', + }) + eight_decimal_format = workbook.add_format({ + 'num_format': '#,##0.00000000;(#,##0.00000000)', + }) + result_int_format = workbook.add_format({ + 'bold': True, + 'fg_color': '#afd095', + 'num_format': '#,##0;(#,##0)', + }) + result_two_decimal = workbook.add_format({ + 'bold': True, + 'fg_color': '#afd095', + 'num_format': '#,##0.00;(#,##0.00)', + }) + result_three_decimal = workbook.add_format({ + 'bold': True, + 'fg_color': '#afd095', + 'num_format': '#,##0.000;(#,##0.000)', + }) + result_summary = workbook.add_format({ + 'bold': True, + 'fg_color': '#afd095', + 'num_format': '#,##0.000;(#,##0.000)', + }) table_header.set_text_wrap() summary.set_text_wrap() int_format.set_text_wrap() @@ -80,14 +60,12 @@ def generate_xlsx_report(self, workbook, data, objects): result_three_decimal.set_text_wrap() result_two_decimal.set_text_wrap() result_summary.set_text_wrap() - table_detail_right_num = workbook.add_format( - { - "border": 1, - "align": "right", - "valign": "vcenter", - } - ) - table_detail_right_num.set_num_format("#,##0.00") + table_detail_right_num = workbook.add_format({ + 'border': 1, + 'align': 'right', + 'valign': 'vcenter', + }) + table_detail_right_num.set_num_format('#,##0.00') worksheet = workbook.add_worksheet("Resumen de matanza") worksheet.write(0, 0, _("Resumen de matanza"), table_header) for i in range(0, 10): @@ -130,11 +108,13 @@ def generate_xlsx_report(self, workbook, data, objects): categ_unit = sum(categ_lines.mapped("unit")) categ_qty_done = sum(categ_lines.mapped("qty_done")) categ_average_weight = ( - (categ_qty_done / categ_unit) if categ_unit else 0 - ) + categ_qty_done / categ_unit + ) if categ_unit else 0 categ_amount = sum(categ_lines.mapped("amount")) categt_applied_price = round( - (categ_amount / categ_qty_done) if categ_qty_done != 0 else 0, 3 + ( + categ_amount / categ_qty_done + ) if categ_qty_done != 0 else 0, 3 ) for product in categ_lines: if product.product_id not in products: @@ -144,26 +124,30 @@ def generate_xlsx_report(self, workbook, data, objects): product_lines = categ_lines.filtered( lambda c: c.product_id == product.product_id ) - product_container = sum(product_lines.mapped("container")) + product_container = sum( + product_lines.mapped("container") + ) product_unit = sum(product_lines.mapped("unit")) - product_qty_done = sum(product_lines.mapped("qty_done")) + product_qty_done = sum( + product_lines.mapped("qty_done") + ) product_percentage = ( - (product_qty_done * 100 / categ_qty_done) - if categ_qty_done - else 0 + ( + product_qty_done * 100 / categ_qty_done + ) if categ_qty_done else 0 ) product_average_weight = ( - (product_qty_done / product_unit) if product_unit else 0 - ) + product_qty_done / product_unit + ) if product_unit else 0 product_amount = sum(product_lines.mapped("amount")) product_applied_price = ( - (product_amount / product_qty_done) - if product_qty_done - else 0 - ) - worksheet.write( - n, m, round(product_percentage, 2), two_decimal_format + ( + product_amount / product_qty_done + ) if product_qty_done else 0 ) + worksheet.write(n, m, round( + product_percentage, 2 + ), two_decimal_format) m += 1 worksheet.write(n, m, product.product_id.default_code) m += 1 @@ -188,10 +172,10 @@ def generate_xlsx_report(self, workbook, data, objects): ) m += 1 worksheet.write( - n, - m, - round(product_qty_done / origin_qty * 100, 2), - two_decimal_format, + n, m, round( + product_qty_done / origin_qty * 100, 2 + ), + two_decimal_format ) n += 1 m = 0 @@ -199,7 +183,9 @@ def generate_xlsx_report(self, workbook, data, objects): m += 1 worksheet.write(n, m, "", result_int_format) m += 1 - worksheet.write(n, m, line.product_category_id.name, result_int_format) + worksheet.write( + n, m, line.product_category_id.name, result_int_format + ) m += 1 worksheet.write(n, m, categ_container, result_int_format) m += 1 @@ -207,18 +193,24 @@ def generate_xlsx_report(self, workbook, data, objects): m += 1 worksheet.write(n, m, categ_qty_done, result_two_decimal) m += 1 - worksheet.write(n, m, categ_average_weight, result_three_decimal) + worksheet.write( + n, m, categ_average_weight, result_three_decimal + ) m += 1 - worksheet.write(n, m, categt_applied_price, result_three_decimal) + worksheet.write( + n, m, categt_applied_price, result_three_decimal + ) m += 1 worksheet.write(n, m, categ_amount, result_two_decimal) m += 1 worksheet.write( n, m, categ_qty_done / origin_qty * 100, result_two_decimal ) - sum_live_percentage += categ_qty_done / origin_qty * 100 + sum_live_percentage += (categ_qty_done / origin_qty * 100) different_date_planned = objects.mapped("saca_date") - different_date_planned = list({d for d in different_date_planned}) + different_date_planned = list( + set([d for d in different_date_planned]) + ) n += 1 m = 0 worksheet.write(n, m, "Partes de matanza", result_int_format) @@ -236,7 +228,9 @@ def generate_xlsx_report(self, workbook, data, objects): total_qty_done = sum(movelines.mapped("qty_done")) worksheet.write(n, m, total_qty_done, result_two_decimal) m += 1 - worksheet.write(n, m, total_qty_done / total_unit, result_three_decimal) + worksheet.write( + n, m, total_qty_done / total_unit, result_three_decimal + ) m += 1 total_amount = sum(movelines.mapped("amount")) total_average_price = total_amount / total_qty_done @@ -244,7 +238,9 @@ def generate_xlsx_report(self, workbook, data, objects): m += 1 worksheet.write(n, m, total_amount, result_two_decimal) m += 1 - worksheet.write(n, m, total_qty_done / origin_qty * 100, result_two_decimal) + worksheet.write( + n, m, total_qty_done / origin_qty * 100, result_two_decimal + ) n += 1 m = 0 worksheet.write(n, m, "Datos de granja", result_int_format) @@ -260,7 +256,9 @@ def generate_xlsx_report(self, workbook, data, objects): m += 1 worksheet.write(n, m, origin_qty, result_two_decimal) m += 1 - real_average_weight = sum(objects.mapped("real_average_weight")) / len(objects) + real_average_weight = sum( + objects.mapped("real_average_weight") + ) / len(objects) worksheet.write(n, m, real_average_weight, result_three_decimal) m += 1 purchase_price = sum(objects.mapped("purchase_price")) @@ -295,7 +293,7 @@ def generate_xlsx_report(self, workbook, data, objects): m = 0 worksheet.write(n, m, "Media personal", result_int_format) personal = objects.saca_line_id.mapped("staff") - average_personal = sum(personal) / productions + average_personal = sum(personal)/productions m += 1 worksheet.write(n, m, average_personal, result_int_format) n += 1 @@ -312,7 +310,9 @@ def generate_xlsx_report(self, workbook, data, objects): m += 1 worksheet.write(n, m, total_qty_done / days, result_two_decimal) m += 1 - worksheet.write(n, m, total_qty_done / total_unit / days, result_three_decimal) + worksheet.write( + n, m, total_qty_done / total_unit / days, result_three_decimal + ) m += 1 worksheet.write(n, m, total_average_price / days, result_three_decimal) m += 1 diff --git a/custom_mrp_descarga/report/mrp_production_summary_xlsx.xml b/custom_mrp_descarga/report/mrp_production_summary_xlsx.xml index a0a97346f..ccfd95a09 100644 --- a/custom_mrp_descarga/report/mrp_production_summary_xlsx.xml +++ b/custom_mrp_descarga/report/mrp_production_summary_xlsx.xml @@ -1,4 +1,4 @@ - + Resumen de mantanza XLSX @@ -6,7 +6,7 @@ xlsx mrp_production_summary_xlsx mrp_production_summary_xlsx - + report diff --git a/custom_mrp_descarga/views/killing_cost_view.xml b/custom_mrp_descarga/views/killing_cost_view.xml index 36b1e0aa3..272c9b6d3 100644 --- a/custom_mrp_descarga/views/killing_cost_view.xml +++ b/custom_mrp_descarga/views/killing_cost_view.xml @@ -1,11 +1,6 @@ - + diff --git a/custom_mrp_descarga/views/mrp_bom_view.xml b/custom_mrp_descarga/views/mrp_bom_view.xml index 4751c2bf8..b2926fa64 100644 --- a/custom_mrp_descarga/views/mrp_bom_view.xml +++ b/custom_mrp_descarga/views/mrp_bom_view.xml @@ -2,12 +2,12 @@ mrp.bom - + - - - + + + Inputs @@ -16,19 +16,13 @@ Outputs - {'column_invisible': [('parent.quartering', '=', True)]} + {'column_invisible': [('parent.quartering', '=', True)]} - {'column_invisible': [('parent.quartering', '=', True)]} + {'column_invisible': [('parent.quartering', '=', True)]} - {'column_invisible': [('parent.quartering', '=', True)]} + {'column_invisible': [('parent.quartering', '=', True)]} @@ -49,20 +43,8 @@ [('quartering', '=', False)] - + - + diff --git a/custom_mrp_descarga/views/mrp_production_view.xml b/custom_mrp_descarga/views/mrp_production_view.xml index 21e1f29a4..a44c057bf 100644 --- a/custom_mrp_descarga/views/mrp_production_view.xml +++ b/custom_mrp_descarga/views/mrp_production_view.xml @@ -2,499 +2,240 @@ mrp.production - + - - - - - - - - + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + mrp.production - - + primary - - + + 1 + + + mrp.production - - +
-
1 - ['&', '|', ('company_id', '=', False), ('company_id', '=', company_id), '&', '|', ('product_id','=',product_id), '&', ('product_tmpl_id.product_variant_ids','=',product_id), ('product_id','=',False), ('type', '=', 'normal'), ('quartering', '=', quartering)] + ['&', '|', ('company_id', '=', False), ('company_id', '=', company_id), '&', '|', ('product_id','=',product_id), '&', ('product_tmpl_id.product_variant_ids','=',product_id), ('product_id','=',False), ('type', '=', 'normal'), ('quartering', '=', quartering)] - + - {'readonly': [('state', 'in', ('cancel', 'done'))]} + {'readonly': [('state', 'in', ('cancel', 'done'))]} - - - + + + - {'invisible': [('saca_line_id', '!=', False)]} + {'invisible': [('saca_line_id', '!=', False)]} - {'invisible': [('saca_line_id', '!=', False)]} + {'invisible': [('saca_line_id', '!=', False)]} qty_done == 0 - {'readonly': ['|', ('saca_line_id', '!=', False), ('state', 'in', ('cancel'))]} + {'readonly': ['|', ('saca_line_id', '!=', False), ('state', 'in', ('cancel'))]} - - - - + + + + - - - - - + + + + + - {'invisible':[('tolvasa', '=', True)]} + {'invisible':[('tolvasa', '=', True)]} - {'invisible':[('saca_line_id', '=', False)]} + {'invisible':[('saca_line_id', '=', False)]} - {'invisible':[('tolvasa', '=', True)]} + {'invisible':[('tolvasa', '=', True)]} - {'invisible':[('saca_line_id', '=', False)]} + {'invisible':[('saca_line_id', '=', False)]} - {'invisible':[('saca_line_id', '=', False)]} + {'invisible':[('saca_line_id', '=', False)]} - {'invisible':[('saca_line_id', '=', False)]} + {'invisible':[('saca_line_id', '=', False)]} - {'invisible':[('saca_line_id', '=', False)]} + {'invisible':[('saca_line_id', '=', False)]} - {'invisible':[('saca_line_id', '=', False)]} + {'invisible':[('saca_line_id', '=', False)]} - {'invisible':[('saca_line_id', '=', False)]} + {'invisible':[('saca_line_id', '=', False)]} - {'invisible':[('saca_line_id', '=', False)]} + {'invisible':[('saca_line_id', '=', False)]} - + - {'readonly': [('state', 'in', ('done', 'cancel'))]} + {'readonly': [('state', 'in', ('done', 'cancel'))]}
-
- - - - - - - - - - - - - - -
@@ -730,22 +386,16 @@ mrp.production - - - - - - - - - - + + + + + + + + + +
@@ -755,12 +405,10 @@ mrp.production ir.actions.act_window tree,form - + [('quartering', '=', True), ('paasa', '=', True)] - {"search_default_todo": 1, 'default_quartering': True} + {"search_default_todo": 1, 'default_quartering': True} @@ -768,33 +416,16 @@ mrp.production ir.actions.act_window tree,form - + [('saca_line_id', '!=', False)] {"search_default_todo": 1} - + - + - +
diff --git a/custom_mrp_descarga/views/product_template_view.xml b/custom_mrp_descarga/views/product_template_view.xml index 6b022aaad..38da68d8d 100644 --- a/custom_mrp_descarga/views/product_template_view.xml +++ b/custom_mrp_descarga/views/product_template_view.xml @@ -1,12 +1,12 @@ - + product.template - + - + diff --git a/custom_mrp_descarga/views/saca_line_view.xml b/custom_mrp_descarga/views/saca_line_view.xml index 6078f1f3f..ebf59a3f3 100644 --- a/custom_mrp_descarga/views/saca_line_view.xml +++ b/custom_mrp_descarga/views/saca_line_view.xml @@ -2,39 +2,24 @@ saca.line - +
-
- - - - - - - + + + + + + + diff --git a/custom_mrp_descarga/views/stock_move_line_view.xml b/custom_mrp_descarga/views/stock_move_line_view.xml index ce318af88..85f405b38 100644 --- a/custom_mrp_descarga/views/stock_move_line_view.xml +++ b/custom_mrp_descarga/views/stock_move_line_view.xml @@ -2,131 +2,60 @@ stock.move.line - + - + - - - - + + + + stock.move.line - + - + - + stock.move.line - + sequence desc qty_done == 0 - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -136,61 +65,42 @@ stock.move.line - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +
stock.move.line - + - - + + - + - - - + + + @@ -199,14 +109,11 @@ stock.move.line.search.view stock.move.line primary - 100 - + 30 + - - + + [('lot_id','=ilike',str(self)+'%')] @@ -216,11 +123,9 @@ stock.move.line ir.actions.act_window tree,form - + - ['|', ('move_id.raw_material_production_id', '!=', False), ('move_id.production_id', '!=', False), '|',('move_id.raw_material_production_id.quartering', '=', False), ('move_id.production_id.quartering', '=', False), '|', ('move_id.production_id.paasa', '=', True), ('move_id.raw_material_production_id.paasa', '=', True), ('state', '=', 'done')] + ['|', ('move_id.raw_material_production_id', '!=', False), ('move_id.production_id', '!=', False), '|',('move_id.raw_material_production_id.quartering', '=', False), ('move_id.production_id.quartering', '=', False), '|', ('move_id.production_id.paasa', '=', True), ('move_id.raw_material_production_id.paasa', '=', True), ('state', '=', 'done')] @@ -228,32 +133,15 @@ stock.move.line ir.actions.act_window tree,form - - + + [('quartering', '=', True)] - {"search_default_todo": 1, "search_default_groupby_production": 1} + {"search_default_todo": 1, "search_default_groupby_production": 1} - + - + tree,form,pivot diff --git a/custom_mrp_descarga/views/stock_production_lot_view.xml b/custom_mrp_descarga/views/stock_production_lot_view.xml index 6d926771c..79e8d7ca8 100644 --- a/custom_mrp_descarga/views/stock_production_lot_view.xml +++ b/custom_mrp_descarga/views/stock_production_lot_view.xml @@ -2,19 +2,13 @@ stock.production.lot - +
-
- +
diff --git a/custom_mrp_descarga/views/stock_quant_view.xml b/custom_mrp_descarga/views/stock_quant_view.xml index ac98ade64..518fde14f 100644 --- a/custom_mrp_descarga/views/stock_quant_view.xml +++ b/custom_mrp_descarga/views/stock_quant_view.xml @@ -2,7 +2,7 @@ stock.quant - + Total Qty Available