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

[FIX] sale: prevent div by zero in sale.report #29472

Closed
wants to merge 1 commit into from

Conversation

kebeclibre
Copy link
Contributor

Backporting the behavior of v12 from e8f01b9

OPW 1916964

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Backporting the behavior of v12 from e8f01b9

OPW 1916964
@kebeclibre kebeclibre changed the base branch from 12.0 to 11.0 December 12, 2018 14:04
@nseinlet
Copy link
Contributor

@robodoo r+

@robodoo
Copy link
Contributor

robodoo commented Dec 12, 2018

I'm sorry, @nseinlet. I'm afraid I can't do that.

@kebeclibre
Copy link
Contributor Author

@nseinlet This is probably robodoo's way to say welcome !

@kebeclibre
Copy link
Contributor Author

robodoo r+

@robodoo robodoo added r+ 👌 CI 🤖 Robodoo has seen passing statuses labels Dec 12, 2018
robodoo pushed a commit that referenced this pull request Dec 12, 2018
Backporting the behavior of v12 from e8f01b9

OPW 1916964

closes #29472
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Dec 12, 2018
@robodoo
Copy link
Contributor

robodoo commented Dec 12, 2018

Merged, thanks!

@robodoo robodoo closed this Dec 12, 2018
pkagori added a commit to pkagori/odoo that referenced this pull request Jan 13, 2019
* [FIX] account_accountant: Make transfer_account not required without chart template

required: [('chart_template_id','!=',False)] doesn't work because you need to fill the chart_template_id
to install a chart of accounts for your company. Then, the transfer_account becomes required before its installation
and then, you are not able to install a chart of accounts for your company.

* [FIX] web: exclude orderedBy when changing action

When activating a filter on a list view,
the environment of the action contained a context with an orderedBy key
which was then used by every controller and model in the various
parallel flows, i.e. changing actions

After this commit, we prevent it by excluding the key when executing an action

OPW 1913190, 1914019

closes #29190

* [FIX] doc: correct spelling mistake in javascript reference

* [CLA] Add fredj to Camptocamp CLA

closes odoo/odoo#29307

* [FIX] delivery: cast to float

Some providers (e.g. Fedex) return a `decimal.Decimal` instead of a
`float`, which causes a crash.

opw-1903784

closes odoo/odoo#29311

* [IMP] account: Adding a method to allow the change of `amount_mnt` var
used to fetch debit & credit recorded in Tax Cash Basis Journal Entries

Main
-

By allowing to change the `amount_mnt` var we will be able to change the
values recorded in Tax Cash Basis Journal Entries, i.e, debit & credit
values.

Explanation
-
We want to keep the `amount` just the way it has been computed because
that is right. We don't want to change that.

Our issue is the`rounded_amt` which is the value that is passed to the
debit and credit downwards.

We have only hooked a new method to allow us later inherit that method
and make our own computations regarding the `rounded_amt` which is the
main subject of this PR and later pass it down to the debit & credit
fields as need for localizations that could be facing the problem of
having the computation of taxes at date of invoicing instead of date of
payment.

`amount` var is used here:

`
'amount_currency': self.amount_currency and
line.currency_id.round(-line.amount_currency * amount / line.balance) or
0.0,`

and we are not intending to change that because the value written to the
`amount_currency` field is right.

What we intend is to compute the values for debit and credit fields
which were computed in this method at invoice date, some l18n need them
at payment date, e.g, l18n_mx.

Be aware
-

Do not be mislead by the fact that `rounded_amt` var is the one taken to
do those computations. It is just a mean to the final goal. Rounding is
not an issue and has never been.

Background
-

By allowing this merge to flow we will be able to address the following issues:
https://github.com/odoo/odoo/issues/25057
https://github.com/odoo/odoo/pull/17196
https://github.com/odoo/odoo/issues/9972

Final Goal
-
Being able to perform the computation of the debits and credits
according to l10n_mx in odoo/enterprise#3137

closes odoo/odoo#28991

* [FIX] mail: wrong many2many definition

The definition of `attachment_ids` on model `email_template.preview` is wrong,
because its table/columns refer to the model `mail.template`.  As the field is
only used to preview a result in a wizard form, it does not need to be stored.

closes odoo/odoo#29349

* [I18N] Update translation terms from Transifex

* [FIX] models: make valid aggregation functions explicit

In `read_group`, allow an explicit set of aggregation functions.

closes odoo/odoo#29348

* [FIX] sale: do not schedule activity when no `user_id`

- The `_write` override on `sale.order` create a Next Activity for the
  SO's salesperson when changing the SO `invoice_status` to upselling.

  If the SO doesn't have a salesperson this code crashes since `user_id`
  is required on Next Activities.
  To avoid this crash we create the Next Activity only if a salesperson
  is set on the SO.

  OPW-1914087

* [FIX] website_project: buggy pager

The pager wasn't taking care of the filter

opw-1912293

closes odoo/odoo#29360

* [FIX] website_membership: correctly check if customize view is active

Commit 5804246e0fca introduced some improvements to speed up performances.
One of them was to check if a customize_show view was active or not but the
condition was on view.customize_show instead of view.active.

Thus, as that view is always a customize_show, the condition would always be
met.

closes odoo/odoo#29414

* [FIX] website_sale: fix overlapping text with product categories

If the price section goes on two lines because of crossed
prices or many icons, then it would overlap with the product title.

See before/after on the PR.

opw 1913521

closes odoo/odoo#29388

* [FIX] base_address_extended: Street in readonly
opw-1916148

The city, state and zip code are shown behind the street name and
street number, and not in a new line.
This only occurs in the read-only view.

This was changed to use the field 'street', which is a text of the
street name, number and door number in the street formatted in the
format of the partner's country. This only for the read-only view,
leaving the 3 fields separated for the edit.

closes odoo/odoo#29467

* [FIX] l10n_be_intrastat, report_intrastat: date

The reference date for Intrastat should be the accounting date, not the
invoice date.

opw-1890240

closes odoo/odoo#29466

* [CLA] Corporate CLA: focusate

CLA signed by Andrius Laukavičius (Focusate).

* [FIX] sale: prevent div by zero in sale.report

Backporting the behavior of v12 from e8f01b94ce8f4aeed7e573821bcfd73d6c20024c

OPW 1916964

closes odoo/odoo#29472

* [FIX] website_sale: Remove pricelist on Sitemap.XML

* [CLA] Include cristinamartinrod in CLA of Tecnativa

closes odoo/odoo#29454

* [FIX] website_blog: fix select to comment

before this commit, the selected text was no more quoted in the comment.

This commit closes #29148

closes odoo/odoo#29486

* [FIX] website_sale: shipping address edition

- Buy on product on the eCommerce with a partner having a single address
- At address selection, edit the shipping address

The billing address is also modified.

From the Odoo PoV, this is expected since they point to the same
partner. But from a user PoV, this is totally unexpected and confusing.

Therefore, we only allow the edition of the shipping addresses which are
different from the billing address. Yet, if the user modifies the
billing address, it will change the corresponding shipping address as
well. However, the usual flow is to set the billing address, then the
shipping address. So that should cause less issues. In v12, a warning
message is added.

opw-1914185

closes odoo/odoo#29509

* [FIX] base_address_extended: add missing mexican address format

