[FIX] purchase_stock: old PO not update qty_received after install purchase_stock

Before this commit, after install purchase_stock, old pol records won't
update their qty_received when receive products. This is because their
qty_received_method are not updated during the installation.

Task 2230811
PR #49921
This commit is contained in:
yhu-odoo
2020-05-27 07:41:43 +00:00
parent 647247e3ff
commit eb6ddb6e9f
2 changed files with 7 additions and 0 deletions
@@ -2,6 +2,8 @@
<odoo>
<data noupdate="1">
<function model="purchase.order.line" name="_update_qty_received_method" />
<!--
Stock rules and routes
-->
+5
View File
@@ -510,3 +510,8 @@ class PurchaseOrderLine(models.Model):
incoming_moves |= move
return outgoing_moves, incoming_moves
@api.model
def _update_qty_received_method(self):
"""Update qty_received_method for old PO before install this module."""
self.search([])._compute_qty_received_method()