[FIX] account: analytic account and cash basis

- Activate cash basis
- Set a tax
Tax Due: Based on Payment
Include in Analytic Cost: true
- Create an invoice, add the tax and an analytic account on the invoice
line
- Validate and pay

The analytic account is correctly set on the tax line, but it is not set
on any of the cash basis entries.

Partial backport of 079a13a349.

opw-1971751

closes odoo/odoo#33236

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2019-05-08 12:41:00 +00:00
parent 6ff5498fc0
commit 709e59b4e9
+6
View File
@@ -1751,6 +1751,9 @@ class AccountPartialReconcile(models.Model):
'debit': abs(rounded_amt) if rounded_amt < 0 else 0.0,
'credit': rounded_amt if rounded_amt > 0 else 0.0,
'account_id': line.account_id.id,
# DO NOT FORWARD-PORT!!! ONLY FOR v11
'analytic_account_id': line.analytic_account_id.id,
'analytic_tag_ids': line.analytic_tag_ids.ids,
'tax_exigible': True,
'amount_currency': line.amount_currency and line.currency_id.round(-line.amount_currency * amount / line.balance) or 0.0,
'currency_id': line.currency_id.id,
@@ -1763,6 +1766,9 @@ class AccountPartialReconcile(models.Model):
'debit': rounded_amt if rounded_amt > 0 else 0.0,
'credit': abs(rounded_amt) if rounded_amt < 0 else 0.0,
'account_id': line.tax_line_id.cash_basis_account.id,
# DO NOT FORWARD-PORT!!! ONLY FOR v11
'analytic_account_id': line.analytic_account_id.id,
'analytic_tag_ids': line.analytic_tag_ids.ids,
'tax_line_id': line.tax_line_id.id,
'tax_exigible': True,
'amount_currency': line.amount_currency and line.currency_id.round(line.amount_currency * amount / line.balance) or 0.0,