Commit Graph
148164 Commits
Author SHA1 Message Date
alt-odoo 6e7d7f780d [FIX] project: allow regular user to share project in edit mode
If a user without Administration/Settings rights tries to share a
project in edit mode with a collaborator, an access rights error is
currently raised when creating the portal user. We should not create
any user instead, as there is a signup link sent to the partner anyway.
He can then set up his password without having to click on Reset
password, which was not user-friendly anyway.

closes odoo/odoo#84001

X-original-commit: 8de8c196a137f4ebbf67d7c7c83fee36f873f5c8
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-02-04 17:56:39 +00:00
Nicolas (vin) d0c3e6cba1 [FIX] account: fix tax line partner assignation
When creating a new invoice by giving it an invoice_line_ids list for
which the last line is a note, the tax line may be created wrongfully
without partner_id, which is totally wrong.

To reproduce :

Create a SO
Set a customer
Insert a product with tax
Insert a note
Deliver the product
Invoice the SO and confirm the invoice
The partner_id is not set on the created tax line

While the issue only arises in 15.0, it brings to light that the partner
is not in the grouping keys while it should, so it will be changed in 13.0+

opw-2750851

closes odoo/odoo#83999

X-original-commit: 2ce994d279126aa0356b86d3fa38b699e9035e54
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-02-04 17:56:35 +00:00
Anh Thao Pham (pta) 440be3f9e2 [FIX] mail, mass_mailing: fix picture of masanry snippet in mailing test
- Go to Email Marketing and create a new mailing
- Add Masonry snippet in mail body
- Send a test mail
The picture of the Masonry snippet is missing.

The masonry image is displayed with CSS via background-image attribute.

There are 2 causes for this issue:

1) The relative url cannot be converted to an absolute one.
This is due to the &quot; entity used to surround the url that is not detected.

style="background-image: url(&quot;/web/image/mass_mailing.s_masonry_block_default_image_1&quot;);"

2) html_sanitize is applied to mail body, but html_sanitize doesn't allow
background-image style attribute.

opw-2735636

closes odoo/odoo#83998

X-original-commit: cdcef228aa30d7dd4081fa25a1aab4811acda3ad
Signed-off-by: Antoine Guenet <age@odoo.com>
2022-02-04 16:54:09 +00:00
Alvaro Fuentes 45631cfcea [FIX] project: MemoryError on _compute_attached_docs_count
When there are multiple projects and many tasks the compute of
project.project.doc_count may raise a `MemoryError` on access to the
projects kanban view.

This issue may appear since the addition on 642fb2e6 of docs_count field
to the kanban view `view_project_kanban`.
https://github.com/odoo/odoo/blob/136808203545eb5d7056d941f3fc250f2871f95b/addons/project/views/project_views.xml#L613
This provokes too much information to be prefetched by the ORM, in
particular the `description` fields of the tasks which may be big (e.g.
contain embedded images).

This issue was observed during upg-101057

closes odoo/odoo#83997

X-original-commit: 6c207ed1027d9b39eecd19886932b17f1a79dccd
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-02-04 16:54:04 +00:00
jpr-odooandBenoit Socias 1bd4f3c7bd [IMP] base, website: prefill the country phone code in website forms
Before this commit the phone fields inside forms did start in a blank
state.

After this commit the empty phone fields are pre-filled with "+" and the
country phone code.
The country is determined based on the IP address with the GeoIP
database.  The phone code is obtained from `res.country` where it is
kept in cache.

task-2463563

closes odoo/odoo#78068

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Co-authored-by: Benoit Socias <bso@odoo.com>
2022-02-04 16:53:54 +00:00
Pierre Masereel f914d42fee [FIX] point_of_sale: epson kitchen printer cannot render
When printer of type Epson are created for kitchen the pos model is not
passed, and so the rendering of the receipt does not working for
printers added that way.

We are now correctly passing the pos model.

OPW-2745009

closes odoo/odoo#83976

X-original-commit: 00713acce939df99016bdc71a8e9132fb564e978
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2022-02-04 15:26:37 +00:00
oco-odoo 5033a532c8 [FIX] account: fix labelling on payment's partner_bank_id
In the for view of account.payment, when creating an inbound one, the partner_bank_id field was always labeled either "Customer Bank Account" or "Vendor Bank Account". This was wrong, as this field contains the bank accounts receiving the payment, so in case of an inbound operation, it's the company account. We hence add a third possible label for it in that case.