After this fix, the field `partner.street` is correcly rendered,
but as the test shows the `street_name` and `street_number` fields
are not correct.

But as there are tests that validate that wrong use case, I
consider it a *feature* and not a bug.

opw-1896773

closes odoo/odoo#29520

* [FIX] account: missing translation

- Install a second language, e.g. French
- Set Parter A language to French
- Create an invoice for A with a date due in the past
- On the partner form view, print the 'Due Payments'

The body of the letter is not translated in French.

Something quite weird appears:
- The corresponding string is exported in the `stock` module
- It is linked to the demo data `stock.res_company_1`, which corresponds
  to 'My Company, Chicago'.

Therefore, the translation cannot be found by the corresponding query
generated in `_generate_translated_field` and `_read_from_database`:
```
SELECT "res_company"."id" as "id",COALESCE("res_company__overdue_msg"."value", "res_company"."overdue_msg") as "overdue_msg" FROM "res_company" LEFT JOIN
                (SELECT DISTINCT ON (res_id) res_id, value
                 FROM "ir_translation"
                 WHERE name='res.company,overdue_msg' AND lang='fr_BE' AND value!=''
                 ORDER BY res_id, id DESC)
             as "res_company__overdue_msg" ON ("res_company"."id" = "res_company__overdue_msg"."res_id")
                        WHERE "res_company".id = 1  ORDER BY "res_company"."sequence" ,"res_company"."name"
```

Indeed, `res_company.id` is 1, while `res_company__overdue_msg.res_id`
is 3.

The root cause has been solved in v11, to we only export the necessary
term.

opw-1908337

closes odoo/odoo#29525

* [FIX] account: incorrect exported term

Manual forward-port of #29525.

opw-1908337

closes odoo/odoo#29526

* [FIX] web: handle `context` key in calendar reload

When filtering the calendar view on search filters, the filter `context`
was not taken into account during the reload.

For example, in the Calendar app, the filter 'My Meetings' has a `context`
{'mymeetings': 1} which was not passed to `search_read`.

Task 1917628

closes odoo/odoo#29531

* [I18N] Update translation terms from Transifex

* [IMP] product: product & template name_get performance

By prefetching only the fields required for the `name_get`

`product.product` & `product.template`
have a huge number of fields,
and prefetching them just to compute
the name is overkill.

Especially, as the browse was done using
sudo, the prefetch was a bit useless as
it was stored in the sudo user cache,
which was most-likely not used afterwards
by the callee of name_get

For a database with 50.000 products,
this reduce the processing time
by 15 (from 60 seconds to 4 seconds measured)

* [FIX] sale_stock: fix onchange product_uom_qty
opw-1916064

Have a sales order line on which you decrease the quantity.
Before, this commit, the warning message that says to update the
delivery order did not show. This was because, the onchange in the
python side compared the new quantity against the saved one, and did
not find any difference. This is caused by the onchange itself, which,
in a o2m setting, received from the JS, the changed order
(already containing the changed line) and only then proceeded to the
onchange of the line. The first operation wrote onto _origin the new
line value, which corresponded subsequently to the new value.

After this commit, we compare the real value explicitly retrieved from
the database to the one just entered by the user as an onchange.
The warning message works as expected.

Long story short, _origin in an onchange doesn't guarantee to yield
persisted values in all cases.

closes odoo/odoo#29582

* [FIX] mail_bot: hide Odoobot request when denied (Firefox)

Before this commit, the notification "Odoobot has a request" would
stay on screen even though the user blocked them in Firefox.

This case occurred when the user clicks on "Not Now", which tells the
browser that the push notifications should be blocked until the next
page reload.

This commit fixes this issue, so that the notification is removed
when clicking on "Not Now", in addition to cleaning tests related
to push notifications.

Task-ID 1918476

closes odoo/odoo#29584

* [ADD] l10n_nl: tax codes for 9%
closes issue #29352
The Dutch taxes will change the low tax 6% to 9% on 01/01/2019. Please add these tax code in the system and also change the affected fiscal positions. Both 6% and 9% needs to exist during the transition period.

closes odoo/odoo#29375

* [FIX] web: x2m in x2m with different fields in different views

Use case: a x2m (ex: attribute values) displayed in a x2m (ex: attributes on
product) using different fields in different views (ex: tags in product form view
and list in product attribute form view). When opening the x2m record (in a
wizard) then going back on the form view, the tags are empty because the
`display_name` value has been lost when fetching x2m for the second time.

In this case, the list `fieldsInfo` needs to be updated with the existing
(default for tags) one so all the fields will be correctly loaded.

Task 1916891

closes odoo/odoo#29598

* [ADD] l10n_nl: tax codes for 9%
closes issue #29352
The Dutch taxes will change the low tax 6% to 9% on 01/01/2019. Please add these tax code in the system and also change the affected fiscal positions. Both 6% and 9% needs to exist during the transition period.

closes odoo/odoo#29374

* [FIX] iap: support dbuuid in authorize requests

In this commit: https://github.com/odoo/odoo/commit/a0b7802a5e7646a896f54cf125f0136ff489d4d9

We've added the possibility to send the dbuuid in the authorize request,
this as been added to allow to give free credits of a service to a
database.

As some services developped in 11.0 are using this mecanism, we have to
add that support in 11.0

* [IMP] doc: improve wording in profile code docs

closes odoo/odoo#29424

* [FIX] web: read records up to list limit

Fine-tuning of commit e7fab234201e357da52c3576ad2e8fc9ceee9359
In a one2many with more than one page with a limit of k records, add a line l.
It increments the list limit to k+1. Remove a line above (of index <= k).
It will try to load a line l' to replace it, that it will find on page 2.
However when deciding if it should read missing fields on that record, it will
scan at most u records, skipping virtual ids.
Here u is the min between the current number of lines and the list limit
without the temporary increase due to the added record.
Since there are at least two pages, u = k.
However since l is in the list at index k, then l' won't be read, and since it
was on page 2 its data hasn't been loaded.
Therefore the js would traceback when trying to evaluate it.

opw 1913361

closes odoo/odoo#29338

* [IMP] account: usability of payments

Backport of commit 771f65ecf565e8c46743259a063f32f54aae0cbe

Payments created without partner_type (field not required)
were previously not shown anywhere, as well as internal transfers.

opw 1910590

closes odoo/odoo#29647

* [FIX] portal: multi-company logo

When using:
```
t-field="res_company.logo" t-options="{'widget': 'image'}"
```
the widget generates a `/web/content/` URL, which ultimately checks the
access rights in method `binary_content`. This means that if the user
doesn't have the `read` access rights on `res_company`, the logo won't
be displayed.

We use the `/logo.png` route instead since it bypasses the access
rights.

opw-1913665

* [FIX] sale: company logo on portal

- Set a logo for Companies A & B
- Create a partner P in A
- Create a SO for P in B
- Send the SO by email
- In the email received, click on 'View Sales Order'

The logo displayed is the logo of Company A instead of Company B.

The logo is retrieved from `res_company` in the template:

https://github.com/odoo/odoo/blob/6be0cdef98fdafc2cb90042758de1b756e955624/addons/portal/views/portal_templates.xml#L31

However, `res_company` is set based on the company of the user:

https://github.com/odoo/odoo/blob/6be0cdef98fdafc2cb90042758de1b756e955624/odoo/addons/base/models/ir_ui_view.py#L1295

