Commit Graph
129311 Commits
Author SHA1 Message Date
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
jem-odoo 1f77ff3cd6 [FIX] sale: name get uniformize API
This commit makes the override of the `name_search` more
consistent the basic implementation of the ORM (using lazy
name_get and supports the `name_get_uid` parameters)

Task-1911581
2019-08-21 11:22:58 +00:00
jem-odoo 7c5ce75aeb [FIX] analytic: missing depends
This commit adds a missing `depends` on the `debit` and `credit` computed
field on analytic account model. Indeed, without that, the recompute is not
done when accessing thoses fields after adding lines in the same
transaction (like in tests).

Task-1911581
2019-08-21 11:22:58 +00:00
jem-odoo 00ac6c60f6 [FIX] project: portal user can not read AA
For historical reason (problably the inheritS between project and AA, removed in 12.0), portal
user can read Analytic Account. This makes no sense, as it is a purely internal resource
for companies. Removing the access rights don't change anything for portal user and make
those data secure.

Task-1911581
2019-08-21 11:22:58 +00:00
jem-odoo ba92261148 [FIX] sale_timesheet_purchase: correct action xmlid
Since the refactoring of the accounting model, some action changed
but their xmlid were not adapted everywhere.

Task-1843241
2019-08-21 11:22:58 +00:00
Denis Ledoux 4737e01691 [FIX] sale: fix _compute_quotations_to_invoice following odoo/odoo@9920f20e4c
closes odoo/odoo#35895

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-08-21 09:59:06 +00:00
Alexandre Kühn 8de430d251 [FIX] base: update minifier regexp to rjsmin (1.1.0)
This version adds full support of string templates.
Before this version, rjsmin may produce wrong code with string
templates. For example:

```js
const url = `https://odoo.com`;
console.log(url);
```

was minified to:

```js
const url=`https:console.log(url);
```

Because `//` was wrongly handled as a comment inside the string
template.

closes odoo/odoo#35867

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-08-21 10:22:05 +00:00
jbm-odoo c230cfa0fe [ADD] stock_sms: Integration with stock pickings
The user can already send a confirmation email when the
Stock Picking is done. It'd be great to communicate the
same information by SMS.

In addition, the current mailing tool requires a manual
action. The idea is to automate the process via a
Setting instead.

id=1972567

closes odoo/odoo#35662

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-21 10:04:54 +00:00
Pierre Masereel 93be40e6eb [FIX] point_of_sale: download invoice from POS
When you are creating an invoice from the POS, the report route is
called to download the invoice, since changes made in rev: 118190f3b3

The values for ids where empty, so we give them now the correct id list.

closes odoo/odoo#35889

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-08-21 09:59:57 +00:00
Arnaud Baes 2408befc8d [FIX] sale_stock: wrong route computed on so lines
_compute_is_mto was based on the sequence of the routes,
as most of those sequences were hardcoded, some had the same values,
resulting in wrong calculations. Furthermore, the method was setting the so lines
as mto if the sequence of the MTO route had the priority on the other ones, even if
the mto route wasn't set on the product.

This simply ensure to check the mto route is set on the product,
sequences should be set manually to prevent any sequence conflict.

TaskID: 2053703

closes odoo/odoo#35740

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-08-21 09:51:17 +00:00
Christophe Simonis c1281f5795 [REM] remove empty module test_pylint
closes odoo/odoo#35892

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-08-21 09:10:02 +00:00
Florent de Labarre 2160db3376 [REM] stock: remove unused code
closes odoo/odoo#35877

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-08-20 19:54:13 +00:00
Katherine Zaoral 1fafb7e524 [FIX] account: journal_type readonly on bank statement
As it is is trying to write the journal type field everytime we try to
create a account.bank.statement record, even when the value we try to
write is the same already, it is assigned again in the journal.

With this new change we are not trying to overwrite the journal's type
field anymore. Only using it.

Closes #35578

closes odoo/odoo#35714

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-08-14 09:33:29 +00:00
Sébastien Theys 064ebe3b1a [IMP] fields, test_new_api: add ondelete support for m2m
Each model of the relation can define `ondelete` for its `column2` foreign key.

This way the behavior is similar to m2o where the target of the `ondelete` is
the `comodel` foreign key.

Some models were already defining `ondelete` 'restrict' on m2m fields and after
review it appears the behavior introduced in this commit is the expected
behavior for them.

The 'restrict' from product.product has to be removed however because the rest
of the code needs adaptation now that it is properly restricted. These changes
will be done on a separate PR.

