修改cnc编程单
This commit is contained in:
@@ -9,7 +9,7 @@ class ResProductTemplate(models.Model):
|
||||
model_long = fields.Float('模型长[mm]', digits=(16, 3))
|
||||
model_width = fields.Float('模型宽[mm]', digits=(16, 3))
|
||||
model_height = fields.Float('模型高[mm]', digits=(16, 3))
|
||||
model_volume = fields.Float('模型体积[mm³]', digits=(16, 3))
|
||||
model_volume = fields.Float('模型体积[mm]', compute='_compute_model_volume', store=True)
|
||||
model_machining_precision = fields.Selection([
|
||||
('±0.10mm', '±0.10mm'),
|
||||
('±0.05mm', '±0.05mm'),
|
||||
@@ -22,9 +22,9 @@ class ResProductTemplate(models.Model):
|
||||
model_process_parameters_id = fields.Many2one('sf.processing.technology', string='工艺参数')
|
||||
model_price = fields.Float('模型单价', digits=(16, 3))
|
||||
model_remark = fields.Char('模型备注说明')
|
||||
long = fields.Float('长[mm]', digits=(16, 3), onchange='add_product_size')
|
||||
width = fields.Float('宽[mm]', digits=(16, 3), onchange='add_product_size')
|
||||
height = fields.Float('高[mm]', digits=(16, 3), onchange='add_product_size')
|
||||
long = fields.Float('长[mm]', digits=(16, 3))
|
||||
width = fields.Float('宽[mm]', digits=(16, 3))
|
||||
height = fields.Float('高[mm]', digits=(16, 3))
|
||||
materials_id = fields.Many2one('sf.production.materials', string='材料')
|
||||
materials_type_id = fields.Many2one('sf.materials.model', string='材料型号')
|
||||
volume = fields.Float(compute='_compute_volume', store=True)
|
||||
@@ -34,6 +34,10 @@ class ResProductTemplate(models.Model):
|
||||
def _compute_volume(self):
|
||||
self.volume = self.long * self.width * self.height
|
||||
|
||||
@api.depends('model_long', 'model_width', 'model_height')
|
||||
def _compute_model_volume(self):
|
||||
self.model_volume = self.model_long * self.model_width * self.model_height
|
||||
|
||||
# 业务平台分配工厂后在智能工厂先创建销售订单再创建该产品
|
||||
def product_create(self, product_id, item, order_id, order_number, i):
|
||||
copy_product_id = product_id.with_user(self.env.ref("base.user_admin")).copy()
|
||||
@@ -70,17 +74,20 @@ class ResProductTemplate(models.Model):
|
||||
if not self.model_type_id:
|
||||
return
|
||||
model_type = self.env['sf.model.type'].search(
|
||||
[('id', '=', self.model_type_id.id)])
|
||||
print(self.model_long)
|
||||
print(self.model_width)
|
||||
print(self.model_height)
|
||||
for item in self:
|
||||
print(item.model_long)
|
||||
print(item.model_width)
|
||||
print(item.model_height)
|
||||
item.model_long = item.model_long + model_type.embryo_tolerance
|
||||
item.model_width = item.model_width + model_type.embryo_tolerance
|
||||
item.model_height = item.model_width + model_type.embryo_tolerance
|
||||
[('id', '=', self.model_type_id.id), ('embryo_tolerance', '=', True)])
|
||||
if model_type:
|
||||
self.model_long = self.model_long + 1
|
||||
self.model_width = self.model_width + 1
|
||||
self.model_height = self.model_width + 1
|
||||
# for item in self:
|
||||
# print(item.model_long)
|
||||
# print(item.model_width)
|
||||
# print(item.model_height)
|
||||
# item.model_long = item.model_long + 1
|
||||
# item.model_width = item.model_width + 1
|
||||
# item.model_height = item.model_width + 1
|
||||
else:
|
||||
return
|
||||
|
||||
|
||||
class ResMrpBom(models.Model):
|
||||
|
||||
Reference in New Issue
Block a user