We make sure to set `res_company` based on the company of the order
instead. This works since the `values` have the priority over the
`qcontext`:

https://github.com/odoo/odoo/blob/fa9874915449896ff770adbb63780629c18b3e7b/odoo/addons/base/models/ir_ui_view.py#L1283

opw-1913665

closes odoo/odoo#29649

* [IMP] base: Vietnam Dong should have 1.00 as rounding.

No decimal part in Vietnam Dong (đ - Việt Nam Đồng)

closes odoo/odoo#29650

* [FIX] stock: xrange->range in template report_location_barcode

closes odoo/odoo#29652

* [FIX] hr_payroll: Specify a worked day description for global leaves

Currently when recording global leaves on the ressource calendar
the worked line has no code or description, which are required.

Specify a default value to allow the saving of the payslip.

closes odoo/odoo#29655

* [FIX] product: name_get, products can share the same template

Oversight in revision
a91ffcf1a72f7d8759704405cd5026cf32c21a7f

Multiple products can have the same template.

Passing multiple times the same template id
to the search domain to get the sellers
works, but better avoid the repetition
for the performances.

* [IMP] product: name_get, use mapped to gain some memory

This revision is related to
12df3c6a98e4a925a8aa2e1232497a01cb4f8d69

The above revision serve its purpose as well,
but by avoiding to store the result in a variable,
and using the records cache instead,
we gain some memory, which is noticeable
when there are hundred of thousands products.

The sudo() is important, as it must be the
same environment then the above call to read
to use the same cache.
Otherwise the values won't be in the cache
of self (without sudo),
and it will go get it and prefetch other fields
in the database.

* [FIX] web_editor, website(_theme_install): avoid theme.ir.ui.view crash

In a particular case, `_views_get` was mixing apples and oranges, ir.ui.view
and theme.ir.ui.view.

