Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/新增上传模型功能
This commit is contained in:
@@ -569,15 +569,20 @@ class MachineBrand(models.Model):
|
||||
result = json.loads(r['result'])
|
||||
if result['status'] == 1:
|
||||
for item in result['machine_brand_all_list']:
|
||||
|
||||
brand = self.env['sf.machine.brand'].search(
|
||||
[("code", '=', item['code'])])
|
||||
if not brand:
|
||||
if item.get('image_brand'):
|
||||
image = base64.b64decode(item['image_brand'])
|
||||
else:
|
||||
image = ''
|
||||
self.env['sf.machine.brand'].create({
|
||||
"id": item['id'],
|
||||
"name": item['name'],
|
||||
"code": item['code'],
|
||||
"remark": item['remark'],
|
||||
"image_brand": '' if not item['image_brand'] else base64.b64encode(item.image_brand),
|
||||
"image_brand": image,
|
||||
"tag_ids": self.env['sf.machine.brand.tags'].search(
|
||||
[("name", 'in', item['tag_ids'])]).ids
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user