Commit Graph
127612 Commits
Author SHA1 Message Date
Christophe Simonis e14fd457b9 [MERGE] forward port branch saas-14 up to 348f3d8bbc 2019-06-12 14:35:44 +02:00
Christophe Simonis 348f3d8bbc [MERGE] forward port branch 10.0 up to 271f1ec688 2019-06-12 14:35:04 +02:00
Nicolas Martinelli b5dddce5b9 [FIX] stock: incorrect field
The field is now `quantity`. This wasn't spotted before because the
method is not used anywhere.

opw-2008491

closes odoo/odoo#34067

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-12 11:50:44 +00:00
Pierre Rousseau 4c7f236fb5 [FIX] snailmail: re-render report when using snailmail
If the option 'Reload from attachment' is checked for a report, it will be generated from the existing attachments.
However, for snailmail, we have to force the re-rendering to apply specific css rules to match the layout of a A4 letter.

Task-ID: 2008896

closes odoo/odoo#34053

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2019-06-12 11:31:26 +00:00
Sébastien Theys bb9c3910bb [FIX] website_sale: fix modal price when Select Quantity is disabled
To reproduce:

- Go on the website page of a product with optional products.
- Disable the Select Quantity customize show.
- Click add to cart.

This will open the optional product modal, where the quantity will be displayed.

However changing that quantity will have no effect, especially the price will
not update accordingly.

The real issue is that the quantity should not be displayed there if Select
Quantity is disabled, but this has never worked before, so this is outside the
scope of this fix.

Anyway, since the quantity is present there, we would at least expect it to
correctly recompute the price, which worked fine when the modal was introduced,
but has been broken since 51e51055bf

opw-2005317

closes odoo/odoo#33992

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-13 11:35:58 +00:00
Nicolas Martinelli 4b8f72eb23 [FIX] hr_payroll_account: analytic account
- Set an analytic account on an employee contract
- Set credit and debit accounts on the salary rules
- Create a payslip, confirm

The journal items created do not use the analytic account set on the
contract.

If no analytic account is set on the salary rule, we fall back on the
contract account.

opw-2006090

closes odoo/odoo#34095

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-13 11:14:39 +00:00
Xavier-Do 271f1ec688 [FIX] test_new_api: move demo_data.xml in demo category
Installing test_new_api without demo will fail since demo_user
does not exists. This is a problem if we want to test migration
with all modules installed. This simple fix solve the problem.

closes odoo/odoo#34065

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-06-12 10:51:32 +00:00
Nans Lefebvre f1706c848d [FIX] stock: put stored related field product_code in compute_sudo
Have a multi-company setup, with shared products.
Write the default code of a product; an access error is raised on inventory.line

On inventory.line, the field product_code is defined as related to
'product_id.default_code', and stored.
So when writing on the default_code of a product, we get the inventory lines of
other companies. For obvious reasons their access is protected by the record
rule "Inventory Line multi-company", therefore the access error is raised.

To avoid that situation stored related fields should be in compute_sudo.

Note that similarly this is necessary for product_name.
There is one more subtlety: directly writing on the product.product does trigger
the access error, but writing it on the product.template does not.

opw 2007167

closes odoo/odoo#34019

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-06-12 07:58:15 +00:00
Jeremy Kersten e08762a99b [FIX] base: _get_eval_domain with localcontext
Before this commit, it was impossible to eval the domain if context_today was
used in domain.

closes odoo/odoo#34031

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-11 13:19:20 +00:00
Aurélien Warnon d763186497 [FIX] website_slides[_forum]: correctly redirect to review on linked forum
When the channel has a linked forum, the "Review" link on the forum should redirect the user
to the "Review" tab on the course page.

Task #2003222

closes odoo/odoo#33786

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-06-13 06:39:32 +00:00
Aurélien Warnon 489c8623e2 [IMP] website_[profile,slides]: improve karma rank layout
This commit improves the karma rank layout displayed on the courses home page
and on the user profile.

Task #2003222
2019-06-13 06:39:32 +00:00
Aurélien Warnonand@stefanorigano <sri@odoo.com> 3a487bdde3 [IMP] website_slides: add top 3 users avatars in courses home footer
This commit improves the footer image of the slides home page by adding
the top 3 users avatars (ordered by karm desc) in the image.
We only fetch users that have an image set as avatar.

Task #2003222

Co-authored-by: @stefanorigano <sri@odoo.com>
2019-06-13 06:39:32 +00:00
Toufik Ben Jaa ca8a510b56 [FIX] hr: field parent_id shadowing same field on res.partner
- On the HR module, the field `parent_id` is added on `res.users`.
The issue here, is that `res.users` inherits the fields from
`res.partner` where `parent_id` is already defined.

This causes issues when trying to read the parent `res.partner`.

