Skip to content
Snippets Groups Projects
Commit 1f888943 authored by Ricardo Gomes Rodrigues (rigr)'s avatar Ricardo Gomes Rodrigues (rigr)
Browse files

[FIX] stock_account: prevent stock account update on product change when using...

[FIX] stock_account: prevent stock account update on product change when using manual stock valuation

If the category of a product is using manual stock valuation, when changing the product on an invoice line,
the account should not be set to the `property_stock_account_input_categ_id`. It should be the case only if
we use automatic/real-time stock valuation.

opw-3226536

closes odoo/odoo#119535

Signed-off-by: default avatarBrice Bartoletti (bib) <bib@odoo.com>
parent ab03b50c
Branches
Tags
No related merge requests found
......@@ -232,7 +232,7 @@ class AccountMoveLine(models.Model):
return super(AccountMoveLine, self)._get_computed_account()
def _can_use_stock_accounts(self):
return self.product_id.type == 'product'
return self.product_id.type == 'product' and self.product_id.categ_id.property_valuation == 'real_time'
def _stock_account_get_anglo_saxon_price_unit(self):
self.ensure_one()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment