A wrong field is used to control propagation of questions from event template
to child events. Currently an event template must use automated emails to
propagate its questions, instead of correctly checking the question enabled
field ``use_questions``.
As most templates use automated email this was not seen before.
Task-2703285 (event performance)
Task-2703289 (event testing)
closesodoo/odoo#81098
X-original-commit: 10732e077d4bfc296ca59a9c3df613b9fd1cb275
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When logging in as employee using barcode scanner, the event to
show the opening cash control is not triggered, therefore, only the
first user to login using the selection popup that the cash opening
will be initiated. We fix this issue by lifting the event trigger
at the `back` method.
closesodoo/odoo#81085
X-original-commit: 992a0130ea802814279c62f28880ab2120d1ad3c
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
It seems the `.scss` weren't recognized when loaded via the bundle
`report_assets_pdf` when rendering certifications
p/feedback report
closesodoo/odoo#81081
X-original-commit: 925ee95b02b51e156b0848161f7716b982e47235
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce the error:
- Create a new company, set Netherlands as country and fill in the required info (street, zip, city, vat, kvk-number).
- Set a bank account on the company contact.
- Install NL chart of account on this company (Netherlands Accounting package).
- Create a test customer, and don't set any address or set a country not listed in EAS (https://docs.peppol.eu/poacc/billing/3.0/codelist/eas/).
- Create an invoice for this test customer and try to post it.
Before this commit, if a Dutch company had tried to create an invoice for a customer from a country not listed in the Electronic Address Scheme (EAS) codes, Odoo would have given them a traceback error.
Now the code checks if the customer is from an EAS country: if they are, the code renders the bis3 invoice template, if not a UserError is thrown explaining the problem.
closesodoo/odoo#81080
X-original-commit: b637a333450911002af3b755cd1450e9efdef9e4
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: John Laterre <jol@odoo.com>
These errors should not happen in production, it is only helpful for debugging.
The opportunity is taken to limit our debug code to a messaging specific debug,
as debug '1' is used in production to see extra features, and debug 'assets' is
necessary to get decent stack trace.
The easiest way to enable this debug mode at the time of this commit is to
either manually set the value to true in the code, or to type the following line
in the browser console if editing the code is not an option:
`odoo.__DEBUG__.messaging.modelManager.isDebug = true;`
Part of task-2702450
closesodoo/odoo#81075
X-original-commit: f9ae7510c8adaa83379b90f798ee535ede99be25
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
On event model, seats_limited and date_tz are required but are editable stored
fields. An override of create has been added to ensure they have a value as
compute are called after creation which leads to required not being satisfied.
Now that precompute [1] is available this code can be safely replaced.
Performance tests (not yet merged [2]) indicate this has no impact on queries.
What was done manually before this commit is now done directly by the ORM.
[1] odoo/odoo@d04a5b5c8c
[2] odoo/odoo#81068
Task-2702872 (Event precompute)
closesodoo/odoo#80672
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
A wrong field is used to control propagation of questions from event template
to child events. Currently an event template must use automated emails to
propagate its questions, instead of correctly checking the question enabled
field use_questions.
As most templates use automated email this was not seen before.
Task-2702872 (Event precompute)
Part-of: odoo/odoo#80672
When consulting the Purchase Analysis, the measure "Days to Confirm" may
not be easily understandable
To reproduce the issue:
1. Create a purchase order PO:
- Order Deadline: <today + 10 days>
- Add 2 products
2. Confirm PO
3. Purchase > Reporting:
- Measures: Days to Confirm
- Group By: Order
Error: For PO, the value of "Days to Confirm" is -20, it should be -10
The report computes the sum of the delay (i.e., "Days to Confirm") of
each purchase order line. Computing an average seems more relevant
A similar flow could be reproduce with the measure "Days to Receive"
(i.e., the difference between the Order Deadline and the Receipt Date)
OPW-2678673
closesodoo/odoo#81053
X-original-commit: da3fa1f8887e06e7a86e761ef844f79cc0d06e6f
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
How to reproduce the problem:
- Install the website_sale module and the German language (and
activate it for the website).
- Go to the website, and choose the German language.
- Add a product to your cart and checkout.
=> on the checkout page, the button "Pay Now" is not translated (
"Confirm Order", if the total amount = 0)
These terms are now added for translation.
The terms were incorreclty formatted in the xml and were not
picked up for translation export. Introduced by this commit:
https://github.com/odoo/odoo/commit/573ed74c121c1572b3fab6f9553ed7f93f7b3f99
opw-2686463
closesodoo/odoo#81056
X-original-commit: 166c19d5e9018332a63c1c82dd4268fd1224332b
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Roose Pierre-Rodéric ( prro) <prro@odoo.com>
Avoid iterating over all channels every time a new channel is added.
Part of task-2702450
closesodoo/odoo#81051
X-original-commit: 5359a8c354b0a6106d462fe8f047de946614b7b1
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, the context coming from the action was
merged with the context of the search items to generate the
context of the filter to save, when the user clicked on "Save
current search", whereas it should not.
There is an ActionService test attesting it, but it currently
uses a ListView, which is still legacy, so the new faulty code
wasn't tested.
closesodoo/odoo#81049
X-original-commit: 2d76b33142cf2bf451d4730c035af75c3243da6f
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Steps to follow
- Click on a product from a sale.order.line
- The form is switched to edit mode
-> We can't go to the product page
Cause of the issue
The quick edit feature was introduced in saas-14.4
Solution
- remove the 'no_open' attribute from the product
opw-2688863
closesodoo/odoo#81047
X-original-commit: 57d662c4817b83a8f166d11bf35b4b73206704b0
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
How to reproduce:
- Switch to an Indian-based company
- Create a non-Indian customer and set gst treatment
- Create a subscription for the new customer
- Generate an invoice for the subscription
- The gst-treatment field will be empty
Bug:
When creating a new account.move object, the gst treatment is not copied.
closesodoo/odoo#80966
Opw: 2662308
X-original-commit: a1f0ae25f8b96a5ff5691aa0b9ffeb62033932bf
Signed-off-by: Laurent Smet <las@odoo.com>
*: base_address_city, base_address_extended, bus, crm, im_livechat,
l10n_ae_pos, lunch, pos_restaurant_adyen, test_assetsbundle,
test_converter, test_lint.
It is spelled `auto_install`, the `complexity` key is long gone, `qweb`
has been moved to `assets: {'web.assets_qweb': []}`. `js` and `css` are
long gone too, `maintainer` is redundant with `author` which is
"Odoo S.A." by default already, the `certificate` key is long gone.
closesodoo/odoo#80988
Related: odoo/enterprise#22766
Signed-off-by: Julien Castiaux <juc@odoo.com>
To ease debugging in general, avoid having multiple methods with the same name,
especially in the same file.
This is especially useful when the method name appears in a stack trace, for
example in the performance tool.
Part of task-2702450
closesodoo/odoo#81020
X-original-commit: c3673e63064c7f331754ef0e9d02cbbe7b1927f4
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Avoid iterating over all listeners that are observing a field, instead store
the fields observed by a listener and access it immediately.
Part of task-2702450
closesodoo/odoo#81019
X-original-commit: bf69834b933c54598bbd82d8fbfcac4a0393c067
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
With recent update to computed fields [1] order responsible is now always
changed to the partner responsible, or its commercial entity responsible.
This cause issues, notably with ACLs 'own documents only'. Indeed a salesperson
could update or set a partner on an order that would change the responsible and
lead to ACLs issues. Moreover some functional flows automatically set a partner
(online registrations, ...) that would make the responsible change without a
clear notification or warning.
We prefer to keep a less intrusive behavior, aka setting a responsible when
no one is set.
Task-2703285 (event performance)
Task-2703289 (event testing)
[1] odoo/odoo@210c9daebcclosesodoo/odoo#81025
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
mass_mailing_demo has a missing space separating two classes in its
mass_mail_1 template. This restores it.
X-original-commit: a104d4279b0438a05dc4b739fbc4e95e7038e6aa
Part-of: odoo/odoo#80621
For email design in the context of Microsoft Outlook, we want to keep
some magic Microsoft comments (Outlook conditional comment), which -
until this commit - were skipped by QWeb. These allow us to change the
rendering exclusively for Outlook so as to overcome some of its
limitations. This commit introduces a qweb rendering option
(`preserve_comments`) for when - like in mass mailing and digest - we
want to keep comments.
Part-of: odoo/odoo#80621
This adds a test sending a mail with comments (MSO conditionals) in
mass_mail mode.
X-original-commit: 8778c10bc1856e57216785a8332b90878ff1b5ef
Part-of: odoo/odoo#80621
This ensures that every `table` element has its contents wrapped in a
`tbody` element, and that that element has its default vertical
alignment replaced with "top" to mimick the grid it's converted from.
X-original-commit: ddf047be9f49ac408c44de26b65ef50be88873b5
Part-of: odoo/odoo#80621
`_replace_local_links` ensures urls are given as absolute rather
relative paths, for link `href`, img `src` and within styles. This
failed when the style contained escaped single quotes (eg:
`background-image: url("/my_url/path");`). This commit adapts the
failing regex appropriately.
X-original-commit: 2af980e8cdc72d35729ef2fbaf5067fe7e72bbb8
Part-of: odoo/odoo#80621
This adds a test for the _replace_local_links function of mail render
mixin, in the case of urls in style attributes.
X-original-commit: 199b45c7f6b0155d3828487b2f7771e1500820b1
Part-of: odoo/odoo#80621
On converting emails for mail client compatibility, masonry showed a few
sizing issues, which are fixed with this commit.
X-original-commit: cfcc498c828b542552b098d6f3a58924abddb091
Part-of: odoo/odoo#80621
When converting a mailing for mail client compatibility, we guarantee a
height for each image. When none can be found, or in the special case of
media_list, that height should however not be forced so the client can
make it take the full height of the cell automatically. This is what is
accomplished by this commit.
X-original-commit: e80433335020a52d8f683060e98047f5ce77b054
Part-of: odoo/odoo#80621
The following structure is not always properly rendered in mail clients:
```html
<table>
<tbody>
<tr>
<td>
<h1>Text</h1>
<p>Text</p>
</td>
</tr>
</tbody>
</table>
```
where the h1 and p can be any block-level element.
This prevents that from happening by wrapping each block in a separate
row/column combo like so:
```html
<table>
<tbody>
<tr>
<td>
<h1>Text</h1>
</td>
<tr>
<td>
<p>Text</p>
</td>
</tr>
</tbody>
</table>
```
X-original-commit: 01404499277b63dc64a5a26a93bc419cca092440
Part-of: odoo/odoo#80621
Some code from odoo-editor utils is needed in convertInline. In order to
avoid duplication, we need to import that code. To that effect, we can't
have the utils being lazy loaded into mass mailing's iframe while
convertInline is loaded the usual way.
This loads the lightweight utils together with convertInline and turns
convertInline into an odoo-module, which makes it easier to simply
import the utils and delete duplicated code.
X-original-commit: 067c94b009609caa0bd78a75b826247e37557417
Part-of: odoo/odoo#80621
When converting bootstrap grids into tables, we have to move the
containers' paddings into the cells, otherwise they would not render
properly in all mail clients. Before this fix, verical padding was moved
to each cell, which is wrong: it should be applied to the first (top)
and last cell (bottom) only, which it now is.
X-original-commit: 43112d417f70ac0086fbed2a704f208530d31f87
Part-of: odoo/odoo#80621
When converting a div to a table, we apply some styles to undo the
table's default styles. This makes sure these styles don't override any
inline styles the div might have been holding.
X-original-commit: 0fad86b330a0e1a3228bbbe76fd2b7370cff3eb0
Part-of: odoo/odoo#80621
When selling a storable kits, the consumable components should be
ignored in account lines
To reproduce the issue:
(Need account_accountant,sale_management,mrp)
1. Create a product category PC:
- Costing Method: FIFO
- Inventory Valuation: Automated
2. Create 3 products P_kit, P_compo01, P_compo02
- P_kit:
- Type: Storable
- Category: PC
- P_compo01
- Type: Storable
- Category: PC
- Cost: 5
- P_compo02:
- Type: Consumable
- Category: PC
- Cost: 6
3. Update P_compo02's on hand qty: 1
4. Create a bill of materials:
- Product: P_kit
- Type: Kit
- Components:
- 1 x P_compo01
- 1 x P_compo02
5. Create & Confirm a sale order SO with 1 x P_kit
6. Process the related delivery
7. Create & Post the related invoice
Error: The journal items of the invoice are incorrect, the value of
Expenses and Stock Interim (Delivered) are $11 instead of $5. The
consumable components should be excluded from this value
OPW-2604084
closesodoo/odoo#81015
X-original-commit: 5de451008552ef9b9c675b34178482d81ff42b89
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
Before this commit, the following traceback would appears when a sale order template was used in rental with rental products.
```py
super()._compute_name()
File "/home/arj/PycharmProjects/odoo/addons/sale_management/models/sale_order.py", line 187, in _compute_name
line.name = line.with_context(lang=line.order_id.partner_id.lang).name + line._get_sale_order_line_multiline_description_variants()
Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/arj/PycharmProjects/odoo/odoo/http.py", line 643, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/arj/PycharmProjects/odoo/odoo/http.py", line 301, in _handle_exception
raise exception.with_traceback(None) from new_cause
AttributeError: 'sale.order.template.line' object has no attribute 'order_id'
2021-12-07 14:27:34,267 95502 INFO subscription werkzeug: 127.0.0.1 - - [07/Dec/2021 14:27:34] "POST /web/dataset/call_kw/sale.order.line/onchange HTTP/1.1" 200 - 16 0.009 0.025
```
closesodoo/odoo#80979
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
To reproduce:
1. Install pos_discount and pos_coupon.
2. Start a session and add item to the order.
3. Add global discount.
4. Change global discount. Stuck.
This is because in some modules, get_orderlines is overridden. Instead
of returning the original object containing the orderlines, it returns
a different array instance containing the lines. This is the reason the
while loop is stuck. With this change, whether get_orderlines return the
container or a copy, we are sure that it won't be stuck in the for loop.
closesodoo/odoo#81011
Task-id: 2697861
X-original-commit: 6d78748794a2db3f324312fc773f7a48fd0ffba4
Signed-off-by: Masereel Pierre <pim@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Before this commit, the default assignee set to a rating in a task is
always empty because we check if the `project.task` has a `user_id`
field to give the partner of this user.
Since it is no longer the case because we can recently assign many users
to a task. That is, it is `user_ids` field and no longer `user_id`
field.
This commit overwrites `rating_get_rated_partner_id` method to set by
default the partner of the user contained in `user_ids` field if this
field contains at most one user. Otherwise, we set no partner. We choose
to not select the first user in the user_ids field because we cannot
consider it is the responsible of the task and not another one.
We cannot create a rating per user because the rating average will no
longer right because at the beginning of the task we could have 5 users
and after we could have more users or less users and so the number of
ratings for this task could be different each time we send a rating
review to the customer.
Part of task-2696911
closesodoo/odoo#81009
X-original-commit: 88e7d270bee962d6e4d40f6b62d25a9519abfcf2
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
Before this PR, the delete button was completely invisible on image with white
background.
task-2709788
closesodoo/odoo#81000
X-original-commit: fd1e05cd131273504e7e6cd4f64f6ea63514b6b7
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This is a bunch of fixes (65 corner cases) for the search on
company-dependent fields:
Without a default value:
- `char` fields:
- operators `not like`/`not ilike` don't return records with unset value
- `(..., '=', False)` doesn't return records with unset value
- `(..., '!=', '<string>')` doesn't return records with unset value
- `(..., 'in', [..., False])` doesn't return records with unset value
- `(..., 'not in', value)` without `False` inside `value` doesn't return records with unset value
- `date` and `datetime` fields:
- `(..., '!=', <Date/datetime>)` doesn't return records with unset value
- `(..., '=', False)` doesn't return records with unset value
- `many2one` fields:
- operators `not like`/`not ilike` don't return records with unset value
- `(..., 'in', [..., False])` doesn't return records with unset value
- `(..., 'not in', value)` without `False` inside `value` doesn't return records with unset value
- `boolean` fields:
- `(..., '=', False)` and `(..., '!=', True)` don't return records with unset and `False` values
- `integer`/`float` fields:
- `(..., '!=', <number>)` doesn't return records with unset value
With a truthy default value:
- `many2one` fields:
- operators `not like`/`not ilike` don't return records with unset value
- `(..., '=', False)` returns the record with the default value (which isn't `False`)
- `boolean` fields:
- `(..., '=', False)` doesn't return records with unset and `False` value
- `(..., '!=', False)` returns records with unset and `False` value
- `integer`/`float` fields:
- all `(..., operator, value)` which include value 0, return all records with unset value, even if the default value does not satisfy the domain
closesodoo/odoo#80994
X-original-commit: 3e3be652ece83420782070bdb13da2c3a4930046
Signed-off-by: Raphael Collet <rco@odoo.com>
Expected behavior :
Project manager can change task's project of any task including timesheets
Current behavior :
When Project manager with `Timesheets : See own timesheets` permission is updating task's project, an Access Error exception is raised `Only a Timesheets Approver or Manager is allowed to modify a validated entry.`
Steps to reproduce :
*Use demo data to make steps easier*
- Install Project and Timesheets
- Go to Project and select one
- Select any Task
- Edit it and try to change the Project
Reason :
When a user is a project administrator, he can still have basic permissions in Timesheets (`Timesheets : See own timesheets`), which prevents him from modifying the task's project if the task has some validated timesheet
OPW-2646233
closesodoo/odoo#80973
X-original-commit: 41907c6722da5b4777cc3b8065f4057b0a5f0801
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Simon Goffin <sig@odoo.com>
Signed-off-by: Claude Thibault (thcl) <thcl@odoo.com>
This commit adds an index on picking_type_id for models stock.picking
and mrp.production.
Filtering on picking_type_id is often done via the Inventory Overview.
This should speed up the list render in case of many object.
Task : 2648449
closesodoo/odoo#80434
Related: odoo/upgrade#3068
Related: odoo/enterprise#22535
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
This commit rename product_uom_qty into reserved_uom_qty and product_qty
into reserved_qty on stock move line to stop mistake them with the stock
move quantities fields.
Task: 2648449
Part-of: odoo/odoo#80434
The stock convention on location name is always to name the destination
`location_dest_id`. It was not the
case on the stock rule model
Task: 2648449
Part-of: odoo/odoo#80434