Files
odoo_source/addons/hr_expense/security
sofiagvaladze d70000bf21 [IMP] hr_expense/sale_expense: allow splitting an expense
Purpose: Sometimes, taxes are distinct on parts of the expense
(for example alcohol and food).
Therefore the expense should be split in two.

In order to split the expense, we added an wizard.
When creating a new expense from the split, we also
copy the attachments.

'hr.expense.split' has to have the similar logic and dependencies between
the fields as 'hr.expense' does. For example, in case we change the
product_id to the product that has cost defined on it, it should have
the same behavior as expense has. In particular, the 'total_price'
will be set and the user should not be able to modify the amount.

Similarly, if we change the product_id to the one that has no tax defined
on it, then split tax_ids should be cleared out and be set to readonly.
Similar logic goes to sale_order_id (Customer to Reinvoice'),
we should not be able to set it, in case the product can not be re-invoiced.

All of the above constraints leads to the amount of similar code to to the 'hr.expense.split' side.
But it could not have been avoided, if we want the smooth flow.

task - 2831024

closes odoo/odoo#90770

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-02 08:02:04 +02:00
..