Commit Graph
159078 Commits
Author SHA1 Message Date
Walid HANNICHE (waha) 7b71480c19 [FIX] base: wkhtml2pdf large documents load
Step to reproduce:

    Edit documents layout in general setting to add logo and background
    select multiple documents (more than 5) e.g. Inventory> delivery slips
    print all documents.

Bug:
background and logo missing on the last documents because the pages
were printed before the browser had time to render them

Fix:
wkhtml2pdf has a default delay of 200 ms (--javascript-delay)
increasing the value will allow large document to load

opw-2951594

closes odoo/odoo#114512

X-original-commit: ac2df93eb3f08696189d010bdfa4187e02a94576
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-03-07 03:53:49 +01:00
Nasreddin Boulif (bon) 8e299fb2ee [FIX] base: fix partner merge wizard
Steps to reproduce:

  - Install `Contacts` module
  - Create 3 contacts with the same name
  - Archive one of the contacts
  - Go to list view
  - Edit search filter to display archived and non archived contacts
  - Select the 3 created contacts
  - Open `Action` menu and click on `Merge`

Issues:

  - Archived partner is set by default as destination partner.
  - Archived partner is not displayed in the list of partners to merge.

Cause:

  - The default destination partner set is the last record of the record
    set returned by `_get_ordered_partner` (where `Archived` partners
    are the last ones in the record set).
  - The field `partner_ids` does not allow archived records.

Solution:

  - Sort the partners to have the archived ones on top (since we took
    the last one).
  - Set `active_test` to False in the context of the partner_ids field.

opw-3205577

closes odoo/odoo#114508

X-original-commit: 8d0cec6844b248d3787bd7d6b8868d930d25e38c
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-03-07 02:57:02 +01:00
Yolann Sabaux e55edef6ae [FIX] account_check_printing: enable increment in new payment
Steps to reproduce:
- Create a new journal Bank
- In Sequence, find the 'New Bank Check" and edit it so the sequence can be 10 number digits long
- Create a Vendor Payments with the the New Banck and Check as a method
- Click on Print a check
- Set the check number to 2147483648 and validate
- Create a new payment with the check method
- Click on Print a check

Issue:
Error is raised

Cause:
As for https://github.com/odoo/odoo/pull/112832 there is a second check in order to increment the check number

opw-3140973

closes odoo/odoo#114496

X-original-commit: 531147bb5fad6372c3742bc061f78687f7f11e5b
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2023-03-07 02:56:57 +01:00
Loan (LSE) a4a0fb233b [FIX] web: JS traceback when trying to load unexisting field
Correction of PR:
https://github.com/odoo/odoo/pull/106101

According to experimental test and documentation:
https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute
> If the given attribute does not exist, the value returned
will either be `null` or `""`
> All modern web browsers return `null` when the specified
attribute does not exist on the specified element.

OPW-3071843

closes odoo/odoo#114494

X-original-commit: a91717ab65e3bee5f4c8d4bb85c18458fd3263c8
Signed-off-by: Loan (LSE) <lse@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Sens Loan (lse) <lse@odoo.com>
2023-03-07 02:56:54 +01:00
Bruno Boi 324ee454da [FIX] web: make the calendar colors cycle
Before this commit:
- When a color index is greater than 55, the CSS class applied does not
  have a matching style.
  Only 56 CSS classes have a matching style: from 0 to 55.

To reproduce:
- Go to Calendar, edit an event and add an attendee having an id greater
  than 55. When displayed, the event does not have a proper color.
  It has the default FullCalendar color instead.

After this commit:
- The colors will cycle through 55 colors, from color 1 to color 55.
  (Color 0 being the value for "no color", which is some kind of gray)

closes odoo/odoo#114491

X-original-commit: eda4e12202a1bf6459009b41313f9af4b4dc326b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-03-07 02:56:51 +01:00
Louis (loco) 5d88137d2b [FIX] web, website: restore the use of the scroll to top button
Steps to reproduce the bug:
- Go to the website and edit a page.
- Make sure there is enough content to be able to scroll the page.
- Go to the "Theme" tab and disable the "Show Header" option.
- Click on the footer and enable the "Scroll Top Button".
- Click on "Save".
=> Clicking on the "Scroll To Top" button does nothing.

