diff options
| author | Hendrik <hendrikwidjaja25@gmail.com> | 2021-03-10 17:42:57 +0000 |
|---|---|---|
| committer | hendrik <hendrik.widjaja@mplus.software> | 2021-03-25 22:16:04 +0000 |
| commit | bfbd8485259d6f27241434d33b16daba57be7a50 (patch) | |
| tree | d156deb8e9c4c968c70f7d63e032378c9219e600 | |
| parent | b1ba8b48f69919d18b946e4f602b9a136e835d51 (diff) | |
[FIX] stock_account: Fix shadowed 'product' variable in anglo-saxon lines
closes odoo/odoo#68371
X-original-commit: bdace2f538718a521926f0c5d073c05c40e98fac
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Hendrik <hendrikw25@users.noreply.github.com>
| -rw-r--r-- | addons/stock_account/models/account_move.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/stock_account/models/account_move.py b/addons/stock_account/models/account_move.py index 27828bcae75..611dd471c4d 100644 --- a/addons/stock_account/models/account_move.py +++ b/addons/stock_account/models/account_move.py @@ -186,12 +186,12 @@ class AccountMove(models.Model): continue products = product or move.mapped('invoice_line_ids.product_id') - for product in products: - if product.valuation != 'real_time': + for prod in products: + if prod.valuation != 'real_time': continue # We first get the invoices move lines (taking the invoice and the previous ones into account)... - product_accounts = product.product_tmpl_id._get_product_accounts() + product_accounts = prod.product_tmpl_id._get_product_accounts() if move.is_sale_document(): product_interim_account = product_accounts['stock_output'] else: @@ -200,10 +200,10 @@ class AccountMove(models.Model): if product_interim_account.reconcile: # Search for anglo-saxon lines linked to the product in the journal entry. product_account_moves = move.line_ids.filtered( - lambda line: line.product_id == product and line.account_id == product_interim_account and not line.reconciled) + lambda line: line.product_id == prod and line.account_id == product_interim_account and not line.reconciled) # Search for anglo-saxon lines linked to the product in the stock moves. - product_stock_moves = stock_moves.filtered(lambda stock_move: stock_move.product_id == product) + product_stock_moves = stock_moves.filtered(lambda stock_move: stock_move.product_id == prod) product_account_moves += product_stock_moves.mapped('account_move_ids.line_ids')\ .filtered(lambda line: line.account_id == product_interim_account and not line.reconciled) |