closes odoo/odoo#83974

X-original-commit: c55f2e6aa88d01bc4f26bee7c6303f53e5bb8e48
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Olivier Colson <oco@odoo.com>
2022-02-04 15:26:33 +00:00
Ivàn Todorovich f4a417b124 [IMP] delivery: use the orm cache on _remove_delivery_line
closes odoo/odoo#79110

Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-02-04 14:03:41 +00:00
Josse Colpaert 1247f5dba0 [IMP] account: put country_code field in debit note and reversal wizard
closes odoo/odoo#83943

Signed-off-by: William André (wan) <wan@odoo.com>
2022-02-04 13:06:58 +00:00
Mitul Shah dc5b7ecbf8 [FIX] calendar: remove the 'With Username' in meeting invitation email
Before this Commit,
While creating a custom appointment, The appointment name has 'Username'
and invitation email also has 'Username'. When a customer receives the
invitation email, The 'username' gets twice.

After this Commit,
We have removed the 'With username' part from the default email template.

Task-2713963

closes odoo/odoo#82894

Related: odoo/enterprise#23197
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-04 13:06:54 +00:00
Christophe Monniez 8cc0a225a5 [IMP] core: bump master release to 15.3 alpha
closes odoo/odoo#83945

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-02-04 11:48:34 +00:00
sofiagvaladze 26a5653f48 [IMP] hr_expense, sale_expense: improve UX (back2basics)
Enterprise PR - odoo/enterprise#23980
Upgrade PR - odoo/enterprise#3206

- UI improvements/changes

- Taxes

    Before this commit, in case taxes were defined on expense,
    the tax amount was added on top of a product price.
    For example, in case product price was 100$, and tax - 15%,
    then expense.total_amount would be 115$.

    Now, tax amount is included in expense.total_amount. To accommodate
    this change, we set following domain - ('price_include', '=', True)
    on tax_ids on expense.

    For the same example, expense.total_amount would be 100$, tax amount
    would be 13.04$ and untaxed amount - 86.96$.

    But, tax amount can be set for non-zero expenses (in case expense.product_id.standard_price !=0).
    For the above example, one could set tax amount to 15$.
    As a result untaxed amount will be 85$ and total amount - 1OO$.

- Journal entry

    Previously, in case journal entry was reset to draft, canceled,
    reversed - it changed the state of the linked expense report.
    Now, actions done on accounting by accountant does not impact expense reports.

task - 2687999

closes odoo/odoo#81904

Related: odoo/upgrade#3206
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-02-04 10:23:43 +00:00
Odoo's Mergebot 3b54f9213e [IMP] web, mail, *: use Yes/No instead of True/False for boolean fields
Purpose
=======
"True" and "False" are not very user-friendly, especially for
non-technical people. Instead, we want to have "Yes" or "No" which have
more sens for non-technical people.

This change is done for the the custom filter and the tracking messages.

Task-2648390

closes odoo/odoo#79911

Related: odoo/enterprise#23863
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-04 10:28:13 +01:00
std-odoo d44e591ca9 [IMP] web: use Yes/No instead of True/False in views when grouping
Purpose
=======
When we group the record based on a boolean fields, we want to show
"Yes/No" instead of "True/False".

This has been done for the list view, the pivot view and the kanban
view.

Task-2648390

Part-of: odoo/odoo#79911
2022-02-04 09:28:12 +00:00
std-odoo 36857cdf87 [IMP] mail: use Yes/No instead of True/False in the tracking messages
Purpose
=======
When the value of a tracked boolean field change, we can see in the
chatter "True -> False". It doesn't have that much sens for
non-technical people, and instead we want to use "Yes -> No".

Task-2648390

Part-of: odoo/odoo#79911
2022-02-04 09:28:11 +00:00
std-odoo eddef06ad4 [IMP] web: use Yes/No instead of True/False for the custom filters
Purpose
=======
"True" and "False" are not very user-friendly, especially for
non-technical people. Instead, we want to have "Yes" or "No" for the
custom filters, when we search on a view, which have more sens for
non-technical people.

Task-2648390

