Merge branch 'feature/功能刀具安全库存注册' into feature/刀柄入库录入Rfid
This commit is contained in:
@@ -7,7 +7,6 @@ from odoo import models, fields, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.modules import get_resource_path
|
||||
|
||||
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
|
||||
@@ -107,7 +106,10 @@ class ResProductMo(models.Model):
|
||||
|
||||
@api.onchange('cutting_tool_model_id')
|
||||
def _onchange_cutting_tool_model_id(self):
|
||||
self.specification_id = False
|
||||
for item in self:
|
||||
if item:
|
||||
item.specification_id = False
|
||||
item.cutting_tool_chuck_id = item.cutting_tool_model_id.chuck_id
|
||||
|
||||
@api.onchange('cutting_tool_material_id')
|
||||
def _onchange_cutting_tool_material_id(self):
|
||||
@@ -310,7 +312,6 @@ class ResProductMo(models.Model):
|
||||
self.cutting_tool_is_safety_lock = self.specification_id.is_safe_lock
|
||||
self.cutting_tool_fit_nut_model = self.specification_id.nut
|
||||
self.cutting_tool_wrench = self.specification_id.spanner
|
||||
self.cutting_tool_chuck_id = self.specification_id.chuck_id.id
|
||||
self.cutting_tool_jump_accuracy = self.specification_id.diameter_slip_accuracy
|
||||
self.cutting_tool_taper_shank_model = self.specification_id.taper_shank_model
|
||||
self.cutting_tool_cooling_type = self.specification_id.cooling_model
|
||||
|
||||
@@ -222,6 +222,22 @@ class ProductionLot(models.Model):
|
||||
_name = 'stock.lot'
|
||||
_inherit = ['stock.lot', 'printing.utils']
|
||||
|
||||
rfid = fields.Char('Rfid', readonly=True)
|
||||
product_material_name = fields.Char('刀具产品物料名称', related='product_id.cutting_tool_material_id.name')
|
||||
product_specification = fields.Char('规格', compute='_compute_product_specification', store=True)
|
||||
|
||||
@api.depends('product_id')
|
||||
def _compute_product_specification(self):
|
||||
for stock in self:
|
||||
if stock:
|
||||
if stock.product_id:
|
||||
if stock.product_id.categ_id.name in '刀具':
|
||||
stock.product_specification = stock.product_id.specification_id.name
|
||||
elif stock.product_id.categ_id.name in '夹具':
|
||||
stock.product_specification = stock.product_id.specification_fixture_id.name
|
||||
else:
|
||||
stock.product_specification = stock.product_id.default_code
|
||||
|
||||
@api.model
|
||||
def generate_lot_names1(self, display_name, first_lot, count):
|
||||
"""Generate `lot_names` from a string."""
|
||||
|
||||
Reference in New Issue
Block a user