Commit Graph
157779 Commits
Author SHA1 Message Date
Pierre Paridans 93790839b6 [FIX] web,website,point_of_sale: settings' header alignment
This commit is a follow-up of odoo/odoo@bb819f6a5c.

Even if the fix above worked around having the settinggs header's
content out of screen on smaller screen, the solution was ugly and was
meant to be improved later on.

This commit reworks the HeaderSetting's template and simplifies it to
properly fix this issue.

closes odoo/odoo#110530

X-original-commit: 0ab079664e380e5e77440e290ec604e3830108bb
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-01-20 21:56:45 +01:00
Aaron Bohy 49c94a3773 [FIX] web: correct docstring of renderToString
closes odoo/odoo#110529

X-original-commit: caf2e59da3000017682cc0211ae481081f465528
Signed-off-by: Georis François (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-20 20:58:48 +01:00
Aaron Bohy f58f2e0d4f [FIX] web: do not save untouched fields on F5
Have a char field with trim option set to True (this is the
default). Open a form view where the value of this field has
leading or trailing spaces. Press F5 (or close the tab/browser).
Before this commit, a write was done before leaving, with the
trimmed value of the char field.

This isn't the expected behavior: as the field hasn't been manually
edited, we don't want to write on it.

This could be reproduced on project.task form views, on tasks with
a name with leading/trailing spaces (e.g. tasks created by mails
sent to feedback@odoo.com).

The issue occurred when we saved a record "urgently" (before unload)
because we parsed the value of each input field, and we sent it if
it was different from the initial (or last set) value. In our case,
parsing the value trimmed it, and it was thus different from the
initial value.

Bug reported after the migration of odoo.com to 16.0.

closes odoo/odoo#110528

X-original-commit: 43b7ae39e633ced6008b067bb4e63ed9be7eda01
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-01-20 20:58:45 +01:00
FrancoisGe 79044b31ff [FIX] sms: clicking on the SendSMSButton in a formview dialog
Before this commit, clicking on a SendSMSButton in a FormViewDialog could
change the record of the main form view.

Problem:
When closing the dialog opened by the SendSMSButton, the model is reloaded
with the record id associated with the button. This has the effect of
replacing the root with this record. This will replace the record used
in the main form view by the one in the FormViewDialog.

How to reproduce:
- Go to a form view with an x2m field that has the same model as the form view
- Add a record in the x2m in order to open a FormViewDialog with at
  least one field using the "phone" widget
- Complete the field with the "phone" widget
- Click on the "SMS" button
- Click on "Discard" button

Before this commit:
The dialog opened by SendSMSButton is closed and the main form view
record is replaced by the FormViewDialog record.

After this commit:
The dialog opened by SendSMSButton is closed and the record of the
main form view has not changed.

closes odoo/odoo#110527

Taskid: 3107429
X-original-commit: 9ceba129223a6368c720596ea17a3f7268487649
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Georis François (fge) <fge@odoo.com>
2023-01-20 20:58:43 +01:00
Kartik Chavda 3ce5cbe064 [FIX] project: avoid resetting the kanban state in task
Steps:
- Install project app.
- Active Sub-tasks feature in config settings
- Create task with parent task
- Green the kanban state
- Modify the parent task

Issue:
  The kanban state changes when we change the parent task in the task.

Fix:
  We avoid the recomputing kanban state.

Why issue occurred:

  When we change the parent task _compute_project_id is called and sets the project.
  the _compute_kanban_state method depends on the project. So reset the kanban state.

task-3141855

closes odoo/odoo#110492

X-original-commit: 0393cffa71821ba32af8e9ba54225275647c4e70
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-20 20:58:40 +01:00
qsm-odoo b4fdc6c01d [FIX] website: allow to reinstall website after deleted user-websites
Before this commit, this flow was broken:

- Install website
- Create a new website of your own (not using the one created
  automatically from XML data)
- Choose another color palette for that website
- Uninstall the website app
- Reinstall the website app
- Try to choose another color palette for any website
=> It does not work

Indeed, after the uninstallation, the DB is left in an invalid state:
the SCSS customizations attachments of the website that was created by
the user are not removed, they just have their website_id field emptied.
Some code made at [1] was already there to remove those attachments. The
problem is that it only worked for websites which were created by XML
data (at website installation), not by the user. Indeed, the `unlink`
method is not called during uninstallation to remove records that were
created by the user, thus the `unlink` override was not called either.
See [2] for some details.

This fixes the issues by moving this attachment cleaning code in a
dedicated method, called in `unlink` but also in the `uninstall_hook` of
the website app.
This also takes the opportunity to refactor the code involved, in
particular to not even consider customized attachments which do not have
a website_id.

[1]: https://github.com/odoo/odoo/commit/2f361bec36dff09181b96d140d62c477cdf013a1
[2]: https://github.com/odoo/odoo/pull/97852#pullrequestreview-1067851656

opw-3127531

closes odoo/odoo#110338

X-original-commit: 988eafa03b57be3b3a7f110650c61ce8fda88e31
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-01-20 20:58:34 +01:00
abd-msyukyu-odoo 14d68b775f [IMP] crm: correctly combine domains for lead forecast facets
The `forecast_filter` facet (aka Upcoming Closings) would have been combined
with other filters from the same group with a logical 'AND' while displaying an
'OR' combination. Fortunately it is currently the only item of its group so it
does not cause a problem.

This commit fix the inconsistency so that `forecast_filter` using the
forecast_search_model won't have this issue in the future.

Task-2657578

closes odoo/odoo#109996

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-01-20 20:58:26 +01:00
abd-msyukyu-odoo 6df5488ecf [IMP] crm: stop using moment
Replace moment calls by their equivalent with the luxon library in CRM, and make
use of date utils from the l10n module.

Task-3056665

closes odoo/odoo#109882

Related: odoo/enterprise#35777
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-01-20 20:58:21 +01:00
abd-msyukyu-odoo b0d3da37ea [IMP] crm: owl improvements
Applies minor fixups to improve owl usage in CRM, following the JS team advice:
https://github.com/odoo/odoo/pull/104975

* remove unused export
* use orm service from model
* remove redundancy for component call

Task-3056665

Part-of: odoo/odoo#109882
2023-01-20 20:58:21 +01:00
Pierre-Yves Dufays a556b54c89 [IMP] mail: standardize template preview form
Small refactor of the template preview form to use regular group and field tags
instead of custom layout using bootstrap.

Technical note: we weren't able to keep the model name in the label of
resource_ref so we have replaced the label with a static one: "Test Record:".
The reasons why we weren't able to keep the dynamic label are:
- a div instead a label tag is rendered with a style of width:50% which breaks
the layout (even when adding class="o_form_label"). Here we can keep the
dynamic part but we get a broken layout.
- when using a label tag for the label, the system forces us to use a "for"
attribute. But the "for" attribute replace the text content of the label by the
standard field label (here "Record"). Here we have a good layout but the label
is “Record”.
- we can override the standard field label with the attribute "string" but in
that case it is not possible to make it dynamic with the model name (field
model_id). Here it is the best we can get: a good layout and a decent label.
Unfortunately, we can't have the dynamic part of the label (the model name
here).

