From 5ea6158e8dea29f77b89dce276747134b876b449 Mon Sep 17 00:00:00 2001 From: yuxianghui <1608204036@qq.com> Date: Tue, 29 Aug 2023 17:28:20 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=AD=A6=E5=91=8A=E4=BF=A1=E6=81=AF=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_warehouse/models/model.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sf_warehouse/models/model.py b/sf_warehouse/models/model.py index ea707463..eafdffac 100644 --- a/sf_warehouse/models/model.py +++ b/sf_warehouse/models/model.py @@ -10,7 +10,7 @@ class SfLocation(models.Model): # 重写字段定义 name = fields.Char('Location Name', required=True, size=20) - barcode = fields.Char('Barcode', copy=False, required=True, size=15) + barcode = fields.Char('Barcode', copy=False, size=15) # 仓库类别(selection:库区、库位、货位) location_type = fields.Selection([ @@ -34,14 +34,14 @@ class SfLocation(models.Model): # 产品类别 (关联:product.category) product_type = fields.Many2many('product.category', string='产品类别') # 货架独有字段:通道、方向、货架高度(m)、货架层数、层数容量 - channel = fields.Char(string='通道', required=True) + channel = fields.Char(string='通道') direction = fields.Selection([ ('R', 'R'), ('L', 'L') - ], string='方向', required=True) + ], string='方向') shelf_height = fields.Float(string='货架高度(m)') - shelf_layer = fields.Integer(string='货架层数', required=True) - layer_capacity = fields.Integer(string='层数容量', required=True) + shelf_layer = fields.Integer(string='货架层数') + layer_capacity = fields.Integer(string='层数容量') # 货位独有字段:货位状态、产品(关联产品对象)、产品序列号(关联产品序列号对象) location_status = fields.Selection([ @@ -54,9 +54,9 @@ class SfLocation(models.Model): product_sn_id = fields.Many2one('stock.lot', string='产品序列号') # time_test = fields.Char(string='time') # 添加SQL约束 - _sql_constraints = [ - ('name_uniq', 'unique(name)', '位置名称必须唯一!'), - ] + # _sql_constraints = [ + # ('name_uniq', 'unique(name)', '位置名称必须唯一!'), + # ] hide_location_type = fields.Boolean(compute='_compute_hide_what', string='隐藏仓库') hide_area = fields.Boolean(compute='_compute_hide_what', string='隐藏库区') From e9afce298d735877af745a2e90120ba7bd252c38 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Tue, 29 Aug 2023 17:40:16 +0800 Subject: [PATCH 2/6] =?UTF-8?q?SF=E7=82=B9=E5=87=BB=E5=90=8E=E8=8E=B7?= =?UTF-8?q?=E5=8F=96cnc=E7=A8=8B=E5=BA=8F=E6=8C=89=E9=92=AE=EF=BC=8Ccloud?= =?UTF-8?q?=E7=94=9F=E6=88=90=E7=9A=84=E7=BC=96=E7=A8=8B=E5=8D=95=E7=9A=84?= =?UTF-8?q?=E7=BC=96=E5=8F=B7=E6=9C=AA=E6=98=BE=E7=A4=BABug=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 42 ++++++++---------------- sf_sale/views/quick_easy_order_view.xml | 1 + 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index b81e6d1e..232ae241 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -135,7 +135,6 @@ class ResMrpWorkOrder(models.Model): self.functional_fixture_code = self.functional_fixture_id.code self.functional_fixture_type_id = self.functional_fixture_id.type_id.id - def get_no_data(self, production_id): process_parameter_workorder = self.search( [('surface_technics_parameters_id', '!=', False), ('production_id', '=', production_id)]) @@ -338,19 +337,19 @@ class ResMrpWorkOrder(models.Model): # tray.unclamp() # self.tray_id = False - # return { - # 'name': _('New Maintenance Request'), - # 'view_mode': 'form', - # 'res_model': 'maintenance.request', - # 'res_id':self.id, - # 'type': 'ir.actions.act_window', - # 'context': { - # 'default_company_id': self.company_id.id, - # 'default_production_id': self.id, - # }, - # 'domain': [('production_id', '=', self.id)], - # 'target':'new' - # } + # return { + # 'name': _('New Maintenance Request'), + # 'view_mode': 'form', + # 'res_model': 'maintenance.request', + # 'res_id':self.id, + # 'type': 'ir.actions.act_window', + # 'context': { + # 'default_company_id': self.company_id.id, + # 'default_production_id': self.id, + # }, + # 'domain': [('production_id', '=', self.id)], + # 'target':'new' + # } def recreateManufacturingOrWorkerOrder(self): """ @@ -400,20 +399,6 @@ class ResMrpWorkOrder(models.Model): try: cnc = self.env['mrp.workorder'].search( [('routing_type', '=', 'CNC加工'), ('production_id', '=', self.production_id.id)], limit=1) - logging.info('fetchCNC-cnc:%s' % cnc) - # if cnc.product_id.upload_model_file: - # logging.info('fetchCNC-upload_model_file:%s' % cnc.product_id.upload_model_file) - # attachments = cnc.product_id.upload_model_file[0] - # logging.info('fetchCNC-attachment1:%s' % attachments) - # logging.info('fetchCNC-attachment1:%s' % cnc.product_id.upload_model_file[0]) - # logging.info('fetchCNC-attachment2:%s' % cnc.product_id.upload_model_file[0].datas) - # logging.info('fetchCNC-attachment:%s' % attachments.datas) - # base64_data = base64.b64encode(attachments.datas) - # logging.info('fetchCNC-attachment1:%s' % attachments) - # base64_datas = base64_data.decode('utf-8') - # model_code = hashlib.sha1(base64_datas.encode('utf-8')).hexdigest() - # logging.info('fetchCNC-model_code:%s' % model_code) - logging.info('fetchCNC-model_code1:%s' % cnc.product_id.model_code) res = {'model_code': '' if not cnc.product_id.model_code else cnc.product_id.model_code, 'production_no': self.production_id.name, 'machine_tool_code': cnc.workcenter_id.machine_tool_id.code, @@ -427,6 +412,7 @@ class ResMrpWorkOrder(models.Model): 'embryo_height': cnc.product_id.bom_ids.bom_line_ids.product_id.height, 'embryo_width': cnc.product_id.bom_ids.bom_line_ids.product_id.width, 'order_no': cnc.production_id.origin, + 'model_order_no': cnc.product_id.default_code.rsplit('-', 1)[0], 'user': self.env.user.name, 'model_file': '' if not cnc.product_id.model_file else base64.b64encode( cnc.product_id.model_file).decode('utf-8') diff --git a/sf_sale/views/quick_easy_order_view.xml b/sf_sale/views/quick_easy_order_view.xml index cf8a2c9f..c140dad7 100644 --- a/sf_sale/views/quick_easy_order_view.xml +++ b/sf_sale/views/quick_easy_order_view.xml @@ -6,6 +6,7 @@ quick.easy.order FP-%(year)s-%(month)s%(day)s- 4 + # ---------- 快速订单 ------------ From 2fdcd3a0094d674a044812357c59b30ede0cf4ac Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Wed, 30 Aug 2023 16:19:38 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=BF=AB=E9=80=9F=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_sale/models/quick_easy_order.py | 7 ++++--- sf_sale/views/quick_easy_order_view.xml | 24 +++++++++++++++--------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index fac229f5..eed2be57 100644 --- a/sf_sale/models/quick_easy_order.py +++ b/sf_sale/models/quick_easy_order.py @@ -37,11 +37,11 @@ class QuickEasyOrder(models.Model): quantity = fields.Integer('数量', default=1) unit_price = fields.Float('单价') price = fields.Float('总价') - model_file = fields.Binary('模型文件') - upload_model_file = fields.Many2many('ir.attachment', 'upload_qf_model_file_attachment_ref', string='模型文件') + model_file = fields.Binary('glb模型文件') + upload_model_file = fields.Many2many('ir.attachment', 'upload_qf_model_file_attachment_ref', string='上传模型文件') delivery_time = fields.Date('交货日期') customer_id = fields.Many2one('res.partner', string='客户', default=lambda self: self.env.user.partner_id.id) - state = fields.Selection([('草稿', '草稿'), ('待付款', '待付款'), ('待派单', '待派单'), + state = fields.Selection([('草稿', '草稿'), ('待派单', '待派单'), ('待接单', '待接单'), ('加工中', '加工中'), ('物流中', '物流中'), ('已交付', '已交付')], string='订单状态', default='草稿', readonly=True) @@ -82,6 +82,7 @@ class QuickEasyOrder(models.Model): obj = super(QuickEasyOrder, self).create(vals) self.model_coloring(obj) self.distribute_to_factory(obj) + obj.state = '待接单' return obj # 将attach的datas内容转为glb文件 diff --git a/sf_sale/views/quick_easy_order_view.xml b/sf_sale/views/quick_easy_order_view.xml index c140dad7..a5ce9da2 100644 --- a/sf_sale/views/quick_easy_order_view.xml +++ b/sf_sale/views/quick_easy_order_view.xml @@ -16,13 +16,16 @@ quick.easy.order - - - - - - - + + + + + + + + + @@ -33,6 +36,9 @@ quick.easy.order
+
+ +

@@ -42,7 +48,7 @@ - + @@ -81,7 +87,7 @@ + filter_domain="['|', ('name', 'ilike', self), '|',('customer_id', 'ilike', self)]"/> From e64cf88809bea0b22d2ed4ea0bc2733bc6983517 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Wed, 30 Aug 2023 16:26:19 +0800 Subject: [PATCH 4/6] =?UTF-8?q?1.=E5=8A=A0=E5=B7=A5=E5=B7=A5=E8=89=BA?= =?UTF-8?q?=E5=8E=BB=E6=8E=89form=E8=A1=A8=E5=8D=95=E5=B1=95=E7=A4=BA=202.?= =?UTF-8?q?=E6=9C=BA=E5=BA=8A=E5=9E=8B=E5=8F=B7=E9=A1=B5=E9=9D=A2=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/views/base_view.xml | 13 +++++++------ sf_base/views/common_view.xml | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sf_base/views/base_view.xml b/sf_base/views/base_view.xml index 5c3fd3ad..8c8e1632 100644 --- a/sf_base/views/base_view.xml +++ b/sf_base/views/base_view.xml @@ -159,11 +159,11 @@