From 84846fb3daddd6ca46aada284df2eed14eba2aea Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Wed, 18 Jun 2025 16:54:15 +0800 Subject: [PATCH] =?UTF-8?q?bfm=E5=86=85=E9=83=A8=E4=B8=8B=E5=8D=95?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=9D=AF=E6=96=99=E9=95=BF=E5=AE=BD=E9=AB=98?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=88=B0sf=E4=BA=A7=E5=93=81-=E5=8A=A0?= =?UTF-8?q?=E5=B7=A5=E5=8F=82=E6=95=B0-=E5=9D=AF=E6=96=99=E5=B0=BA?= =?UTF-8?q?=E5=AF=B8=E7=9A=84=E9=95=BF=E5=AE=BD=E9=AB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_dlm/models/product_template.py | 6 +++--- sf_manufacturing/models/product_template.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sf_dlm/models/product_template.py b/sf_dlm/models/product_template.py index a2d848c2..e4b15922 100644 --- a/sf_dlm/models/product_template.py +++ b/sf_dlm/models/product_template.py @@ -76,9 +76,9 @@ class ResProductTemplate(models.Model): vals = { 'name': '%s-%s-%s' % ('P', order_id.name, i), 'blank_type': item.get('blank_type'), - 'model_long': item['model_long'] + model_type.embryo_tolerance, - 'model_width': item['model_width'] + model_type.embryo_tolerance, - 'model_height': item['model_height'] + model_type.embryo_tolerance, + 'model_long': item.get('blank_length') if item.get('blank_length') else item['model_long'] + model_type.embryo_tolerance, + 'model_width': item.get('blank_width') if item.get('blank_width') else item['model_width'] + model_type.embryo_tolerance, + 'model_height': item.get('blank_height') if item.get('blank_height') else item['model_height'] + model_type.embryo_tolerance, 'model_volume': (item['model_long'] + model_type.embryo_tolerance) * ( item['model_width'] + model_type.embryo_tolerance) * ( item['model_height'] + model_type.embryo_tolerance), diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index eec6b118..5f371aed 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -897,9 +897,9 @@ class ResProductMo(models.Model): vals = { 'name': product_name, 'blank_type': item.get('blank_type'), - 'model_long': self.format_float(item['model_long'] + embryo_redundancy_id.long), - 'model_width': self.format_float(item['model_width'] + embryo_redundancy_id.width), - 'model_height': self.format_float(item['model_height'] + embryo_redundancy_id.height), + 'model_long': item.get('blank_length') if item.get('blank_length') else self.format_float(item['model_long'] + embryo_redundancy_id.long), + 'model_width': item.get('blank_width') if item.get('blank_width') else self.format_float(item['model_width'] + embryo_redundancy_id.width), + 'model_height': item.get('blank_height') if item.get('blank_height') else self.format_float(item['model_height'] + embryo_redundancy_id.height), 'model_volume': self.format_float((item['model_long'] + embryo_redundancy_id.long) * ( item['model_width'] + embryo_redundancy_id.width) * ( item['model_height'] + embryo_redundancy_id.height)),