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.
closesodoo/odoo#110530
X-original-commit: 0ab079664e380e5e77440e290ec604e3830108bb
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
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.
closesodoo/odoo#110528
X-original-commit: 43b7ae39e633ced6008b067bb4e63ed9be7eda01
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
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.
closesodoo/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>
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
closesodoo/odoo#110492
X-original-commit: 0393cffa71821ba32af8e9ba54225275647c4e70
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
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
closesodoo/odoo#110338
X-original-commit: 988eafa03b57be3b3a7f110650c61ce8fda88e31
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
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
closesodoo/odoo#109996
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Replace moment calls by their equivalent with the luxon library in CRM, and make
use of date utils from the l10n module.
Task-3056665
closesodoo/odoo#109882
Related: odoo/enterprise#35777
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
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
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
closesodoo/odoo#109560
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
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/ef03db9edd9472201cb2c08a32d20ff0f33a5fdfclosesodoo/odoo#109349
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
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)
closesodoo/odoo#104167
Related: odoo/upgrade#4005
Related: odoo/enterprise#33246
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
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
closesodoo/odoo#100168
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
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
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
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"
closesodoo/odoo#71333
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Co-authored-by: William Braeckman (wbr) <williambraeckman@yahoo.fr>
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
closesodoo/odoo#107200
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
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
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
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.
closesodoo/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>
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
closesodoo/odoo#110517
X-original-commit: 3ff0d4b032e44719f52d09c7bfb701c47a79a5c3
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit, the form view in dark mode had some
coloring issue. This commit fixes that issue.
task-3138224
closesodoo/odoo#110516
X-original-commit: 11cb224a19f5ffdcda50ecf9274259d8ceea5730
Signed-off-by: Kevin Baptiste <kba@odoo.com>
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
closesodoo/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>
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.
closesodoo/odoo#110361
Signed-off-by: Julien Castiaux <juc@odoo.com>
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
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.
closesodoo/odoo#110486
X-original-commit: 008cd34c49574f1b0c50132a75b50111422e431a
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
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
closesodoo/odoo#110477
X-original-commit: 4caf4eb9b957853245a881b645863d6af8a166d1
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
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
closesodoo/odoo#110443
X-original-commit: fdaeaf69c1770edf3f33e32947326d1ebe42820e
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
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.
closesodoo/odoo#110488
X-original-commit: 6de19caf6aa38e040aaf4cb50b17dee894c20984
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/odoo#110478
X-original-commit: af7be17b71fc72d15149c4baabadeacdcf77cc99
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/odoo#110476
X-original-commit: 9f4e1fa80dc75900fb8a2c979568c3ab8f65a635
Signed-off-by: Kevin Baptiste <kba@odoo.com>
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.
closesodoo/odoo#110339
X-original-commit: fb7dbfb03f4e7c48d199c98fc852e037d3127d16
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
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.
closesodoo/odoo#110487
X-original-commit: 9de8080a45773c4fd4fc2882e9135b51e3e613ce
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
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
closesodoo/odoo#110445
X-original-commit: 1a01c8470b1971dfc2b06dcce0e06fe969ac8040
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
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
closesodoo/odoo#110474
X-original-commit: 869208cd09b6ceb5dcda55b6fe4131d7cc8d43e8
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
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
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
closesodoo/odoo#110475
X-original-commit: 3527215730b0454cf92bf35a16f541748ad294ba
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: nea@odoo.com <nea@odoo.com>
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
closesodoo/odoo#110446
X-original-commit: 511eebf7de4b751b776e7b2d1b1d15a08c53171b
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/odoo#110430
X-original-commit: 3a3c83b90ed1bdedc2bb6aca59928225e3fdb55d
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
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
closesodoo/odoo#110429
X-original-commit: 9105f803095d7ddb07bc62ec1e2f2982215e273e
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
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
closesodoo/odoo#110412
X-original-commit: c7f49d1381ab1bf3dd7ed42436d0c881d7bab27d
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
In this commit, we remove the duplicate `Indian EDI Testing Environment` field
from the settings form view.
closesodoo/odoo#110411
X-original-commit: 5a6930e2ed54dc9c0ae6eb38b4b5546d27ec1816
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Bhavin Patel (bat) <bat@odoo.com>