summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorjem-odoo <jem@openerp.com>2019-06-13 12:46:47 +0000
committerjem-odoo <jem@openerp.com>2019-08-21 11:22:59 +0000
commitf871908e86dc868a7d2fb1d2dff6cae0fb79977c (patch)
tree98a27b3e78012fa9244eac1d6f5d12cb39f863a9 /addons/web/static/src/js
parent1f77ff3cd6ef27c0945aaf6d6f677e44e342ffd8 (diff)
[IMP] sale_expense: cost tracking and reinvoice flow for expense
Since 12.0, we wanted the employee to select directly the sales order on which the expense should be reinvoiced. The goal was to avoid employee to select the analytic account (too technical and usually unknown for employee). Problem is that we had to give read access to SO to simple employee, breaking the access rules "See your own document". As we want to allow all internal employees to determine if the expense should be reinvoice and on which sales order it should be, we need to allow them to select that sales order. This commit allows user to search on SO (simply get their name_get), no information more to avoid breaking "See your own document" for salesman. Falty ir.rule and access rights are now removed. We now clearly split the cost tracking and reinvoicing flow: - the analytic account field (visible only with group 'analytic' as considered as advance feature) allows user to track their expenses in some accounts. - the sales order is displayed for users or approvers to reinvoice the expense. As this operation implies the tracking, if the AA is not give, the SO will create its own AA in which the expense will be tracked. This SO field is only relevant when the product has a reinvoice policy, so we hide it if there is no reinvoice policy defined. Reinvoicing an expense has now a different flow from reinvoicing a "Vendor Bill", which still do magic to determine the SO from the AA set on its lines. Technical: to allow user to select SO from a m2o dropdown, the `name_search` is done in `sudo` for internal user. This is a borderline 'feature' of the system. A few thing show that the system does completely supports this ("Search More" gives access error, ...). We still keep this solution, as we don't want a sub group giving access to SO to all employee (aka an option allowing people to break the sales rights). Task-1843241
Diffstat (limited to 'addons/web/static/src/js')
0 files changed, 0 insertions, 0 deletions