智能工厂接口新增相关字段
This commit is contained in:
35
sf_bpm_api/models/product_template.py
Normal file
35
sf_bpm_api/models/product_template.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from odoo import models, fields
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class ResProductTemplate(models.Model):
|
||||
_inherit = 'product.template'
|
||||
|
||||
purchase_ok = fields.Boolean(default=False)
|
||||
detailed_type = fields.Selection(default='product')
|
||||
list_price = fields.Float(digits=(16, 3))
|
||||
invoice_policy = fields.Selection(default='delivery')
|
||||
long = fields.Float('长[mm]', digits=(16, 3))
|
||||
width = fields.Float('宽[mm]', digits=(16, 3))
|
||||
height = fields.Float('高[mm]', digits=(16, 3))
|
||||
volume = fields.Float('体积[mm³]', digits=(16, 3))
|
||||
precision = fields.Float('精度要求', digits=(16, 3))
|
||||
materials_id = fields.Many2one('mrs.production.materials', string='材料')
|
||||
# materials_type_id = fields.Many2one('mrs.materials.model', string='型号')
|
||||
# surface_technics_id = fields.Many2one('mrs.production.process', string='表面工艺')
|
||||
# technological_parameter_id = fields.Char('工艺参数')
|
||||
unit_price = fields.Float('单价')
|
||||
amount = fields.Integer('数量')
|
||||
|
||||
# 业务平台分配工厂时调用该方法创建产品,(调用该方法时用prototype)
|
||||
def product_create(self, products):
|
||||
self.env['product.template'].create({
|
||||
'name': products['order_number'],
|
||||
'length': products['length'],
|
||||
'width': products['width'],
|
||||
'height': products['height'],
|
||||
'volume': products['volume'],
|
||||
'materials_id': products['materials_id'],
|
||||
'unit_price': products['unit_price'],
|
||||
'amount': products['amount']
|
||||
})
|
||||
Reference in New Issue
Block a user