Task-3098782

closes odoo/odoo#109560

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-01-20 20:58:15 +01:00
Benoit Socias 45f63ca044 [MOV] website, test_website: move test using data file to test_website
When the QWeb `<template>` loading test was introduced at [1], the
`test_website` module did not exist yet, see [2].

This commit moves that test and its related data file to `test_website`
to remove the `fake data` noise from the `website` module.
That's one of the two purpose of this `test_website` module:
- Avoid noising the website module with test only data & code
- Encapsulate in a lighter module the module operations tests, but it's
  not really the case anymore as those tests are now standalone tests.

See manifest for more details.

[1]: https://github.com/odoo/odoo/commit/9cd982bcc811cacb42f5c08db139043d2734b891
[2]: https://github.com/odoo/odoo/commit/ef03db9edd9472201cb2c08a32d20ff0f33a5fdf

closes odoo/odoo#109349

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-01-20 20:58:12 +01:00
Lucas Lefèvre a7fe381f71 [REF] spreadsheet_dashboard: remove badly named raw field
Up until now, the collaborative expected a field named `raw` containing
the serialized json data. This is historic and appeared because the field
containing the existing field `raw` on `document.document` contained this
data.

The name `raw` is meaningless. Now the collaborative expects a field
named `spreadsheet_data`.
I chose a field over a custom method because fields are more broadly
supported everywhere (web client services, web client mocks)

