调整模型显示
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -50,9 +50,13 @@
|
||||
<group>
|
||||
<field name="customer_id" context="{'is_customer': True }"
|
||||
options="{'no_create': True}" required="1"/>
|
||||
<field name="upload_model_file" widget="many2many_binary"/>
|
||||
<field name="upload_model_file" widget="many2many_binary" attrs="{'invisible': [('upload_model_file', '=', False)]}"/>
|
||||
<!-- <field name="model_url" widget="binary_download" filename_field="model_name" readonly="1" string="模型文件"
|
||||
attrs="{'invisible': [('model_url', '=', False)]}"/> -->
|
||||
<field name="model_file" widget="Viewer3D" string="模型" readonly="1" force_save="1"
|
||||
attrs="{'invisible': [('model_file', '=', False)]}"/>
|
||||
<!-- <field name="glb_url" widget="Viewer3D" string="模型" readonly="1" force_save="1"
|
||||
attrs="{'invisible': [('glb_url', '=', False)]}"/> -->
|
||||
<label for="model_length" string="尺寸(mm)"
|
||||
attrs='{"invisible": [("model_file","=",False)]}'/>
|
||||
<div class="test_model"
|
||||
|
||||
Reference in New Issue
Block a user