Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/刀具物料与夹具物料的反注册
This commit is contained in:
@@ -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