jem-odoo f871908e86 [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
2019-08-21 11:22:59 +00:00
2015-09-08 15:45:09 +02:00
2018-10-09 13:44:38 +00:00
…
2015-09-08 17:58:38 +02:00

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

Then follow the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%