The "Scroll To Top" button is an anchor with its `href` set to `#top`.
By disabling the "Show Header" option, the header is removed from the
DOM and there is no existing element with `id=top` anymore. To fix
this, the `scrollTo` function has been patched in order to be able to
receive selectors as arguments. In the '#top' and '#bottom' case, those
positions are known and always the same (either at the top of the
document or the bottom of it) so there is no need to have the header or
the footer present in the DOM in order to be able to scroll up to those
positions.

Now that the `scrollTo` function is able to scroll to the top or the
bottom of the page even without header or footer, those two positions
can always be suggested as internal link anchors during link edition.

opw-3133464

closes odoo/odoo#114472

X-original-commit: 6ae5d73332d5413495cc25e28cba86f8be18b570
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-03-07 02:56:49 +01:00
Thibault Delavallée 2b9e288e1f [IMP] mail: support email_layout_xmlid on template
RATIONALE

Currently email layout choice is done in code and is not controllable through
any user interface. In this commit we prepare improvements in template
management by allowing to choose the email layout directly from a given
mail template. As number of layouts is going to grow better be able to
choose the right one.

SPECIFICATIONS

Add a field on template to propagate email layout choice directly on
template and propagate it to the composer, then post/notify process.

We can now choose directly on a template which notification layout should be
used in conjunction with this template. Composer model already holds a field
'email_layout_xmlid', used in various places in code to give a specific
layout to use when sending notifications emails e.g. SO email layout. This
can now be specified directly from the template itself. It allows to
customize the look and feel of notifications without having to do it
explicitly in a given code flow.

Computation is coming either from template, either reset. When having a
template with a value set, set it on composer. When removing the template
reset it.

Currently no standard template uses it as this task targets mainly a code
cleaning that began with the composer code cleaning. It targets the near
freeze to have the base code updated once, then functional templates will
make use of it (hopefully).

Note that currently notification layout is still not supported at composer
level for mailings. It is simply ignored when generating outgoing mail
records. This will be improved soon.

Global followup of odoo/odoo#107356 / Task-2088884 (Mail: Use editable
computed stored fields in composer).

Prepares code for Task-3046371 (Mail: Better Language Support in Composer)
see odoo/odoo#106177 .

Task-3186426 (Mail: Support notification layout in template / email composer)

closes odoo/odoo#114462

Related: odoo/upgrade#4404
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-07 02:56:46 +01:00
Jeremy Kersten f20f6667fa [FIX] website_forum: add default value for forum_origin
We have a lot of hits without any forum_origin which will raise an
error 500 because this parameter is required. But because this params is
not into the controller but received as a get parameter, it will match
the controller and return an error 500 instead of a beautiful 404.

Some controller like 'open_partner' redirect to this url without the
parameter forum_origin too, leading in a 500 in all cases.

Better for uX to have this param, but not critical to display the page.
The only negative impact will be to have a 'Back' button that return to
this new default value '/forum'.

closes odoo/odoo#114461

X-original-commit: 991d1c430f2c9bb0d2b2d7ac8f75338eafd2aced
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2023-03-07 02:56:41 +01:00
Victor Feyens 2e435e53a6 [CLN] website_sale: correct file names
closes odoo/odoo#114456

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-03-07 02:56:38 +01:00
Victor Feyens cf1989edfa [REM] website_sale: unused actions
Part-of: odoo/odoo#114456
2023-03-07 02:56:38 +01:00
Victor Feyens 5bf1103962 [CLN] website_sale: xml cleanup
Part-of: odoo/odoo#114456
2023-03-07 02:56:37 +01:00
Victor Feyens e095bd566a [MOV] website_sale: report views in report folder
follow the same organisation as in the `sale` module for coherence.

Part-of: odoo/odoo#114456
2023-03-07 02:56:37 +01:00
Victor Feyens 431e700009 [IMP] website_sale: clean menus definition
Part-of: odoo/odoo#114456
2023-03-07 02:56:37 +01:00
niyasraphy f765bd1c2b [FIX] website_forum: restore answers field width on post form view
Before this commit, in the forum post form view, the answers one2many
field is not aligned properly.

* open a forum post from website
* click forum post in the top bar (near edit button)
* forum post form will be opened

After this commit, the field will be displayed properly.

closes odoo/odoo#114433

