fix issue with loading products
This commit is contained in:
parent
de9832fd5c
commit
984ede2646
|
|
@ -49,7 +49,7 @@ class PurcahseRefues(models.TransientModel):
|
|||
}
|
||||
|
||||
move_vals = []
|
||||
for line in self.request_line_ids.filtered(lambda line: line.product_id.type == 'product'):
|
||||
for line in self.request_line_ids.filtered(lambda line: line.product_id.type in ['product', 'consu']):
|
||||
if line.qty < line.available_qty:
|
||||
move_vals.append((0, 0, {
|
||||
"product_id": line.product_id.id,
|
||||
|
|
@ -73,7 +73,7 @@ class PurcahseRefues(models.TransientModel):
|
|||
init_active = self.env['ir.module.module'].search(
|
||||
[('name', '=', 'initial_engagement_budget'), ('state', '=', 'installed')], limit=1)
|
||||
init_budget = True if init_active else False
|
||||
for line in self.request_line_ids.filtered(lambda line: line.product_id.type != 'product'):
|
||||
for line in self.request_line_ids.filtered(lambda line: line.product_id.type not in ['product', 'consu']):
|
||||
line.qty_purchased = line.qty
|
||||
self.request_id.write({'state': 'wait_for_send' if init_budget else 'waiting'})
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ class PurcahseRefues(models.TransientModel):
|
|||
}
|
||||
move_vals = []
|
||||
|
||||
for line in self.request_line_ids.filtered(lambda line: line.product_id.type == 'product'):
|
||||
for line in self.request_line_ids.filtered(lambda line: line.product_id.type in ['product', 'consu']):
|
||||
move_vals.append((0, 0, {
|
||||
"product_id": line.product_id.id,
|
||||
"name": line.product_id.name,
|
||||
|
|
|
|||
Loading…
Reference in New Issue