From 05dac9fb0ca8683b45b41bc107524541ffed3ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Thu, 20 Feb 2025 13:36:05 +0800 Subject: [PATCH 001/181] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=9A=84=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product_template_management_view.xml | 12 +++-- sf_manufacturing/models/mrp_production.py | 6 ++- sf_manufacturing/models/product_template.py | 49 ++++++++++++------- sf_manufacturing/models/sale_order.py | 4 +- sf_manufacturing/views/sale_order_views.xml | 4 -- sf_sale/models/sale_order.py | 10 +++- sf_sale/views/sale_order_view.xml | 6 +-- .../static/src/js/3d_viewer.js | 15 +++--- 8 files changed, 66 insertions(+), 40 deletions(-) diff --git a/sf_dlm_management/views/product_template_management_view.xml b/sf_dlm_management/views/product_template_management_view.xml index 1f3dc50b..f575b9cf 100644 --- a/sf_dlm_management/views/product_template_management_view.xml +++ b/sf_dlm_management/views/product_template_management_view.xml @@ -16,13 +16,16 @@ + - + - + + @@ -68,6 +71,7 @@ + - - + + diff --git a/web_widget_model_viewer/static/src/js/3d_viewer.js b/web_widget_model_viewer/static/src/js/3d_viewer.js index 4ed9dcc1..8cd9ba87 100644 --- a/web_widget_model_viewer/static/src/js/3d_viewer.js +++ b/web_widget_model_viewer/static/src/js/3d_viewer.js @@ -27,7 +27,10 @@ export class StepViewer extends Component { formatUrl() { var url = ''; if (this.props.value) { - if (this.props.value.slice(-1) == 'b' && !isNaN(this.props.value.split(' ')[0])) { + if (this.props.value.startsWith('http')) { + // 从url读取文件内容 + url = this.props.value; + } else if (this.props.value.slice(-1) == 'b' && !isNaN(this.props.value.split(' ')[0])) { var url_props = { base_url: session['web.base.url'], model: this.props.record.resModel, @@ -37,21 +40,19 @@ export class StepViewer extends Component { url = url_props['base_url'].replace('http://', 'https://') + '/web/content/' + url_props['model'] + '/' + url_props['id'] + '/' + url_props['field'] + '?download=true'; // url = 'http://localhost:8069'+'/web/content/'+url_props['model']+'/'+url_props['id']+'/'+url_props['field']+'?download=true' // console.log('url111111', url) - return url; + } else { url = "data:model/gltf-binary;base64," + this.props.value; // console.log('url2', url) - return url; + // localStorage.setItem('url',url) // let new_url = localStorage.getItem(('url')) // var oViewer = document.getElementsByTagName('model-viewer')[0]; // return new_url // url = "web_widget_model_viewer/static/src/images/not_model.png"; } - } else { - // var oImg = document.getElementsByClassName('test')[0] - // console.log(oImg) - } + } + return url; } } From 2409dab8b037fa0e1bca617ef85485a6f3ca679e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Wed, 5 Mar 2025 14:27:41 +0800 Subject: [PATCH 002/181] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=9D=9E=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96=E5=8E=9F=E5=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/sale_order.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sf_manufacturing/models/sale_order.py b/sf_manufacturing/models/sale_order.py index 39066f14..dbd06e6a 100644 --- a/sf_manufacturing/models/sale_order.py +++ b/sf_manufacturing/models/sale_order.py @@ -190,3 +190,16 @@ class SaleOrderLine(models.Model): if vals['supply_method'] == 'purchase' and line.is_incoming_material: raise UserError('当前(%s)产品为客供料,不能选择外购' % ','.join(line.mapped('product_id.name'))) return super(SaleOrderLine, self).write(vals) + + cancel_auto_machining = fields.Boolean('是否取消自动化加工', compute='_compute_cancel_auto_machining', store=True) + cancel_auto_machining_reason = fields.Char('非自动化加工原因') + + def _compute_cancel_auto_machining(self): + for line in self: + line.cancel_auto_machining = True if line.product_id.auto_machining \ + and line.supply_method != 'automation' else False + + @api.onchange('product_id') + def _onchange_product_id_set_supply_method(self): + if self.product_id.auto_machining: + self.supply_method = 'automation' From e12755783c31addf5f9675c0f9fa760db1105fd2 Mon Sep 17 00:00:00 2001 From: guanhuan Date: Thu, 6 Mar 2025 13:46:18 +0800 Subject: [PATCH 003/181] =?UTF-8?q?=E5=AE=A1=E6=89=B9=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_purchase_tier_validation/models/models.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/jikimo_purchase_tier_validation/models/models.py b/jikimo_purchase_tier_validation/models/models.py index 018766eb..4462e962 100644 --- a/jikimo_purchase_tier_validation/models/models.py +++ b/jikimo_purchase_tier_validation/models/models.py @@ -9,6 +9,8 @@ class jikimo_purchase_tier_validation(models.Model): _name = 'purchase.order' _inherit = ['purchase.order', 'tier.validation'] _description = "采购订单" + _state_from = ["draft", "to approve", "rejected"] + _state_to = ["approved"] _tier_validation_buttons_xpath = "/form/header/button[@id='draft_confirm'][1]" @@ -68,11 +70,6 @@ class jikimo_purchase_tier_validation(models.Model): return res - def _rejected_tier(self, tiers=False): - res = super(jikimo_purchase_tier_validation, self)._rejected_tier(tiers) - self.state = 'draft' - return res - @api.model def _get_under_validation_exceptions(self): res = super(jikimo_purchase_tier_validation, self)._get_under_validation_exceptions() From cb645aa1b9a6c632be8314d56816e60196bf693b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Thu, 6 Mar 2025 13:59:14 +0800 Subject: [PATCH 004/181] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E4=BA=A7=E7=BA=BF=E7=9A=84=E9=9B=B6=E4=BB=B6=E4=BE=9B?= =?UTF-8?q?=E8=B4=A7=E8=B7=AF=E7=BA=BF=E5=88=9D=E5=A7=8B=E5=8C=96=E4=B8=BA?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8C=96=E4=BA=A7=E7=BA=BF=E5=8A=A0=E5=B7=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/sale_order.py | 11 ++++++----- sf_manufacturing/views/sale_order_views.xml | 4 ++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sf_manufacturing/models/sale_order.py b/sf_manufacturing/models/sale_order.py index dbd06e6a..d46c1baf 100644 --- a/sf_manufacturing/models/sale_order.py +++ b/sf_manufacturing/models/sale_order.py @@ -22,6 +22,9 @@ class SaleOrder(models.Model): def confirm_to_supply_method(self): self.state = 'supply method' + for line in self.order_line: + if line.product_id.auto_machining: + line.supply_method = 'automation' def action_confirm(self): if self._get_forbidden_state_confirm() & set(self.mapped('state')): @@ -192,14 +195,12 @@ class SaleOrderLine(models.Model): return super(SaleOrderLine, self).write(vals) cancel_auto_machining = fields.Boolean('是否取消自动化加工', compute='_compute_cancel_auto_machining', store=True) - cancel_auto_machining_reason = fields.Char('非自动化加工原因') + cancel_auto_machining_reason = fields.Char('更改供货原因') + @api.depends('product_id', 'supply_method') def _compute_cancel_auto_machining(self): for line in self: line.cancel_auto_machining = True if line.product_id.auto_machining \ and line.supply_method != 'automation' else False - @api.onchange('product_id') - def _onchange_product_id_set_supply_method(self): - if self.product_id.auto_machining: - self.supply_method = 'automation' + diff --git a/sf_manufacturing/views/sale_order_views.xml b/sf_manufacturing/views/sale_order_views.xml index 4d7a0c41..e0f9e097 100644 --- a/sf_manufacturing/views/sale_order_views.xml +++ b/sf_manufacturing/views/sale_order_views.xml @@ -21,6 +21,10 @@ + + + + From b276f616e59b1d7d304bc6f3dd9b76dad8898e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Thu, 6 Mar 2025 14:03:31 +0800 Subject: [PATCH 005/181] =?UTF-8?q?=E6=88=90=E5=93=81=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E9=BB=98=E8=AE=A4=E5=8F=96=E6=A8=A1=E6=9D=BF=E4=B8=AD?= =?UTF-8?q?=E6=9C=80=E5=90=8E=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_sale_multiple_supply_methods/models/mrp_bom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jikimo_sale_multiple_supply_methods/models/mrp_bom.py b/jikimo_sale_multiple_supply_methods/models/mrp_bom.py index 2528d0a4..aa9d6c60 100644 --- a/jikimo_sale_multiple_supply_methods/models/mrp_bom.py +++ b/jikimo_sale_multiple_supply_methods/models/mrp_bom.py @@ -9,5 +9,6 @@ class MrpBom(models.Model): # 成品的供应商从模板中获取 if product_type == 'product': - bom_id.subcontractor_id = product.product_tmpl_id.seller_ids.partner_id.id + if product.product_tmpl_id.seller_ids: + bom_id.subcontractor_id = product.product_tmpl_id.seller_ids[-1].partner_id.id return bom_id From 0d7f34819461e9b583ea5fb912673d426705fd6d Mon Sep 17 00:00:00 2001 From: guanhuan Date: Fri, 7 Mar 2025 11:29:32 +0800 Subject: [PATCH 006/181] =?UTF-8?q?=E8=B0=83=E6=8B=A8=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=E8=AF=A2=E4=BB=B7=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 --- .../models/models.py | 2 +- sf_manufacturing/views/stock_picking_view.xml | 10 +++++++ sf_sale/views/purchase_order_view.xml | 28 +++++++++++-------- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/jikimo_purchase_tier_validation/models/models.py b/jikimo_purchase_tier_validation/models/models.py index 4462e962..ecb7ed73 100644 --- a/jikimo_purchase_tier_validation/models/models.py +++ b/jikimo_purchase_tier_validation/models/models.py @@ -23,7 +23,7 @@ class jikimo_purchase_tier_validation(models.Model): def button_confirm(self): for record in self: - if record.state in ['to approve']: + if record.need_validation and not record.validation_status == 'validated': raise ValidationError(_('请先完成审批。')) res = super(jikimo_purchase_tier_validation, self).button_confirm() for record in self: diff --git a/sf_manufacturing/views/stock_picking_view.xml b/sf_manufacturing/views/stock_picking_view.xml index 458494b9..3cb877a9 100644 --- a/sf_manufacturing/views/stock_picking_view.xml +++ b/sf_manufacturing/views/stock_picking_view.xml @@ -67,6 +67,16 @@ + + + + diff --git a/sf_sale/views/purchase_order_view.xml b/sf_sale/views/purchase_order_view.xml index 209fd4fa..6624c7fa 100644 --- a/sf_sale/views/purchase_order_view.xml +++ b/sf_sale/views/purchase_order_view.xml @@ -42,20 +42,20 @@ - -