closes odoo/odoo#35654

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-08-20 14:09:01 +00:00
Christophe Simonis 72d9167c3a [FIX] mail: add missing import
Oversight of previous forward-port.
2019-08-21 10:58:04 +02:00
Christophe Simonis 0c98abeed0 [FIX] base: remove extra column in csv entry
Oversight of previous forward-port.
2019-08-21 10:33:51 +02:00
Christophe Simonis 3faea8fbf8 [MERGE] forward port branch saas-12.4 up to f26de445e5 2019-08-21 10:10:11 +02:00
Damien Bouvy cc2d78beea [FIX] sale_product_configurator: adapt tests to 84c8f66
closes odoo/odoo#35805

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-08-20 15:55:08 +00:00
Damien Bouvy 6cc526884a [IMP] account: UX improvements for credit note
- no default reason (otherwise the invoice ref is repeated twice)
- rewording of refund types and helper texts
- avoid 'Reversal of: INV/2019/001, False' as reference -_-
2019-08-20 14:02:30 +00:00
Damien Bouvy 976464f6a8 [IMP] payment(_*): UI fixes
- no help msg by default
- kanban alignment thingy
2019-08-20 14:02:30 +00:00
Damien Bouvy ef59eabd47 [IMP] sale, sale_(various): UX improvements in SO form view 2019-08-20 14:02:30 +00:00
Damien Bouvy b61fd3af7f [IMP] purchase_requisition: UX improvements in product form view 2019-08-20 14:02:30 +00:00
Damien Bouvy e3f029c33f [IMP] product: UX improvements in form view 2019-08-20 14:02:30 +00:00
Victor Feyens 3c6437710a [IMP] *_product_matrix: UI 2019-08-20 14:02:29 +00:00
Victor Feyens 591cb8bd8f [FIX] product_matrix : multiple extra prices 2019-08-20 14:02:29 +00:00
Pierre Masereel a4a52da121 [FIX] delivery: wrong domain on carrier list
When you try to find a carrier in the wizard that let you add one on
your sale order, you don't see all of them because of a domain that only
show the ones that havethe same company id of the sale order, but it
should also show you the ones that don't have company_id set.

So we removed the domain in the view, and the invisible company_id as it
is not used anymore. Because the domain we need is already applied in
'available_carrier_ids'.

This behavior has been introduced in rev: c058562d73

closes odoo/odoo#35856

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-08-20 20:06:51 +00:00
Jeremy Kersten 0d1fdb0b95 [IMP] website_blog: refactoring python code for new layout
task-1973902

+ use of img locally
+ last PO review:
+ show latest in the list
+ remove underline
+ force same height if blog or not
+ ...

closes odoo/odoo#34609

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-08-20 15:47:39 +00:00
sri-odoo bb0cdec459 [REF] website_blog: new blog layout
task-1973902
2019-08-20 15:33:36 +00:00
sri-odoo 21d818cf53 [IMP] website: allow subtitles on empty oe_structure helpers. 2019-08-20 15:24:33 +00:00
Christophe Simonis f26de445e5 [MERGE] forward port branch saas-12.3 up to 6f55fd65da 2019-08-20 12:17:04 +02:00
Christophe Simonis 6f55fd65da [FIX] mail: correct test adaptation to async version
Oversight of previous forward-port.
2019-08-20 10:42:44 +02:00
Alex Tuyls 60c438dfb7 [FIX] sale_coupon: performance issue with promotion programs
In case of large cart and promotion program with a discount reward
of percentage type, we are rewriting the reward order lines
multiple times while we can do all in one update.

opw-2038791

closes odoo/enterprise#5086

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>

X-port/Cherry-pick of odoo/enterprise@243e66663a
2019-08-19 19:28:48 +02:00
Christophe Simonis 20e69b3299 [FIX] stock: correctly forward-port 5b83f7214f
Oversight of previous forward-port.
2019-08-19 19:27:53 +02:00
Christophe Simonis 168e54d488 [MERGE] forward port branch 12.0 up to 32039b2ab4 2019-08-19 18:57:08 +02:00
Christophe Simonis 32039b2ab4 [FIX] test_access_rights: add _description to new test model
Oversight of previous forward-port.
2019-08-19 17:08:08 +02:00
Christophe Simonis aac8e0c960 [MERGE] forward port branch saas-11.3 up to 121034f79a 2019-08-19 16:38:30 +02:00
Hiral Bhavsar bc6accc568 [IMP] mass_mailing_sale: remove complex computation of invoices linked to mailing UTM
UTM fields are available in the invoice without sale_crm. That's why just apply
search_read on account.move instead of doing

--> search on sale order
--> map on invoice_ids which is computed
--> search_read on account.invoice.report

to get sale_invoiced_amount.

Currently, stat button 'Invoiced' is not redirecting to invoices tree
view because of wrong action and domain parameters. Thus we, set proper
action and pass valid parameter to get that invoices tree view.