closes odoo/odoo#104167

Related: odoo/upgrade#4005
Related: odoo/enterprise#33246
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-01-20 20:58:01 +01:00
Odoo's Mergebot 9df5b774dc [IMP] survey: Improve results display
Purpose
=======
Give users a better experience when using the survey
result page.

Specifications
==============
Handle long chars display for single-line question
answers by showing them on multiple lines.

Prevent answer tables from flickering when having multiple
pages with different answers count by fixing their height.

Display a no answers helper instead of the empty table
and the alert message.

Task-2957775

closes odoo/odoo#100168

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-01-20 20:57:58 +01:00
amdi-odoo 4b7bfbc252 [IMP] survey: prevent table flicker
Purpose
=======
Prevent table with answers from flickering when
having multiple pages with different items count.

Specifications
==============
Adjust the table height to the question types to
keep the pagination buttons on the same level while
switching pages.
Each table line is expected to be, for the text_box
questions, 3 lines height and for the char_box,
numerical, date and datetime question types
(+ comments), only one line height.
Adding a scrollbar if the table height is greater
than expected.

For the text, char, number, date and datetime
question type (+ comments), set the input line id
cells width to a percentage to avoid horizontal
flicker while changing pages and to reduce first
column width.

Task-2957775

Part-of: odoo/odoo#100168
2023-01-20 20:57:57 +01:00
amdi-odoo c4f954c808 [IMP] survey: add no answer helper
Display a no answers helper instead of the empty table
and the alert message when a question doesn't have
any answers.

Task-2957775

Part-of: odoo/odoo#100168
2023-01-20 20:57:57 +01:00
amdi-odoo af328742d0 [FIX] survey: handle long chars
Handle long chars display for single-line question
answers by showing them on multiple lines in the
print page.

Task-2957775

Part-of: odoo/odoo#100168
2023-01-20 20:57:57 +01:00
Florent de LabarreandWilliam Braeckman e8a3e9319a [FIX] website_sale : don't hide Send quotation
A customer start an order on website
A few days later the back office call the customer to finalize the order. And try to send the quotation.
--> Issue the button "Send Quotation" is remplaced by "Send a Recovery Email"

closes odoo/odoo#71333

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Co-authored-by: William Braeckman (wbr) <williambraeckman@yahoo.fr>
2023-01-20 20:57:53 +01:00
Odoo's Mergebot a74f048e89 [FIX] event: update static maps api
Google now requires an API key for the static maps API. As API calls cost money, and we cannot restrict the domain of the caller with the API key in emails, as the domain may vary vastly, the signing of static API URLs is implemented in the existing 'google_map_img' of partners.

This in turn can be used to get a url for an existing location. While preventing anyone from stealing the API key for their own purposes

task - 3079113

closes odoo/odoo#107200

Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-01-20 19:56:53 +01:00
Renaud Thiry a64a72188b [FIX] mail: remove MAKO compatibility
Before this change URLs would get their url-safe encoding replaced
with regular characters when cleaning up
html content.

This caused signed URLs that use some of those characters to become
invalid if the target did not accept equivalent characters.

Concrete example:

/markers=size%3Alittle%7CAddress
is not the same as
/markers=size%3Alittle|Address
for google maps signed static urls

Do not add special handling for MAKO patterns
as they are not used in templates anymore

task - 3079113

Part-of: odoo/odoo#107200
2023-01-20 19:56:52 +01:00
Renaud Thiry 1348509668 [IMP] event: add setting menu for g-map API key
Add some setting buttons for users to configure their API keys in events

task-3079113

Part-of: odoo/odoo#107200
2023-01-20 19:56:52 +01:00
Renaud Thiry 83e4551492 [FIX] event: add signed static maps api
Google now requires an API key for the static maps API.
As API calls cost money, and we cannot restrict the domain of the caller
with the API key in emails, as the domain may vary vastly,
the signing of static API URLs is implemented in the existing
'google_map_img' of partners.

This in turn can be used to get a url for an existing location.
While preventing anyone from stealing the API key for their own purposes

task - 3079113

Part-of: odoo/odoo#107200
2023-01-20 19:56:52 +01:00
Anita (anko) 5cc86c3bb1 [IMP] payment: Rename Payment Icon to Payment Method.
Payment Icon sounds confusig comparing to what it really is,
payment method name makes it clearer for user to understand
what it is.

