Commit Graph
125877 Commits
Author SHA1 Message Date
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
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
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
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
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
Goffin Simon d1a5ce02dc [FIX] hr: Impossible to change job_id in hr.employee
The field job_id is displayed in the tree view but it was not available in the form view
like in 12.0. So it was not possible to change it.

opw:2006084

closes odoo/odoo#33933

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-06-06 08:16:12 +00:00
Lucas Lefèvre 05ed9ebbe5 [FIX] hr_payroll: Generate work entry for full days
Currently, `generate_work_entry` has a different behavior
if the type of parameters is `date` or `datetime`:
If the type is `date`, it implicitely set hours and minutes
to 00:00.
It is particularly confusing when `date_stop` is a `date`:
work entries are not generated for this day because it's
actually outside of the range.

This commit makes it consistent in all cases:
-hours and minutes are set to 00:00 for start date
-hours and minutes are set to 23:59 for end date

closes odoo/odoo#33906

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-06-05 11:35:21 +00:00
RomainLibert 4783253ba3 [FIX] hr_holidays: add method to override selection of calendar
closes odoo/odoo#33905

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-06-05 11:29:17 +00:00
RomainLibert c081ee0462 [FIX] hr_holidays: fix multi company issue in onchange
If you are logged into a company that differs from the company of your
employee, you won't be able to read the informations on that employee,
and you will have a crash.
Instead of taking the employee linked to the current user, we use search
in order to first apply the ir.rules hence we ensure that we will be
able to read the needed informations.
2019-06-05 11:14:55 +00:00
ef7988c22c [IMP] account: faster reconciliation
avoid to get journal_entry_ids, to avoid pushing those ids in cache and
having them read uselessly when accessing an account.move.line
recordset.
Use search and search_read instead of ORM __get__

closes odoo/odoo#33192

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>

=======================================================================

Note on this commit:

This reintroduces what was reverted in 83b52e3a97 with an extra
fix in the call of `_prepare_reconciliation_move_line`. The second
parameter of the method call should be the amount in the company
currency since it used as debit or credit value.

A test is added.

opw-1997794

closes odoo/odoo#33515

Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>


Co-authored-by: william-andre <wan@odoo.com>
Co-authored-by: Nicolas Martinelli <nim@odoo.com>
2019-06-03 06:14:22 +00:00
Nicolas Martinelli be1ee79322 [FIX] repair: create in mobile view
When creating a repair order in mobile view, it is not possible to add
any Parts or Operations since required fields are not set.

We make the corresponding form views consistent with the tree views.

opw-2005905