Task 1919391

closes odoo/odoo#35296

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-19 13:23:50 +00:00
Christophe Simonis 121034f79a [MERGE] forward port branch 11.0 up to 1e4de19cd4 2019-08-19 14:43:31 +02:00
Yannick Tivisse be983c7002 [FIX] hr: Expose employee timezone on public profile
Purpose
=======

It happens a lot that we access to the employee timezone to compute
presence states, leaves, ...

Instead of sudoing all those accesses, it looks better to expose this
data in the public profile.

closes odoo/odoo#35811

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-19 12:05:19 +00:00
Christophe Simonis 1e4de19cd4 [MERGE] forward port branch saas-15 up to c43de33643 2019-08-19 13:54:40 +02:00
Christophe Simonis c43de33643 [MERGE] forward port branch saas-14 up to fa26279014 2019-08-19 12:51:26 +02:00
Christophe Simonis fa26279014 [MERGE] forward port branch 10.0 up to 59c59cd8a0 2019-08-19 12:47:56 +02:00
Julien CastiauxandHugo Adan 855447fc77 [FIX] ir_rule: invalid user context propagation
Create two models, `object` and `category`. The object have a Many2One
to the category. Override the `search` on the category so it returns a
subset of the records if a context key is present. Create an IR Rule on
object with the following pseudo-domain: `categ_id in category.search([])`.
Search on object with the context key present. Even if the context
should only be applied to category, it is applied to object too thus
there are some object missing.

When evaluating the domain of IR Rules, the current user is propagated
with the current environment context. API calls triggered by the domain
are called with the given context, possibly populating the cache with
different records than it would normally does without the context (i.e.
at `addons/point_of_sale/models/account_journal.py#L19-L23`). Following
requests do use that invalid cache thus return invalid results.

Forcing an empty context on the user used during the evaluation of the
context ensures the IR Rules are working as they should and is
future-proof (cf `load_company` v13 context key)

opw-2041667

closes #35123
closes #35125

closes odoo/odoo#35667

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>


Co-authored-by: Hugo Adan <hugo@vauxoo.com>
2019-08-19 09:04:09 +00:00
Christophe Simonis b6deb72747 [MERGE] forward port branch 10.0 up to 2fc46a064d 2019-08-19 10:24:42 +02:00
Fanny He f9f288cd47 [FIX] sale_timesheet: correct the context when viewing a contact's SO's tasks
When accessing a SO's tasks from Contacts (the partner_id's page), and
calling action_view_task, the active_id first corresponds to the contact's id.
Therefore, if a project.project exists with the contact's id, one can access
the SO's tasks, but otherwise, we get the error

Record does not exist or has been deleted.

(Records: [partner_id], User: ...)

Thus, if there is one corresponding project, we first update the context:
active_ids is set to project_id,
allowing access to the SO's corresponding project's tasks.
Note that the same thing is done lower:

eval_context.update({'active_id': task_projects.id})

which is too late to avoid trying to access the wrong record.

In the case where there are more than 1 corresponding projects (or if
there are no corresponding tasks), we don't have the issue.

OPW 2052559

closes odoo/odoo#35792

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-08-19 06:20:00 +00:00
Holger Brunn 024d7ebaa0 [FIX] tests: wait for chrome's cookie to be set
In some cases, the first request of a test is made before the
proper setting of the cookie. In that case, Odoo picks a new session,
leaving the request unauthenticated.

closes odoo/odoo#35780

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-08-19 07:29:44 +00:00
Odoo Online 19727047ce [I18N] Update translation terms from Transifex 2019-08-18 06:20:13 +02:00
Odoo Translation Bot 0458337bc3 [I18N] Update translation terms from Transifex 2019-08-18 03:08:13 +02:00
Nicolas Martinelli 57fef7c11c [FIX] survey: certificate of failure
- Take a quizz survey, and fail it
- Go to Answers
- Print the Certification

Even if the quizz was failed, the certification can be printed.

There is no option to prevent printing a PDF, therefore we need to print
a different template.

opw-2049481

closes odoo/odoo#35769

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-16 14:04:03 +00:00
Swapnesh Shah d5072c2ec6 [FIX] calendar: Add force_save to send values to server
- Create Event (Where All Day is Set to False)
- Edit Event > Check 'All Day', make it 'Recurrent'

An error occurs because a mandatory field is not set (`stop_date`).

It is possible to work around the issue by doing:
- Check 'All Day'
- Save
- Make it 'Recurrent'

However, the result should not depend on the order we perform the
action. To solve this we send data to server with `force_save`.

Fixes #27269
Closes #33068

closes odoo/odoo#35758

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-16 10:35:18 +00:00