Part-of: odoo/odoo#79911
2022-02-04 09:28:11 +00:00
Victor Feyens 405c0dcc9c [IMP] core: warn on duplicate files in manifest data/demo
closes odoo/odoo#83775

Related: odoo/enterprise#23901
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-02-04 07:18:51 +00:00
tsm-odoo dc7d71823d [IMP] mail: add browser key to messaging
closes odoo/odoo#83854

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-03 17:59:46 +00:00
Didier (did) 496c0f0d47 [IMP] mail: cleanup naming in attachmentList model
closes odoo/odoo#83557

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-03 17:59:42 +00:00
stefanorigano (SRI) 8c0d28c3db [FIX] mail: o_Activity, inline avatars alignment
Part of the overall v16 SCSS optimization/restyle (task-2704984).

task-2731819

closes odoo/odoo#82590

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-03 17:08:00 +00:00
stefanorigano (SRI) da5d9e745f [REF] mail: o_Activity, revamp scss
Review and simplify activities SCSS.
Part of the overall v16 SCSS optimization/restyle (task-2704984).

task-2731819

Part-of: odoo/odoo#82590
2022-02-03 17:07:59 +00:00
Louis Wicket (wil) 51a07724d9 [IMP] mail: add test for file upload activity type
Some recent changes have evidenced that the modification of the activity
type of an 'upload_file' activity was not properly covered by the tests.

This commit adds a new test for this specific case.

Part of task-2730667

closes odoo/odoo#82498

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-03 16:14:43 +00:00
Julien Giannone c4bbe13fdf [FIX] mail: click on link in a message preview while replying
When clicking on a mention (or a link) within the preview of the
message we're replying to, there was a traceback because we tried
to update a component which has already been deleted.

closes odoo/odoo#83912

Task-id: 2747321
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-03 15:22:14 +00:00
Luis González 8bf732f050 [FIX] sale: search order lines by order number not working
When searching sale order lines from another model (e.g. task), the
order number was not being considered.

The technical reason for the above is the resulting domaing was like this:

    [
        '|',
        ('order_id.name', 'ilike', 'SO name'),
        ('name', 'ilike', 'SO name'),
        # The below line is added by _name_search of base model
        ('name', 'ilike', 'SO name'),
    ])

So, even though the order number is added to the domain, an extra
condition was forcing the line description to be the only field to be
considered.

closes odoo/odoo#83911

X-original-commit: b5d45d6cae3579970ed55bc65d52c2de2377c381
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-02-03 15:22:09 +00:00
Noe Antoine b68cc2fc02 [FIX] website_slides: restore 'latest created' default promote strategy
To reproduce :
- Create a new documentation course from front-end
- Add a content there
- Edit the course in backend
=> any attempt to save the record or exiting it will trigger an error
as the specific option is set and no content has been manually set.

This has been introduced in 2597345
=> We restore the default 'latest created' that makes it work all the time.

Task-2731468

closes odoo/odoo#83910

X-original-commit: 1973944c0cdd0ea3f706280875acedfbd190333e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-03 15:22:05 +00:00
Antoine Vandevenne (anv) be1f134820 [IMP] payment: stop inserting CSRF tokens in test JSON(-RPC) requests
The CSRF token is not checked for JSON(-RPC) requests.

closes odoo/odoo#83906

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-02-03 15:22:00 +00:00
Sébastien Theys 7d905c232b [IMP] mail: pass classname as props in components (follow up)
Part of task-2694196

closes odoo/odoo#83904

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-03 15:21:55 +00:00
Arthur Gossuin (goa) d624b4fbec [IMP] delivery: add shipping insurance
Shipping insurance is a service which may reimburse senders whose parcels are
lost, stolen, and/or damaged in transit. Since most shipping connectors
provide it, it makes sense to put it in the base directory.

task-2701459

closes odoo/odoo#83896

Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-02-03 15:21:43 +00:00
Nicolas (vin) 45666139ee [FIX] account: bank account config company_id
When trying to set up a new bank account using the bank account wizard,
there is an issue with the check company on the linked_journal_id field.

The check will make sure that the company on that field is either false
or the same as the company on the record. But with a recent change in
68f4534aa5 the bank account company_id will be the one from the linked partner.
As the partners for companies have an empty company_id, this check does
not make a lot of sense anymore, as it would be wrong in most cases.
(We expect a journal with the currently selected company, but the bank
account will in most cases have an empty company_id)