task-2882564

closes odoo/odoo#105678

Related: odoo/enterprise#33908
Related: odoo/upgrade#4029
Related: odoo/documentation#2955
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-01-20 18:54:44 +01:00
Jorge Pinna Puissant aa1b22447d [FIX] l10n_ke_edi_tremol: use the new tags for the settings
Change the arch to use the new tags for the settings. If the new tags
are not used, the search cannot be performed on these settings.

closes odoo/odoo#110519

See: 02f7835aade005484ca49a8ba4c5c5feea249aae
X-original-commit: 4ab728c5ac0c28947901727f4986b3a6904f6ef7
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-01-20 17:52:16 +01:00
Nicolas Bayet b63a0dced3 [FIX] web_editor: save the content without blur
When the only change in a form was made in the html editor, if the user
did not blur the editor, the content was not saved.

The reason is because the `urgentSave` in `basic_relational_model.js`
check if the record is dirty before the HtmlField had the time to update
the value to make it dirty since the commitChange in the HtmlField could
run promises before calling `update`.

To solve it, in case of urgent save, we update the value before any
asynchronous modification and re-update it after those modifications.

In order to have this strategy only on urgentSave and not on the
blur of the editor, the params `{urgent: true}` has been removed in
`_onWysiwygBlur` as it seems to not be useful. Another params will need
to be added if we want to keep that behavior on blur.

task-3140763

closes odoo/odoo#110517

X-original-commit: 3ff0d4b032e44719f52d09c7bfb701c47a79a5c3
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-01-20 17:52:14 +01:00
Dossogne Bertrand 15201b1e28 [FIX] hr_holidays: fix accrual visuals in dark-mode
Before this commit, the form view in dark mode had some
coloring issue. This commit fixes that issue.

task-3138224

closes odoo/odoo#110516

X-original-commit: 11cb224a19f5ffdcda50ecf9274259d8ceea5730
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-20 17:52:11 +01:00
59101edb9b [FIX] website: prevent confirmation modal when discarding without changes
Before this commit:

When entering edit mode on the website and discarding directly, the editor
considers that there are changes in the DOM and displays a confirmation modal.

After this commit:

When entering edit mode on the website and clicking directly on discard, the
confirmation modal is not displayed.

Task-3056463

closes odoo/odoo#110515

X-original-commit: 650a97d1bd59254cc2115d54d58940b6112a8d70
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: Dhaval Baraiya <dhba@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
2023-01-20 16:54:18 +01:00
niyasraphy 19210a44a8 [IMP] test_exceptions: show close button instead of save/discard
before this commit, when opening the test exception form from Tests -> Test exceptions -> Test exceptions, in the bottom of the form it currently shows Save and Discard button.

after this commit, on opening the same form, instead of save and discard, it will show Close button to close the opened form.

closes odoo/odoo#110361

Signed-off-by: Julien Castiaux <juc@odoo.com>
2023-01-20 16:54:14 +01:00
Nicolas Bayet 81dadd9731 [REM] web_editor: remove unused import
closes odoo/odoo#110513

X-original-commit: da85b221e29e5e6aedbd71284be2b33113926cfc
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-01-20 11:43:51 +01:00
Nicolas Bayet 4562b4ad69 [FIX] web_editor: prevent edition on void elements
Before this commit, it was possible to edit void element if they were
branded. It does not make sense to edit a void element.

task-3096813

X-original-commit: fbf633b8110a74dbf25bdc5372a60e793017fbdc
Part-of: odoo/odoo#110513
2023-01-20 11:43:50 +01:00
niyasraphy bcf6f6625b [IMP] web: remove non existing module from _eslintignore
before this commit, the web_dashboard module was reffered in _eslintignore file

web_dashboard module was removed by this commit:  https://github.com/odoo/enterprise/commit/658606bd870041da8a7c969c3ffe63f762e5daf5

after this commit, the refferenced web_dashboard module will be removed from _eslintignore file.

closes odoo/odoo#110495

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-01-20 11:43:44 +01:00
Jeremy Kersten 3baa772b28 [FIX] sale: don't assign non-salesperson as salesperson on sales order
Before this commit, if you create a sale order for partner who is not
is not a salesman on the res.partner, you become the salesman of the
sale.order. No matter if you are salesman or even employee.