closes odoo/odoo#34016

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-11 07:10:59 +00:00
Nicolas Martinelliandjev-odoo 94a2c54fb5 [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#33943

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


Co-authored-by: jev-odoo <jev@odoo.com>
2019-06-06 11:40:28 +00:00
Odoo Translation Bot 0ebee56da5 [I18N] Update translation terms from Transifex 2019-06-09 01:17:53 +02:00
Christophe Simonis 9e9e9acef1 [MERGE] forward port branch saas-11.3 up to a2582c4252 2019-06-07 19:04:43 +02:00
Nicolas Martinelli 67e9210a1c [FIX] membership: cyclic dependency
In a still-to-determnie situation, a cyclic dependency with
`associate_member` is observed, preventing the installation of the
module.

We remove the dependency, and trigger a recompute on the parent members.

opw-2005325

closes odoo/odoo#33977

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-07 12:43:43 +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 Martinelli ff97e66c6c [FIX] hr_attendance: kanban view in fullscreen
- Goto App Attendance > Manage Attendances > Kiosk Mode
- Select Employee (redirect to Kanban view)
- Refresh the browser

The page reloads and Kiosk Mode is left (Menu is visible, Dashboard can
be accessed).

Since the action is only used in 'Kiosk Mode', we can set it as
fullscreen.

opw-2006789

closes odoo/odoo#33969

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-07 08:10:28 +00:00
Alex Tuyls c05cceed7b [FIX] stock: backorder pickings
With the demo data:
- Go to Inventory
- On the 'Delivery Order' Kanban card of YourCompany, click on 'Back Orders'

More pickings are displayed than the expected count.

This is because the domain of the filter is not in line with the domain
of `_compute_picking_count`.

closes odoo/odoo#33953

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-06 12:41:08 +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
jem-odoo 8a1037df67 [FIX] sale_timesheet: SO line editable only for salesman
This commit makes the sale line field on task editable and clickable
only for salesperson. As task can be read by any employee (depending on
project visibility), a non salesman user can see the 'name_get' of the
sale line, but get an access error when clicking on it.

This fix duplicate the field and only display the correct version
(editable or readonly) according to current user access rights.

Task-1999673

closes odoo/odoo#33320

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-06-06 09:28:22 +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
jem-odoo 20f3290eab [FIX] sale_timesheet: billable task access error for project user
When a project user (without any sales acces rights) want to create a task in
a billable project (linked to a sales order / sales order line), he will face
some access right issues :
1/ the system want to set the default customer on the task, by taking the one
from the sale order line linked to the project in which the task is created. This
raises an error as the task creator has no right to read the project'sale line.
2/ after that, the "sales order" field is computed on the task. This raises the
same error as we need acces through sale line to determine the sales order of the
task.

This commit fixes thoses problem by adding a `sudo` and by adding the "sales order"
field only for sales person.

opw-1999673
2019-06-06 06:58:46 +00:00
jem-odoo 5513ebdf1b [FIX] sale_timesheet: default filters to setup services
In settings, we added the possibility to edit service products per type
(time-based, fixed, or milestone). An action was trigger and a default filter
was applied. This filter was removed with c1f7987f49, making the 3 settings
links displaying all products.
This commit restore the filters. In order to keep the UI silmplification,
those 3 filters are only displayed (in search view) for this specific flow.
So, we keep the general search view simple.

opw-1987352
2019-06-06 06:58:46 +00:00
Florent de Labarre 808238212e [FIX] mrp: add persistent domain
Steps to reproduce the bug:

- Create a product template A with variant color: black and white.
- Create attribute : size : 16gb and 32 gb
- Create a bom with template A.
- Add a bom line L with product B
- Save the bom ,edit it and select an attribute value for L

Bug:

All attribute values of the database (color: white, color: black, size: 16 gb, size 32 gb)
were displayed.

opw:2006988

closes odoo/odoo#33949

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-06-06 12:03:19 +00:00
Goffin Simon 2e7cbca0e9 [FIX] hr_holidays: Not able to fill holiday request
Steps to reproduce the bug:
- Log as admin user in company C
- Go to Leaves module and click on Managers > Allocations
- Create a leave.allocation with type = Compensatory Days, duration = 7 days
mode = By Company and Company = C
- Approve the allocation
- Create a leave request LR for all the company C and approve it
- Log as demo user (only user access right for Leaves)
- Go to Leaves > My Leaves and click on "Leaves requests"

Bug:

A traceback was raised

opw:2005813

closes odoo/odoo#33899

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-06-06 07:29:02 +00:00
Nathan de Pryck f435c65517 [FIX]account_asset: Increase performance to generate asset entries
For each asset depreciation lines we verify that there are not linked
to a move. This verification was done for each line separately.
Moreover, during the creation of the journal entries, we were writing
on the 'line_ids'. In this case, accessing the move of a line
was invalidating the cache. This fix ensure that this operation is
done out of the loop and the cache is then not invalidated at each
step.

See opw-2000305

closes odoo/odoo#33908

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-05 12:47:02 +00:00
Michele Zaccheddu 6a6471d727 [CLA] signature for MicheleZak
closes odoo/odoo#33880

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-05 06:45:00 +00:00
Christophe Monniez 7cc13e91b6 [FIX] test_lint, test_pylint: reintroduce an empty test_pylint module
Since test_pylint was moved into the test_lint module in commit
b27077bb, this could break Odoo instances where a module has test_pylint in its dependency.

With this commit, the test_pylint module is coming back as an empty
module.

closes odoo/odoo#33871

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-06-04 12:24:29 +00:00
luisiniguezh e88edfc5c5 [CLA] signature for luisiniguezh
closes odoo/odoo#33851

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-04 13:13:03 +00:00
Julien Mougenot d7d7d92e92 [FIX] web: binary fields correctly resets
When uploading a file to a binary file, then clicking on the
"clear" button, then reuploading the same file...

Before this commit:

The actual input of the field was only changed on user input.
This means that the "clear" action didn't reset the actual value
of the input, and the browser's default behaviour when getting
the same path twice is not to change anything. In the use case,
you couldn't upload the same file until you uploaded another one.

After this commit:

The "clear" action now also clears the value, allowing reuploading
the same file over again.

closes odoo/odoo#33843

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-06-03 15:01:57 +00:00
Atul Patel 6028d91a26 [FIX] stock: clean m2m records for warehouses on routes.
when we select places warehouses where route can be applied, then unselect that warehouses, warehouses values on m2m tag are not deleted.
because of wrong value empty list on onchange. so remove all records of warehouses if warehouse option was not selected.

closes odoo/odoo#33883

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-04 16:55:13 +00:00
Romain Derie 9efc11c8da [FIX] website: redirect user
Before this commit, user would be redirect to / instead of /my after signup.
That error was detected with task-1829827 which has a tour ensuring user is
correctly redirected to /my after signup on the checkout summary after payment.

Since 0229ef4c4a, the `web_login()` super call order has been changed when
called from the `/web/signup` route.
See the commit for more details but basically, before the fix, it went only
through:
1. web.web_login
2. portal._login_redirect

Where now, it goes through:
1. website.web_login
2. auth_signup.web_login
3. web.web_login
4.portal._login_redirect

Thus, portal._login_redirect is not returning `/my` as redirect anymore.
Indeed, website.web_login will ignore its super() and force redirect to `/`

With this commit, website's user are redirected to /my as expected.
Side effect: website's user will also be redirected to /my on login instead of
`/`, which is also prefered.

closes odoo/odoo#33865

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-04 09:38:44 +00:00
Nicolas Lempereur 7c900568c5 [FIX] web_editor: modal open>save document keep it
When we add a document with the "Select a Media" modal, if we reopen the
modal then click on "Save" without modfiying anything, the element is
broken since we do not have the data saying it is a document and the
code try to display it as image.

With this changeset, we keep the information that the attachment is a
document and when saving it works as expected.

opw-2004064
closes #33844

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-06-03 13:54:45 +00:00