diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2020-05-07 13:24:23 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2020-05-07 15:55:33 +0000 |
| commit | a9d117178f815455461e9475e324eef2f12cecca (patch) | |
| tree | b78ae57459b0e48fa57be6891e21fdab17b00e87 /addons/hr_expense/models | |
| parent | fb8a69706f38b2c21f7ab284f8ec9b0ace2216b2 (diff) | |
[FIX] hr_expense: analytic tax
- Enable Include in Analytic Cost in purchase tax P
- Create an expense
- Select product, purchase tax P, set analytic account and tags
- Create report, submit to manager, approve, post journal entries
The tax `account.move.line` does not have the analytic account and tags
assigned.
The information is missing at the tax line creation, so apply the same
logic than:
https://github.com/odoo/odoo/blob/784d22bd005db7825375a97caf9661bd5d463efe/addons/account/models/account_invoice.py#L1055-L1057
opw-2250257
closes odoo/odoo#50879
X-original-commit: ec6fe8cdff7a072a6d44e5a2a40ca0da43254f7d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/hr_expense/models')
| -rw-r--r-- | addons/hr_expense/models/hr_expense.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py index 70832b2af28..01ce03fe56b 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -437,6 +437,8 @@ class HrExpense(models.Model): 'expense_id': expense.id, 'partner_id': partner_id, 'currency_id': expense.currency_id.id if different_currency else False, + 'analytic_account_id': expense.analytic_account_id.id if tax['analytic'] else False, + 'analytic_tag_ids': [(6, 0, expense.analytic_tag_ids.ids)] if tax['analytic'] else False, } total_amount -= amount total_amount_currency -= move_line_tax_values['amount_currency'] or amount |