After this commit, the customer or public user will be not assigned as a
salesman on sale.order when creating without forcing the user_id = False.

closes odoo/odoo#110486

X-original-commit: 008cd34c49574f1b0c50132a75b50111422e431a
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-01-20 11:43:41 +01:00
Mathieu (mano) 51b9bff01c [FIX] web_editor: editor caret color contrast
In the web editor when the placeholder using the class `oe-hint` is
shown the insertion caret color is almost invisible in dark-mode.

This commits reset the caret to its default behavior by removing the
`caret-color` property from the class `oe-hint`. Therefore making the
caret dark in white mode and white in dark mode even when the
placeholder is shown.

It makes it consistent with all the other inputs w/ a placeholder.

task-3099628

closes odoo/odoo#110477

X-original-commit: 4caf4eb9b957853245a881b645863d6af8a166d1
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-01-20 10:42:49 +01:00
Renaud Thiry a8cb52afee [FIX] web: keep full urls in settings
The function that adds the missing url root on documentation links uses a regex
in startsWith, which is not supported.

startsWith is replaced with ``regex.test`` which will succeed
if the regex has any match.
Which is fine because we use a '^' to ensure it *starts* with https

task-3079113

closes odoo/odoo#110443

X-original-commit: fdaeaf69c1770edf3f33e32947326d1ebe42820e
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-01-20 10:42:43 +01:00
William Henrotin ddee7db9a9 [FIX] sale_stock_margin: create currency rate once
On January first, the test test_so_and_multicurrency fails because it
creates a new currency rate on EUR. There is already a currency rate
created in the demo data (base/data/res_currency_rate_demo.xml) for the
01-01.

This commit removes all currency rate before the test to make sure we
avoid duplicates.

closes odoo/odoo#110488

X-original-commit: 6de19caf6aa38e040aaf4cb50b17dee894c20984
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-20 09:41:00 +01:00
Yolann Sabaux 14b57cbf48 [FIX] account: total rounded
closes odoo/odoo#110479

X-original-commit: 9580bee139a588d8e34533aac6c1120477fd6dd3
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2023-01-20 09:40:55 +01:00
Touati Djamel (otd) 9bf1d5e47a [FIX] {stock,mrp}_account: ignore the type of inventory valuation in MO
Steps to reproduce the bug:
- Create a storable product “P1”:
     - Go to product category → set the inventory valuation to
     “Automated”
     - Create a BoM:
         - Add a component with the cost set to 10$
         - Add an analytic account
- Create a MO to produce one unit of “P1”:
    - Confirm the MO:
        - an analytic account line is created with the amount of $10
    - Mark as done the MO:
        - The amount is updated to $0

Problem:
In the case where the inventory valuation is set to “automated” we use
the analytical distribution since this commit:
https://github.com/odoo/odoo/blob/7e3403068fc3fbc40182b3cfeb80e97a9300e8ff/addons/account/models/account_move_line.py#L2326

but in the case of MO it shouldn't use it

Solution:
If we are in MO, ignore the type of inventory valuation

opw-3081877
opw-3086626

closes odoo/odoo#110478

X-original-commit: af7be17b71fc72d15149c4baabadeacdcf77cc99
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-20 09:40:52 +01:00
Adesh Jolhe eee988bc89 [IMP] hr_org_chart: fix the traceback when we click on See All of the Organization Chart
Steps to reproduce:
- Go to Employee
- Open the Employee profile and click on Work information.
- In the Organization Chart Below the hierarchy See All button is visible.
- Click on the 'See All' button.

Currently, when we click on the ``see all'' button of the organization chart, the traceback
comes. Fixed it in this commit.

task-3133047

closes odoo/odoo#110476

X-original-commit: 9f4e1fa80dc75900fb8a2c979568c3ab8f65a635
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-20 09:40:49 +01:00
niyasraphy 5838a036da [FIX] pos_restaurant: add widget many2many_tags for product_categories_ids in tree
before this commit, in the tree view of restaurant.printer model the field product_categories_ids is showing the value in tree as 1 records, 2 records based on the no of records added in the m2m field.

after this commit, the selected field values will be shown in the tree view, so the end users can see the selected categories without going into the form view.

