Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MERGE] forward port branch saas-12.3 up to 50e571acf7c #36491

wants to merge 204 commits into from


Copy link

commented Sep 5, 2019

No description provided.

sbidoul and others added 30 commits May 11, 2019
[FIX] account: allow cancelling payment whith draft move
Payment journals have an option to keep moves unposted until bank statement
When cancelling such payments, it is not necessary to attempt canceling the move
if it is unposted.
This patch allows cancelling such payments without needing to configure the
journal as cancellable while the move is still draft.

To reproduce:
1. check "Post at bank reconciliation" on a bank journal
2. do "Register payment" with that journal on a invoice
3. open the generated payment
4. click cancel => error "You cannot modify a posted entry of this journal..."

closes #33312

Signed-off-by: Laurent Smet <>
[FIX] base_address_city: Add parent_id in view
Fixes #34405
base_address_city adds domain on existing fields which uses parent_id as field_name while it is not present in 'res_partner_view_form_private'

closes #34498

Signed-off-by: Nicolas Martinelli (nim) <>
[FIX] auth_oauth: Override qcontext in the right place
Before this patch, if some module was based on top of `auth_signup`, and `auth_oauth` was also installed in the same database, the only way to get the proper qcontext would be to call `super()` inside `web_auth_signup_qcontext`, which would produce a login, which is most likely not desired because such addon would try to add some logic on top of it that maybe prevents login based on some circumstances.

After this patch, any submodules can work properly without workarounds.

closes #34690

Signed-off-by: Christophe Simonis <>
[IMP] l10n_uk: updated website link
-website link now redirects to accounting page of portal

Closes #35513

Signed-off-by: Nicolas Martinelli (nim) <>
[FIX] tools: epsilon magnitude
The following rounding is incorrect:
>>> float_round(6.6 * 0.175, precision_digits=2)

Indeed, 6.6 * 0.175 = 1.155 ≈ 1.16.

In this specific case, the `epsilon` computed is not sufficient. A
precision of 53 gives:
normalized_value = 115.49999999999997
epsilon = 1.2823075934420547e-14
=> new normalized_value = 115.49999999999999

Bad luck, this is just not enough to tip the value in the right

However, a precision of 52 is sufficient:
normalized_value = 115.49999999999997
epsilon = 2.5646151868841094e-14
=> new normalized_value = 115.5

The value of 53 was chosen from the `binary64` number format precision.
In case of Python, the corresponding machine epsilon is 2^-52 [1].
Therefore, using 52 instead of 53 does make sense.

It is worth noting that the value of the machine epsilon
2^-52 = 2.2204460492503131e-16, which is still 2 orders of magnitude
below our dynamic estimation.

[2] `numpy.finfo(float).eps = 2.2204460492503131e-16`


closes #35565

Signed-off-by: Nicolas Martinelli (nim) <>
[FIX] account: avoid deleting contact on invoice
From Invoicing/Accounting generate an invoice toward a customer
which is a child contact of a company.
Click on "Validate" and print the invoice: the name and contact
information of the customer will be in the report.

Now go into Contacts and delete the customer. If you print again the
report there will be no mention of the customer, and also from the
invoicing tree view there is no customer information.
This is due to the contraint on the deletion that affect only the
parent contact (i.e. a company) which is being billed.

The solution is to put a constraint on the account model to restrict the
deletion of the contact if it is customer of an invoice.


closes #35761

Signed-off-by: Nicolas Martinelli (nim) <>
[FIX] base: create partner from email
Call the method `find_or_create` with `email` equals to
`"Raoul Grosbedon <>"`

The partner created has the name `` instead of
`Raoul Grosbedon`.

The method `name_create` is capable of handling such a use case, so we
take advantage of it.


closes #35797

Signed-off-by: Nicolas Martinelli (nim) <>
[FIX] base: same vat with empty string vat
If partner.vat is an empty string, python evaluates it as falsy and doesn't check the remaining of the line. This makes the framework to send ["", ""] as values for the many2one to the browser instead of false.
By forcing to have True or False, this is not a problem anymore as bool() will be False, and False will result in the correct value in the read.

