Skip to content
Snippets Groups Projects
Commit 193f1d8c authored by David (dafr)'s avatar David (dafr)
Browse files

[FIX] purchase: recompute qty_received_method


qty_received_method is not recomputed if the product type change, and can lead to issues on existing purchases when trying to generate a Vendor Bill.

# HOW TO REPRODUCE:
- Create product P, type: Service, Control Policy: 'On Received Qty'
- Create PO for 1 unit of P (do not confirm)
- Update type of P to Storable
- Confirm PO, Receive Products
=> Qty Received is 0, not able to generate Bill

closes odoo/odoo#119622

Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
parent 1327022f
No related branches found
No related tags found
No related merge requests found
......@@ -923,7 +923,7 @@ class PurchaseOrderLine(models.Model):
else:
line.qty_to_invoice = 0
@api.depends('product_id')
@api.depends('product_id', 'product_id.type')
def _compute_qty_received_method(self):
for line in self:
if line.product_id and line.product_id.type in ['consu', 'service']:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment