Commit Graph
127612 Commits
Author SHA1 Message Date
Christophe Simonis c816efe7de [MERGE] forward port branch 10.0 up to 24b677a359 2019-07-03 19:23:14 +02:00
Christophe Simonis 24b677a359 [FIX] test_rpc: more robust tests
- mute logger to avoid logging bad queries
 - enforce fields strings

These changes will forbid tests to fail in following versions.
2019-07-03 19:20:31 +02:00
Christophe Simonis 565165a6c8 [MERGE] forward port branch 10.0 up to acbdd526e6 2019-07-03 18:32:16 +02:00
Olivier Colson 91a549dea6 [FIX] hr_expense: assign tags to move lines when using taxes on expenses
Before that, tags were not set at all on base and tax lines.

closes odoo/odoo#34376

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-07-03 14:20:26 +00:00
Martin Trigaux 40421be73c [MERGE] Forward port of saas-12.2 to saas-12.3 up to cf8e74a1a7
closes odoo/odoo#34907

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16 11:44:38 +00:00
Aaron Bohy aac3059873 [FIX] web: wrap char fields in list views
This fix is similar as 793933a1, but for char fields. It prevents
cells containing char fields with long value from overflowing.

closes odoo/odoo#34739

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-15 09:45:31 +00:00
Odoo Translation Bot 4fc83f62fa [I18N] Update translation terms from Transifex 2019-07-14 06:08:03 +02:00
Xavier-Do 87fc1554d6 [FIX] core: avoid writting sources during tests
Future runbot improvement may share sources between build,
meaning that sources will be readonly to avoid any interaction.

_touch() was supposed to handle ro filesystem but
f7130556 introduced a new test that was not working
in this case.

Instead of trying to touch file and pseudomocking the result
if the filesystem is readonly, this commit add a real patch
on getmtime.

cherry-pick of b295723c99

closes odoo/odoo#34823

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-07-12 10:02:32 +00:00
Nicolas Seinlet 80fa405af5 [FIX] mail: message_unsubscribe takes 3 parameters
don't know why you try to use 4 parameters with a function that requires
3 of them:
https://github.com/odoo/odoo/blame/saas-12.3/addons/mail/models/mail_thread.py#L2283

closes odoo/odoo#34639

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-12 09:09:27 +00:00
Martin Trigaux c962b2cd11 [MERGE] Forwardport of saas-12.2 to saas-12.3 up to 01365a3f62
closes odoo/odoo#34747

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-12 07:22:41 +00:00
Aaron Bohy cea3f51e2f [FIX] web: batch read of m2m in o2m after onchange
Let's assume a one2many field (editable list) in a form view with
a many2many (e.g. many2many_tags), and an onchange on the one2many
such that, when a row is added to the relation, the server returns
update commands for (a subset of) the records being already in the
relation. For thoses updated records, the many2many field needs to
be read (the onchange only returns the ids in the relation).

Before this rev., the many2many field was read independently for
each record in the one2many. This could cause a performance issue
on large relations. For instance, this was the case on
account.invoice records with a lot of lines.

Issue 2027356

closes odoo/odoo#34785

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-07-11 10:43:42 +00:00
Lucas Lefèvre 646ccfc530 [FIX] web: Display boolean title in list views
Since commit 9fbb4fb, the `title` attribute is added
to list views `<td>`. The title value is given
by field utils formatting methods, according to the
field type. However, for boolean fields, the formatting
method does not return a string but a jquery element
(unless `forceString: true` is given as an option).
Hence, the displayed title is `[Object object]`.

After this commit, boolean fields do not have any title.

closes odoo/odoo#34657

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-07-11 11:25:32 +00:00
Thanh Dodeur 01365a3f62 [FIX] mail: removes unsupported usage of formData.delete
This commit replaces the usage of `formData.delete()` as it is not supported
by Internet Explorer and Safari Mobile.

closes odoo/odoo#34787

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-07-11 09:39:54 +00:00
Lucas Lefèvre 9d29056989 [FIX] website_slides: Display button when not in fullscreen
When answering a quiz, the button "Check your answers"
is not displayed when not in fullscreen.

JS error: `def.resolve is not a function`
because an already instantiated Promise does not have a
resolve function.
A promise cannot be resolved from outside its callback scope.

closes odoo/odoo#34762

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-11 07:14:05 +00:00
Olivier Colson 7dd718f0e5 [FIX] l10n_br: invoice and refund accounts had been inverted on some taxes
closes odoo/odoo#34693

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-07-09 11:56:05 +00:00
RomainLibert 6157a3876c [FIX] base: revert of 9607f4e801
In website_sale we don't want to synchronize the company_id of the
parent partner so use sudo to fix opw-1930305
2019-07-10 12:55:48 +02:00
Julien Castiaux f69bd5c23c [FIX] website_slides: fix typo in enroll attribute
opw-2032459

closes odoo/odoo#34686

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-07-09 11:22:45 +00:00
Nicolas Lempereur 545437b899 [FIX] mail: show old messages /leave w/o reload
Before this commit, if we had a livechat channel with a user and:

- in backend use command "/leave" to leave and unpin conversation
- [do not reload the page (or there is no issue)]
- then the user sends a new message

The chat window opens just with the new message. Fetched previous
messages are ignored due to being already in the mail manager, and
links between these messages and the threads were never updated.

With this commit, when fetching messages that are already in the mail
manager, these messages are linked again to threads.

This commit also fixes an issue in which messages moderated with
status "accepted" were not correctly removed from the moderation
mailbox. This problem occurred after the fix on re-linking messages
to threads.

opw-2031270
closes #34761

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-07-10 16:46:22 +00:00
Toufik Ben Jaa 07e87e1e34 [FIX] lunch: default value for responsible_id is incorrect
- When creating a vendor on lunch without setting explicitly the
`responsible_id`, `default_get` should return the current user id.
Instead it returns the current user's partner id.

closes odoo/odoo#34759

Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>
2019-07-10 14:19:17 +00:00
Martin Trigaux 00ef2653da [MERGE] Forward port of 12.0 to saas-12.2 up to 3b1d00acda
closes odoo/odoo#34732

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-10 10:14:06 +00:00
Martin Trigaux 3b1d00acda [MERGE] Forward port of saas-11.3 to 12.0 up to db5261b19e
closes odoo/odoo#34723

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-10 08:27:12 +00:00
Alexandre Kühn f9ead39f5f [FIX] mail: rename direct message chat
Before this commit, when a direct message chat was renamed, it
crashed with the following error:

`TypeError: Cannot read property 'toLowerCase' of undefined`

This occurs because the name of the dm chat changed from the RPC
response. However, no new name was provided, thus it sets its
name to `undefined`.

Test has been adapted in order to reflect that the server does not
response with new name after RPC `channel_set_custom_name`.

closes odoo/odoo#34641

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-07-09 12:37:07 +00:00
Odoo Translation Bot 5a438cec13 [I18N] Update translation terms from Transifex 2019-07-07 06:07:54 +02:00
Jeremy Kersten 127ada424d [FIX] website: improve test with more precise trigger
Why not... If it can avoid a red branch.

closes odoo/odoo#34626

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-05 15:20:05 +00:00
Christophe Simonis 66bb578ac9 [MERGE] forward port branch saas-12.2 up to be5e8fdab8 2019-07-05 16:14:48 +02:00
qsm-odoo 201c5b5878 [FIX] website: restore read_events and edit_events
Since https://github.com/odoo/odoo/pull/29442, "Animations" became
"Public Widgets" (even though the Animation class still exists as an
extension of standard PublicWidget).