closes #35807

Signed-off-by: Quentin De Paoli (qdp) <>
[FIX] account: fix account_move_line's default_get()
Backport of 50ee1c9.
Previous version was buggy, as it was already patched by 54c2c08 and 862c245.

When creating a journal entry manually, the computed value for the next line
was not taking into consideration all existing lines.
Was PR #25298. Courtesy of Pieter Paulussen (Dynapps)
[FIX] account: round balance in the default_get of account move lines
Edit journal entries (account.move).
Create a new line. Credit and debit values are filled in with the default get.
Conveniently, if lines_ids is given in context this computes the right value to
balance existing move lines. However, this is done by float operations.
Let e be the resulting epsilon in balance.
As a result a new line may contain e, 0 for credit, debit (or respectively).
If the user fills in the 0 value with v, then the new line contains e, v.
This violates the constraint that exactly one of the two values should be nonzero.

We get the currency from the journal to round adequately the balance.

opw 2046137

closes #35815

Signed-off-by: Nans Lefebvre (len) <>
[FIX] base: QR code validation
The QR code validation does not require the payment account to be in EUR
(e.g. CHF or GBP).

From [1]:

> Though the transaction must be made in euros, the payment accounts
> held at operating in SEPA do not have to be denominated in euros.



closes #35824

Signed-off-by: Nicolas Martinelli (nim) <>
[FIX] account, payment, website_sale: QR code based on partner's country
The QR code was limited to a set of countries listed from Wikipedia [1],
but the list is incomplete. Any partner from a SEPA country should have
the QR code printed since we don't know which banks support it.

At the moment we simply remove the limitation, and hopefully a proper
filtering will be done in master.



closes #35827

Signed-off-by: Nicolas Martinelli (nim) <>
[FIX] im_livechat: livechat rating computes well
Open a livechat session between a visitor and a user
That is, open the / controller as public user, and click,
on the bottom right corner, on "Have a question ? Chat with us."
Exchange at least one message to open the session

From the visitor side, close the window. There is a proposal to rate the discussion
Assign either the green face or the yellow one
(The red one is a bit trickier)

Now, on the user side, check the list view of LiveChat sessions

Before this commit, the rating of those sessions were 0
This is because:
The rating.rating < Many2One > link is not a foreign key
(rather, it is composed by char::res_model; Integer::res_id)
and doesn't make the reciprocal field recompute, which in turn doesn't make
our relevant field compute

After this commit, the last_rating field field is recomputed and appear in the list view

OPW 2052964

closes #35830

Signed-off-by: Lucas Perais (lpe) <>
[FIX] purchase: return dropship
Backport of 4da8277.
Because of e38ed7c the code moved between versions, but is otherwise identical.

- Set an internal location as a return location
- Create a SO with a dropship product, validate and deliver
- Return the product, and choose the internal location as the return

The received quantity on the PO is counted twice.

Since the return is an 'in' move linked to a PO, it is automatically
counted as incoming quantity.

This case is quite specific, so we explicitly add an exception in case
the origin move was a dropship, but the return is not a returned


opw 2045685

closes #35831

Signed-off-by: Nans Lefebvre (len) <>
[FIX] mail: preview of almost empty mail templates
The lxml.html.fromstring method does not accept an encoding parameter, so the
preview crash if the going through this branch, i.e. if the root is an empty tag.

opw 2054368

closes #35817

Signed-off-by: Nans Lefebvre (len) <>
[FIX] base: Page not found on "project forecast" link
In odoo community edition go to Apps, locate Project Forecast and click
on "Learn More". A page not found error is displayed

The link is wrong or missing
Replaced with a working one


closes #35836

Signed-off-by: Nicolas Martinelli (nim) <>
[FIX] website_sale_comparison: translate product attribute categories
Install the module "Product Comparison". Go to
Website>Configuration>Attribute Categories, then create or edit a category.

No translate button is present when editing the field, there should be one
on the right edge to enter the translation menu.

