Before this commit, the computed field _compute_is_system make a write which
one is a bad practice and trigger a lot of others calls on res.user model.
opw-2716468
closesodoo/odoo#81555
X-original-commit: f85a67935c5dfa660e94f9bed8e8058c8df256cc
Signed-off-by: Jérémy Kersten <jke@odoo.com>
Since commit [1], the user context wasn't put in the context
sent when executing a server action (only the context of the
action sent). This commit fixes the issue.
[1] 7354d1686915ec21437fc677f15a6c5409106492
closesodoo/odoo#81552
X-original-commit: fee371be291ba3d6f1adc71c08420b6510fdf386
Signed-off-by: Géry Debongnie <ged@odoo.com>
Before this commit, the ir.rule called `timesheet_line_rule_portal_user`
is added just for the project sharing and have to be unarchived when at
least an external collaborator is added into a project. But this rule is
never unarchived.
This commit archives/unarchives the ir rule when the condition is
satisfied.
part of task-2648955
closesodoo/odoo#81553
X-original-commit: a6f0aaeea8b621040559738d7b27d320b6208b58
Related: odoo/enterprise#22956
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Purpose of this merge is to clean and add tests for event application and
its sub modules.
We notably
* clean common files, lessen "shared" data and make tests more localized;
* remove manual patch of datetime to use freezegun;
* add more tests in test_event_full about synchronization with event
types and seats computation;
* add some performance tests;
* add performance tests around page browsing and registration flow;
Task-2703289 (Event testing and coverage)
Preparing Task-2703285 (Event performance improvements)
Somehow related to Task-2341656 (Event submenus shenanigans)
closesodoo/odoo#81068
Related: odoo/enterprise#22783
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose of this commit is to add performance tests for some commonly used
URLs related to event: the main event page and browsing a given event.
A complete registration tour involving buying tickets, answering questions
and filling billing information is also added under a query counter check.
This allows to see a bit how many queries are involved in that flow. To
ease reproduction a data is added but not imported, allowing to quickly see
what happens locally instead of having to debug tests.
Task-2703285 (Event performance improvements)
Task-2703289 (Event testing and coverage)
Part-of: odoo/odoo#81068
Add performance test for event and registration creation. This serves as a base
for future cleaning and improvements for both models and performance in event
models targeting v16.
Task-2703285 (Event performance improvements)
Task-2703289 (Event testing and coverage)
Part-of: odoo/odoo#81068
Add some classes and name on some DOM elements easing tests writing. Otherwise
xpath are hard to write, especially in tours where it can quickly become a
PITA to write and update.
Task-2703285 (Event performance improvements)
Task-2703289 (Event testing and coverage)
Part-of: odoo/odoo#81068
With this commit we ensure website_menu field is computed before calling
create. Indeed otherwise it is computed after the create if value is not
given and stays to False. This is due to the compute that does not distinguish
a False value from user from a False value added as default. This breaks
the event type -> event synchronization when no form view is used (either
through UI or in code).
With this commit, it is computed before resuming the creation and field
is correctly synchronized with the template value unless the user gives
a value at create time.
Task-2341656 (Event submenus shenanigans)
Part-of: odoo/odoo#81068
Purpose of this commit is to add tests about template (``event.type`` model)
synchronization when creating an event. Some tests already exist in event sub
addons but this one has all community features activate. It eases checking the
final result.
Tests about seats computation and registration creation prevention due to
limits are also added as this behavior may be re-implemented soon.
Task-2703285 (Event performance improvements)
Task-2703289 (Event testing and coverage)
Part-of: odoo/odoo#81068
Purpose of this commit is to make test_event_full globally independent from
other event sub modules testing data. We now define a complete event type
with all sub options clearly activated in a single setup. That way tests
in test_event_full are easier to read, understand and modify.
A custom report replacing badge report is added as the base one is quite
complex. It is easier to test the result with simpler templates.
Task-2703285 (Event performance improvements)
Task-2703289 (Event testing and coverage)
Part-of: odoo/odoo#81068
Use freezegun as it is more easy to use and allow to remove a lot of extra
boilerplate. Indeed manually patching datetime is a PITA as a lot of imports
have to be patched.
A custom patching has to be done for create_date, as it is done using a value
stored on the cursor (cr._now), based on SQL now. As it has nothing to do
with standard python library it cannot be patched using freezegun.
Task-2703285 (Event performance improvements)
Task-2703289 (Event testing and coverage)
Part-of: odoo/odoo#81068
Purpose is to have a common event class for users and useful stuff (customers,
products, ...) but lessen usage of common test data through sub modules.
Indeed having a "global event type" test data updated in various addons is
actually complicated to maintain.
Sub add-ons are updated to use mainly the ``EventCase`` test class holding
users and side data. Data specific to those modules (event type with some
specific configuration notably) is created and used in tests in the given
module only, and not through generic event_type_complex and event_0 test
data anymore.
With this commit tests are more localized to their add-on and modifying data
in a given add-on has less chances to have unwanted side effect in other event
submodules unit tests.
Task-2703285 (Event performance improvements)
Task-2703289 (Event testing and coverage)
Part-of: odoo/odoo#81068
When double clicking a number in the numbers snippet, then typing a new
number, the number line would be merge with the text underneath. This
prevents that by adding a line break in between so they aren't
considered the same line by the editor (an inline with a block as
sibling is a tricky case for edition).
task-2711644
closesodoo/odoo#81551
X-original-commit: 886af1f328a9f1664b0d3e204bf984bfee28b215
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
The wrong classes were declared for the s_blockquote and
s_text_highlight snippets in the selector of so_content_addition. As a
result, these snippets could not be inserted inside other snippets.
task-2711645
closesodoo/odoo#81550
X-original-commit: 8d05470e51b9a48d73f8ffaba4789321523b3129
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
When changing a mailing's background color to black, the text of many
snippets would change to white, even though the mailing's body was
white. This was because said body was applied in css while the mailing's
body was applied with a class that also set the text's color.
This fixes that issue by applying the white background on the body via
such a class rather that via css.
task-2711643
closesodoo/odoo#81549
X-original-commit: 31abb63fca22c73b85912eb9ba2cf08806aab679
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
A traceback was triggered when removing flex styles in convert_inline.
This is fixed by iterating over the styles rather that over all keys of
the style object.
task-2697159
closesodoo/odoo#81540
X-original-commit: 18db94d9fc320c35e811d991fc4a32533d481083
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This adds a `toInline` function that replaces the code that was
duplicated between convert_inline and mass_mailing_widget. The
duplication was confusing and error prone.
X-original-commit: 916582af2d707fc1aa462c6feffa3f5defda75a2
Part-of: odoo/odoo#81540
This simply reorders (alphabetically and public/private), renames and
document (with docstrings) all functions of convert_inline.
X-original-commit: 970a3686b1f5edea97bbf86bf4fadc90cfe63357
Part-of: odoo/odoo#81540
When saving an email, its contents pass through convert_inline to ensure
wide e-mail client compatibility. One phase of that process is the
conversion of classes to inline styles, which involves parsing through
all the styles in all the stylesheets of the document, and matching them
with each element in the DOM. That is an extremely expensive process and
because of that, saving an e-mail can take a very long time depending on
how large the DOM is.
This refactors it for performance gains. Tested on an exaggeratingly big
DOM, what used to take about 12s now takes about 5s.
- The process of parsing through the document's stylesheets is now done
on opening the email (about 500ms) rather than on saving it so we
split the processing time between the two.
- When parsing the stylesheets, we now also preprocess them by grouping
whatever can be grouped together and precomputing the specificity so
as to sort them appropriately. This has the benefit of considerably
reducing the number of rules to iterate over for each element (from
11k+ to 3k+).
- In the process, some things were re-written for improved readability.
X-original-commit: 10e749537186dfb80aee1f2537f3b5804f66cfe5
Part-of: odoo/odoo#81540
This provide tests for the main unit testable functions of
convert_inline, as well as a couple of test utils to that purpose.
X-original-commit: 6a17ff7442a8395663c3e215cc14c057c098d4b5
Part-of: odoo/odoo#81540
This introduces a doctype declaration in the initialization of html
fields iframes and wysiwyg iframes. That prevents the browser from
rendering in Quirks mode[1] which makes tables override the usual style
inheritance patterns. As a result, this fixes an issue with text colors
and alignments that were lost on converting divs to table structures.
[1] See https://developer.mozilla.org/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode
X-original-commit: da5cf4bcac696a73c33d856ac889342fe8670e65
Part-of: odoo/odoo#81540
This covers minor refactors in convert_inline, and adds docstrings to
some of its functions that were missing them.
X-original-commit: 7c67a703ac5874cbd05ab5e82f566499b1e07849
Part-of: odoo/odoo#81540
There was a section of code in `getMatchedCSSRules` that didn't do
anything. Essentially its loop did `a === b ? a = b : break`. As for
what was done before the loop (a = b), it's what is done with the styles
returned by `getMatchedCSSRules` in `classToStyle`.
X-original-commit: 835dba6ec02f1eb4dc43c33fc3bd5eab08032707
Part-of: odoo/odoo#81540
There was dead code in `addTables` that would never get triggered. When
fixing that, the code crashed because of a reference to the wrong
variable. Those two problems are hereby fixed.
X-original-commit: 21dccd1521c654eb9723a93bceda8e3e3ec8cc6a
Part-of: odoo/odoo#81540
When converting an rem size to a pixel size, we sometimes ended up with
values with many decimal places. This rounds them to one decimal place.
X-original-commit: 8f8d5bf93f60560040a37695c3439600d5d88287
Part-of: odoo/odoo#81540
A percentage height will only be applied on an element whose parent has
a set pixel height. This is why convert_inline applies a pixel height to
the parent of each element with a percentage height when possible. But
it failed in the case where said parent also had a percentage height.
This keeps looking up the tree until we find an appropriate suitor for
that pixel height.
X-original-commit: a9b0184087bec08db523a02068cc3d04b5f1381e
Part-of: odoo/odoo#81540
For the purpose of good compatibility across email clients, we need
paddings to be applied to cells rather than to tables. The mechanism in
charge of that wrongly added up the paddings, and excessively rounded
them to integers. This commit fixes these issues.
X-original-commit: 6c6e0c18176b41bd1c6967973d0e774f8094c76f
Part-of: odoo/odoo#81540
When converting a list-group to a table, we sometimes ended up with <li>
in <td> element, which is non-sense and is hereby corrected.
X-original-commit: 41eda109d2fbc0eb6616fb03102a205b945ab9b2
Part-of: odoo/odoo#81540
When converting the last row of a grid to a table row, we may end up
having handled all of its columns, but there is still space in the row.
This ensures we properly insert the columns and fill the row.
X-original-commit: 52c35361a0cc86e87337ef321c1b198d4f8cc3c1
Part-of: odoo/odoo#81540
This fixes an issue with the conversion to table of rows that had such
long columns that they should span more than two rows.
X-original-commit: 4daf4378db023365415994296ea7bac53ecb907c
Part-of: odoo/odoo#81540
Prior to this commit, it was impossible to change the background color
of many columns (eg.: Big boxes). This was because the selector for the
option had likely not been adapted along with the snippet structure.
task-2711618
closesodoo/odoo#81538
X-original-commit: 9db006a6f2f5f1f8e6fd29ca0c0b5157988fb710
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit, `XmlHttpRequestError abort` could show up as client error
with an empty stack trace.
see task-2664831
closesodoo/odoo#81531
X-original-commit: 3bd542cef735512700431b32ad2ab93834769a99
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
And make configurable via an ICP. Provide a reasonable default value,
and use it as a lower bound so user error can't lead to an insecure /
unsustainable amount of hashing.
Aside from being somewhat overdue on account of age (passlib's current
default were last updated 6 years ago), this is also made much more
feasible by API keys, meaning non-interactive use (RPC) is less
strained by the (interactive) password hashing.
Also modernize passlib usage:
* Remove global `DEFAULT_CRYPT_CONTEXT`, create inline (as overhead
should not be too huge given what we're doing with it), and
`ormcache()` for safety, the caches should be invalidated on any ICP
addition, removal, or update, so user update to the rounds
configuration should get reflected immediately.
* Switch on `deprecated=["auto"]`, feature was added in 1.6 and we now
depend on 1.7.
* Remove mentions of `encrypt`, it is deprecated in 1.7.
closesodoo/odoo#81498
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
**Description of the issue/feature this PR addresses:**
Lunch App: not able to place lunch orders from the list view of Lunch App -> My Lunch -> New Order list
**Current behaviour before PR:**
Create button visible on the Lunch App -> My Lunch -> New Order list view. when we click on it nothing happens.
**Desired behaviour after PR is merged:**
Like v14 Create button will be invisible and able to add an order from Lunch App -> My Lunch -> New Order by clicking on any records from the list view
Fixes#78272
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
closesodoo/odoo#81514
X-original-commit: 7026dc8357c29451dbcff132dc19c60614e38b82
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Access /base/static/img/country_flags/fr.png, 404 file not found but it
exists.
The conditional was wrong. We should load static files when the addon is
installable OR that it contains assets.
Code before 2e29a93:
expr = not manifest or (
not manifest.get('installable', True)
and 'asset' not in manifest
)
if expr:
continue
...
Code after 2e29a93:
expr = manifest and (manifest['installable'] or manifest['assets']
if not expr:
...
Proof:
a is manifest
b is manifest.get('installable', True)
c is 'asset' in manifest
expr = ~a | (~b & ~c)
~expr = ~(~a | (~b & ~c)
= a & ~(~b & ~c)
= a & (b | c)
Fine-tuning of 2e29a93closesodoo/odoo#81509
Signed-off-by: Raphael Collet <rco@odoo.com>
Rename javascript model 'mail.attachment' to 'Attachment' in order to
distinguish javascript model from python model.
Part of task-2701674.
closesodoo/odoo#80601
Related: odoo/enterprise#22609
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
When you need to add certain details to the data in order to make a
maintenance request. I can't do it using the old code.
As a result, I've included a hook method to be more flexible with
customers.
closesodoo/odoo#81052
X-original-commit: a71a8fbc43cf0deee669869792b2ff2ac9ab9a8b
Signed-off-by: Arnold Moyaux <arm@odoo.com>
- Set up a POP account
- On the POP account, receive emails addressed to various recipients,
e.g. `my_alias_1` and `my_alias_2`. Receive more than 50 emails to
`my_alias_2`.
- In Odoo, create a mail alias for `my_alias_1`
- Run the fetchmail cron
The cron runs endlessly until it is killed. In the logs, inconsistent
messages are shown:
```
...
Fetched 3507 email(s) on pop server xxx; -16493 succeeded, 20000 failed.
Fetched 3507 email(s) on pop server xxx; -16543 succeeded, 20050 failed.
...
```
First the message count is incorrect in the log. We fetched at most 50
emails, not the total number of emails. Then, the endless loop is due
to the fact that
- we do not delete failed messages (= messages addressed to
`my_alias_2`)
- we always fetch messages from `num=1`
If the first 50 messages fail, we fetch them endlessly until the cron is
killed.
To avoid this, we compare the number of failed messages with the number
of messages retrieved. If all messages retrieved have failed, we stop
the loop.
After the fix, consistent messages are show in the logs and the process
stops after the first complete failure:
```
start checking for new emails on pop server xxx
Fetched 50 email(s) on pop server xxx; 0 succeeded, 50 failed.
```
Note that it doesn't solve the core of the issue; we just fail faster. A
proper way would probably be to use an offset so we don't always start
at `num=1`. On the other hand, it is just a matter of time before the
cron times out: if the mailbox is full of messages which canot be
treated, we will just spend more and more time trying to find the ones
which can be treated.
closesodoo/odoo#81493
X-original-commit: 72cd8d0769097b21bbf94a34496888617058cb1b
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Rename javascript model mail.volume_setting to VolumeSetting
in order to distinguish javascript model from python model.
Task-2701674
closesodoo/odoo#81479
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Steps to reproduce:
- Install and launch sales
- In settings: activate price lists and discount; price list based on advanced rules
- Create a new price list; based on percentage (54%)*; applicable on all products; show discount
- Make sure the Public Price List has show discount activated
- Create a new quotation
- Select the Test pricelist
- Select a product (price 0.03 eur/$/other)*
- Change the price list to Public price list
- update the prices
- change the price list to Test price list
- update the prices
-> The Discount shown is not the one defined in the price list (66.67%)*
*(values for my example)
Solution:
Use the real price and not the a posteriori-rounded price for the computation of the discount in the `update_prices` method.
opw-2677884
closesodoo/odoo#81395
X-original-commit: 986dbc20952caae9d5a1b4b7ee34cfb994dea077
Signed-off-by: yosa-odoo <yosa@odoo.com>
In this commit, we add the 'rating' field to the list view of 'project.task'.
Also, make the field optional and hidden by default.
rating_text field will be used to search tasks and tickets by rating text.
closes#78973
task-2667754
Related: odoo/upgrade#3031
Related: odoo/enterprise#21880
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
-if an analytic tags are inserted on the project, it will be added to the timesheet /invoice
analytic tag.
-In this commit, analytic tags field is added on project in order to gain in
granularity.Those tags are passed to the invoice lines generated from the
project's SO lines.
-set the analytic account and analytic tag of the project by default on its tasks.
-added string 'Analytic Tags' analytic_tag_ids field on task.
closes#78973
task-2667754
The aim of this commit is to make the cogs generation multi-company
safe.
2 bugs are fixed in this forwardport commit:
- The product.valuation on the line wasn't evaluated in a company safe
way.
- cogs method weren't company safe either
Before this commit:
- When posting an invoice from company B with both company A and B
selected and A being selected as "main", the cost from company A could
be selected instead of cost from company A to create the anglosaxon
lines.
- If company B's product isn't in real time valuation, cogs aren't even
created.
After this commit:
Whatever the selected companies are, the cost selected will always be from
the company that created the invoice.
closes odoo/odoo#81492
Task: #2686104 and #2713607
X-original-commit: e34caf0ec33a3001bb6343e02d34a6edb5a9f609
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Brice Bartoletti <bib@odoo.com>
Currently Bank Suspense Account has "Current Liabilities" type, while it should be "Current Assets"
Task ID: 2702804
closesodoo/odoo#81491
X-original-commit: c6d2a50499744a9ddbb09a9974d6ab52116ef542
Signed-off-by: Laurent Smet <las@odoo.com>