summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2020-10-21 08:17:42 +0000
committerNicolas Martinelli <nim@odoo.com>2020-10-21 10:18:13 +0000
commit2eecff58239868ef596841534f4b5cffaa1d75c0 (patch)
tree7d77be57ab5f3f406431c550ac6a544faaafb976
parent018b594506bc15ab462911f8bdf64e4d8dcf20a8 (diff)
[FIX] stock_landed_costs: fix account for non-anglosaxon accounting companies
This reverts commit c382e8c81f7c3739bf5875d621623f971aa9ccab. closes odoo/odoo#60428 X-original-commit: 84ec7277193958d914d0c976d85a00d2270a0563 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
-rw-r--r--addons/stock_landed_costs/models/account_move.py2
-rw-r--r--addons/stock_landed_costs/tests/test_stockvaluationlayer.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/addons/stock_landed_costs/models/account_move.py b/addons/stock_landed_costs/models/account_move.py
index 80c7a5eacf1..72c1b6b05e2 100644
--- a/addons/stock_landed_costs/models/account_move.py
+++ b/addons/stock_landed_costs/models/account_move.py
@@ -30,7 +30,7 @@ class AccountMove(models.Model):
'cost_lines': [(0, 0, {
'product_id': l.product_id.id,
'name': l.product_id.name,
- 'account_id': l.product_id.product_tmpl_id.get_product_accounts()['stock_input'].id if self.company_id.anglo_saxon_accounting else l.account_id.id,
+ 'account_id': l.product_id.product_tmpl_id.get_product_accounts()['stock_input'].id,
'price_unit': l.currency_id._convert(l.price_subtotal, l.company_currency_id, l.company_id, l.move_id.date),
'split_method': 'equal',
}) for l in landed_costs_lines],
diff --git a/addons/stock_landed_costs/tests/test_stockvaluationlayer.py b/addons/stock_landed_costs/tests/test_stockvaluationlayer.py
index 818aafd2b9f..c2cb5354282 100644
--- a/addons/stock_landed_costs/tests/test_stockvaluationlayer.py
+++ b/addons/stock_landed_costs/tests/test_stockvaluationlayer.py
@@ -520,9 +520,9 @@ class TestStockValuationLCFIFOVB(TestStockValuationLCCommon):
self.assertEqual(lc.cost_lines.price_unit, 50)
self.assertEqual(lc.cost_lines.product_id, self.productlc1)
- expense_aml = self._get_expense_move_lines()[-1]
- self.assertEqual(expense_aml.debit, 0)
- self.assertEqual(expense_aml.credit, 50)
+ input_aml = self._get_stock_input_move_lines()[-1]
+ self.assertEqual(input_aml.debit, 0)
+ self.assertEqual(input_aml.credit, 50)
valuation_aml = self._get_stock_valuation_move_lines()[-1]
self.assertEqual(valuation_aml.debit, 50)
self.assertEqual(valuation_aml.credit, 0)