Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/刀具物料与夹具物料的反注册
This commit is contained in:
@@ -46,11 +46,11 @@ class ResProductMo(models.Model):
|
||||
)
|
||||
|
||||
brand_id = fields.Many2one('sf.machine.brand', '品牌')
|
||||
manufacturer_model_number = fields.Char('厂家型号')
|
||||
tool_length = fields.Integer('长度L(mm)', size=6)
|
||||
tool_width = fields.Integer('宽度D(mm)', size=6)
|
||||
tool_height = fields.Integer('高度T(mm)', size=6)
|
||||
tool_weight = fields.Float('重量(kg)', size=4)
|
||||
coating_material = fields.Char('涂层材料')
|
||||
# 整体式刀具参数
|
||||
cutting_tool_total_length = fields.Float('总长度(mm)')
|
||||
cutting_tool_shank_length = fields.Float('柄部长度(mm)')
|
||||
@@ -93,7 +93,7 @@ class ResProductMo(models.Model):
|
||||
string='适用刀盘型号' # 使用空列表作为默认值
|
||||
)
|
||||
cutting_tool_radius = fields.Float('刀尖半径(mm)')
|
||||
# 刀杆/刀盘参数
|
||||
# 刀杆/参数
|
||||
cutting_tool_c_diameter = fields.Float('C柄径(mm)')
|
||||
cutting_tool_l_total_length = fields.Float('L总长(mm)')
|
||||
cutting_tool_d_diameter = fields.Float('D刃径(mm)')
|
||||
@@ -156,11 +156,6 @@ class ResProductMo(models.Model):
|
||||
register_state = fields.Selection([('未注册', '未注册'), ('已注册', '已注册'),('注册失败','注册失败')], string='注册状态', default='未注册')
|
||||
industry_code = fields.Char('行业编码', readonly=True)
|
||||
|
||||
@api.onchange('brand_id')
|
||||
def _onchange_brand_id(self):
|
||||
if self.brand_id:
|
||||
self.manufacturer_model_number = self.brand_id.manufacturer_model_number
|
||||
|
||||
def _json_apply_machine_tool_type_item_code(self, item):
|
||||
code_arr = []
|
||||
for i in item.product_id.fixture_apply_machine_tool_type_ids:
|
||||
|
||||
@@ -283,9 +283,9 @@ class StockPicking(models.Model):
|
||||
_('该入库单对应的单号为%s的出库单还未完成,不能进行验证操作!' % picking_out.name))
|
||||
|
||||
res = super().button_validate()
|
||||
# 采购单验证(夹具和刀具)
|
||||
# 采购单验证(夹具)
|
||||
for item in self.move_ids_without_package:
|
||||
if item.product_id.categ_type in ['刀具', '夹具']:
|
||||
if item.product_id.categ_type == '夹具':
|
||||
if item.quantity_done > 0:
|
||||
item._register_fixture()
|
||||
return res
|
||||
@@ -349,7 +349,7 @@ class ReStockMove(models.Model):
|
||||
|
||||
# 将采购到的夹具注册到Cloud
|
||||
def _register_fixture(self):
|
||||
create_url = '/api/fixture/create'
|
||||
create_url = '/api/factory_fixture_material/create'
|
||||
config = self.env['res.config.settings'].get_values()
|
||||
headers = Common.get_headers(self, config['token'], config['sf_secret_key'])
|
||||
strurl = config['sf_url'] + create_url
|
||||
@@ -358,7 +358,6 @@ class ReStockMove(models.Model):
|
||||
'token': config['token'],
|
||||
'name': item.product_id.name,
|
||||
'brand_code': self.env['sf.machine.brand'].search([('id', '=', item.product_id.brand_id.id)]).code,
|
||||
'manufacturer_model_number': item.product_id.manufacturer_model_number,
|
||||
'fixture_material_code': self.env['sf.fixture.material'].search(
|
||||
[('id', '=', item.product_id.fixture_material_id.id)]).code,
|
||||
'fixture_multi_mounting_type_code': self.env['sf.multi_mounting.type'].search(
|
||||
@@ -401,3 +400,5 @@ class ReStockMove(models.Model):
|
||||
item.product_id.write({'register_state': '注册失败'})
|
||||
except Exception as e:
|
||||
raise UserError("注册夹具到云端失败,请联系管理员!")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user