X-original-commit: 5d8db1e1715cef36468681f59da55c780ae67a55
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-07 02:56:21 +01:00
Jorge Pinna Puissant a73390a42a [REF] web: remove isVirtual function from Record
Before this commit, the model's record had two similar functions: isNew
and isVirtual, this commit will remove the isVirtual function to only use
the isNew one.

closes odoo/odoo#114431

Part-of: task-id 3179751
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-07 02:56:18 +01:00
Horacio Tellez 2d919694d5 [FIX] sale: optional products not keeping user defined price unit
When a portal client changed the quantity of an optional product on a
quotation while being in the portal the unit price of the product
was recomputed and we lost the unit price defined by the user on
the backend.
After this commit this issue will no longer occur.

opw - 3178262

closes odoo/odoo#114425

X-original-commit: bcd1a5820fe8250f50b4dc360ed1d0d48ae76b1c
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-03-07 02:00:20 +01:00
Jeremy Kersten 3eaca8ba16 [FIX] hr_rexpense: expense_sheet_id is not readable for portal user
Missing sudo for portal user on Invoice list.

When portal user go to his portal, to display the list of the invoices
we compute the url via get_portal_url that will call this method
`is_purchase_document` and got a traceback due to missing permission.

Now we call it with sudo to bypass the Access Right error without leaking
any extra information since it is casted as boolean later.

`get_portal_url` -> `record.access_url `-> `_compute_access_url`

account:account.move `def _compute_access_url` -> `filter(is_invoice)`

account:account.move `def is_invoice` -> `is_sale_document or is_purchase_document`

hr_expense:account.move `def is_purchase_document` -> `return bool(self.expense_sheet_id) or super()`

closes odoo/odoo#114424

X-original-commit: 01a91419f906bd8d9248e6376a0246b667218ca2
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2023-03-07 02:00:17 +01:00
Hansun (hale) 415a8b11a1 [FIX] account: control account payment creation
1. Install [Studio], [Accounting] on Apps
2. Enter [Accounting]
- Click the Studio icon second to left on the top right corner
- [Edit Menu]
- [NEW MENU]
- Fill in e.g.`Test`, select [Existing Model], Model: Payment Methods
- Click the icon on the right, check it is `account.payment.method`
- [SAVE & CLOSE]
- [CONFIRM]
- [CLOSE]
3. Click on `Test` menu created next to [Configuration]
- [NEW]
- Type in all info, click to Save
- Error is thrown

Desired: block users from creating a `payment.method` by all means

Impacted versions: 14-master

opw-3148453

closes odoo/odoo#114408

X-original-commit: 59ea0e9802fc9cf98bab8fbdc065d9b5fc023ac7
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Lee, Hansun (hale) <hale@odoo.com>
2023-03-07 02:00:15 +01:00
Akim Juillerat eb55cbb244 [FIX] google_calendar: Avoid unexpected recurring event duplication
When following recurring meeting are imported through google calendar
synchronisation, it happens that a meeting get unexpectedly
duplicated in Odoo, what will in turn duplicate the event on google
and send invitations to all the existing attendees.

As calendar.recurrence.calendar_event_ids is a One2many field,
the update using self was setting the base_event_id's recurrence_id
field to the last record of self recordset. Due to this, the event
will not be considered to filter out the existing_ranges in
calendar.recurrence._reconcile_events function.
Therefore, a calendar.event will in turn be created using the same
start and end datetime as the base_event_id of the calendar.recurrence.

OPW-3143680

closes odoo/odoo#114392