closes odoo/odoo#83852

Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-02-03 15:21:39 +00:00
yhu-odoo 699957fd19 [REV] mrp: don't suggest qty to produce when start workorder
In 9f7e6d2bb6ae0a6b0257edf26a5aa069cd00d78e , when start a workorder, we
always suggest the qty to produce to be the full qty to produce on MO.
If the previous WO produced less than the full qty to produce on MO,
user won't aware of that when start the WO. We revert it in this committ

Task-2678388

closes odoo/odoo#83389

Related: odoo/enterprise#23961
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-02-03 15:21:35 +00:00
0b38cc527b [IMP] account: implementation of storno accounting
Storno accounting is the term used to described the process of recording
a reverse action as a negative amount on the same site instead of a
positive amount on the opposite site of the credt/debit.
For instance, when one creates a credit note for an invoice, the values
of debit and credit will be kept in the same column with negative signs
instead of swapping columns like in non-Storno accounting.

It is a business practice commonly used in Eastern European countries.

Countries where Storno accounting is mandatory or considered as best
practice would be :
Czech Republic, Poland, Romania, Russia, Slovakia, Ukraine, Croatia,
Bosnia and Herzegovina, Serbia, Romania, China, Russia, Slovenia

It is available as an option in the settings and is automatically
activated for some countries which use this type of accounting.

otask-2064899

closes odoo/odoo#79581

Related: odoo/upgrade#3212
Signed-off-by: William André (wan) <wan@odoo.com>
Co-authored-by: william-andre <wan@odoo.com>
Co-authored-by: qdp-odoo <qdp@odoo.com>
2022-02-03 15:21:28 +00:00
Habib (ayh) 676c5b5f69 [IMP] account: enable account type domain filter using the context
Users are able to create accounts without restriction on the type of account to be created. With this commit we provide a context key to limit available account types and thus minimise errors.

part of task-2684816

closes odoo/odoo#80831

Related: odoo/enterprise#22198
Signed-off-by: William André (wan) <wan@odoo.com>
2022-02-03 15:21:20 +00:00
Sébastien Theys 092864b5dd [IMP] mail: use useComponent instead of Component.current
Part of task-2694208

closes odoo/odoo#83898

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-03 14:22:58 +00:00
roen-odoo 52256398c9 [FIX] account : PoS invoice product description
Current behavior :
When creating an invoice from a PoS the description attached to the product was not the same as the one in the SO

Steps to reproduce:
- create a SO from Sales
- create an invoice from the SO
- preview the invoice

- open a POS session
- fetch the same SO
- validate the order with an invoice

compare the 2 invoices, they are not the same

opw-2674896

closes odoo/odoo#83833

X-original-commit: dbd766f1b87f91eefce7b6e5946856961fd96c70
Signed-off-by: Masereel Pierre <pim@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2022-02-03 13:23:43 +00:00
a6f310fca3 [FIX] base: ignore tags in translations matching
When comparing existing translations to new source value
html tag would invalidate existing translations.
The html tags used for styling (coloring, italic, ...) should not
invalidate the translation as the meaning of the text as not changed.

Changed the logic to compare translations based on textual content only.

+ add some tests.

task-2667950

closes odoo/odoo#83895

X-original-commit: 1fe4b0cc1981382cc3d944ec44276f0aee90945d
Signed-off-by: Antoine Guenet <age@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
Co-authored-by: rco-odoo <rco@odoo.com>
Co-authored-by: xmo-odoo <xmo@odoo.com>
2022-02-03 11:45:55 +00:00
Sébastien Geelen (sge) 2e2914e5fe [FIX] web_editor: fix italic and underline in FF
When selecting the text content of a link
the underline and italic commands were not working in Firefox.

We re-implement the Browser command to fix this.

task-2667950

X-original-commit: 52a5b2bb692ab6712d497492f4f2fbef3a9a7874
Part-of: odoo/odoo#83895
2022-02-03 11:45:55 +00:00
boan-odoo 7b29e9d70f [IMP] stock: explain removal strategies in help-text
Ref: https://drive.google.com/file/d/1ObNPHzl8fIeNtmRIMLT60KtHJqOhrd0r/view

Note: also added contextual help to the second occurrence of the
"Removal Strategy" combo in
`Configuration>Product categories>...>Force Removal Strategy`.

