diff --git a/jikimo_purchase_request/models/stock_picking.py b/jikimo_purchase_request/models/stock_picking.py index 037484c7..f0f3260a 100644 --- a/jikimo_purchase_request/models/stock_picking.py +++ b/jikimo_purchase_request/models/stock_picking.py @@ -41,8 +41,10 @@ class StockPicking(models.Model): if backorder_ids: purchase_request_lines = self.move_ids.move_orig_ids.purchase_line_id.purchase_request_lines if purchase_request_lines: - purchase_request_lines.move_dest_ids = [ - (4, x.id) for x in backorder_ids.move_ids if x.product_id.id in purchase_request_lines.mapped('product_id.id') + purchase_request_lines.move_dest_ids = [ + (4, x.id) for x in backorder_ids.move_ids if + x.product_id.id in purchase_request_lines.mapped('product_id.id') and \ + not x.created_purchase_request_line_id ] return res diff --git a/sf_demand_plan/models/sf_demand_plan.py b/sf_demand_plan/models/sf_demand_plan.py index e7be1cda..aee46e52 100644 --- a/sf_demand_plan/models/sf_demand_plan.py +++ b/sf_demand_plan/models/sf_demand_plan.py @@ -115,7 +115,10 @@ class SfDemandPlan(models.Model): def _compute_embryo_long(self): for line in self: if line.product_id: - line.embryo_long = f"{round(line.product_id.model_long, 3)}*{round(line.product_id.model_width, 3)}*{round(line.product_id.model_height, 3)}" + if line.product_id.blank_type == '圆料': + line.embryo_long = f"Ø{round(line.product_id.model_width, 3)}*{round(line.product_id.model_long, 3)}" + else: + line.embryo_long = f"{round(line.product_id.model_long, 3)}*{round(line.product_id.model_width, 3)}*{round(line.product_id.model_height, 3)}" else: line.embryo_long = None diff --git a/sf_demand_plan/models/sf_production_demand_plan.py b/sf_demand_plan/models/sf_production_demand_plan.py index d7de2de2..bf56a03a 100644 --- a/sf_demand_plan/models/sf_production_demand_plan.py +++ b/sf_demand_plan/models/sf_production_demand_plan.py @@ -344,9 +344,11 @@ class SfProductionDemandPlan(models.Model): pro_plan.do_production_schedule() def update_sale_order_state(self): - demand_plan = self.env['sf.demand.plan'].sudo().search([('sale_order_id', '=', self.sale_order_id.id)]) - demand_plan_state = demand_plan.filtered(lambda line: line.state != '40') - if not demand_plan_state: + # demand_plan = self.env['sf.demand.plan'].sudo().search([('sale_order_id', '=', self.sale_order_id.id)]) + # demand_plan_state = demand_plan.filtered(lambda line: line.state != '40') + production_demand_plan = self.env['sf.production.demand.plan'].sudo().search([('sale_order_id', '=', self.sale_order_id.id)]) + production_demand_plan_state = production_demand_plan.filtered(lambda line: line.status in ('10', '20', '30')) + if not production_demand_plan_state: # 修改销售订单为加工中 self.sale_order_id.state = 'processing' @@ -675,6 +677,7 @@ class SfProductionDemandPlan(models.Model): self._action_launch_stock_rule() if self.supply_method in ('automation', 'manual'): self.write({'status': '50'}) + self.update_sale_order_state() else: self.write({'status': '60'}) self.update_sale_order_state() diff --git a/sf_demand_plan/static/src/scss/style.css b/sf_demand_plan/static/src/scss/style.css index 08d382c1..8c2b61c9 100644 --- a/sf_demand_plan/static/src/scss/style.css +++ b/sf_demand_plan/static/src/scss/style.css @@ -83,7 +83,7 @@ } } -th[data-name=processing_time] + th::before{ - content: '待执行单据'; - line-height: 38px; -} +/*.demand_plan_tree th[data-name=planned_start_date] + th::before{*/ +/* content: '待执行单据';*/ +/* line-height: 38px;*/ +/*}*/ diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index ba6e9d20..072fe9f5 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -217,7 +217,8 @@ class StockRule(models.Model): ''' 创建制造订单时生成序列号 ''' - production.action_generate_serial() + if production.product_id.tracking != "none": + production.action_generate_serial() origin_production = production.move_dest_ids and production.move_dest_ids[ 0].raw_material_production_id or False orderpoint = production.orderpoint_id @@ -442,7 +443,7 @@ class ProductionLot(models.Model): @api.model def _get_next_serial(self, company, product): """Return the next serial number to be attributed to the product.""" - if product.tracking == "serial": + if product.tracking != "none": last_serial = self.env['stock.lot'].search( [('company_id', '=', company.id), ('product_id', '=', product.id), ('name', 'ilike', product.name)], limit=1, order='name desc') @@ -453,7 +454,9 @@ class ProductionLot(models.Model): return self.env['stock.lot'].generate_lot_names1(product.name, last_serial.name if ( not move_line_id or (last_serial and last_serial.name > move_line_id.lot_name)) else move_line_id.lot_name, 2)[1] - return "%s-%03d" % (product.name, 1) + else: + return "%s-%03d" % (product.name, 1) + return False qr_code_image = fields.Binary(string='二维码', compute='_generate_qr_code')