Skip to content
Snippets Groups Projects
Commit 66ea264f authored by niyasraphy's avatar niyasraphy
Browse files

[FIX] stock_landed_costs: missing required account on invoice line


before this commit, on creating a vendor bill with
landed cost product, is not allowing to save the bill,
it shows the exception that missing required account
on accountable invoice line.

steps to reproduce:

* create a product category with inventory
valuation set as Manual
* create a landed cost product using above category
* enable anglo saxon accounting in accounting settings
* create a vendor bill with this product and click save
* exception is shown: missing required account
on accountable invoice line

after this commit, the exception wont be shown

closes odoo/odoo#117474

Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
parent 6c4f0b08
No related branches found
No related tags found
No related merge requests found
...@@ -78,6 +78,6 @@ class AccountMoveLine(models.Model): ...@@ -78,6 +78,6 @@ class AccountMoveLine(models.Model):
def create(self, vals_list): def create(self, vals_list):
lines = super().create(vals_list) lines = super().create(vals_list)
for line in lines.filtered('is_landed_costs_line'): for line in lines.filtered(lambda x: x.is_landed_costs_line and x.product_id.categ_id.property_valuation == 'real_time'):
line.account_id = line._get_landed_costs_account(line.product_id.product_tmpl_id._get_product_accounts()) line.account_id = line._get_landed_costs_account(line.product_id.product_tmpl_id._get_product_accounts())
return lines return lines
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