Issue found by @rrahir

closes odoo/odoo#34059

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-06-12 10:42:07 +00:00
Christophe Simonis 2bb593cc9f [FIX] mass_mailing: do not define xml attribute twice
Oversight of previous forward-port.
2019-06-12 11:42:40 +02:00
Christophe Simonis 75efeb2666 [MERGE] forward port branch 12.0 up to 41dfef8e2a 2019-06-12 11:21:33 +02:00
Pierre Rousseau 41dfef8e2a [FIX] snailmail: fix external tests
From now, the color option 2 ('Mixed color & B/W') is not available anymore. So set the option to 1 ('Color').

Task-ID: 2008913

closes odoo/odoo#34052

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2019-06-12 07:06:43 +00:00
Christophe Simonis 63e19c118b [FIX] website_sale_delivery: only load tour in frontend
This tour is useless in backend.
This patch will be required in saas~12.2 as `web_editor.base` (used in
the tour) is only available in frontend.

closes odoo/odoo#34041

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-11 15:57:13 +00:00
Christophe Simonis 5983a05d57 [IMP] base: return groups ordered in ACL error message
This allow error to have a predictable message. Forbid some tests to
fail randomly.
2019-06-11 16:37:14 +02:00
Christophe Simonis 10fac59172 [FIX] test_access_rights: adapt tests to new error message format
Oversight of previous forward-port.
2019-06-11 16:34:29 +02:00
Christophe Simonis 8853e6b594 [MERGE] forward port branch 12.0 up to 7ef4ba03c4 2019-06-11 15:20:13 +02:00
Nicolas Martinelli ca57218b61 [FIX] mass_mailing: campaign subject
- Create a mailing campaign
- Create a mailing 1, set the subject to "Test 1"
- Create a mailing 2, set the subject to "Test 2"

The subject of mailing 1 is set to "Test 2".

When checking the code, this behavior seems the one expected. The
`_rec_name` of a mass mailing is the `subject_id`:

https://github.com/odoo/odoo/blob/7ef4ba03c4f8dce42f5a56b64d2374373d13aa8d/addons/mass_mailing/models/mass_mailing.py#L437

Moreover, there is an onchange to set the subject in line with the
subject of the campaign:

https://github.com/odoo/odoo/blob/7ef4ba03c4f8dce42f5a56b64d2374373d13aa8d/addons/mass_mailing/models/mass_mailing.py#L608

However this behavior is not present up to v11, and only appears in v12.
Surprisingly, this is due to an unrelated improvement which adds the
field in the view (in debug mode): 5b0bcaef3e.

Up to v11, the onchange exists, but since the fields are not in the
view, it has no effect. However, in v12 the fields are in the view so
the onchange has an effect.

Since this was the behavior up to v11, and that the behavior is fixed
in f50fbc6d16, we keep it consistent in v12 as
well.

opw-2007764

closes odoo/odoo#34028

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-11 12:25:49 +00:00
Christophe Simonis bf139f0662 [MERGE] forward port branch saas-12.1 up to 05ed9ebbe5 2019-06-11 14:25:11 +02:00
Christophe Simonis 6dd58871e1 Revert "[FIX] sale: recompute delivered qty"
This commit shouldn't have been land in saas~11.3
See https://git.io/fjg2o

This reverts commit a25f6e1b96.
2019-06-11 13:43:32 +02:00
sri-odoo 862f16ee5f [FIX] website_slides: layout, add missing #wrap id
The '#wrap' id is needed by website themes to correctly
handle layout options.

closes odoo/odoo#34024

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-11 10:04:36 +00:00
Christophe Simonis 7bd3f9379d [MERGE] forward port branch 11.0 up to a25f6e1b96 2019-06-11 10:51:40 +02:00
Nans Lefebvre 7ef4ba03c4 [FIX] ir_translation: do not raise access errors on list view
Have a translation linked to a record unreadable because of a record rule
(e.g. a product that is not shared between companies).
Display the translations list view; if one such translation is in the view,
it will raise an access error.
When computing the source value, _compute_source will fail to read the record,
and raise an access error.
This will make it impossible to access untranslated terms.
Instead we guard this error.
Since it is displayed in the view, we display an informative message.

Note that since we make this error go away, we also fix the check method.
Only the superuser bypasses the record rules; so if we made the check on write
with _is_admin, it means than a user in group_erp_manager cannot read a record
but can edit its translations.

opw 2000817

closes odoo/odoo#33989

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-06-11 06:50:01 +00:00
Nicolas Martinelli a25f6e1b96 [FIX] sale: recompute delivered qty
- Create a product A of type "Service", Invoice based on "Milestones",
Service Tracking "Create a task in a new project".
- Create a new SO with A, confirm.
- Go the to task associated to the SO, go to "Timesheets" tab, add an
entry
- In the SO, edit the delivered quantity
- Create invoice, validate

