1.优化sf的产品页面展示:新增服务产品的工艺参数字段,当产品类别为服务时,该字段出现出现,材料和型号隐藏;加工参数里的表面工艺参数字段的值显示为表面工艺+可选参数
2.修复sf的表面工艺工单及完成后的询价单
This commit is contained in:
@@ -15,10 +15,10 @@
|
||||
<field name="type">原材料</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="product_category_server_sf" model="product.category">-->
|
||||
<!-- <field name="name">服务</field>-->
|
||||
<!-- <field name="type">服务</field>-->
|
||||
<!-- </record>-->
|
||||
<record id="product_category_surface_technics_sf" model="product.category">
|
||||
<field name="name">表面工艺</field>
|
||||
<field name="type">表面工艺</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_sf" model="product.product">
|
||||
<field name="name">CNC加工产品模板</field>
|
||||
|
||||
@@ -15,7 +15,8 @@ class ResProductTemplate(models.Model):
|
||||
# 模型的长,宽,高,体积,精度,材料
|
||||
model_name = fields.Char('模型名称')
|
||||
categ_type = fields.Selection(
|
||||
[("成品", "成品"), ("胚料", "胚料"), ("原材料", "原材料")], string='产品的类别', related='categ_id.type',
|
||||
[("成品", "成品"), ("胚料", "胚料"), ("原材料", "原材料"), ("表面工艺", "表面工艺"), ("服务", "服务")],
|
||||
string='产品的类别', related='categ_id.type',
|
||||
store=True)
|
||||
model_long = fields.Float('模型长[mm]', digits=(16, 3))
|
||||
model_width = fields.Float('模型宽[mm]', digits=(16, 3))
|
||||
@@ -31,9 +32,11 @@ class ResProductTemplate(models.Model):
|
||||
embryo_model_type_id = fields.Many2one('sf.model.type', string='胚料模型类型')
|
||||
model_processing_panel = fields.Char('模型加工面板')
|
||||
# model_surface_process_category_id = fields.Many2one('sf.production.process.category', string='表面工艺类别')
|
||||
model_surface_process_ids = fields.Many2many('sf.production.process', 'rel_product_process', string='表面工艺')
|
||||
model_process_parameters_ids = fields.Many2many('sf.production.process.parameter', 'rel_product_parameter',
|
||||
string='工艺参数')
|
||||
# model_surface_process_ids = fields.Many2many('sf.production.process', 'rel_product_process', string='表面工艺')
|
||||
server_product_process_parameters_id = fields.Many2one('sf.production.process.parameter',
|
||||
string='表面工艺参数(服务产品)')
|
||||
model_process_parameters_ids = fields.Many2many('sf.production.process.parameter', 'process_parameter_rel',
|
||||
string='表面工艺参数')
|
||||
# model_price = fields.Float('模型单价', digits=(16, 3))
|
||||
model_remark = fields.Char('模型备注说明')
|
||||
length = fields.Float('长[mm]', digits=(16, 3))
|
||||
@@ -109,7 +112,7 @@ class ResProductTemplate(models.Model):
|
||||
[('materials_no', '=', item['texture_code'])]).id,
|
||||
'materials_type_id': self.env['sf.materials.model'].search(
|
||||
[('materials_no', '=', item['texture_type_code'])]).id,
|
||||
'model_surface_process_ids': self.get_production_process_id(item['surface_process_code']),
|
||||
# 'model_surface_process_ids': self.get_production_process_id(item['surface_process_code']),
|
||||
'model_process_parameters_ids': self.get_process_parameters_id(item['process_parameters_code']),
|
||||
'model_remark': item['remark'],
|
||||
'default_code': '%s-%s' % (order_number, i),
|
||||
@@ -121,12 +124,12 @@ class ResProductTemplate(models.Model):
|
||||
# product_id.product_tmpl_id.active = False
|
||||
return copy_product_id
|
||||
|
||||
def get_production_process_id(self, surface_process_code):
|
||||
production_process_ids = []
|
||||
for item in surface_process_code:
|
||||
production_process = self.env['sf.production.process'].search([('process_encode', '=', item)])
|
||||
production_process_ids.append(production_process.id)
|
||||
return [(6, 0, production_process_ids)]
|
||||
# def get_production_process_id(self, surface_process_code):
|
||||
# production_process_ids = []
|
||||
# for item in surface_process_code:
|
||||
# production_process = self.env['sf.production.process'].search([('process_encode', '=', item)])
|
||||
# production_process_ids.append(production_process.id)
|
||||
# return [(6, 0, production_process_ids)]
|
||||
|
||||
def get_process_parameters_id(self, process_parameters_code):
|
||||
process_parameters_ids = []
|
||||
@@ -340,7 +343,7 @@ class ResProductCategory(models.Model):
|
||||
_inherit = "product.category"
|
||||
|
||||
type = fields.Selection(
|
||||
[("成品", "成品"), ("胚料", "胚料"), ("原材料", "原材料")],
|
||||
[("成品", "成品"), ("胚料", "胚料"), ("原材料", "原材料"), ("表面工艺", "表面工艺"), ("服务", "服务")],
|
||||
default="", string="类型")
|
||||
|
||||
# @api.constrains('type')
|
||||
|
||||
@@ -22,17 +22,13 @@
|
||||
<field name="invoice_policy" position="after">
|
||||
<field name="embryo_model_type_id" string="模型类型"
|
||||
attrs="{'invisible': ['|',('categ_type', '!=', '胚料'),('categ_type', '=', False)]}"/>
|
||||
<field name="materials_id" string="材料"/>
|
||||
<field name="materials_id" string="材料" attrs="{'invisible': [('categ_type', '=', '表面工艺')]}"/>
|
||||
<field name="materials_type_id" string="型号"
|
||||
domain="[('materials_id', '=', materials_id)]"/>
|
||||
<field name="model_surface_process_ids" string="表面工艺" widget="many2many_tags"
|
||||
>
|
||||
<tree>
|
||||
<field name="name"></field>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="model_process_parameters_ids" string="工艺参数" widget="many2many_tags"
|
||||
options="{'no_create': True}"/>
|
||||
domain="[('materials_id', '=', materials_id)]"
|
||||
attrs="{'invisible': [('categ_type', '=', '表面工艺')]}"/>
|
||||
<field name="server_product_process_parameters_id" string="表面工艺参数"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': ['|',('categ_type', '!=', '服务'),('categ_type', '=', False)]}"/>
|
||||
</field>
|
||||
|
||||
<xpath expr="//label[@for='volume']" position="before">
|
||||
@@ -73,8 +69,9 @@
|
||||
<field name="product_model_type_id" string="模型类型"/>
|
||||
<field name="model_processing_panel" placeholder="例如R,U" string="加工面板"/>
|
||||
<field name="model_machining_precision"/>
|
||||
<field name="model_surface_process_ids" string="表面工艺"/>
|
||||
<field name="model_process_parameters_ids" string="工艺参数"/>
|
||||
<!-- <field name="model_surface_process_ids" string="表面工艺"/>-->
|
||||
<field name="model_process_parameters_ids" string="表面工艺参数" widget="many2many_tags"
|
||||
options="{'no_create': True}"/>
|
||||
<field name="model_remark" string="备注说明"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
Reference in New Issue
Block a user