优化sf获取cnc程序和ftp
This commit is contained in:
@@ -66,25 +66,24 @@ class StockRule(models.Model):
|
||||
list2 = []
|
||||
for item in procurements:
|
||||
num = int(item[0].product_qty)
|
||||
product = self.env['product.template'].search(
|
||||
["&", ("name", '=', item[0].product_id.display_name), ('single_manufacturing', '!=', False)])
|
||||
if product:
|
||||
|
||||
product = self.env['product.product'].search(
|
||||
[("id", '=', item[0].product_id.id)])
|
||||
product_tmpl = self.env['product.template'].search(
|
||||
["&", ("id", '=', product.product_tmpl_id.id), ('single_manufacturing', "!=", False)])
|
||||
if product_tmpl:
|
||||
if num > 1:
|
||||
for no in range(1, num + 1):
|
||||
Procurement = namedtuple('Procurement', ['product_id', 'product_qty',
|
||||
'product_uom', 'location_id', 'name', 'origin',
|
||||
'company_id',
|
||||
'values', 'model_file',
|
||||
'model_information'])
|
||||
'values'])
|
||||
s = Procurement(product_id=item[0].product_id, product_qty=1.0, product_uom=item[0].product_uom,
|
||||
location_id=item[0].location_id,
|
||||
name=item[0].name,
|
||||
origin=item[0].origin,
|
||||
company_id=item[0].company_id,
|
||||
values=item[0].values,
|
||||
model_file=base64.b64decode(item[0].product_id.model_file),
|
||||
model_information='%s/%s' % (item[0].product_id.model_processing_panel,
|
||||
item[0].product_id.materials_id.name),
|
||||
)
|
||||
item1 = list(item)
|
||||
item1[0] = s
|
||||
|
||||
Reference in New Issue
Block a user