Adding the missing option in the model.


closes #35838

Signed-off-by: Nicolas Martinelli (nim) <>
[FIX] account: reconciliation filter when partner found
Have 2 invoices for one partner
Have 1 statement, and line, without partner
Reconcile it

In the filter to search among proposition, type the name of the partner of the invoices
The two invoices should appear

Click on one of them to add it to the reconciliation

Before this commit, the filter was reloaded without the second invoice

After this commit, the filter is reloaded with the second invoice

OPW 2053615

closes #35846

Signed-off-by: Lucas Perais (lpe) <>
[FIX] account: do not copy 'Reverse entry'
When a journal entry is duplicated, `reverse_entry_id` should not be
copied for obvious reasons.


closes #35847

Signed-off-by: Nicolas Martinelli (nim) <>
[FIX] website_sale_delivery: fix wrong selector + add test
Since commit e8916a8, it was not possible anymore to go through the
ecommerce checkout when `website_sale_delivery` module was installed.

Indeed, it would raise a traceback on the confirmation step if more than one
delivery carrier would be available (different qweb if more than one carrier).

Thus, it would not be possible to click on pay now and buy the product.

This commit fixes it and improves the current test to ensure such flows are

closes #35577

Signed-off-by: pimodoo <>
[FIX] delivery: set carrier on order when carrier line added
When you are adding a line on your sale order that is a delivery line,
the carrier is not always set on the sale order which means that when
the carrier is not explicitly set on the sale order, the carrier won't
be set on picking created from the sale order.

When you are using the wizard on sale order, it works, but when the
carrier is selected on the e-commerce, it is not set on the sale order.

To avoid such difference in behavior, we are writing the carrier_id of
sale order in the function 'set_delivery_line' insread of the wizard and

closes #35855

Signed-off-by: pimodoo <>
[FIX] models: avoid Unicode error when translating that error message
Same cause, error, rationale and fix than 0ec0a4a

#OneCharacterPatch, reloaded


closes #35857

Signed-off-by: Richard Mathot (rim) <>
[FIX] hr_payroll_account: no company on payroll
When no company is set on the payslip, journal entries of zero are

This is because `currency` is empty, therefore `currency.round()` rounds
all amounts to zero.

We fall back on the company of the journal, since the latter is


closes #35859

Signed-off-by: Nicolas Martinelli (nim) <>
[FIX] web_editor: font>a colorize a change font color
If you change the color of a link with the editor without using the link
edition menu, this do not work (which might be expected), but if the
text outside the font had been colorized, the font will be applied
outside of the link only.

This is unexpected since if we have: "hello <a>cruel</a> world!", if we
select only "cruel" and change color, the change only happen to "hello"
and "world!".

With this changeset, an anchor in the ancestor prevent to use an
ancestor font tag to change color (which prevent the issue).

closes #35862

Signed-off-by: Nicolas Lempereur (nle) <>
[FIX] website_slides: adapt youtube api widget to promise
Before this commit, the adaptation of Deferred to Promise was not well done
Hence, the change in video playing status was not handled correclty
i.e. When a video arrives to its end, the next slide or the questions should be displayed

After this commit, when a video is finished, the next slides is displayed

OPW 2052971

closes #35863

Signed-off-by: Christophe Simonis <>
[FIX] gamification, hr_recruitment, maintenance: kankan tooltip no lo…
…nger supports field tag

In v10.0, it was possible, and kinda work, to have
<t t-name="kanban-tooltip">
<ul class="oe_kanban_tooltip">
<li><b>Project:</b> <field name="project_id"/></li>

In v11.0 onwards, this "feature" has been dropped, since in kanban records
it doesn't make much sense to a field defined/displayed that way
The right way is to call


This commit adapts the only two modules still having kanban-tooltip classes in their views

OPW 2055132
related to #29802

closes #35869

Signed-off-by: Aaron Bohy (aab) <>
[FIX] base_import: date pattern
- Change the date format of the users language to "%b %d, %Y"
- Export any res.partner as .csv and include at least 'Display Name' in
the fields to Export
- Import the file exported

