[FIX] Fix singleton

This commit is contained in:
Cas Vissers
2019-10-18 10:25:09 +02:00
committed by David
parent 9204feed8b
commit cfad9e017d
2 changed files with 10 additions and 9 deletions

View File

@@ -4,7 +4,7 @@
{
'name': 'Order point generator',
'summary': 'Mass configuration of stock order points',
'version': '11.0.1.0.0',
'version': '11.0.1.0.1',
'author': "Camptocamp, Odoo Community Association (OCA)",
'category': 'Warehouse',
'license': 'AGPL-3',

View File

@@ -54,14 +54,15 @@ class OrderpointTemplate(models.Model):
""" Create instances of model using template inherited model
"""
orderpoint_model = self.env['stock.warehouse.orderpoint']
for data in self.copy_data():
data.pop('auto_generate', None)
data.pop('auto_product_ids', None)
data.pop('auto_last_generation', None)
for product_id in product_ids:
vals = data.copy()
vals['product_id'] = product_id
orderpoint_model.create(vals)
for record in self:
for data in record.copy_data():
data.pop('auto_generate')
data.pop('auto_product_ids')
data.pop('auto_last_generation')
for product_id in product_ids:
vals = data.copy()
vals['product_id'] = product_id
orderpoint_model.create(vals)
@api.multi
def create_orderpoints(self, product_ids):