X-original-commit: d1587758ac642b0181e660ea48222385d01098e3
Signed-off-by: Arnaud Joset <arj@odoo.com>
2023-03-07 02:00:09 +01:00
Rémi Rahir (rar) 406abe1f6e [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/ec749cf1 [REL] 16.2.0-alpha.3
https://github.com/odoo/o-spreadsheet/commit/d7267cfa [IMP] selection input: dynamic highlight followup
https://github.com/odoo/o-spreadsheet/commit/de0cdc02 [FIX] figure,chart: Enforce unicity of figure ids
https://github.com/odoo/o-spreadsheet/commit/2410e9d2 [IMP] color_picker: make the color picker a popover
https://github.com/odoo/o-spreadsheet/commit/5ff12582 [FIX] bundle_xml: small fixes for script bundling the xmls
https://github.com/odoo/o-spreadsheet/commit/cf82dbd6 [REV] charts: Fix chart duplicated ids
https://github.com/odoo/o-spreadsheet/commit/a4d593fb [REV] figure,chart: Prevent destructive creation
https://github.com/odoo/o-spreadsheet/commit/eb626ad0 [REL] 16.2.0-alpha.2
https://github.com/odoo/o-spreadsheet/commit/2afe3505 [FIX] chart: Remove forwardport comments Task: 3210689
https://github.com/odoo/o-spreadsheet/commit/2048d9ac [IMP] config: GH release follow semantic versions of package
https://github.com/odoo/o-spreadsheet/commit/00bd206c [IMP] config: tag npm publications
https://github.com/odoo/o-spreadsheet/commit/c66113b3 [FIX] server: server checking the wrong dir to watch for changes
https://github.com/odoo/o-spreadsheet/commit/38af1607 [FIX] config: Fix the action version extractor
https://github.com/odoo/o-spreadsheet/commit/162451a3 [REL] 16.2.0-alpha.1
https://github.com/odoo/o-spreadsheet/commit/92eaf0f5 [FIX] figures: menu not displayed for small figures positioned left
https://github.com/odoo/o-spreadsheet/commit/2855f543 [REL] 16.2.0-alpha.0
https://github.com/odoo/o-spreadsheet/commit/e3653157 [IMP] config: Add Github Action to automatically release and publish on npm
https://github.com/odoo/o-spreadsheet/commit/dfc2cf96 [IMP] config,*: Prepare introduction of releases
https://github.com/odoo/o-spreadsheet/commit/bf7c536e [IMP] doc: adapt the doc to the new API for arguments
https://github.com/odoo/o-spreadsheet/commit/270c02e2 [FIX] figure,chart,image: Prevent destructive creation
https://github.com/odoo/o-spreadsheet/commit/34fc5622 [FIX] charts: Fix chart duplicated ids
https://github.com/odoo/o-spreadsheet/commit/8f75a4f3 [FIX] chart,image: Prevent destructed charts on duplicated sheet
https://github.com/odoo/o-spreadsheet/commit/a815a167 [IMP] functions: translate argument description
https://github.com/odoo/o-spreadsheet/commit/c215783e [IMP] helpers: export lazy function
https://github.com/odoo/o-spreadsheet/commit/f6dfe33f [REM/IMP] css: remove unused classes and improved a bit the css
https://github.com/odoo/o-spreadsheet/commit/fbd86375 [REF] port: run server on 9090 instead of 9000
https://github.com/odoo/o-spreadsheet/commit/8cbfba42 [IMP] top_bar: added and updated tooltips
https://github.com/odoo/o-spreadsheet/commit/7421765d [IMP] figure: remove useless chart registry filling
https://github.com/odoo/o-spreadsheet/commit/7b31778f [FIX] selection input: dynamic highlights
https://github.com/odoo/o-spreadsheet/commit/84ae26f2 [FIX] composer: fix wrong style attribute
https://github.com/odoo/o-spreadsheet/commit/58b09153 [FIX] corner: Fix missing background color
https://github.com/odoo/o-spreadsheet/commit/155c6af3 [IMP] bottom_bar: Add drag&drop on sheet tab.
https://github.com/odoo/o-spreadsheet/commit/d641b2cf [FIX] menus,charts: missing translations
https://github.com/odoo/o-spreadsheet/commit/36df3326 [FIX] selection: uncomment test
https://github.com/odoo/o-spreadsheet/commit/990c158b [FIX] font_size_editor: add props definition
https://github.com/odoo/o-spreadsheet/commit/4dfa6d3e [IMP] autofill: support edge scrolling
https://github.com/odoo/o-spreadsheet/commit/a198f5c9 [IMP] Components: extract color picker entry component

closes odoo/odoo#114388

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-03-07 02:00:06 +01:00
Jeremy Kersten 2f992e6cd1 [IMP] website, test_website, website_sale: allow to find partial url
Until now, if you search for /shop/Desk for a new link, you will not
have any result.
Now we search that it match *shop*desk* so /shop/custom-desk-12 will
match.

closes odoo/odoo#114357

X-original-commit: 84a407e744b7bacab43a0213ab52002a49c5d623
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2023-03-07 02:00:03 +01:00
hupo-odoo 08776c1d39 [FIX] sale_project: analytic default plan
issue: When creating a sale order, with a service that involves the creation of a project, with analytic accounting activated, the default analytic account is not the default one set in the settings of the Project app.

Steps to reproduce the issue :
- activate analytic accounting in the Accounting app.
- in the settings of the Project app, set the default analytic plan to any value but the first one.
- create a product in the Sale app, with a product type 'Service', that involves the creation of a 'Project'.
- create a sale order with the product
- go in the analytic accounting menu in Accounting app
 -> the analytic plan is not the one set by default in the settings of the Project app.

closes odoo/odoo#114302

Task: 3169483
X-original-commit: e801b3fa1bbc31713375cc669c6d47b32b175f53
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: hupo-odoo <hupo@odoo.com>
2023-03-07 01:59:57 +01:00
Adrien Guilliams (adgu) ffe27c3f32 [IMP] pos_restaurant: Table not stacked when added
When we added tables on a floor plan from the floor screen,
the tables stacked one upon another which was confusing and annoying.
Now the table will be added on a free place on the floor plan.
We also rename the tables: they are no more called "T1", "T2"
but "1", "2",...

closes odoo/odoo#114282

Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
2023-03-07 01:59:54 +01:00
Nicolas (vin) c25341ed0c [IMP] account: payment scamming protection
Odoo does not have much in terms of payment protection; you can create
payments to any account you want without many checks.

This changes it by requiring users with the right groups to trust an
account before allowing it to be used for payment methods requiring.
Also adds some warnings on the bank account view, and checks at the time
of creating a payment.

Task id # 3210415

closes odoo/odoo#114278

Related: odoo/enterprise#37789
Related: odoo/documentation#3737
Related: odoo/upgrade#4397
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-03-07 01:59:51 +01:00
Denis Ledoux 2541cf636b [REM] core: remove search_view from ir.actions
This field has been introduced in
https://github.com/odoo/odoo/commit/c68600cc5397700df4f40095c27723a2b1f90a22

The reason why is not really clear, given the commit message.

But, it looks completely unused nowadays.
We can therefore safely remove it.

In addition, this will save a lot of transferred data to the web client,
as currently all the fields of an action are read when the web client
loads an action,
including this one, which contains a long xml content.

For instance, with just base and the contacts modules installed,
to load the action of the Contacts menu,
it goes from 5.51kB to 1.05kB.

closes odoo/odoo#114041

Related: odoo/upgrade#4390
Signed-off-by: Rémy Voet <ryv@odoo.com>
2023-03-07 01:59:38 +01:00
Nicolas (vin) ab14228f01 [IMP] account: Improvement of accounting dashboard kanban
Rework the button displayed on the kanban.
Part of task 3086715

closes odoo/odoo#108024

Related: odoo/upgrade#4394
Related: odoo/enterprise#34992
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
2023-03-07 01:59:25 +01:00
JF Aubert 3b801a6d48 [IMP] mrp: apply propagation mechanism
Apply propagation mechanism to Manufacture rules,
except the ones from the mto rule.

Also fix some _find_global_route having missed route's rename.

closes odoo/odoo#107952

Task: 2907698
Related: odoo/upgrade#4342
Related: odoo/enterprise#34963
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-03-07 01:59:16 +01:00
JF Aubert 6825c440d5 [IMP] mrp: Move fields from product to bom
Manufacturing lead time & Days to prepare are now handled at bom level

Task: 2907698
Part-of: odoo/odoo#107952
2023-03-07 01:59:16 +01:00
Odoo's Mergebot c5e58589cd [IMP] base: search on properties
Purpose
=======
Allow to search properties fields.

For now, the properties fields are meant to be used with the search bar available in views, so everything was simplify as much as possible for this feature.

Technical
=========
Relational properties
---------------------
We can not search on relational properties using the rec name, or using one of their fields.

The following domains do not work
```
[('properties.partner_id', 'ilike', 'alice')]
[('properties.partner_ids', 'ilike', 'alice')]
[('properties.user_id.name', 'ilike', 'bob')]
[('properties.user_ids.name', 'ilike', 'bob')]
```

Instead, we should give the ids
```
[('properties.partner_id', '=', 55)]
[('properties.partner_ids', 'in', 55)]
```

IN operator
-----------
The "in" operator is used to either search specific tags / many2many
values, either doing a "OR like" condition on "non-array" value.

It can be used if the left or the right side is not an array
```
[('properties.my_char', 'in', ['a', 'b'])]
[('properties.my_tags', 'in', 'a')]
```

But it can't be used if both side of the condition are array, because
it will require to check type in SQL (which is technically possible,
but add extra complexity, so for now we keep the feature as simple as
possible).

So the following domain is not supported.
```
[('properties.my_tags', 'in', ['a', 'b'])]
```

Instead we should use the "OR" operator
```
['|', ('properties.my_tags', 'in', 'a'), ('properties.my_tags', 'in', 'b')]
```

Tags / many2many - "=" operator
-------------------------------
Tags and many2many have to be searched using the "in" operator.

So the following domain will return unexpected results and raise a warning.
```
[('attributes.mytags', '=', ['a', 'b'])]
```

The reason is that we don't want to dynamically check the type in SQL,
and so we need the "in" domain operator to know what to do in SQL.

Task-2980121

closes odoo/odoo#101901

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-07 01:59:06 +01:00
std-odoo 590beec447 [IMP] crm, project: allow to search properties
Purpose
=======
Allow to search properties.

Task-2980121

Part-of: odoo/odoo#101901
2023-03-07 01:59:05 +01:00
std-odoo 1c2f29fc56 [IMP] base: allow to order record by properties fields values
Purpose
=======
Allow to sort records by properties fields values.

Task-2980121

Part-of: odoo/odoo#101901
2023-03-07 01:59:05 +01:00
std-odooandPolymorphe57 defa390621 [IMP] web: allow to search properties fields using the top search bar
Purpose
=======
Add the properties fields in the search bar and allow to search
properties fields values.

Technical
=========
If the "active_id" is in the context, show only the properties
of the given definition record. Otherwise, show all properties
of all definition records.

Because fetching the properties definitions cost a SQL query and a RPC
call, the properties definition are fetched only if we unfold the
properties field (so it has no performance impact until we ask
explicitly to search a property).

Task-2980121

Part-of: odoo/odoo#101901
Co-authored-by: Polymorphe57 <dam@odoo.com>
2023-03-07 01:59:05 +01:00
std-odoo 0583a5ddd0 [IMP] base: search on properties fields
Purpose
=======
Allow to search properties fields.

For now, the properties fields are meant to be used with the frontend
top bar filter on views in a later commit, and so everything as been
kept as simple as possible for that particular use case.

Technical
=========
Relational properties
---------------------
We can not search on relational properties using the rec name, or
using one of their fields.

The following domains do not work
```
[('properties.partner_id', 'ilike', 'alice')]
[('properties.partner_ids', 'ilike', 'alice')]
[('properties.user_id.name', 'ilike', 'bob')]
[('properties.user_ids.name', 'ilike', 'bob')]
```

Instead, we should give the ids
```
[('properties.partner_id', '=', 55)]
[('properties.partner_ids', 'in', 55)]
```

IN operator
-----------
The "in" operator is used to either search specific tags / many2many
values, either doing a "OR like" condition on "non-array" value.

It can be used if the left or the right side is not an array
```
[('properties.my_char', 'in', ['a', 'b'])]
[('properties.my_tags', 'in', 'a')]
```

But it can't be used if both side of the condition are array, because
it will require to check type in SQL (which is technically possible,
but add extra complexity, so for now we keep the feature as simple as
possible).

So the following domain is not supported.
```
[('properties.my_tags', 'in', ['a', 'b'])]
```

Instead we should use the "OR" operator
```
['|', ('properties.my_tags', 'in', 'a'), ('properties.my_tags', 'in', 'b')]
```

Tags / many2many - "=" operator
-------------------------------
Tags and many2many have to be searched using the "in" operator.

So the following domain will return unexpected results and raise a warning.
```
[('attributes.mytags', '=', ['a', 'b'])]
```

The reason is that we don't want to dynamically check the type in SQL,
and so we need the "in" domain operator to know what to do in SQL.

Task-2980121

Part-of: odoo/odoo#101901
2023-03-07 01:59:04 +01:00
std-odoo da48700b59 [IMP] base: do not modify the cache when reading properties fields in batch
Purpose
=======
Do not modify the cache in order to improve the performance when we
read in batch. Instead we create a new batched method "convert_to_read"
that check existence in batch, and generate a dict with the result.

Now, all the properties field checks (many2one existence, selection option
still exists, tag value stiff exist, etc) and done in "convert_to_read".

It means that doing `record.properties` won't do all those checks.

Having the batched field fetch at the convert_to_record required too
many changes for the scope of this task, so "record.properties" having
the cache values unchecked is an acceptable tradeoff currently, hence
we batch convert_to_read.

Task-2980121

Part-of: odoo/odoo#101901
2023-03-07 01:59:04 +01:00
Maximilien (malb) df997b1d01 [IMP] l10n_mn:translation
Before this PR, all this localisation was written in Mongolian, but all the localisation have to be written in english and then translated back in the native language. This PR correct that.

closes odoo/odoo#113465

Task-id: 3166094
Related: odoo/enterprise#37442
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-03-07 00:31:13 +01:00
william-andre 871f35b089 [FIX] account: installation of CoA in UI
It was impossible to install a CoA in the UI because the selection field
didn't have any possible values. The cause was that when we tried to
fetch the values for `account_templates`, the `contains_field` was
returning True even though `get_records` was not returning anything.

Reproduce:
* Create a new company
* Go to Accounting Settings
* Select a fiscal localization and save

opw-3212601

closes odoo/odoo#114164

Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-06 23:34:50 +01:00
william-andre 8e6a3d7269 [REF] l10n_*: clean code
A lot of the separate files were kept up to now because it made the
process easier while applying the script to rebase.
The files can now be merged.

Some code is also cleaned by using CSV instead of a python dict.

Part-of: odoo/odoo#114164
2023-03-06 23:34:49 +01:00
baa ef5d43a4d2 [FIX] l10n_eg_edi_eta: fix the url within the qr code on the egyptian invoice
The URL computed by Odoo was not mathing the URL computed by the ETA system. The previous endpoint used was https://api.invoicing.eta.gov.eg instead of https://invoicing.eta.gov.eg. Also the url contained '/search/' which should not be there. Correct format should be https://invoicing.eta.gov.eg/documents/id/share/long_id

closes odoo/odoo#113937

X-original-commit: 70f6199401cfde0cdb7864910f9e8e14117981b6
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-03-06 23:34:46 +01:00
Shawcker 0a5583f07a [IMP] l10n_no: update Norwegian tax report
The Norwegian tax report is outdated as of January 2022 and currently displays values that do not fit directly into the new mandatory reporting system set up by the Norwegian Tax Authorities.

Change:
  - Update tax report tax lines to match the required fields

task id=2667013

closes odoo/odoo#113324

X-original-commit: da1e6c571d96dc6834c0e7710c6b237fd476f69c
Related: odoo/enterprise#37380
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-03-06 21:55:44 +01:00
Julien Van Roy ab0191dca2 [IMP] point_of_sale: add code on ticket to create invoice
Currently, it is possible to add a QR to generate an invoice for a pos
order at a later time (see
https://github.com/odoo/odoo/commit/14183883432e9d35c6240e1d7dc8c51d04cb93db).
When scanning the QR, the customer can fill various fields (including
potential l10n_* specific fields) and then generate an invoice.

This commit makes it possible to add a 5-digits code on the ticket. A
customer can go to `pos/ticket` and fills this code, the date and the
order reference written on the ticket. He will then be redirected to the
same flow as when scanning the QR code.

task-3178954

closes odoo/odoo#112285

Related: odoo/enterprise#36859
Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-06 21:01:28 +01:00
Michael (mcm) 13fc4751a4 [IMP] web: allow to move dialog
After this commit, the user will be able to move dialogs
to see the content hidden behind the dialog.

closes odoo/odoo#111654

Task: 3132894
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-06 18:52:52 +01:00
Michael (mcm) 15200a122e [IMP] mail,*: revamp activity records UI
* hr_holidays,project

This commit revamps some activity records UI in different applications.

closes odoo/odoo#111373

Task: 3133150
Related: odoo/enterprise#36473
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-06 18:52:47 +01:00
Martin Maes 2b907e9f95 [IMP] deliver: add fixed margin
Removed the margin on rate when the provider is Fixed Price

Removed the margin on rate, free, amount when the provider is Based on Rules

Added a fixed margin for all the other providers

task-3043063

closes odoo/odoo#108794

Signed-off-by: Steve Van Essche <svs@odoo.com>
2023-03-06 18:52:41 +01:00
std-odoo 97ca45e4f3 [IMP] mail, mass_mailing: store the bounce email and allow the user to read it
Purpose
=======
The bounce emails aren't stored in Odoo, which can complicate the
debugging of the email sending.

Now, we store this bounce email, and we allow the user to read it from
the interface, so he can easily find the issue when an email sending
fail.

Specifications
==============
The bounce email is stored on the mail notification for standard emails
sending, and on the mailing traces when using mass mailing.

For some email providers (e.g. Yahoo), the "Final-Recipient" header is
not present. Normally, it allows us to retrieve the original recipient
of the email which bounced and then the partner. So if this header is
not there in a bounce email, we take the first recipient of the parent
<mail.message>.

Change the way that we parse the email body, for the bounce email.
For most email providers, the first mail body is the one that contains
the error and the next one contains the parent email body. So, the
current logic might ignore this body for Outlook and Yahoo.

Task-2116296

closes odoo/odoo#105923

Related: odoo/enterprise#34051
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-06 17:47:29 +01:00
Jérémy Hennecart (jeh) a25ab87abe [IMP] crm: improve log meeting
When logging a meeting linked to a lead we now add a link to the
record. The link takes the place of the subject as it's the same
displayed value.

task-2984657

closes odoo/odoo#106546

Related: odoo/enterprise#32945
Related: odoo/upgrade#3974
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-06 17:47:18 +01:00
Thomas Josseandstd-odoo 0ffa2d64ba [IMP] gamification, website_forum, website_slides: karma tracking improvement
Purpose
=======
Some users found a way to farm karma points, so we want to be able to
track the source of the karma gain / loss.

Specifications
==============
Now, we added a reference field `origin_ref` which store the record
responsible for the karma gain / loss (e.g. a slide we just completed).

In addition to this origin, we also have a new field to store the
reason (e.g. "Slide completed") so we know exactly what happened and
how the user gains his karma.

Before, the `old_value` of the karma tracking has to be set manually,
but now it's done automatically based on the value of the previous
tracking of the same user. That way, it will simplify other part of
the code.

Add the karma reason in the website modules. Adapt those modules due
to the changes in gamification.

Task-2234179

closes odoo/odoo#76430

Related: odoo/enterprise#23702
Related: odoo/upgrade#3299
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Co-authored-by: std-odoo <std@odoo.com>
2023-03-06 17:47:09 +01:00
std-odoo f76e65118e [IMP] website_slides: remove the karma gain on vote
Purpose
=======
Remove the karma gain on vote, because it gives an incentive to like
all slides and to never dislike.

Task-2234179

Part-of: odoo/odoo#76430
2023-03-06 17:47:09 +01:00
william-andre 07ff047b9d [FIX] account: manage base locale in CoA loading
If we had a name that is translated in the template files with the base
locale instead of the fully qualified one (i.e. `fr` instead of
`fr_BE`), we would only store `fr`, which the ORM doesn't understand as
there is no fallback on the generic locale (only on `en_US`)

Instead of storing the translation values straight out of the record's
values dictionary, we are now doing something similar as the generic
`_load_module_terms`, loading only the languages being installed, and
using the fallback on the generic locale there.

closes odoo/odoo#113886

Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-06 15:18:54 +01:00
FrancoisGe 17a24020ac [REF] *: do not use activeFields in Field components
This commit is to replace all uses of activeFields in Field components
by passing fieldInfos to extractProps. We will therefore retrieve the
node-dependent information in the extractProps function.

Why?
This ensures that the info used is that of the correct node. Because the
activeFields function contains the information from the last node that
referred to the same field.

Example:
<tree>
    <field name="a"/>
    <field name="a" context='{'b':"yop"}'/>
</tree>

For the first field:
    FieldInfo.context = {}
    activeField.context = {'b':"yop"}

For the second field:
    FieldInfo.context =  {'b':"yop"}
    activeField.context = {'b':"yop"}

Part of task: 3179751

closes odoo/odoo#113874

Related: odoo/enterprise#37621
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-06 15:18:48 +01:00
David Monnom (moda) 3620ae22ba [IMP] point_of_sale: loading animation send and print receipt
Before this PR, the user was not sure that the sending of mail / printing
of the ticket was done because no animation was triggered when the button was clicked.

Now a loading icon replaces the original icon during the sending or printing of the ticket.

closes odoo/odoo#112899

Taskid: 3177518
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
2023-03-06 14:15:27 +01:00