Back to the SO, delivered quantity is reset to 0.

We make sure to filter out SO lines which have a delivered quantity set
manually.

Introduced by d6ad22227c.

opw-1982020

closes odoo/odoo#33991

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-07 14:20:35 +00:00
Odoo Translation Bot 34ae29e68b [I18N] Update translation terms from Transifex 2019-06-09 03:07:58 +02:00
Lucas Lefèvre 92d0419467 [FIX] hr_holidays: Display approve button when needed
This commit reverts commit 492764c

*Note for forward port*
This commit will conflict with 76ee0af. Keep this version.

TL;DR: the fix had unintended effects and the original problem has been
fixed by b5c2004 in the mean time.

Why the original commit?
------------------------
To know if the current user has the rights to approve/delete a leave,
two boolean fields are computed (respectively `can_approve`
and `can_reset`). Associated buttons are shown in the form view according to
the field values.
In the compute methods, the `check_approval_update(state)` method is called.
This method checks various conditions, including `ir.rules` by calling the ORM
method `self.check_access_rule('write')`. If one condition or one `ir.rule`
is not met, an Error is raised.

If the method raises, the user does not have the rights.
The exception is catched and the field `can_approve|reset` is set to False.

However, an unexpected behaviour happens when fields are re-computed
in the context of an onchange. In an onchange, `self.ids` is an empty list.
When checking ir.rules, the `_filter_access_rules()` method is used
to retrieve valid records in self by checking every record against ir.rules.
If some records are not in the valid set, they are considered invalid and an
exception is raised.
But because self.ids is empty, no record is actually checked and therefore
no record is valid.
=> in an onchange it always raises an AccessError and the users is considered
as not having the rights to approve nor refuse a leave as soon as an
onchange has been triggered. Thus associated buttons does not appear.

The original commit fixed the problem by preventing checking the rules
when in an onchange.

In the mean time, the root cause of the problem has been fixed by b5c2004.

Why revert?
-----------
While commit 492764c allowed HR users and Team leaders to approve
after an onchange, it had the unintended effect to
show the "Approve" and "Refuse" buttons to other users.
In summary:

- With commit 492764c: buttons are shown more than necessary
(which is confusing to users who don't actually the rights
to approve)

- Without: Thanks to b5c2004, the original problem no longer exists.
Users with access rights always see buttons. Users without never see
buttons.

closes odoo/odoo#33894

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-06-07 13:10:05 +00:00
Christophe Simonis a2582c4252 [MERGE] forward port branch 11.0 up to bdc62d8031 2019-06-07 13:00:07 +02:00
Christophe Simonis bdc62d8031 [FIX] test_lint: move custom pylint checkers to new module
Oversight of previous forward-port.
2019-06-07 12:08:29 +02:00
Christophe Simonis 9bf4766f3d [MERGE] forward port branch saas-15 up to 6c6e652673 2019-06-07 11:38:48 +02:00
Christophe Simonis 6c6e652673 [MERGE] forward port branch saas-14 up to 757846c591 2019-06-07 11:09:29 +02:00
Christophe Simonis 757846c591 [MERGE] forward port branch 10.0 up to 7746621b92 2019-06-07 11:08:13 +02:00
Nicolas Martinelliandjev-odoo b5a04fd29f [IMP] mail, website_mail, base: extra info on error messages
Display extra information on error messages:
- Access error based on ACLs: user, fields (if applies)
- Access error based on record rules: user, ids
- Missing error: model, operation, user, ids

closes odoo/odoo#33942

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


Co-authored-by: jev-odoo <jev@odoo.com>
2019-06-07 06:38:06 +00:00
Christophe Simonis b4337f57d7 [MERGE] forward port branch saas-15 up to ec8cfd5624 2019-06-18 10:59:18 +02:00
Odoo Translation Bot ca8b354cc1 [I18N] Update translation terms from Transifex 2019-06-16 03:07:16 +02:00
Julien Castiaux 45bd7a58d5 [FIX] website_sale_comparison: concurrent add/delete
1) Add a 1st product to compare from the ecommerce /shop page.
2) Open the compare list pop up at the bottom.
3) Add a 2nd product to compare from the /shop page.
4) Remove the 1st product from the compare list before the rpc of the
2nd product is done.
5) Javascript error `self.product_data[res] is undefined`

The function `add_new_products` and `rm_from_comparelist` are
concurrent, they both modify the internal `comparelist_product_ids`
product list. The first one perform an RPC and delay the update once the
request is done, the second does the update immediately.

The solution has been to use a mutex to exclude the two functions.

opw-1974108