Since that refactoring an error was introduced which made the code
modify the prototype of the 'events' key each time a public widget with
a 'read_events' or 'edit_events' was instantiated (while the goal was
to modify the widget's own 'events' key, not from the prototype). This
was the cause of very ununderstandable errors...

closes odoo/odoo#34600

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-07-04 15:28:17 +00:00
Goffin Simon 625b25ecf0 [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-07-04 11:16:48 +02:00
Lucas Perais (lpe) 59c663ae42 [FIX] point_of_sale: correct compute fixed tax negative quantity
Have a product with a fixed amount tax.
Make a "return" of that product in the pos (i.e. negative quantity)

Before this commit:
- The amount of the return was `tax_amount + product_amount` instead of `-1 * positive_total_amount`
- The amount differed from what can be observed in sales

This was because the sign of the quantity was applied twice

After this commit,:
- the amounts of positive and negative amounts are symmetrical
- they match the behavior in sale

The logic is very similar to bb72dea98d

OPW 2026278

closes odoo/odoo#34548

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-03 13:25:01 +00:00
Deivis Laya 09b1cd810a [CLA] Update Vauxoo's CLA
Incorporate Deivis Laya (deivislaya) as Vauxoo's contributor
I confirm I have signed the CLA and read the PR guidelines at
www.odoo.com/submit-pr

closes odoo/odoo#34569

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-03 21:24:18 +00:00
Olivier Colson 2078fefdb1 [FIX] l10n_es: fix base tags for groups of taxes
Before that, groups of taxes defined in l10n_es only defined tags on child taxes. This is wrong: base tags of a group of taxes should always be set on the group itself; children should only contain tax tags (at least, if their type_tax_use is 'none'). Indeed, the tax_ids field of aml generated for these taxes will point to the group, while tax_line_id points to its children.

closes odoo/odoo#34557

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-07-03 12:50:53 +00:00
David Arnold a69b4653c5 [FIX] web: missed P3 text model change
concat_xml was apparently missed during the Python 3 text model fixes,
resuling in a function which usually returns ``(bytes, str)`` but in
the case of an empty or missing ``file_list`` would return ``(str,
str))` instead, leading to type errors in Python 3.

Fix the particular case so it properly returns bytes as the
"concatenation result" even when it did nothing. Fix the docstring so
it properly reflects expectations as well.

closes odoo/odoo#34751

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-07-30 06:41:09 +00:00
qsm-odoo 263e980817 [FIX] website: restore folded ul option
The option which allows to create foldable lists was not working
anymore. Taking advantage of https://github.com/odoo/odoo/commit/62a234e6e21397986733152b448e89ee0353dcfb
solves the issue.

Note: the option should be improved a lot to be more beautiful / useful
but this will be a master task.

closes odoo/odoo#35249

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-07-29 09:10:40 +00:00
Odoo Translation Bot d6ad3e1a76 [I18N] Update translation terms from Transifex 2019-07-28 03:09:03 +02:00
qsm-odoo 62a234e6e2 [FIX] website: only stop clone's animations on cloning
/!\ Should not be forward-ported ! As further explained, this commit is
/!\ only partial backports of 12.0 commits. All conflicts should be
/!\ ignored.

A recently merged PR https://github.com/odoo/odoo/pull/35029 was in
fact developed for 12.0 originally and finally merged in 11.0 to solve
potential same bugs. The problem is that one line of that merge relied
on a 12.0 feature that is missing in 11.0: the ability to stop
animations *on part of the DOM only*.

This commit chose to backport that 12.0 feature instead of retargeting
the original PR as it will be needed for another unrelated fixes. So,
this commit partially backport those commits:
- https://github.com/odoo/odoo/commit/0a31cb9b4ae461119ecafdd05c5b979621ffb039
- https://github.com/odoo/odoo/commit/b56e647f2c540d34860cdee8a6adf0785ce3b8ef

(Only the stop animation ability part, not the way it was used).

Note that the first commit was already partially backported with
https://github.com/odoo/odoo/commit/59e1bdff221f4a099f6000eb9884f84f772c38bb

closes odoo/odoo#35230

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2019-07-26 15:34:17 +00:00
Arnold Moyaux 3c4bb080c3 [FIX] stock: reserve on transit location
Usecase to reproduce
- Create company A and company B with one warehouse each
- Warehouse from A resupply warehouse in company B
- Create a product and check the route MTO and resupply from warehouse A
- Connect as Demo User that only have access to company B
- Do a delivery order in company B for this product -> it creates a
receipt from warehouse A
- Deliver in warehouse A to company transit
- Try to reserve the receipt in company B

-> It does nothing.

It happens because the receipt move is in company A and the delivery
order is in company B. The move is tagged as make_to_order so the
reservation is based on move_orig_ids. However the move_orig_ids is
empty due to record rule that hide since it's in the other company.

In order to fix it, allow to see move from other companies that goes
to transit location.

opw-2033066

closes odoo/odoo#35223

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-07-26 13:20:14 +00:00
jcoux 69db18ef0f [FIX] hr_timesheet_attendance: allow update of view
Add the missing drop_view_if_exists that allows the recreation of the template
when updating the module

closes odoo/odoo#32380

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-26 11:27:18 +00:00
Benoît Fontaine 324268a976 [FIX] mail: translate model description
Do not use model._description as this is a static string that is untransalted
Retrieve the value on the ir.model record which has a translated field

Fixes odoo/odoo#28481

closes odoo/odoo#33957

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-25 14:56:15 +00:00
Paul Morelle 79ef03d4cc [FIX] base: always send HELO when connecting SMTP
smtplib.SMTP API calls such as .sendmail() or .login() make sure on
their first line that this command is sent, by calling
.ehlo_or_helo_if_needed().

However, test_smtp_connection() does not use SMTP.sendmail() to simulate
sending email, or the email would really be sent.
Instead it uses the low-level API SMTP.mail() which does not make sure
that HELO was sent.

The connection test could be fixed by ensuring that this command was
sent to the server in the test method. However, this could lead to
inconsistent cases where the connection test passes whereas another
usage in the code fails because the command was not sent.
For example, someone could use the low-level API for some reason.

EHLO could have already been sent because if authentication is enabled
smtplib.SMTP.login() calls ehlo_or_helo_if_needed(). Therefore it is
correct to call it ourselves at the end of our connect() method.

STARTTLS sends a first EHLO, negociates the encryption, and leaves the
state without the second EHLO, which should still be sent to the server,
as stated by RFC 3207, in section "4.2 Result of the STARTTLS Command".
https://www.ietf.org/rfc/rfc3207.txt

closes odoo/odoo#34550

Signed-off-by: Julien Legros (jle) <jle@odoo.com>
2019-07-03 11:56:35 +00:00
jev-odoo acbdd526e6 [FIX]l10n_fr_fec: better remove new line
Fix/improve commit d870749d79
that was removing line feed (\n).

In this one, we also remove carriage return (\r)
to address all cases.

closes odoo/odoo#34536

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-03 07:40:43 +00:00
Aaron Bohy 869cc15232 [FIX] web: form: combine field and renderer classnames
The rendering of field widgets is asynchronous (as it returns a
native Promise). However, the '_renderFieldWidget' method of basic
renderers is sync, and returns a fake div that will be replaced by
the widget'$el afterwards.

The form renderer sometimes needs to add classNames on the rendered
nodes (e.g. each child of an outer group as class 'o_group_col_x').

To handle this, once the field widget is ready, we copied all
attributes of the fake node to the widget's node. Unfortunately, we
were erasing the attr value (e.g. className) by the new one. As a
consequence, the className defined in the widget were lost. This
could be observed for the 'note' field in 'sale.order'.

As this was only necessary for classNames, this rev. only retrieves
the class attribute of the fake node, and adds it to the classNames
of the widget's $el.

closes odoo/odoo#34528

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-03 06:29:46 +00:00
jem-odoo f8e41c6b00 [FIX] sale_expense: avoid breaking "Sale: Own Documents Only" rule when reinvoicing
In sale_expense, there is a rules allowing employee to see all confirmed sales
order. This rule breaks the one from sale "see own document" for salesman user.
The initial goal of this rule is explained in Task-29303: we wanted to ease the
reinvocie flow. For an employee, is it diffuclt to know on which analytic account
the expense should be reinvoice (no knowledge of that, no "analytic rights", ...).

Anyway, this rule brings more problem than expected and prevent people to work.
So, we decided to functionnaly revert the feature by desactivate the rule and hide
the sales order field on expense for user that are not salesperson. Salesperson can
set the SO, and the onchange will set the analytic account. Futher work will be
done in master (for 13.0) in order to solve that matter.
To apply the fix, the rule should be desactivated, and the module sale_expense can
be updated.

opw-2027005
Coming from Task-29303

closes odoo/odoo#34514

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-07-02 14:15:45 +00:00
Christophe Simonis 9c742d0c65 [MERGE] forward port branch saas-11.3 up to 6cf09b9a3c 2019-07-04 20:14:47 +02:00
Christophe Simonis ee28b1bf78 [FIX] test_rpc: adapt test to version 12
In version 12, user 1 is deactivated. Use `base.user_admin` instead.
2019-07-04 20:10:03 +02:00
Christophe Simonis 7b74f4ca9a [MERGE] forward port branch saas-11.3 up to 1debaa89f1 2019-07-04 18:57:17 +02:00
Romain Derie 789aa140b9 [FIX] website, website_sale: correctly set company_id on address
During checkout, the user can create a new billing (only for public user as it
will create a 'normal' `res.partner`), a new shipping, edit its billing (that
will edit himself) or edit its shipping address.

All those cases will go through the exact same methods, public user and logged
in user included.

This previously led to multiple issues and multiple fixes to correctly set
`company_id` and `website_id` on the address (res.partner).

See 44372471ef that fixed the `website_id` part.

See 3a0f05f33 that fixed the multi-company behavior, but needed 2ba71140 to not
modify the company of an already created partner, but was still incomplete as
after that fix a logged in user would still have the admin (sudo) company
instead of the website one as supposed.

This commit will fix that bug and add some tests for all mentionned issues.

Related to #28853 as we want to backport the mentionned commit but needed to be
fix first.

closes odoo/odoo#34596

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-04 13:58:23 +00:00
Abridbus 1c57d5edcf [FIX] mail: use server mail on template
Sending an email wasn't taking the outgoing mail server into account.
Adding it in the 'account_invoice_send_views' to use it in the wizard.

opw-2030717

closes odoo/odoo#34593

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-04 13:03:11 +00:00
qdp-odoo 90334b7db0 [FIX] account: aged partner balance with private partners
When hr is installed, with 'private' type, you should be member of
hr/officer group to read them, or you'll face an access right error.

closes odoo/odoo#34587

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-07-04 12:30:44 +00:00
Lucas Perais (lpe) 356b2ae43e [FIX] hr_holidays: report summary has a wizard as model
Before this commit, the report Leave Summary had hr.leave as its model
implicitly meaning that a report could be printed from an hr leave.

Since the report actually is a view which aggregates data, and not a document
representing a leave, it should have its wizard (the only entry point for that report)
as its model

OPW 2029699

closes odoo/odoo#34507

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-04 08:14:58 +00:00
Lucas Perais (lpe) 65648ab4d0 [FIX] base: action reports have direct ref to model
Before this commit, action report had their model referenced only with a char field
which made impossible to elaborate domain based on the model

After this commit, a new computed field, depending on that char field allows to do that

OPW 2029699
2019-07-04 08:14:58 +00:00
Adrian Torres 235a9da5db [FIX] base: oversight of 547118d76f
The aforementioned commit prevented the creation of automatic xmlids for
custom fields, however this change is not exactly stable; if a database
already contains automatic xmlids for custom fields and the module to
which these xmlids belong to is upgraded, the xmlids would get deleted,
along with any records related to it because of the way that
`_update_xmlids` works.

This commit leaves existing automatic xmlids of custom fields while
preventing the creation of *new* ones.

closes odoo/odoo#34563

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-07-04 06:47:23 +00:00