closes odoo/odoo#83829

Task: 2654703-1
X-original-commit: 4bae10e0d960e5b80055e0e44056493238e552d3
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-02-03 09:56:07 +00:00
Goffin Simon e91b00d053 [FIX] sale_mrp, stock, stock_account: Decimal Accuracy in Inventory report & Valuation report
Steps to reproduce the bug:

- Go to  Settings > Technical > Decimal Accuracy
- Change Unit of Measure to 4 digits
- Go to Inventory report or Valuation report

Bug:

The decimal accuracy in Valuation report for quantity or reserved quantity was in two digits instead of four digits
The decimal accuracy in Inventory report for qty_at_date was in two digits instead of four digits

PS: In stock move report or stock move line report, the decimal accuracy of quantity fields are in four digits

By default digits of Product Unit of Measure is 3, that's why some test had to be modified

opw:2410981

closes odoo/odoo#82989

X-original-commit: 0cf5c4e8241c46724defc0ea7e0d2c881ec2eeab
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-02-03 09:56:03 +00:00
Moises Lopez - https://www.vauxoo.com/ 088b9c2398 [REF] account_check_printing: Speed-up payment creation
The method constraint to validate the Check Number is slow

1. Analyzing the following query:

```sql
SELECT
    payment.check_number,
    move.journal_id
FROM
    account_payment payment
    JOIN account_move move ON move.id = payment.move_id
    JOIN account_journal journal ON journal.id = move.journal_id,
    account_payment other_payment
    JOIN account_move other_move ON other_move.id = other_payment.move_id
WHERE
    payment.check_number::integer = other_payment.check_number::integer
    AND move.journal_id = other_move.journal_id
    AND payment.id != other_payment.id
    AND payment.id IN (1085159)
    AND move.state = 'posted'
    AND other_move.state = 'posted';
```

The output is:

    Planning Time: 3.354 ms
    Execution Time: 2514.660 ms

Discarding null values

```diff
    AND other_move.state = 'posted';
+    AND payment.check_number IS NOT NULL
+    AND other_payment.check_number IS NOT NULL
```

The output is

    Planning Time: 3.216 ms
    Execution Time: 0.140 ms

2. The constraint is computed even if the payment is not a check (check_number is empty)

Returning early save useless extra computating
It is not needed to compare falsy values for duplicated for whole table

3. The validation to check is it not a number is not optimal

It is transforming the string -> integer -> string to check if the string is not a number
but it is enough using only string -> integer not needed to transform to string again

    python3 -m timeit -u msec -s "check_numbers = [str(i) for i in range(1000000)]" "[str(int(i)) for i in check_numbers]"
        > 1 loop, best of 5: 323 msec per loop

    python3 -m timeit -u msec -s "check_numbers = [str(i) for i in range(1000000)]" "[int(i) for i in check_numbers]"
        > 2 loops, best of 5: 135 msec per loop

It is better but not enough, using `str.isdigit` method is 5x faster than original approach

    python3 -m timeit -u msec -s "check_numbers = [str(i) for i in range(1000000)]" "[i.isdecimal() for i in check_numbers]"
        > 5 loops, best of 5: 64 msec per loop

closes odoo/odoo#83851