This was the case if a theme has a theme.ir.ui.view t-calling another
theme.ir.ui.view.
(Only theme's sale bridge cause this issue, eg theme_kea_sale.products)
Then, having that theme installed on a website would make all other website
without that theme to crash when opening the /shop customize menu.

Indeed, the theme.ir.ui.view would have the xml_id theme_kea_sale.search.
The generic view `website_sale.products` would have `theme_kea_sale.products`
as inherit child which is website specific and t-call `theme_kea_sale.search`.

Then, on a website witout theme_kea installed, opening the customize menu would
call `get_related_views` that would call `_views_get` that would loop through
inherit children calling `_view_obj` that would not find a view with that key
and would fallback on self.env.ref, finding the theme.ir.ui.view.

Note: `_views_get` might return specific view for another website but that will
      be filtered on `get_related_views` override in website.

Step to reproduce:
  - Have at least 2 websites and website_sale installed
  - Install theme_kea on a website, it will also install theme_kea_sale
  - Go on the website that has not theme_kea installed
  - Go to /shop
  - Open Customize menu, it won't load because of python crash

opw-1914576
Closes #29347

* [FIX] website_*: get specific view over generic one

Before this commit, self.env.ref would always find the generic view loaded from
the assets.
Disabling a customize_show view on a website would not hide completely the
feature as the self.env.ref would retrieve the active generic one and not the
inactive specific one.

Step to reproduce (on one of the module):
  - Install website_sale_wishlist
  - Disable "Wishlist" on the Customize menu of /shop
  - Go to a product page, the wishlist hearth icon is still there

opw-1914576
Closes #29347

* [FIX] website: prevent customize options to be reordered

With multi-website, activating a customize option (customize_show view) will
actually duplicate the customize view to make it specific.
By doing so, the duplicated view will have a higher ID than the original, and
the original's siblings customize options.

Before this fix, two issues could be seen:
1. When toggling a customize option, it would appear last in the dropdown
   afterward. This is because of the views being sorted by (priority, id)
   (if the views have the same priority).
2. When toggling, sometimes the views header would be duplicated. This comes
   from the JS code that loop through the returned views and create the DOM
   by adding a header when the view inherit_id is different than the previous.
   Obviously, as 2 views with the same inherit_id could not be grouped together
   now that the specific one has a bigger ID, it will create twice the DOM.

=> Check tests in this commit, they have schemas that will explain it clearly

Note: We don't take priority into account for customize menu view order as it
      would create the same problem as (2.)
      We could have sorted by (inherit_id, priority, name) to avoid the issue
      and give the user possibility to order options in header but it was
      decided we dont.

Closes #29347

* [FIX] website: simplify filter_duplicate

The `filter_duplicate()` method was introduced with b0b6b9afb53 for
website_version.
The module was removed on Odoo 12.0 with https://github.com/odoo/enterprise/commit/51c1bb3cca9ae02fc55cb49ba98cec2901a8e273

`filter_duplicate()` can now fit the multi-website behavior more simply.

Closes #29347

* [FIX] website: get only specific view children on _views_get()

Before this comit:
The `_views_get()` method would be called recursively for every
`inherit_children_ids`.
At the end of the method, we would get the complete view hierarchy, including
duplicate hierarchies for website specific copies (COW).

Then, the `get_related_views` that is calling `_views_get()` would be overriden
in website module to keep only most specific views.

But this would not be enough as it would leave orphans from other trees:
  - Have a base view 'B'
  - That has an inherited view 'I'
  - That has itself an inherited view 'II'
  - Now make the hierarchy specific on a website from 'I'
  - And add another inherited view to 'I' on the generic tree
This become:
              B
             / \
            /   \
           I     I'
          / \     |
        II  II2   II'

As explained, filtering duplicates would not be enough as it would correctly
remove 'I' and 'II' from the generic tree but would not remove 'II2'.

At the end, it would return "B", "II2", "I'" and "II'".

Now, we correctly return only "B", "I'" and "II'" by ignoring generic trees
when there is a specific one.

Closes #29347

* [CLA] Martronic SA signs Odoo CCLA

closes odoo/odoo#29669

* [IMP] website: Explain scope of language in keywords in seo
When there is a website with traduction (for exemple, Spanish and
French). In the Spanish website, at the SEO menu, you can add keywords
using any of the languages (Spanish or French), but these keywords are
only added to the Spanish website.

To avoid misunderstanding between the website language and the keyword
language a tooltip is added.

closes odoo/odoo#29683

* [IMP] l10n_{be,ca}: translate the CoA in both base languages too

Same as ea747d23e4 for Belgium and Canada

If somebody chose nl instead of nl_BE as the language (e.g. on the SaaS on
odoo.com, only nl is proposed on startup), the chart of account was not
translated.
Now it will be in both languages.

Rename the translation file so it is loaded by any nl_* language
Add multiple spoken_languages to be sure to load each one via the
process_translation mechanism.

Apply same logic for fr_CA

closes odoo/odoo#29682

* [CLA] Open Source Integrators signs Odoo CLA

closes odoo/odoo#29255

* [CLA] signature for doun

closes odoo/odoo#29009

* [CLA] Darshan Patel

closes odoo/odoo#29691

* [IMP] doc: convert xmlrpc python examples to P3

closes odoo/odoo#29485

* [IMP] stock_account: Fixed typo in field's help

closes odoo/odoo#29692

* [FIX] iap: handle HTTPErrror and Timeout when contacting iap server

When the iap sever is called, it is possible that the request timeout
or that the webserver returns an error code (if the Odoo server is down
for example) and we should warn the user instead of throwing an
exception in a traceback

closes odoo/odoo#29667

* [FIX] website_*: prevent record to be unpublished on website change

Before this commit, when changing the website field in a record form view,
the is_published field would be force to false, ending unpublishing the record
if it was published.

That behavior was coming from the fact that is_published field is missing from
the form view. Thus, onchange on website is triggering a recompute server side
without is_published as the JS framework is not sending the field.
The ORM is then fallbacking on default Boolean value (False) for is_published
when sending back the onchange result.

This would only appear on object with 'website.published.multi.mixin' and with
website_id in the form view.

task-1919689

closes odoo/odoo#29707

* [REV] Revert "[FIX] modules: load demo data fallback"

This reverts commit 5f4a9451828fff1919c74e421001bc111c5c138d.
The cure is worse than the original disease.

The main installation cursor often holds exclusive locks (due to DDL
changes) on vital tables such as res_users. As a result, using
another cursor to perform changes while the main cursor is waiting
is extremely deadlock-prone. And these deadlocks can't be detected by
PostgreSQL as they mix Python-SQL locking, which leads to deadlocked
HTTP workers.

Related to:
- opw-1916918
- #29528

* [CLA] signature for anandkansagra

closes odoo/odoo#29709

* [FIX] base: fix name_search on res_partner when searching on linked users

Currently name_search on res_partner holds code to be done by a customized SQL
query allowing to speedup the search [1]. However when dealing with given args
there may be a crash if there is a domain based on user_ids fields.

Indeed this field is defined as auto_join [2]. It means the result of get_sql
returns where parameters based on joined tables. Those tables are not available
in the from clause in the original query.

This commit fixes that issue by correctly taking the from_clause from get_sql.
That way joined tables are available. Small update of the query is necessary
as fields are now res_partner.{id/email/vat/reference} as there may be several
tables linked in the query.

A test has been added to avoid regression.

[1] See https://github.com/odoo/odoo/commit/05ec12692f99b69924765fd0ce384632547f03f9 for a recent modification
    and implementation of this query, even if it exists since a looooong time
[2] See https://github.com/odoo/odoo/commit/db8203c27a21acdbcad2cf1c394b6fea3cf13688 for the auto_join addition

closes odoo/odoo#29827

* [FIX] account: don't propose partial reconciliation on blue lines

Create a vendor payment of 100€
Create a bank statement line with an amount lower than the payment
Open bank reconciliation view
Reconcile the bank statement line with the blue line of 100€, the triangle for partial reconcile appear.
Current behavior:
If you click the triangle, you can reconcile this payment with the statement line but it becomes unbalanced.

Expected behavior:
The triangle should not appear.

Fixes odoo#29654

closes odoo/odoo#29718

* [FIX] purchase_requisition: Use correct field to access state

closes odoo/odoo#29715

* [FIX] web: Add missing aria attributes in menus

Some aria attributes were missing on menus, and are required to ensure a
good compatibility with keyboard users and screen readers.

To solve the above, the following attributes are included:
- `aria-expanded`: this should be present in all dropdown menus. This is
  set on elements with class `dropdown-toggle` and `o_closed_menu`.
- `role`: used to improve given information about what elements are for.
  It is added in the following cases:
  1. Non-button elements that have the class `dropdown-menu` are set to
     `role="button"`.
  2. Menu items that have the class `dropdown-item` are set to
     `role="menuitem"`.
  3. Menu separators that have the class `dropdown-divider` are set to
     `role="separator"`.

This is a continuation of baa1c515c592

closes odoo/odoo#29719

* [I18N] Update translation terms from Transifex

* [I18N] Update translation terms from Transifex

* [FIX] stock_picking_batch: do not lock batch model on transient model

closes odoo/odoo#29722

* [I18N] Update translation terms from Transifex

* [I18N] fix bad comment

f8dad1bb4 added the terms in the .pot with an incorrect syntax in the comment
The pulled translation have this incorrect syntax as well which produces a warning

closes odoo/odoo#29729

* [FIX] portal: change width of portal modal to match backend

Some features are common to portal and backend, such as the sign modal in
enterprise.

This commit uniformize the width of the modal to make it more consistent between
the two by default. Of course themes can still customize this behavior.

closes odoo/odoo#29521

* [FIX] website: remove faulty decorator

copy_menu_hierarchy is not a model function since it expects
to iterate on a recordset of websites

closes odoo/odoo#29723

* [FIX] account: fix untranslatable strings

The "customer invoice" and "vendor bill" string was untranslated.
Instead of adding a _ call, properly translate it.
No need to try saving bytes by splitting the sentences, this makes it very
difficult to translate in some languages where the order of words are not the
same as English

closes odoo/odoo#29690

* [IMP] base: Add context key to force the rendering of the pdf in 'test-enabled' mode

In `test_enable` mode, `render_qweb_pdf` fallbacked to `render_qweb_html`. We add a context key to be able to force the rendering of the pdf, even in `test-enable` mode.

* [IMP] snailmail_account: Add tests to make sure that all default templates can be sent with Pingen

Add tests to make sure that, with sample data, the format of the invoices is accepted by Pingen.

* [FIX] snailmail: Avoid format errors when sending with Pingen

Pingen validates the format of documents before sending them. These are the elements that it checks and how when ensure that the constrains are validated:
    - The recipient's address should appear in a predefined area
	--> Move the address to this area and reduce the font-size if the address is too long
    - The destination country should be the last line of the address
	--> Sometimes, the Tax ID was in this zone, so we add a margin after the address
    - Above the Address Area, there should be a Postage Area that should be completely empty
	--> Make the background white to avoid having a background image in this area
	--> Crop the header if it takes too much space
    - There are margins of 5mm all around the document
	--> Crop the footer 5mm above the bottom of the page if it takes too much space
    - There is a square in the bottom left of the document that should be empty
	--> Add a margin on the left of the footer

closes odoo/odoo#29522

* [FIX] website_sale: remove click from tour when checking button

This step was meant to be "check" but did "click" instead because no empty
function was provided.

This caused a nondeterministic issues where an unwanted RPC generated a warning.
Indeed by clicking "add to cart" when checking if the button is disabled, that
called `create_product_variant` on non-dynamic product.

PR: #29675
task-1920036

* [FIX] website_sale_wishlist: prevent flicker and make tour deterministic

Before this commit, there was a slight chance that the "add to wishlist" button
would flicker `disabled` off, which caused the tour to go next step too early.

The flicker was because the `_onChangeVariant` could be triggered by the
`website_sale` code before the variable `this.wishlistProductIDs` was actually
set, so it wrongly computed the state and enabled the button.

Now the RPC is done on the `willStart` instead of `start` to solve this issue.

The tour has been edited to check the button is actually disabled initially.

The view has been edited because the existing condition was too lazy: it checked
if any variant of the current template was in the wishlist, instead of checking
for the variant actually displayed. That also caused a flicker when the JS
correctly computed the state for the variant afterwards.

The widget has also been edited to trigger `input.product_id` instead of
`input.js_variant_change:checked` to avoid calling `get_combination_info` twice
from `website_sale` code.

PR: #29675
task-1920036

* [FIX] website_sale_delivery: allow to restrict delivery to a website

Before this commit, website_id field would not be added in form view, making it
impossible to set a website on a delivery method and so impossible to restrict
a delivery method to a specific website.

Now, adding this field will be enough as we already search() on
website_published carrier and the delivery.carrier model has the
'website.published.multi.mixin' mixin that will filter accessible website when
searching on website_published field.

+ add missing groups on website_id field
+ remove useless website_published

opw-1918189

closes odoo/odoo#29749

* [FIX] stock: wrong location technical field

The commit a35df8d37170790257876a54aa54f2c3ab596c44 changes the odoo object
of "rules" from stock.location.path to stock.rule. The field on the first
object to store the destination location was location_dest_id but is location_id
in the second one.

This commit fix the variable name that refers to the destination location

opw : 1919655

closes odoo/odoo#29755

* [IMP] l10n_no: Norway tax update, see #28422

closes odoo/odoo#29852

* [FIX] hr_holidays: Fix traceback on onchange

closes odoo/odoo#29773

* [FIX] partner_autocomplete: Remove companies from suggestions

We wanted to make it possible to manually mark records from the partner_autocomplete service as 'ignored' so that they wouldn't appear in suggestions.
Previously, this was done by removing, in the service, records that were marked as 'ignored' from returned suggestions.
The problem is that, since the record was not present in odooSuggestions, the data from this company was retrieved from clearbitSuggestions and the company was still present in the dropdown.
We fix this problem by also returning ignored companies from the service, marked as 'ignored', so that they can be filtered out after getting additional suggestions from clearbit.

closes odoo/odoo#29785

* [FIX] stock: Use current datetime when no Scheduled date

Same as the default get
This field should probably be set as required in master

Fixes #29778

closes odoo/odoo#29781

* [FIX] mail,web: link attachments & messages

The information of the active model and record was not given in the context
Records created from the Manage Messages and Manage Attachements in the debug
menu were not linked to the current records
Add context in test too

closes odoo/odoo#27766

* [FIX] hr_holidays: Fix 6035112

1/ self.date_from on a for loop on self won't work
2/ When calling get_work_hours_count with self.date_from=False or self.date_to=False,
   this will lead to a traceback when looking the timezone on the date.

Closes #29697

* [FIX] hr_holidays: Reset interface-based fields on leave type change

Purpose
=======

When changing the leave type on a leave request, reset the technical
fields that only have a visual purpose to avoid mismatch on the leave
duration compute method.

closes odoo/odoo#29789

* [FIX] account: apply currency on uom change

When creating a new line on a customer invoice, we could get the price
unit in the company currency instead of the invoice currency.

This is because the uom_id onchange would ignore currency when setting
the price.

Changing an invoice line's price unit on uom_id change was introduced
in february 2018 in saas-11.3 with 3a38080ff.

Change to how currency is applied when setting an invoice line's price
unit was introduced in june 2018 in 9.0 with 367fadc8.

So there was a missing part in saas-11.3 to adapt 367fadc8 for 3a38080ff
change that is added with this commit.

Without the fix, the added test failed with:

  AssertionError: 10.0 != 20

opw-1920504
closes #29776

* [FIX] stock_account: fix default field value in wizard

Default time was set to default=fields.Datetime.now() instead of
default=lambda self: fields.Datetime.now(),
resulting in a discrepancy when printing the report.

opw 1917523

* [FIX] service: fix integrity error display

During the installation of a module, an IntegrityError can be raised,
e.g. if some module data already exists in the database
(as in the case of a module which uninstallation did not remove its data).

In Python2 it was possible to use such a psycopg2.IntegrityError with i[0]
to get its error message, while this raises an exception in Python3,
i.args[0] is needed.

As a result the log would contain an exception within an exception instead of
displaying an error to the user.

opw 1916374

closes odoo/odoo#29787

* [I18N] Update translation terms from Transifex

* [I18N] Update translation terms from Transifex

* [CLA] Stojan Ivastanin signs personal CLA

closes odoo/odoo#29821

* [FIX] mail: Wrong message when closing activities
opw-1916935

Before this commit, when a next activity was closed, the message said
that the action was performed by the assigned person.

Now, the message say that the action was performed by the person who
closed the activity.

closes odoo/odoo#29678

* [FIX] purchase: prevent div by zero in purchase.report

Spinoff of 6cd12694d86e52601d80cecfd605f9dc282a2c18

OPW 1916964

closes odoo/odoo#29828

* [FIX] tools: value_label attribute translatables

A newly intoduced xml attribute by @svs-odoo was not translatable.

Related PR on enterprise: odoo/enterprise#3252

opw-1908220

closes odoo/odoo#29386

* [FIX] sale: do not display negative discount

opw-1903225

closes odoo/odoo#29829

* [FIX] hr_holidays: demo data error on 31 december

On installation demo data causes an error on 31 december since we test:
 is 31 december at midnight < now() => so after midnight error.

Solve this by comparing today instead of datetime.

opw-29776
closes #29830

* [FIX] hr_holidays: date and datetime comparison

The fields `validity_start` and `validity_stop` are `Date` fields, they
should therefore be compared to `datetime.date`.

opw-1918843

closes odoo/odoo#29834

* [FIX] base_setup: prevent using incompatible views

If a non-QWeb view is used, it would fail to render the template

closes odoo/odoo#27405

* [FIX] gamification: add space in generated query

The generated query in _generate_goals_from_challenge lacked spaces
between the date clause, which caused a traceback.
The traceback only appears since v12 and above, because the dates are
now casted as dates (::date) in SQL, which has to be followed by a
space. Before that it was "fine" as SQL does allow you to write
g.start_date = '10-10-2017'and g.end_date = '11-11-2017'

Closes #28773

closes odoo/odoo#29836

* [I18N] Update translation terms from Transifex

* [FIX] web: _getFullCalendarOptions firstDay key

After making improvement to allow user to choose first day of week per
language, it was not taken into account that calendar view uses
different weekdays indexing than newly added field `week_start`. The
difference is in Sunday, where in calendar view it has index 0, but
week_start index is 7 (other days' indexes match).

opw 1916666

closes odoo/odoo#29471

* [FIX] base: correct res.partner name_search

Oversight of previous forward-port when adapting cc217569b7d45cca72e7a3d0d5c1580531443bb0

* [FIX] stock: tell the user which product is causing the issue

closes odoo/odoo#29857

* [CLA] siognature for Enric Tobella

closes odoo/odoo#29593

* [FIX] (website_)sale: make test non-reliant on currency rate demo

Without this fix, the test does not work at the start of the year, because it is
reliant on a date that is hard-coded on the currency rate demo.

Instead of changing the demo, this commit will make the test stronger by not
depending on it.

PR: #29850

* [FIX] account_check_printing: Fix traceback on onchange

Method amount_to_text() having self.ensure_one(), it should not be
called with empty recordset

Closes #29854

closes odoo/odoo#29865

* [FIX] web: adapt forward-ported test

* [I18N] l10n_fr_fec: update fr.po

The file no longer matched the linked .pot file

closes odoo/odoo#29328

* [FIX] hr_holidays: recompute the duration based on employee

When changing the employee value, the duration was not recomputed

closes odoo/odoo#29844

* [FIX] hr_holidays: Correctly compute number_of_days on form loading

Backport of https://github.com/odoo/odoo/commit/1c391c3dfbdf733304fc882b9045d25e20e6dd1f

Closes #29800

closes odoo/odoo#29853

* [FIX] account: adapt forward-ported test

* [FIX] partner_autocomplete: ignored field is sent to view

The field ignored is set in javascript on company object to filter the
ones we want to show. As it is not an odoo field, it triggers a
traceback when the trigger_up 'field_changed' is called.

OPW-1921568

closes odoo/odoo#29864

* [FIX] web: add tests for calendar start of the week and week numbering

The week_start has been added as an option since commit 27b30daea54b02c.
This stores as a database parameter the day starting the week, [1.. 7] starting
on Monday, while the calendar options expect to get Sunday as 7 % 7 = 0.
As a result the week number would be shifted.

Commit c72403d2ba79f0d5091183e33240034f2fdc6f73 solved the issue,
this commit adds tests for it.

opw 1916666

closes odoo/odoo#29838

* [FIX] tools/date_utils: Fix get_fiscal_year with leap years

Suppose calling get_fiscal_year(date, day=29, month=2) with date(year=2017, month=2, day=28)

The computation steps are:
date_from = date(year=2017, month=2, day=28) - 1 year = date(year=2016, month=2, day=28)
date_from = date_from + 1 day = date(year=2016, month=2, day=29)

It's incorrect because the value of date_from must be date(year=2016, month=3, day=1)

closes odoo/odoo#29416

* [FIX] base_automation: do not reload registry at create

The original issue is described in #29528, and the commit was reverted
in eb19016ba35d4dc472.

The root cause of the issue was that the module `base.automation`
performs a `commit()` in `_update_registry`, which is called during a
`create`. This conflicts with the `savepoint` created in `load_demo`.

We postpone the registry reload after installing the demo data. Note
that we only do this in `base_automation`, to limit the potential side
effects.

opw-1920636

Co-authored-by: Raphael Collet <rco@odoo.com>

closes odoo/odoo#29863

* [FIX] account: typo introduced in d44437f93830afae60e5354e0b4777413be29c93

closes odoo/odoo#29874

* [FIX] *: correctly hide "groups settings" from user form

* = account, sale_management, website

Settings that are using groups internally should not appear on the user form
without using debug mode.

The admin should not get the idea that he should configure those per user,
because they are going to be reset if/when changing the general setting.

closes #29842
PR: #29860

* [FIX] web_planner: prepare_backend_url give a bad URL
opw-1920590

Before this commit, the function prepare_backend_url forced in the url
the view_type 'form'. This occurs because a misunderstand between the
fields ir.actions.act_window.view_type (That indicate if an hierarchy
in the view list exists, with as possible values : form and tree, which
can be mistaken as views types) and ir.actions.act_window.view_mode
(which is a list of allowed views).

Now, if not ask otherwise, the function give the url of the first
(the default) allowed view; or one of the allowed view if asked for it.

closes odoo/odoo#29882

* [IMP] account: Search res.partner.bank without partner in reconciliation

Search bank account without partner to handle the case the res.partner.bank already exists but is set
on a different partner. Without this commit, the error 'An account with the same number already exists'
was raised.

* [FIX] account: Fix payment's move_name when cancelling

Create a paiement, post it, cancel it, set it to draft, post it again:
The move_name has been incremented instead of staying the same as before.

-opw: 1919241

* [FIX] account: Fix missing cancel option in Misc. journal form

Introduced by:
https://github.com/odoo/odoo/commit/73fc643057958edd37e385148dcf22c768e3cc01

-opw: 1921034

closes odoo/odoo#29885

* [IMP] api: gain some memory by not creating the cache_key tuple multiple times

* [IMP] api: improve storing performance of the api cache

This revision moves the `cache_key` to the first level
dict of the cache, instead of the last one.

Doing so, we reduce the number of times the reference
to the cache key is stored in the dict.

For instance,
for 100.000 records, 20 fields and 2 env (e.g. with and without sudo)
formerly, there were 100.000 * 20 * 2 occurences of cache key references
now, there is only 2 references.

Storing references to an object consumes memory.
Therefore, by reducing the number of object references
in the cache, we reduce the memory consumed by the cache.
Also, we reduce the time to access a value in the cache
as the cache size is smaller.

The time and memory consumption are therefore improved,
while keeping the advantages of revision
d7190a3fd043639ec21e91ddb30481b2989842c5
which was about sharing the cache of fields
which do not depends on the context, but
only on the cursor and user id.

This revision relies on the fact there are less different references
to the cache key then references to fields/records.
Indeed, this is more likely to have 100.000 different records stored
in the cache rather than 100.000 different environments.

Here is the Python proof of concept that was used
to make the conclusion that setting the cache_key
in the first level dict of the cache is more efficient.
```Python
import os
import psutil
import time

from collections import defaultdict

cr = object()
uid = 1
fields = [object() for i in range(20)]
number_items = 500000

p = psutil.Process(os.getpid())
m = p.memory_info().rss
s = time.time()

cache_key = (cr, uid)
cache = defaultdict(lambda: defaultdict(dict))
for field in fields:
    for i in range(number_items):
        cache[field][i][cache_key] = 5.0
        # cache[cache_key][field][i] = 5.0

print('Memory: %s' % (p.memory_info().rss - m,))
print('Time: %s' % (time.time() - s,))

```
- Using `cache[field][i][cache_key]`:
   - Time: 3.17s
   - Memory: 3138MB
- Using `cache[cache_key][field][i]`:
   - Time: 1.43s
   - Memory: 756MB

Even worse, when the cache key tuple is instantiated inside the loop,
for the former cache structure (e.g. `cache[field][i][(cr, uid)]`),
the time goes from 3.17s to 25.63s and the memory from 3138MB to 3773MB

Here is the same proof of concept, but using the Odoo API and Cache:
```Python
import os
import psutil
import time

from odoo.api import Cache

model = env['res.users']
records = [model.new() for i in range(100000)]

p = psutil.Process(os.getpid())
m = p.memory_info().rss
s = time.time()

cache = Cache()
char_fields = [field for field in model._fields.values() if field.type == 'char']
for field in char_fields:
    for record in records:
        cache.set(record, field, 'test')

print('Memory: %s' % (p.memory_info().rss - m,))
print('Time: %s' % (time.time() - s,))
```
- Before (`cache[field][record_id][cache_key]` and cache_key tuple instantiated in the loop):
   - Time: 4.12s
   - Memory: 810MB
- After (`cache[cache_key][field][record_id]` and cache_key tuple stored in the env and re-used):
   - Time: 1.63s
   - Memory: 125MB

This can be played in an Odoo shell, for instance
by storing it in `/tmp/test.py`, and then
piping it to the Odoo shell:
`cat /tmp/test.py | ./odoo-bin shell -d 12.0`

closes odoo/odoo#29676

* [FIX] base: missing tests on record cache

* [FIX] models: avoid prefetch hell when reading fields

The method `read()` may be very slow when reading relational fields and
computed fields, because the computed fields can be computed on a recordset
that is larger than expected.

The issue occurs on model 'res.partner' when reading fields 'child_ids' and
'purchase_order_count', for instance.  Suppose we read those two fields on a
partner with 1000 contacts.  First, the one2many field is read from the
database and stored to the cache; the latter adds the value ids to the
prefetching of 'res.partner'.  Then, the fields are fetched from the cache.
When 'purchase_order_count' is accessed on the partner, the field is computed
on all its children as well...

closes odoo/odoo#29867

* [FIX] snailmail: Object of type `bytes` is not JSON serializable

Sending a letter resulted systematically in an error due to the insertion of the binary of the PDF in the JSON sent to IAP-services.

closes odoo/odoo#29880

* [FIX] translate: inline elements with translatable attributes only

* [FIX] sale: only create one activity to upsell a SO

Create a Sale Order linked to a timesheet, for k hours.
Add the a line for the k hours, invoice the SO.
Then, next time you add a line or modify the value of an existing line,
the SO invoice_status becomes "upselling".
Then, everytime you do it again, it triggers a recompute which writes the
invoice_status "upselling" on the SO.

Now since commit 17c9b7afee219e86e48035044570939a70fb18f3 every time you write
an invoice_status as "upselling" this creates a new activity to upsell the SO.
However it was intended to run only once, the first time the status changes.

Before creating an activity, we check what was the invoice_status to ignore
records that were already in that state.

opw 1911642
opw 1919283
opw 1919284

closes odoo/odoo#29891

* [FIX] tools: properly verify the size of HTML nodes

Instead of checking the size of text only node, let the xml_translate verify it.

The size verification using etree was introduced at 40efdccc3d1e1f070c9 but was
probably too simple.
Since 45352512a842, this becomes redundant with the nonspace method which can
be extended.

The re.sub is still relevant as some terms may contain only non-alphanumeric and
use push_translation (e.g. '>=' as a selection or xml terms extracted by babel
in static repository)

closes odoo/odoo#29432

* [FIX] rating_project: pop `group_by`

- Go to 'Project'
- Group by 'Manager'
- Click on the rating

A traceback occurs.

This is because the grouping field `user_id` does not exist in the
target model.

Fixes #26060
opw-1920979

closes odoo/odoo#29900

* [FIX] web: attach document fix click on firefox

As of saas-11.3 there is a "Attach document" widget that is meant to
more easily add attachment.

But on firefox the click event is coming from the button, where on other
browsers it was possibly from a child element.

So the code expecting the child element did not work on firefox.

opw-1920842
closes #29903

* [FIX] sale_timesheet: more flexible domain for sale line on task

Imagine the following use case: you have a partner (company) with
children (person). Selling a service to that company will create
a task on SO confirmation. Then the project lives its life, and
sometime a person of that company requests a task. The task
customer is the person, but should be linked to the SO as the
time spent on its should be invoiced to the client (the company,
customer of the SO).
This is not possible, as the selectable Sale lines for a task was
the one of the exact partner of the the task.

This commit changes that by checking the commercial partner instead
of the partner. So, for reporting purpose, we can keep the real
customer of the task, and correctly invoice the related timesheet
on the SO of customer company.

opw-1915703

closes odoo/odoo#29921

* [FIX] web: X2Many read propagates field context

Most operations on X2Many widget possibly propagates a field context
(name_create, name_search, ...) but the original read or read on an
onchange does not.

With this changeset, the field context is also used in these instances.

The assertions added in the added test failed with:
  expected: ["world"], result: [undefined]
  expected: ["world","world"], result: [undefined,undefined]

fixes #29203
opw-1914466
closes #29866

* [FIX] hr_attendance: kiosk keep alive

When running in kiosk mode, it is necessary to refresh the interface
once a week since the session is garbage collected.

The garbage collection method `session_gc` relies on the last
modification time of the session file. However, the session file is only
saved when the field key `should_save` of the session request is `True`.
This happens when the session is `modified`, i.e. an item on the cookie
is set.

In practice, the session is saved at each reload of the page. Regular
RPC calls, such as the one used in commit 6e1b660f9c76a41, do not
trigger a modification of the session file. Therefore, we create a new
route which explicitly sets the session as `modified`, which ultimately
triggers a `save` in `get_response`.

opw-1917254

closes odoo/odoo#29919

* [FIX] sale: non-consistent tests

The tests of the sale module are not constistent. Success depends on version
in use (com vs ent) and the modules installed (sale, stock, event_sale).

**Fix 1**

The "Description" field is updated by a onchange while saving the record.

**Fix 2**

The `sale_stock` module  adds a new step to click "ok" on the warning modal
shown when saling a product without enough of that product on hand. The added
step was added to test_01 (that doesn't show the modal) instead of test_02.

**Fix 3**

There is a difference between the price of the SO between community and
enterprise.

**Fix 4**

The event_sale module changes the form view thus need to perform more steps
to create a record.

opw-1912266

closes odoo/odoo#29679

* [I18N] export 11.0 source terms

To integrate recent content changes and benefit from cd4080839f and 7f8631a91

closes odoo/odoo#29933

* [CLA] Brainbean Apps OU signs Odoo CCLA

* [FIX] hr_holidays: extra space in state check

The condition was never validated

closes odoo/odoo#29898

* [FIX] account: compute_fiscalyear_dates non leap years

Before this commit, when the fiscal year was setting to 29/02.
The function that compute the fiscal year dates gives an error.
This occurs when the date passed as parameter wasn't a leap year.

Now, for the non leap years we use the 28/02.

opw-1917035

closes odoo/odoo#29932

* [FIX] sale: hide the sales menu from users without any rights

If a user has no rights on sale, he should not see the sales menuitem
on the dashboard.

opw 1921335

closes odoo/odoo#29934

* [FIX] sale: allow execution on multiple records

avoid singleton error when self contains multiple orders

closes odoo/odoo#29922

* [FIX] account: deadlock on install

- When installing an accounting l10n module, the method `try_loading_for_current_company`
  is called and could cause a deadlock.
  The deadlock is caused by the fact that if the installation is started
  via a web request the code tries to retrieve the current user's
  company by doing `request.env.user.company_id`.

  This causes issues since the installation code has its own postgresql
  cursor while calling `request.env.user.company_id` will create its own
  cursor.

  So two cursors exists for the same Odoo worker.
  The installation cursor asks for a lock on `res_users` while the
  second cursor (the request one) will try to read on `res_users` and
  wait the first lock to be dropped.

  The lock is never dropped since the python code isn't running anymore
  waiting for the `request.env.user.company_id` to be completed.
  Causing the deadlock.

  To fix the issue, we avoid the creation/usage of a cursor created by
  `requesŧ`.
  So to retrieve the current user's company, we read the user id on the
  request's session, then browse the `res.user` record with the
  installation cusror.

  Fix issue introduced by commit d40956c7909bffa338fd0138565044571e852da3

closes odoo/odoo#29927

* [IMP] l10n_be_hr_payroll: Update salary rules up to 2019

Update withholding taxes and child allowances for the new fiscal year.

Documentation: https://finances.belgium.be/fr/entreprises/personnel_et_remuneration/precompte_professionnel/calcul

* [FIX] l10n_be_hr_payroll: Remove wrong rule

This rule is not correct, and shouldn't be applied here.

* [IMP] l10n_be_hr_payroll: Update 'bonus à l'emploi' up to 2019

Documentation: https://www.socialsecurity.be/employer/instructions/dmfa/fr/latest/instructions/deductions/workers_reductions/workbonus.html

* [IMP] l10n_be_hr_payroll: Update witholding taxes reductions up to 2019

* [FIX] purchase: don't change status when writing a note through the composer

Have a RFQ in draft. Log a note or send a new message, but use the full composer to do it.

Before this commit, the RFQ was set to sent

After this commit, it stays rightfully in draft
It is mark as sent, only if the button SEND RFQ is used

OPW 1908094

closes odoo/odoo#29902

* [FIX] test_main_flows: more explicit trigger

* [FIX] mrp: manufacture user can not record production

Usecase to reproduce:
- Connect with demo user
- Create a MO w/h routing
- Confirm and produce it
- Record the production wizard

Access right error on product.product for field tracking

It happens because the wizard use a related to product.tracking howerver
it is not set as readonly on the view and send to the server as a value
on save. Since it write on a related field it will try to write on the
linked model(product.product).

This commit set the field as readonly so it is not set to the server.
The field is just used inside domain and it is invisible to the user
so it do not modify any behavior.

opw-1918684

closes odoo/odoo#29942

* [FIX] website_gengo: override of static template was not working

The template `website_gengo.web_editor.TranslatorInfoDialog` was not used
anymore.
It is supposed to replace the one in `web_editor` module.

Among other things, 2972976 refactored the `web_editor` template to
contain only the modal body content. The bug might be coming from it.

closes odoo/odoo#29955

* [FIX] account: Wrong amount_currency on reconciling several lines

closes odoo/odoo#29966

* [I18N] Update translation terms from Transifex

* [I18N] Update translation terms from Transifex

* [FIX] base: correct typo in state name

Argentina state is Entre Ríos

closes odoo/odoo#29959

* [FIX] snailmail: Remove class on recipient's address

Layouts were not accepted by Pingen due to the fact that the class that we added to the recipient's address was not present in stable versions.
The format was therefore not adapted to Pingen.
We then remove this class to fix layouts in stable versions.

closes odoo/odoo#29976

* [FIX] web_editor: banner not horizontaly centered

When creating a banner using the web editor, the targeted image
appears centered in the editor but is aligned on the left in the
email.

The issue also happened with other alignment (left in a centered
widget, right, ...) for example on outlook 2007 and should be solved
with this changeset.

opw-1904827
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
closes #29985

closes odoo/odoo#29214

* [CLA] PlanetaTIC signs Odoo CCLA

* [FIX] test_main_flows: open operations menu in enterprise only

In community, when entering the Manufacturing app, the first view is the
Manufacturing orders list view as it's not the case in enterpise, the
two steps are only necessary in enterprise.

Note: even if it fix the tour, the main bug could still be there.

closes odoo/odoo#30016

* [FIX] web_editor: left/right/center image for mail

When creating a banner using the web editor, the targeted image
appears centered in the editor but is aligned on the left in the
email.

The issue also happened with other alignment (left in a centered
widget, right, ...) for example on outlook 2007 and should be solved
with this changeset.

note: 12.0 version of #29214

opw-1904827
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
closes #29954

* [FIX] web, website: set correct order on modal footer button

Since 12.0, some modal footer button order were changed. The primary button
would not be the one in the modal footer corner.

This is against bootstrap but more annoyingly, users are intuitively clicking
on the secondary button, ending up closing the modal and losing form
information they entered.

This commit simply fix the regression from 12.0 as before 12.0 these buttons
were positionned correctly.

Note that a commit in master (saas-12.2) will fix all the other ones that were
wrongly positionned before 12.0.

Step to reproduce:
  - Go to an event having the possibility to register.
  - Click on 'Register Now', a modal is shown to write details (name, email..)
  - You intuitively click on 'Cancel' as it is the bottom right button
    |________________________________ CONFIRM _ CANCEL _|
  - The modal is closed, if you try to open it again your infos are lost

Closes #29884
task-1922120

* [FIX] portal: dont override list-group-item BS4 active color (white)

Before this commit, BS4 color for active list-group-item (white) would always
be overriden by our portal custom css to the BS4 color for inactive one.

Part of #29884

* [FIX] website_sale: make eCommerce animations work in all browsers

The eCommerce sometimes animates product images when they are put in
the cart / wishlist / comparison panel. Those animations did not work
on Firefox and IE and made strange scrollbars appear instead.

* [FIX] account: error in Base amount tax
opw-1917605

Before this commit, when accounting is set to global rounding, the base
amount per tax is not correctly calculated.

Now, the Base amount per tax is calculated adding the rounded lines.

To test this issue, you need to set to global rounding and create a
customer invoice with the following lines :
line 1 = Qty:40; unit price:2.27; tax:15%; discount: 10%
line 2 = Qty:21; unit price:2.77; tax:15%; discount: 10%
line 3 = Qty:21; unit price:2.77; tax:15%; discount: 10%

When the invoce is printed, you would notice that the amount is 186.43
and it should be 186.42.

closes odoo/odoo#30021

* [fix] point_of_sale: payment screen backspace

before the fix if hitting the backspace in point of paiment screen would
triger the keypress event twice.

removed the double eventhandler

resolves https://github.com/odoo/odoo/issues/29911

closes odoo/odoo#30031

* [FIX] stock: assign partner

- Create a SO with a stockable product, validate
- On the corresponding picking, change the partner
- Print the 'Picking Operations' or 'Delivery Slip'

The partner printed is the partner of the SO, not of the picking.

This was reported many times in the past, and is quite confusing. It
happens because the partner on the `stock.move` remains the partner set
on the SO.

We shouldn't change the reports, nor automatically propagate the change
since it might cause issues, e.g. in case on dropshipping or manual
creation of the picking.

Therefore, we add an action which allows to set the partner on the stock
move manually.

opw-1917851

closes odoo/odoo#29939

* [FIX] web: graph view translation

The control labels 'Grouped' and 'Stacked' are not translated since they
are default values from nvd3.

opw-1908220

closes odoo/odoo#29975

* [FIX] stock: translation of Traceability Report

opw-1908220

closes odoo/odoo#30012

* [FIX] sale_timesheet: responsive table

On small screens, when we click on the overview of a task
inside the "project" app, the displayed table doesn't fit the screen.

This commit only add missing parent "div.table-responsive" to add
responsive support.

A better fix has been merged in master, see:
https://github.com/odoo/odoo/commit/dc017d17e9170d3fc0a5104ab9dc84f748bc097a

opw-1907877

closes odoo/odoo#29971

* [FIX] product: report product labels price
opw-1916965

Before this commit, the price printed in the product label was the
list_price (catalog price) it didn't take into account the extra price
of the variants.

Now, the price printed is the lst_price (catalog value + extra).

closes odoo/odoo#30039

* [FIX] test_mail: bump expected query count

The prefetch hell patch [1] generate one more query.

[1] a07a076c45fc4b83caa9ab30ca919b30016015a7

* [FIX] mrp: BoM Structure report

Send the context for proper translation of the report.

opw-1908220

closes odoo/odoo#30038

* [CLA] alexcn signs cla

closes odoo/odoo#30010

* [FIX] base: delete linked record only if last external id

In case a record is no longer referenced in the updated module, its external id
is deleted.
If the linked record still exists, it is deleted as well.

This last clause was incorrect as the record may still be referenced in other
modules.

If a field is declared in module A

class FooA(models.Model):
    _name = 'foo'
    bar = fields.Char()

and overriden in module B…
@fw-bot fw-bot deleted the 11.0-salereport-divzero-lpe branch October 20, 2019 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI 🤖 Robodoo has seen passing statuses OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants