调整模型显示

This commit is contained in:
胡尧
2025-03-12 17:05:29 +08:00
parent b8bec37e15
commit 29337bfceb
14 changed files with 28 additions and 5 deletions

View File

@@ -248,6 +248,7 @@ class ResaleOrderLine(models.Model):
# part_number = fields.Char('零件图号', related='product_id.part_number', readonly=True)
part_name = fields.Char('零件名称', related='product_id.part_name', readonly=True)
model_glb_file = fields.Binary('模型的glb文件', compute='_compute_model_glb_file', store=True)
glb_url = fields.Char('glb文件地址', compute='_compute_model_glb_file', store=True)
# product_template_id = fields.Many2one(
# string="产品",
# comodel_name='product.template',
@@ -265,7 +266,6 @@ class ResaleOrderLine(models.Model):
embryo_redundancy_id = fields.Many2one('sf.embryo.redundancy', '坯料冗余')
manual_quotation = fields.Boolean('人工编程', default=False)
model_url = fields.Char('模型文件地址')
glb_url = fields.Char('glb文件地址')
model_id = fields.Char('模型id')
@api.depends('embryo_redundancy_id')
@@ -279,6 +279,8 @@ class ResaleOrderLine(models.Model):
if line.product_template_id:
if not line.model_glb_file:
line.model_glb_file = line.product_id.product_tmpl_id.model_file
if not line.glb_url:
line.glb_url = line.product_id.product_tmpl_id.glb_url
if not line.price_unit:
line.price_unit = line.product_id.product_tmpl_id.list_price