closes odoo/odoo#33302

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-14 09:02:09 +00:00
Lucas Perais (lpe) 187b77d7b9 [FIX] product: report pricelist empty data
Try to get the report_pricelist with empty data
(Studio Report editor can)

Before this commit, it crashes because we tried to access dict keys directly
in an empty dict

After this commit, it doesn't crash

OPW 2009862

closes odoo/odoo#34118

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-06-14 08:05:33 +00:00
ThanhDodeurOdoo 66e2aeb660 [FIX] tools: image.crop_image default type fix
Backport of fa39019ee1.
If crop_image is called without a default format, it would try the default,
'PNG', to save the result and crash at save when processing non-PNG images.
For example, if a jpeg image was in CMYK colors.

Here it will still crash non-gracefully when failing to save, but the default
should almost always work; if it doesn't it means we failed to detect the format
of the stream, so it is unlikely that we could save the image anyway.

opw 2009029

closes odoo/odoo#34088

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-06-13 16:05:34 +00:00
Nicolas Martinelliandjev-odoo fa492d87f4 [IMP] mail, website_mail, base: extra info on error messages
Display extra information on error messages:
- Access error based on ACLs: user, fields (if applies)
- Access error based on record rules: user, ids
- Missing error: model, operation, user, ids

closes odoo/odoo#33945

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


Co-authored-by: jev-odoo <jev@odoo.com>
2019-06-07 06:37:25 +00:00
Lucas Lefèvre 6b93738299 [FIX] test_assetsbundle: Properly unpatch ir.attachment
`_patch_method` and `_revert_method` do not work properly.
This commit fixes a test which patches `create` and `unlink`
of `ir.attachment`.
The methods are not correctly unpatched.

One consequence:
if a module is installed after this test is executed and
the new module overrides `create` and `unlink`, the overritten
methods are never called.

closes odoo/odoo#33952

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-06-06 14:23:28 +00:00
Odoo Translation Bot bafe82309a [I18N] Update translation terms from Transifex 2019-06-09 06:06:20 +02:00
Lucas Lefèvre 12ace54a9f [FIX] hr_holidays: Fix out of office message default value
If a user has an ooom in his Preferences, it should be
used as the default value for a leave ooom.

closes odoo/odoo#33890

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-06-07 12:51:02 +00:00
Lucas Lefèvre 8dff37f3ec [FIX] hr_holidays: Fix out of office message edition
Purpose
=======
Currently, the ooom field is editable in the leave view but an ir.rule
prevents the employee to save as soon as the leave is approved.

Specification
=============
An employee should be able to edit the out of office message
even if the leave is already approved.
2019-06-07 12:51:02 +00:00
Cedric Snauwaert cc6cc7ae8b [FIX] account: remove the warning in reconciliation widget for to_check
The goal of the to_check checkbox in the reconciliation widget is to set the to_check field present on the move that will be created. However since the UI is not perfect, the to_check checkbox was added on the wizard when we create a new line in the widget, which cause the following problem: what if we select to_check on line1 and then deselect it on line2, previously it was not possible to do this, a warning was thrown to tell the user that he had some line with to_check set and some other not. A better way to do this, and more user friendly is by preventing the user from deselecting the checkbox if some other line has the to_check value set.

closes odoo/odoo#33956

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-06-07 09:15:43 +00:00
Rishabh Jadia 7746621b92 [FIX] base: prevent renaming the column for non stored field
Before this task, when creating the related field from the studio, it is by
default stored. When we change the field name in 'ir.model.fields' using ORM's
write method, it also renames the column in the table associated with the
field's model.

This is the expected behavior. But when someone tries to change the 'name' of a
non stored field, the column is not available in the associated model, and so
trying to rename the column results into traceback. This issue was probably
there for a while but came into light with the task 1985710. More info can
be found on the chatter of the task.

This commit fixes the issue by adding an extra check before renaming the table
column. The query will be executed only when the field is stored and thus
exists in the table.

closes odoo/odoo#33944

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-06-06 11:47:19 +00:00
wan e358c41313 [FIX] account: manual reconciliation no data
The function get_all_data_for_manual_reconciliation got an empty list instead of None. This leads to not query the db. However we want to get results in the default behavior for get_all_data_for_manual_reconciliation

closes odoo/odoo#33711

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-06-06 10:26:42 +00:00
Nicolas Martinelli f7b870ca1b [IMP] account: constraint error message
Make SQL constraints errors more accurate.

closes odoo/odoo#33934

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-06 08:34:00 +00:00
Barad Mahendra ef7ae9ae14 [FIX] base: avoid traceback on params field of client action
The content of these fields can't be updated, there's no reason to
even show them. Just remove them from the default / auto-generated
view for client actions.

Task 1772242

closes odoo/odoo#29179

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-06 10:10:12 +00:00