The import fail with error: "Import preview error failed due to: 'b'".

This was introduced with commit 32c2666 where the format of the
user was added in the list of patterns to match. Since we use a limited
version of TimeRE (see Python module `_strptime`), only the patterns
defined in `_P_TO_RE` are supported. If an unsupported format is used, a
`KeyError` is raised.

We simply skip the pattern if it cannot be parsed. Another solution
would be to instanciate TimeRE, but that would also require to set the
locale correctly. Long story short: things will start to get messy for a
nice-to-have feature, a.k.a being able to import dates such as
`January 1, 2019`.

Fixes #35868


closes #35883

Signed-off-by: Nicolas Martinelli (nim) <>
[REM] mrp_subcontracting
There was a first version of mrp_subcontracting at rev [1] and now
there's a second verion at rev [2]. As the second version sensibly
changed the flows and models AND we don't have the time to backport the
changes AND saas-12.3 will be released on the saas, we chose to remove
the module in saas-12.3 to not have to support both version once v13 is

[1] d91db5b
[2] 9b6a539

closes #35898

Signed-off-by: Christophe Simonis <>
yostashiro and others added 3 commits Sep 9, 2019
[CLA] update quartile CCLA
Add nakometal

closes #36648

X-original-commit: dea2632
Signed-off-by: Martin Trigaux (mat) <>
[FIX] account: i18n: de: online sync partner form
In german
In account > settings
click on add a bank account

search for a bank that doesn't exist
And click, on the middle of the modal, on "create ..."

Before this commit, it crashed, because the term was wrongly translated

After this commit, it opens the form view to create a bank account

OPW 2068507

closes #36652

Signed-off-by: Lucas Perais (lpe) <>
[FIX] stock: correctly works on non unique recordsets
Followup of 3d6e917 to avoid leaking
the company of first warehouse on all others when writing on multiple

closes #36656

X-original-commit: ca5def0
Signed-off-by: Christophe Simonis <>

This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2019

@robodoo robodoo removed the r+ 👌 label Sep 11, 2019

robodoo pushed a commit that referenced this pull request Sep 11, 2019
[MERGE] forward port branch saas-12.3 up to 9bf0b04
closes #36491

Signed-off-by: Christophe Simonis <>

This comment has been minimized.

Copy link

commented Sep 11, 2019

Staging failed: ci/runbot (view more at

@KangOl KangOl force-pushed the odoo-dev:fp-saas-12.4-1909051943 branch from 1567307 to 2832703 Sep 11, 2019

@robodoo robodoo removed the error 🙅 label Sep 11, 2019

@KangOl KangOl changed the title [MERGE] forward port branch saas-12.3 up to 7895044a797 [MERGE] forward port branch saas-12.3 up to 50e571acf7c Sep 11, 2019


This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2019

robodoo merge review+ priority=0

@robodoo robodoo added the r+ 👌 label Sep 11, 2019


This comment has been minimized.

Copy link

commented Sep 11, 2019

Merge method set to merge directly, using the PR as merge commit message

robodoo pushed a commit that referenced this pull request Sep 11, 2019
[MERGE] forward port branch saas-12.3 up to 50e571a
closes #36491

Signed-off-by: Christophe Simonis <>

This comment has been minimized.

Copy link

commented Sep 11, 2019

Merged at 51354fa, thanks!

@robodoo robodoo closed this Sep 11, 2019

@KangOl KangOl deleted the odoo-dev:fp-saas-12.4-1909051943 branch Sep 11, 2019


This comment has been minimized.

Copy link

commented on fbbfa6d Sep 16, 2019

After this commit I cannot any more type the date quickly into the field
I used to be able to type 15/9 and it will convert it to 15/09/2019
Now I have to type every digit exactly 15/09/2019 15:03:00 or use the mouse

This comment has been minimized.

Copy link
Contributor Author

replied Sep 16, 2019


We are already working on a fix: #36821


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
You can’t perform that action at this time.