From 9f67dbe9aac41467f74d5eec893b10de7a994009 Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Thu, 12 Dec 2024 16:06:55 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E5=B7=A5=E5=BA=8F=E5=A4=96=E5=8D=8F?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E6=B2=A1=E6=9C=89=E8=87=AA=E5=8A=A8=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E5=B7=A5=E5=8D=95=E5=BC=80=E5=A7=8B=E3=80=81=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E7=9A=84=E4=BC=98=E5=8C=96=E9=9C=80=E6=B1=82=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/__init__.py | 1 + sf_manufacturing/models/purchase_order.py | 31 +++++++++++++++++++ sf_manufacturing/models/stock.py | 37 +++++++++++++++-------- 3 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 sf_manufacturing/models/purchase_order.py diff --git a/sf_manufacturing/models/__init__.py b/sf_manufacturing/models/__init__.py index 9f77d841..c4d8ad94 100644 --- a/sf_manufacturing/models/__init__.py +++ b/sf_manufacturing/models/__init__.py @@ -15,3 +15,4 @@ from . import sf_technology_design from . import sf_production_common from . import sale_order from . import quick_easy_order +from . import purchase_order \ No newline at end of file diff --git a/sf_manufacturing/models/purchase_order.py b/sf_manufacturing/models/purchase_order.py new file mode 100644 index 00000000..e54e96bf --- /dev/null +++ b/sf_manufacturing/models/purchase_order.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from collections import defaultdict + +from odoo import api, fields, models, _ +from odoo.tools import OrderedSet + + +# _get_surface_technics_purchase_ids +class PurchaseOrder(models.Model): + _inherit = 'purchase.order' + + def button_confirm(self): + super().button_confirm() + workorders = self.env['mrp.workorder'].search([('purchase_id', '=', self.id)]) + for workorder in workorders: + if workorder.routing_type == '表面工艺' and workorder.is_subcontract is True: + move_out = workorder.move_subcontract_workorder_ids[1] + # move_out = self.env['stock.move'].search( + # [('location_id', '=', self.env['stock.location'].search( + # [('barcode', 'ilike', 'WH-PREPRODUCTION')]).id), + # ('location_dest_id', '=', self.env['stock.location'].search( + # [('barcode', 'ilike', 'VL-SPOC')]).id), + # ('origin', '=', self.production_id.name), ('state', 'not in', ['cancel', 'done'])]) + for mo in move_out: + if mo.state != 'done': + mo.write({'state': 'assigned', 'production_id': False}) + if not mo.move_line_ids: + self.env['stock.move.line'].create(mo.get_move_line(workorder.production_id, workorder)) + return True diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index fbe3be8c..6506cc1a 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -644,12 +644,19 @@ class StockPicking(models.Model): workorder = move_in.subcontract_workorder_id workorders = workorder.production_id.workorder_ids subcontract_workorders = workorders.filtered(lambda wo: wo.is_subcontract == True).sorted('sequence') - if workorder == subcontract_workorders[-1]: + if workorder == subcontract_workorders[-1]: self.env['stock.quant']._update_reserved_quantity( - move_in.product_id, move_in.location_dest_id, move_in.product_uom_qty, lot_id=move_in.move_line_ids.lot_id, + move_in.product_id, move_in.location_dest_id, move_in.product_uom_qty, + lot_id=move_in.move_line_ids.lot_id, package_id=False, owner_id=False, strict=False ) - + workorder.button_finish() + picking_type_out = self.env.ref('sf_manufacturing.outcontract_picking_out').id + if res and self.picking_type_id.id == picking_type_out: + move_out = self.move_ids + if move_out: + workorder = move_out.subcontract_workorder_id + workorder.button_start() return res # 创建 外协出库入单 @@ -671,14 +678,16 @@ class StockPicking(models.Model): else: # 从sorted_workorders中找到上一工单的move if sorted_workorders.index(workorder) > 0: - move_dest_id = sorted_workorders[sorted_workorders.index(workorder) - 1].move_subcontract_workorder_ids[1].id + move_dest_id = \ + sorted_workorders[sorted_workorders.index(workorder) - 1].move_subcontract_workorder_ids[1].id new_picking = True outcontract_picking_type_in = self.env.ref( 'sf_manufacturing.outcontract_picking_in').id, outcontract_picking_type_out = self.env.ref( 'sf_manufacturing.outcontract_picking_out').id, moves_in = self.env['stock.move'].sudo().create( - self.env['stock.move']._get_stock_move_values_Res(item, outcontract_picking_type_in, procurement_group_id.id, move_dest_id)) + self.env['stock.move']._get_stock_move_values_Res(item, outcontract_picking_type_in, + procurement_group_id.id, move_dest_id)) picking_in = self.create( moves_in._get_new_picking_values_Res(item, workorder, 'WH/OCIN/')) # pick_ids.append(picking_in.id) @@ -686,7 +695,8 @@ class StockPicking(models.Model): {'picking_id': picking_in.id, 'state': 'waiting'}) moves_in._assign_picking_post_process(new=new_picking) moves_out = self.env['stock.move'].sudo().create( - self.env['stock.move']._get_stock_move_values_Res(item, outcontract_picking_type_out, procurement_group_id.id, moves_in.id)) + self.env['stock.move']._get_stock_move_values_Res(item, outcontract_picking_type_out, + procurement_group_id.id, moves_in.id)) workorder.write({'move_subcontract_workorder_ids': [(6, 0, [moves_in.id, moves_out.id])]}) picking_out = self.create( moves_out._get_new_picking_values_Res(item, workorder, 'WH/OCOUT/')) @@ -694,8 +704,7 @@ class StockPicking(models.Model): moves_out.write( {'picking_id': picking_out.id, 'state': 'waiting'}) moves_out._assign_picking_post_process(new=new_picking) - - + @api.depends('move_type', 'immediate_transfer', 'move_ids.state', 'move_ids.picking_id') def _compute_state(self): super(StockPicking, self)._compute_state() @@ -706,7 +715,9 @@ class StockPicking(models.Model): if picking.move_ids: workorder = picking.move_ids[0].subcontract_workorder_id if picking.state == 'assigned': - if workorder.state in ['pending', 'waiting'] or workorder._get_surface_technics_purchase_ids().state in ['draft', 'sent']: + if workorder.state in ['pending', + 'waiting'] or workorder._get_surface_technics_purchase_ids().state in [ + 'draft', 'sent']: picking.state = 'waiting' @@ -719,7 +730,8 @@ class ReStockMove(models.Model): def _get_stock_move_values_Res(self, item, picking_type_id, group_id, move_dest_ids=False): route_id = self.env.ref('sf_manufacturing.route_surface_technology_outsourcing').id - stock_rule = self.env['stock.rule'].sudo().search([('route_id', '=', route_id), ('picking_type_id', '=', picking_type_id)]) + stock_rule = self.env['stock.rule'].sudo().search( + [('route_id', '=', route_id), ('picking_type_id', '=', picking_type_id)]) move_values = { 'name': '推', 'company_id': item.company_id.id, @@ -997,8 +1009,9 @@ class ReStockMove(models.Model): res['origin'] = ','.join(productions.mapped('name')) res['retrospect_ref'] = production.product_id.name return res - - subcontract_workorder_id = fields.Many2one('mrp.workorder', '外协工单组件', check_company=True, index='btree_not_null') + + subcontract_workorder_id = fields.Many2one('mrp.workorder', '外协工单组件', check_company=True, + index='btree_not_null') class ReStockQuant(models.Model): From 3253b26818b6dcae289081873c1336b94e14bdc1 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Fri, 13 Dec 2024 13:38:22 +0800 Subject: [PATCH 02/15] =?UTF-8?q?1=E3=80=81=E6=8A=A5=E4=BB=B7=E3=80=81?= =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E6=B7=BB=E5=8A=A0=E5=B9=B3=E5=8F=B0=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=8F=B7=E5=AD=97=E6=AE=B5=E3=80=822=E3=80=81=E9=94=80?= =?UTF-8?q?=E5=94=AE=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E7=9A=84=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E9=93=BE=E6=8E=A5=E6=8C=89=E9=87=87=E8=B4=AD=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=8B=86=E5=88=86=E4=B8=BA=E5=A7=94=E5=A4=96=E5=8A=A0?= =?UTF-8?q?=E5=B7=A5=E5=92=8C=E9=87=87=E8=B4=AD=E7=9A=84=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/controllers/main.py | 2 +- sf_sale/models/sale_order.py | 69 +++++++++++++++++++++++++++- sf_sale/views/sale_order_view.xml | 25 ++++++++-- 3 files changed, 89 insertions(+), 7 deletions(-) diff --git a/sf_manufacturing/controllers/main.py b/sf_manufacturing/controllers/main.py index e45265d3..839b87fe 100644 --- a/sf_manufacturing/controllers/main.py +++ b/sf_manufacturing/controllers/main.py @@ -27,7 +27,7 @@ class JikimoSaleRoutePicking(Sf_Bf_Connect): bfm_process_order_list = json.loads(kw['bfm_process_order_list']) order_id = request.env['sale.order'].with_user(request.env.ref("base.user_admin")).sale_order_create( company_id, kw['delivery_name'], kw['delivery_telephone'], kw['delivery_address'], - kw['delivery_end_date'], kw['payments_way'], kw['pay_way'], state='draft') + kw['delivery_end_date'], kw['payments_way'], kw['pay_way'], kw['order_number'], state='draft') i = 1 # 给sale_order的default_code字段赋值 # aa = request.env['sale.order'].sudo().search([('name', '=', order_id.name)]) diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py index ca851fc6..c9cf8af8 100644 --- a/sf_sale/models/sale_order.py +++ b/sf_sale/models/sale_order.py @@ -58,9 +58,11 @@ class ReSaleOrder(models.Model): delivery_warning = fields.Selection([('normal', '正常'), ('warning', '告警'), ('overdue', '逾期')], string='时效', tracking=True) + order_code = fields.Char('平台订单号', readonly=True) + # 业务平台分配工厂后在智能工厂先创建销售订单 def sale_order_create(self, company_id, delivery_name, delivery_telephone, delivery_address, - deadline_of_delivery, payments_way, pay_way, state='sale'): + deadline_of_delivery, payments_way, pay_way, order_number, state='sale'): now_time = datetime.datetime.now() partner = self.get_customer() data = { @@ -76,6 +78,7 @@ class ReSaleOrder(models.Model): 'address_of_delivery': delivery_address, 'payments_way': payments_way, 'pay_way': pay_way, + 'order_code': order_number, } if deadline_of_delivery: # deadline_of_delivery字段存在为false字符串情况 @@ -158,6 +161,68 @@ class ReSaleOrder(models.Model): if not line.tax_id: raise UserError('请对【订单行】中的【税】进行选择') + consignment_purchase_order_count = fields.Integer( + "Number of consignment Purchase Order Generated", + compute='_compute_purchase_order_count') + + @api.depends('order_line.purchase_line_ids.order_id') + def _compute_purchase_order_count(self): + for order in self: + order.purchase_order_count = len(order._get_purchase_orders().filtered( + lambda po: po.purchase_type not in ['consignment'])) + order.consignment_purchase_order_count = len(order._get_purchase_orders().filtered( + lambda po: po.purchase_type in ['consignment'])) + + def action_view_purchase_orders(self): + """ + 采购 + """ + self.ensure_one() + purchase_order_ids = self._get_purchase_orders().filtered( + lambda po: po.purchase_type not in ['consignment']).ids + action = { + 'res_model': 'purchase.order', + 'type': 'ir.actions.act_window', + } + if len(purchase_order_ids) == 1: + action.update({ + 'view_mode': 'form', + 'res_id': purchase_order_ids[0], + }) + else: + action.update({ + 'name': _("从 %s生成采购订单", self.name), + 'domain': [('id', 'in', purchase_order_ids)], + 'view_mode': 'tree,form', + }) + return action + + def action_view_consignment_purchase_orders(self): + """ + 委外加工 + """ + self.ensure_one() + consignment_purchase_order_ids = self._get_purchase_orders().filtered( + lambda po: po.purchase_type in ['consignment']).ids + action = { + 'res_model': 'purchase.order', + 'type': 'ir.actions.act_window', + } + if len(consignment_purchase_order_ids) == 1: + action.update({ + 'view_mode': 'form', + 'res_id': consignment_purchase_order_ids[0], + }) + else: + action.update({ + 'name': _("从 %s生成委外加工订单", self.name), + 'domain': [('id', 'in', consignment_purchase_order_ids)], + 'view_mode': 'tree,form', + }) + return action + + + class ResaleOrderLine(models.Model): _inherit = 'sale.order.line' @@ -255,7 +320,7 @@ class RePurchaseOrder(models.Model): else: server_template = self.env['product.template'].search( [('server_product_process_parameters_id', '=', pp.surface_technics_parameters_id.id), - ('detailed_type', '=', 'service')]) + ('detailed_type', '=', 'service')]) server_product_process.append((0, 0, { 'product_id': server_template.product_variant_id.id, 'product_qty': 1, diff --git a/sf_sale/views/sale_order_view.xml b/sf_sale/views/sale_order_view.xml index 673d7fa3..641e4278 100644 --- a/sf_sale/views/sale_order_view.xml +++ b/sf_sale/views/sale_order_view.xml @@ -170,19 +170,34 @@ - 下单时间 + 下单日期 + + sale.order.inherited.form.purchase + sale.order + + + + + + + + sale.management.order.form.quote.inherit.sf sale.order - - 下单日期 - @@ -224,6 +239,7 @@ hide + + + + @@ -174,6 +181,19 @@ sf_base.group_purchase,sf_base.group_purchase_director + + 采购员 + + + hide + + + 报价截止日期 + '' + + + + @@ -201,6 +221,20 @@ date_approve asc + + hide + + + + + 采购员 + + + + + + + @@ -212,8 +246,29 @@ + + + + + + + + + purchase.order.list.select.sf + purchase.order + + + + + + + + + + + {"search_default_categ_id":1,"search_default_filter_to_purchase":1, "purchase_product_template": 1} From 202fafac841e7e1e8c0c4fe3e10c71f89a1839fa Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Mon, 16 Dec 2024 17:22:39 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E4=BC=98=E5=8C=96=E3=80=81=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=96=B0=E5=A2=9E=E3=80=90=E5=B7=A5=E5=BA=8F?= =?UTF-8?q?=E5=A4=96=E5=8D=8F=E3=80=91=E3=80=81=E3=80=90=E5=A4=96=E8=B4=AD?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E3=80=91=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_sale/__manifest__.py | 1 + sf_sale/models/sale_order.py | 10 ++++++---- sf_sale/static/src/css/purchase_list.css | 3 +++ sf_sale/views/purchase_order_view.xml | 3 +++ sf_sale/views/sale_order_view.xml | 7 +++++++ 5 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 sf_sale/static/src/css/purchase_list.css diff --git a/sf_sale/__manifest__.py b/sf_sale/__manifest__.py index 45c95030..0ca6457c 100644 --- a/sf_sale/__manifest__.py +++ b/sf_sale/__manifest__.py @@ -26,6 +26,7 @@ 'assets': { 'web.assets_backend': [ 'sf_sale/static/js/setTableWidth.js', + 'sf_sale/static/src/css/purchase_list.css', ] }, 'demo': [ diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py index 11fa0096..a0e321a0 100644 --- a/sf_sale/models/sale_order.py +++ b/sf_sale/models/sale_order.py @@ -55,8 +55,9 @@ class ReSaleOrder(models.Model): store=True, readonly=False, copy=False, precompute=True, states=READONLY_FIELD_STATES, default=fields.Datetime.now) - delivery_warning = fields.Selection([('normal', '正常'), ('warning', '告警'), ('overdue', '逾期')], string='时效', - tracking=True) + delivery_warning = fields.Selection([('normal', '正常'), ('warning', '告警'), ('overdue', '逾期')], + default='normal', + string='时效', tracking=True) order_code = fields.Char('平台订单号', readonly=True) @@ -278,8 +279,9 @@ class RePurchaseOrder(models.Model): compute='_compute_user_id', store=True) - purchase_type = fields.Selection([('standard', '标准采购'), ('consignment', '委外加工')], string='采购类型', - default='standard') + purchase_type = fields.Selection( + [('standard', '标准采购'), ('consignment', '委外加工'), ('outsourcing', '工序外协'), ('outside', '外购订单')], + string='采购类型', default='standard') origin_sale_id = fields.Many2one('sale.order', string='销售订单号', compute='_compute_origin_sale_id') diff --git a/sf_sale/static/src/css/purchase_list.css b/sf_sale/static/src/css/purchase_list.css new file mode 100644 index 00000000..2deacb9c --- /dev/null +++ b/sf_sale/static/src/css/purchase_list.css @@ -0,0 +1,3 @@ +.purchase_order_list_name { + min-width: 62px !important; +} \ No newline at end of file diff --git a/sf_sale/views/purchase_order_view.xml b/sf_sale/views/purchase_order_view.xml index 28890cbd..f70dbb6d 100644 --- a/sf_sale/views/purchase_order_view.xml +++ b/sf_sale/views/purchase_order_view.xml @@ -235,6 +235,9 @@ + + purchase_order_list_name + diff --git a/sf_sale/views/sale_order_view.xml b/sf_sale/views/sale_order_view.xml index 641e4278..4373689d 100644 --- a/sf_sale/views/sale_order_view.xml +++ b/sf_sale/views/sale_order_view.xml @@ -261,6 +261,10 @@ + + + + @@ -293,6 +297,9 @@ + + + From 15eb36a5bc7b9107e551b4a0754552537a251329 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Wed, 18 Dec 2024 16:39:54 +0800 Subject: [PATCH 05/15] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E9=94=80?= =?UTF-8?q?=E5=94=AE=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E9=A1=B5=E3=80=81?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E5=AD=97=E6=AE=B5=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=EF=BC=9B2=E3=80=81=E4=BC=98=E5=8C=96=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E3=80=81=E8=AF=A6=E6=83=85=E9=A1=B5=E5=AD=97=E6=AE=B5=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_sale/models/sale_order.py | 7 +++++++ sf_sale/views/purchase_order_view.xml | 12 ++++++++++++ sf_sale/views/sale_order_view.xml | 6 +++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py index a0e321a0..2e99de70 100644 --- a/sf_sale/models/sale_order.py +++ b/sf_sale/models/sale_order.py @@ -263,6 +263,7 @@ class ProductTemplate(models.Model): _inherit = 'product.template' manual_quotation = fields.Boolean('人工编程', default=False) + part_name = fields.Char(string='零件名称', readonly=True) class RePurchaseOrder(models.Model): @@ -378,6 +379,12 @@ class RePurchaseOrder(models.Model): return result +class PurchaseOrderLine(models.Model): + _inherit = 'purchase.order.line' + + part_name = fields.Char('零件名称', related='product_id.part_name', readonly=True) + + class ResPartnerToSale(models.Model): _inherit = 'res.partner' diff --git a/sf_sale/views/purchase_order_view.xml b/sf_sale/views/purchase_order_view.xml index f70dbb6d..ccdee1d0 100644 --- a/sf_sale/views/purchase_order_view.xml +++ b/sf_sale/views/purchase_order_view.xml @@ -130,6 +130,12 @@ {'no_create': True} + + hide + + + + 报价截止日期 @@ -191,9 +197,15 @@ 报价截止日期 '' + + + + + purchase_order_list_name + diff --git a/sf_sale/views/sale_order_view.xml b/sf_sale/views/sale_order_view.xml index 4373689d..d6247823 100644 --- a/sf_sale/views/sale_order_view.xml +++ b/sf_sale/views/sale_order_view.xml @@ -169,9 +169,10 @@ - + 下单日期 + @@ -287,6 +288,9 @@ + + 下单日期 + From ff91aa1ad69b83ba560ff0361a1ce2dedb7a02d6 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Wed, 18 Dec 2024 16:56:26 +0800 Subject: [PATCH 06/15] =?UTF-8?q?sf-=E5=88=9B=E5=BB=BA=E5=91=98=E5=B7=A5?= =?UTF-8?q?=E6=97=B6=E6=8F=90=E7=A4=BA=E5=91=98=E5=B7=A5=E5=B7=B2=E5=AD=98?= =?UTF-8?q?=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_hr/models/hr_employee.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sf_hr/models/hr_employee.py b/sf_hr/models/hr_employee.py index 5d37f199..2a93ddc5 100644 --- a/sf_hr/models/hr_employee.py +++ b/sf_hr/models/hr_employee.py @@ -23,6 +23,16 @@ class JkmPracticeEmployee(models.Model): vals["we_id"] = self._get_we_id(vals.get('work_email')) return super(JkmPracticeEmployee, self).write(vals) + def unlink(self): + for record in self: + res_partner_obj = record.env['res.partner'].sudo().search([('email', '=', record.work_email)]) + if res_partner_obj: + res_partner_obj.unlink() + res = super(JkmPracticeEmployee, self).unlink() + + return res + + @api.depends('work_contact_id', 'work_contact_id.mobile', 'work_contact_id.email') def _compute_work_contact_details(self): for employee in self: From 97facdaf9c4cf3632da47ed8a774467a99d91f3a Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Thu, 19 Dec 2024 13:45:10 +0800 Subject: [PATCH 07/15] =?UTF-8?q?1=E3=80=81=E9=94=80=E5=94=AE=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E7=8A=B6=E6=80=81=E6=B7=BB=E5=8A=A0=E3=80=90=E5=8A=A0?= =?UTF-8?q?=E5=B7=A5=E4=B8=AD=E3=80=91=E3=80=81=E3=80=90=E7=89=A9=E6=B5=81?= =?UTF-8?q?=E4=B8=AD=E3=80=91=E3=80=81=E3=80=90=E5=B7=B2=E4=BA=A4=E4=BB=98?= =?UTF-8?q?=E3=80=91=E4=B8=89=E7=A7=8D=E7=8A=B6=E6=80=81=EF=BC=9B2?= =?UTF-8?q?=E3=80=81=E4=BC=98=E5=8C=96=20=E8=8E=B7=E5=8F=96mrs=E4=B8=8B?= =?UTF-8?q?=E5=8F=91=E7=9A=84=E7=BC=96=E7=A8=8B=E5=8D=95=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=AF=B9=E8=BF=94=E5=B7=A5?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E7=BC=96=E7=A8=8B=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/sale_order.py | 3 +++ sf_manufacturing/views/sale_order_views.xml | 2 +- sf_mrs_connect/controllers/controllers.py | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sf_manufacturing/models/sale_order.py b/sf_manufacturing/models/sale_order.py index a56721a2..5d318141 100644 --- a/sf_manufacturing/models/sale_order.py +++ b/sf_manufacturing/models/sale_order.py @@ -13,6 +13,9 @@ class SaleOrder(models.Model): ('sent', "报价已发送"), ('supply method', "供货方式待确认"), ('sale', "销售订单"), + ('processing', "加工中"), + ('physical_distribution', "物流中"), + ('delivered', "已交付"), ('done', "已锁定"), ('cancel', "已取消"), ]) diff --git a/sf_manufacturing/views/sale_order_views.xml b/sf_manufacturing/views/sale_order_views.xml index 1e5c4587..49cc752f 100644 --- a/sf_manufacturing/views/sale_order_views.xml +++ b/sf_manufacturing/views/sale_order_views.xml @@ -13,7 +13,7 @@ diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index bab7e282..acbb4bfe 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1114,9 +1114,7 @@ class ResMrpWorkOrder(models.Model): # ================= 如果制造订单刀具状态为[无效刀、缺刀] 或者 制造订单状态为[返工]========================== if (workorder.production_id.tool_state in ['1', '2'] or workorder.production_id.state == 'rework' or workorder.production_id.schedule_state != '已排' - or workorder.production_id.reservation_state not in ['assigned'] - or workorder.production_id.workorder_ids.filtered( - lambda wk: wk.sequence == workorder.sequence - 1).test_results in ['报废', '返工']): + or workorder.production_id.reservation_state not in ['assigned']): if workorder.state != 'waiting': workorder.state = 'waiting' continue diff --git a/sf_manufacturing/views/mrp_production_addional_change.xml b/sf_manufacturing/views/mrp_production_addional_change.xml index 043990ef..d08ff81f 100644 --- a/sf_manufacturing/views/mrp_production_addional_change.xml +++ b/sf_manufacturing/views/mrp_production_addional_change.xml @@ -442,7 +442,7 @@