[FIX] stock_account: take default credit/debit accounts from journal
Create a product category with automated inventory valuation but no accounts defined for expense/income Create a stored product with such category but again without expense/income accounts. Create an invoice with such product and a jounral on which default credit/debit accounts are defined. Save and Post the invoice. Journal entries related to the inventory move (COGS) are not created because the accounts are missing, but the system should take the default defined on the jounral instead of skipping the operation opw-2339168 closes odoo/odoo#58662 X-original-commit: 3019828c1c101cdbf2f7d61a751ed6d73e40005f Signed-off-by: Laurent Smet <smetl@users.noreply.github.com> Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
This commit is contained in:
@@ -122,7 +122,7 @@ class AccountMove(models.Model):
|
||||
.get_product_accounts(fiscal_pos=move.fiscal_position_id)
|
||||
)
|
||||
debit_interim_account = accounts['stock_output']
|
||||
credit_expense_account = accounts['expense']
|
||||
credit_expense_account = accounts['expense'] or self.journal_id.default_account_id
|
||||
if not debit_interim_account or not credit_expense_account:
|
||||
continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user