X-original-commit: 31e0ed8c957e8a6af7f6bd5d449b450967206eab
Signed-off-by: Olivier Colson <oco@odoo.com>
2022-02-03 09:03:13 +00:00
Gorash e830953570 [IMP] IrQweb: refactoring and add technical documentation
Major changes:
- Remove some of the recursively when compiling
- Compile attributes became a directive
- Compile options became a directive
- `t-field` compilation now uses the same logic as `t-out`
- Simplification of ``t-if`` directive compilation
- Improved handling of errors wrapped by QWebException
- Constants defined outside the class

    Odoo
     ┗━► _render (returns MarkupSafe)
        ┗━► _compile (returns function)                                        ◄━━━━━━━━━━┓
           ┗━► _compile_node (returns code string array)                       ◄━━━━━━━━┓ ┃
              ┃  (skip the current node if found t-qweb-skip)                           ┃ ┃
              ┃  (add technical directives: t-tag-open, t-tag-close, t-inner-content)   ┃ ┃
              ┃                                                                         ┃ ┃
              ┣━► _directives_eval_order (defined directive order)                      ┃ ┃
              ┣━► _compile_directives (loop)    Consume all remaining directives ◄━━━┓  ┃ ┃
              ┃  ┃                              (e.g.: to change the indentation)    ┃  ┃ ┃
              ┃  ┣━► _compile_directive                                              ┃  ┃ ┃
              ┃  ┃    ┗━► t-if            ━━► _compile_directive_if                 ━┫  ┃ ┃
              ┃  ┃    ┗━► t-foreach       ━━► _compile_directive_foreach            ━┛  ┃ ┃
              ┃  ┃    ┗━► t-inner-content ━━► _compile_directive_inner_content ◄━━━━━┓ ━┛ ┃
              ┃  ┃    ┗━► t-options       ━━► _compile_directive_options             ┃    ┃
              ┃  ┃    ┗━► t-call          ━━► _compile_directive_call               ━┫ ━━━┛
              ┃  ┃    ┗━► t-att           ━━► _compile_directive_att                 ┃
              ┃  ┃    ┗━► t-tag-open      ━━► _compile_directive_open          ◄━━┓  ┃
              ┃  ┃    ┗━► t-tag-close     ━━► _compile_directive_close         ◄━━┫  ┃
              ┃  ┃    ┗━► t-out           ━━► _compile_directive_out             ━┛ ━┫ ◄━━┓
              ┃  ┃    ┗━► t-field         ━━► _compile_directive_field               ┃   ━┫
              ┃  ┃    ┗━► t-esc           ━━► _compile_directive_esc                 ┃   ━┛
              ┃  ┃    ┗━► t-*             ━━► ...                                    ┃
              ┃  ┃                                                                   ┃
              ┗━━┻━► _compile_static_node                                           ━┛

closes odoo/odoo#81024

Related: odoo/enterprise#22942
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-02-03 08:09:31 +00:00
Gorash 9ce5bc8881 [IMP] IrQweb: merge Qweb engine file qweb.py and ir_qweb.py
QWeb is the primary templating engine used by Odoo. It is an XML
templating engine and used mostly to generate XML, HTML fragments and
pages.

To create new XML template, please see :doc:`QWeb Templates documentation
<https://www.odoo.com/documentation/15.0/developer/reference/frontend/qweb.html>`

In **input** you have an XML template giving the corresponding input
etree. Each etree input nodes are used to generate a python function.
This fonction is called and will give the XML **output**.
The ``_compile`` method is responsible to generate the function from the
etree, that function is a python generator that yield one output line at a
time. This generator is consumed by ``_render``. The generated function is
orm cached.

In the graphic below you can see theresume of the call of the methods
performed in the IrQweb class.

    Odoo
     ┗━► _render (returns MarkupSafe)
        ┗━► _compile (returns function)                                        ◄━━━━━━━━━┓
           ┗━► _compile_node (returns code string array)                       ◄━━━━━━━┓ ┃
              ┃  (add technical directives: t-inner-content, t-tag)                    ┃ ┃
              ┣━► _directives_eval_order (defined directive order)                     ┃ ┃
              ┃                                                                        ┃ ┃
              ┣━► _compile_directives                              (recursive) ◄━━━━┓  ┃ ┃
              ┃  ┣━► _compile_directive                                             ┃  ┃ ┃
              ┃  ┃    ┗━► t-if            ━━► _compile_directive_if                ━┫  ┃ ┃
              ┃  ┃    ┗━► t-foreach       ━━► _compile_directive_foreach           ━┫  ┃ ┃
              ┃  ┃    ┗━► t-*             ━━► ...                                  ━┛  ┃ ┃
              ┃  ┃    ┗━► t-inner-content ━━► _compile_directive_inner_content ◄━━━━┓ ━┛ ┃
              ┃  ┃    ┗━► t-tag           ━━► _compile_directive_tag               ━┫    ┃
              ┃  ┃    ┗━► t-call          ━━► _compile_directive_call              ━┫ ━━━┛
              ┃  ┃    ┗━► t-out           ━━► _compile_directive_out           ◄━┓ ━┫
              ┃  ┃    ┗━► t-field         ━━► _compile_directive_field          ━┛  ┃
              ┃  ┃                                                                  ┃
              ┗━━┻━► _compile_static_node                                          ━┛