closes odoo/odoo#110339

X-original-commit: fb7dbfb03f4e7c48d199c98fc852e037d3127d16
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-01-20 09:40:44 +01:00
Michael (mcm) bc82ea7379 [FIX] web: fix issue on reorder list with colspan
The PR https://github.com/odoo/odoo/pull/109461
fixed the size of the dragging row but it did not care
about cells with colspan.
Since this PR, another one (https://github.com/odoo/odoo/pull/110349)
has been opened to manage the colspan in the
section_and_note widget but the issue also exists in
other subclass of list.
This commit moves the fix from the section_and_note
widget in the base list.

closes odoo/odoo#110487

X-original-commit: 9de8080a45773c4fd4fc2882e9135b51e3e613ce
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-01-20 08:40:46 +01:00
Thomas Lefebvre (thle) f700b10ac4 [FIX] sale_loyalty: multiple discount on specific product
Steps to reproduce:

- create a coupon program with a discount type reward on specific product;
- "reward_point_mode" has to be "per unit paid";
- create a sale order;
- add a product several times;
- click on the "PROMOTIONS" button to apply promotion program.

Issue:
We calculate the amount of the discount on the total price of the product.

Expected behavior:
- If you buy 1 product at 100, you can consume 1 point,
each of which is worth 10% of the remaining amount to be paid,
so you have to pay 100 * 0.9 = 90
- If you buy 2 products at 100, you can consume 2 points,
each of which is worth 10% of the remaining amount to pay,
so you have to pay 200 * 0.9 * 0.9 = 162
- If you buy 3 products at 100, you can consume 3 points,
each of which is worth 10% of the remaining amount to be paid,
so you have to pay 300 * 0.9 * 0.9 * 0.9 = 218.7
- If you buy 4 products at 100, you can consume 4 points,
each of which is worth 10% of the remaining amount to pay,
so you have to pay 400 * 0.9 * 0.9 * 0.9 * 0.9 = 262.44
- If you buy 5 products at 100, you can consume 5 points,
each of which is worth 10% of the remaining amount to be paid,
so you have to pay 500 * 0.9 * 0.9 * 0.9 * 0.9 * 0.9 = 295.24

opw-3112925

closes odoo/odoo#110445

X-original-commit: 1a01c8470b1971dfc2b06dcce0e06fe969ac8040
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-01-20 08:40:44 +01:00
Adrien Schoffeniels 9e071ac34c [FIX] utm, *: allow quick creation of campaigns
Purpose:
========
Since the introduction of the required "title" field in the utm_campaign
model in commit [1], quick creation of campaigns from many2ones is not
possible anymore (the slow creation modal is opened when clicking on
"Create"), and the name value entered is not copied into the name field
of the creation form.

This is because the model now has a field "name", and a field "title",
which are both required. The creation using the many2one widget tries to
create a record using the entered value as title and no name, which fails.

It fails because the create method replaces this empty name by a False
value, since it could not generate a unique name given no name.

This commit makes sure that if a title but no name is given when creating
a new campaign record, one does not set the name value to False anymore.

It also makes sure that the value entered before clicking on the "create
and edit" button is copied in the form, by adding the "create_name_field"
option on the many2one fields (the form uses the title field, not the
name).
The "always_reload" option has also been added because without it, the
many2one shows the name of the created record instead of showing the title.

[1]: https://github.com/odoo/odoo/commit/4dbcefb5e5b1878e81fe9be9fe48a785f813334f

Task-3113954

closes odoo/odoo#110474

X-original-commit: 869208cd09b6ceb5dcda55b6fe4131d7cc8d43e8
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-01-20 06:21:02 +01:00
Adrien Schoffeniels 71d90f15b9 [FIX] web: fix create_name_field option of many2one field component
Purpose:
========
The `create_name_field` option of many2one fields in form views does not
work: when setting it, the value entered in the many2one field is copied
in the default `name` field, instead of in the field set, when clicking
on the "Create and Edit" button.

This is because an incorrect prop is used: the many2one component uses a
prop named `createNameField` for that purpose, but passes a prop called
`nameCreateField` to the Many2XAutocomplete component.

This commit renames the `createNameField` prop of the many2one field to
`nameCreateField`, to match the prop used in many2many_tags_field and in
Many2XAutocomplete.

Task-3113954

X-original-commit: c0ff0824d964cd702470076d31c066c5443ce9ca
Part-of: odoo/odoo#110474
2023-01-20 06:21:02 +01:00
ノウラ 1358d9a115 [FIX] stock: make replenishment buttons visible with groupby
Steps to reproduce:

- Install stock
- Go to operations/replenishment
- Group by product or whatever
- Select one or all items

The buttons order and snooze disappear when using group by, to solve the problem we take advantage of showButtons property.

opw-3129241
opw-3126708
opw-3114485

closes odoo/odoo#110475

X-original-commit: 3527215730b0454cf92bf35a16f541748ad294ba
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: nea@odoo.com <nea@odoo.com>
2023-01-19 21:07:51 +01:00
svs-odoo fb60cf19b2 [FIX] stock: _get_rule infinite loop
The `product.product` method `_get_rules_from_location` can call itself
in case `_get_rule` returns a rule using the "Trigger Another Rule"
supply method. But if this rule cannot trigger any other rules,
`_get_rules_from_location` will continue to call itself endlessly until
it reach the recursion's limit, causing a traceback.

How to reproduce:
- In Inventory Configuration, enable "Multi-Step Routes";
- In Configuration > Rules, create a new rule with the following config:
  - Action: Pull & Push
  - Operation Type: Internal Transfers
  - Source Location: same location than the Destination Location
  - Supply Method: Trigger Another Rule
  - Route: Receive
- Insure the created rule is the only one used by its route;
- Insure there is at least one product who needs to be ressuplied;
- Click on Operation > Ressuply --> traceback.

opw-3068546

closes odoo/odoo#110446

X-original-commit: 511eebf7de4b751b776e7b2d1b1d15a08c53171b
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-19 18:50:09 +01:00
Đặng Văn Lộc 40affecb62 [IMP] base: translate report header
Closes odoo/odoo#107376

closes odoo/odoo#110441

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-19 18:50:06 +01:00
payen000 4d254ba1eb [CLA] Update Vauxoo's Contributor CLA
closes odoo/odoo#110438

X-original-commit: 8825d12f9035fa6cb167ab1a7933ea96bffbe6eb
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-19 18:50:03 +01:00
aliya e76d6dc88c [FIX] account_edi_ubl_cii: fix invoice import
Sometimes the invoice import fails, because `payment_terms_node.text` can be None and we're trying to concatenate it with a string.
This commit makes sure that `payment_terms_node.text` is there first.

task-3132980

closes odoo/odoo#110430

X-original-commit: 3a3c83b90ed1bdedc2bb6aca59928225e3fdb55d
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2023-01-19 18:49:56 +01:00
roen-odoo c00efede3b [FIX] pos_sale_margin: correctly compute margin when no cost is set
Current behavior:
If there was no cost set on a product, the margin couldn't be calculated
for the PoS sale report.

Steps to reproduce:
- Install PoS and Sales
- Create a product with no cost
- Open a session and make an order with this item
- Close the session and go to the PoS sale report
- Add the margin measure to the report, and show the stats by product
- The new product does not have any margin.

opw-3120208

closes odoo/odoo#110429

X-original-commit: 9105f803095d7ddb07bc62ec1e2f2982215e273e
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2023-01-19 18:49:53 +01:00
William Henrotin a26db9a3a7 [FIX] stock,mrp: kanban-menu specific to picking type
Since 5b68871097, the scrollable menu of
the picking type kanban card (`kanban-menu`) is the mrp one even for
stock picking type. The inherited view replace the template without
testing the picking type code as it was done before.

This commit adds a `t-if` for stock picking types and another for mrp
one to makes sure the two template are mutually exclusives

closes odoo/odoo#110412

X-original-commit: c7f49d1381ab1bf3dd7ed42436d0c881d7bab27d
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-19 17:49:20 +01:00
bat-odoo 4223162905 [IMP] l10n_in_edi: remove duplicate field in settings view
In this commit, we remove the duplicate `Indian EDI Testing Environment` field
from the settings form view.

closes odoo/odoo#110411

X-original-commit: 5a6930e2ed54dc9c0ae6eb38b4b5546d27ec1816
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Bhavin Patel (bat) <bat@odoo.com>
2023-01-19 17:49:17 +01:00