Part-of: odoo/odoo#81024
2022-02-03 08:09:31 +00:00
Gorash 39ce6f02a6 [IMP] Profiler: more QWeb directive informations in speedscope graph
Part-of: odoo/odoo#81024
2022-02-03 08:09:31 +00:00
Xavier BOL (xbo) 3d8d97e2bd [FIX] sale_timesheet: fix pricing_type search method
Before this commit, when a project has no SOL set and has an employee
mapping, then the domain builds in the search method of `pricing_type`
is the following:
`[
    ('sale_line_id', '!=', False),
    ('sale_line_employee_ids', '!=', False),
    ('allow_billable', '=', True),
]`
The problem is we don't need to have a SOL set into the project to
define the pricing_type as employee rate. We should find the project
with at least an employee mapping set in that project.
Moreover, this commit fixes the domain built in the
`_search_pricing_type` method.

Some unit tests are added to check the domain built in the
`_search_pricing_type` method.

The issue has been found during the development of task-2680425

closes odoo/odoo#83874

X-original-commit: 490747c85f2d2e390a44e8f375e24dc3a8425409
Related: odoo/enterprise#23951
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-02-02 21:49:05 +00:00
Antoine Vandevenne (anv) f4ca7290ac [IMP] payment(_*): search only once for the transaction
Before this commit, most acquirers needed to run several successive
searches for the transaction whose reference was received by a
controller in notification data. This is because the security checks
run on the notification data require access to the acquirer through the
transaction record which was immediately discarded.

Starting with this commit, all `*_feedback_data` method are no longer
decorated with `api.model` and can use the transaction record they're
called on if provided. They are also renamed to `*_notification_data`.

task-2737144

closes odoo/odoo#83850

Related: odoo/enterprise#23938
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-02-02 19:50:49 +00:00
Alexandre Kühn 0df4b0029b [IMP] mail, snailmail: convert legacy dialog with t-ref to model
In preparation to using Owl 2 in discuss code.

task-2738648

closes odoo/odoo#83598

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-02 19:50:45 +00:00
Thibault Delavallée ef9429231c [IMP] various: update query counters
Notably after odoo/odoo@f9442f47eb query counters are heavily impacted
and a lot of them has lessened.

closes odoo/odoo#83832

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-02 18:14:54 +00:00
Thibault Delavallée bc9943f188 [FIX] test_mail: re-add groups for notification, allowing bw tests
To ease comparisons for query counters let us try to keep the same test flow
through v15+. We therefore now also compute recipient groups for portal users
for some test models, like before odoo/odoo@faeb5e7fee .

Part-of: odoo/odoo#83832
2022-02-02 18:14:54 +00:00
Thibault Delavallée f9736c0238 [FIX] website_sale/forum: fixup renaming
Somehow a naming update was not correctly applied in all files.

Followup of odoo/odoo@faeb5e7fee

Part-of: odoo/odoo#83832
2022-02-02 18:14:54 +00:00
Arnold Moyaux ef7664bd8a [FIX] stock: b2b pack in reception
Usecase to reproduce:
- Create a planned receipt of 10 product A
- Set quantity done to 10
- Put in Pack

Actual result:
UerError "There is not move line to pack"

Expected result:
Pack them

It happens because since we are in a receipt without suggestion (by
default) then the fields `move_line_nosuggest_ids` is used.
But `_set_quantity_done` on `stock.move` will first try to fill
move line with reservation before creating new ones.
So the move_line_nosuggest_ids will not contain the quantity done
on planned quantity

closes odoo/odoo#83430

X-original-commit: 3c7453a61372d6ecdeae099d49cbc79844c144ae
Related: odoo/enterprise#23767
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-02-02 16:40:49 +00:00
Arnold Moyaux 9ec17ac219 [FIX] stock: Lazy column in multi company
Usecase:
- Install mrp with demo data
- Log in chicago company
- Go to manufacturing list view
-> Access error is raise due to multicompany rule

It happens because the state.res_ids contains all the mrp.production
even in SF company. So it try to read records in the wrong company
and raise the error.

Instead of doing a read, we change that and do a search_read like in the
classic process using the state.domain. So it filter the wrong records
before reading them

X-original-commit: 2077ee3b9312fc511d8fd5d328b5c4e329d9b784
Part-of: odoo/odoo#83430
2022-02-02 16:40:49 +00:00