In the BS5 migration, the legacy `checkbox` and `boolean_toggle` widget
were adapted but not the OWL Component.
Also, we have tweaked the old widget and the component to have better
positioning and margins.
Note:
the CSS for the print is already done in BS5
```css
@media print {
.form-check-input {
color-adjust: exact;
}
}
```
Also we change `offsetWidth` by `getBoundingClientRect().width` in
`list_renderer` to avoid inaccurate rounding in columns width's
calculation.
Lastly a `.o-checkbox` class is added to the Checkbox component for a
more universal and context independent targetting.
closesodoo/odoo#96185
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
The "pressing a specific key to confirm/cancel a popup" behavior was added but the problem was that
some popups only had one button which was either confirm or cancel. It was thus possible to close
those popups by bypassing the default behavior (e.g. possible to "cancel" a popup which only
has one button linked to an overridden confirm method and vice-versa). Also, we normalize the use of
`confirm` and `cancel` methods in the popups so that when the specifics keys are pressed, the right
behavior is executed.
closesodoo/odoo#97069
X-original-commit: a14ade59744855a9dea8b16f23a3d61eb88678de
Related: odoo/enterprise#29957
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
To make cleaner code and keep a similar API than fields, the
extractProps static method is added to the the widgets.
extractProps allows making new props out of the attrs of the widget
node.
Part-of: odoo/odoo#96843
No need to set carrier_id to False.
This is already taken care by `delivery` module since 448312173.
closesodoo/odoo#79231
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Before this commit, in a ListView, the view context was not used when
creating a record.
This caused some problems:
- the record does not use "default_" to initialise its data
- server-side required fields that are not present in the arch and
have a value given in the context return server errors
closesodoo/odoo#97165
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
We keep the statement line note when changing
the partner in reconciliation widget
Steps:
- Create a Bank Statement, a Bank Statement
Line BSL with a note (field narration)
- Save, edit, change partner on statement
line and save.
-> The note on BSL is empty
With this commit we allow narration computation
only for sale documents.
opw-2832287
closesodoo/odoo#97125
X-original-commit: 19394d1971259933c5158139c56344c9c35bdaed
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
The way the code has evolved, `create` is now no more than an
unnecessary indirection for `insert`.
This PR removes `create` and replaces its uses with `insert` directly.
closesodoo/odoo#97058
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, an error was raised when an invisible button was
found on a list view (for example, if it has a group).
Now, the invisible buttons are correctly managed.
closesodoo/odoo#96963
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
auth_totp module added user_id in session_info, but it's not in the depends of project and web_editor module.
To avoid traceback after uninstalling auth_totp module:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0'),
we should use uid instead of user_id in js code.
closesodoo/odoo#96880
X-original-commit: 81b92a61907028f71b1337b11d0d60ee98bb5775
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Steps to reproduce:
1- install sale, accounting
2- create a fiscal position fp that maps
tax inc t1 to any other tax t2
3- create a delivery product dp with t1 and mark it "can be sold"
4- create a new delivery method with dp
5- in a new sales order, choose fp, click on add delivery
6- the unit_price is wrong, it hasn't mapped t1 to t2
7- try adding the delivery as a product in a new sales order line
8- the unit_price is correct and the taxes are correctly calculated
Bug:
`_create_delivery_line` is not using the same logic used
when normally adding a sales order line although technically
delivery product is still a product
Fix:
use `_get_tax_included_unit_price` to get the correct unit_price
OPW-2806965
closesodoo/odoo#96874
X-original-commit: 03bb18d12606447faaed0de04bb83dde5de53b96
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>
`_post_dispatch` is a late addition to the httpocalypse. It can be used
to alter the response object e.g. to inject headers or cookies. The
function is automatically called for regular, fallback and error
responses. On the other hand, `_dispatch` is only called when an
endpoint is matched and might not return a response in case of error.
task-2839031
closesodoo/odoo#96651
Related: odoo/upgrade#3710
Signed-off-by: Julien Castiaux <juc@odoo.com>
Step to reproduce:
- Create variants for product without grid
- Go to website
- Try to add variant of created product to wishlist
Current behaviour:
- Product ID is not properly fetched
- Product template is added to wishlist
Behaviour after PR:
- Product ID is properly fetched
- Product is added to wishlist
opw-2705883
closesodoo/odoo#96274
X-original-commit: f7ce60511c64002b84d3b4dbd66a2f52becc46fc
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
This commit fixes following html block [1]
``` xml
<div class="fc-content">
<span class="fc-time">08:00</span>
<div class="o_event_title">Mitchel Admin - Administrator</div>
</div>
```
`rtlcss` lib changes `padding-right` to `padding-left`, which doesn't work if we
use `span` block next to `div` block, because position of the blocks are not
changed (time is still on the left side and title is on the right). Adding the
`ignore` directive solves the issue.
[1]: https://github.com/odoo/odoo/blob/4a996060e6b922fecb299eca32d6763dbb12b831/addons/web/static/src/legacy/xml/web_calendar.xml#L16-L17
opw-2925491
closesodoo/odoo#97129
X-original-commit: e6807b75e33ab3a083c84ace0b6c337e7566e64b
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
Currently, when enabling watch mode on a tour the tour's timeout does
not change. This is usually an issue because:
- watch mode makes tours a bit slower, so they can timeout even
without doing anything
- trying to diagnose what's wrong, it's common to add check steps with
a long timeout or even a `debugger` statement, which trips the
python-side timeout and kills the tour
To avoid needing to remember to update the timeouts (then revert them
afterwards), just bump the timeout to 1h by default, or 10x the
original time for very long tours (e.g. qweb test suite, which
currently has a 30mn timeout).
While at it, forward the watch mode status to the client via the QS,
so we can eventually make use of it for one reason or an other.
closesodoo/odoo#96994
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Columns involving price within the downloaded e-faktur document is supposed to report prices that does not include tax.
When taxes are configured to not be included in price (account.tax field: price_include), result would be correct.
However, if the tax configurations is "Included in Price", the price columns will not respect the official e-faktur guideline. Consequently, it will also result to the discount column to be incorrect due to the calculation.
2889400
closesodoo/odoo#97049
X-original-commit: 633c89bcc00cea674f2582c25dadafb2792d9945
Signed-off-by: William André (wan) <wan@odoo.com>
Steps to reproduce:
1- create a company in saudi arabia
2- install l10n_sa and l10n_gcc_invoice
3- enable LN/SN on invoice from settings
4- configure a product with lot number
5- make a SO with that product
6- create an invoice and post it
7- print the invoice
8- Lot number information is missing on the invoice
Bug:
the implementation in
https://github.com/odoo/odoo/blob/15.0/addons/l10n_gcc_invoice/views/report_invoice.xml#L11-L16
is ignoring the inheritance in
https://github.com/odoo/odoo/blob/15.0/addons/stock_account/views/report_invoice.xml
so any view inheriting "account.report_invoice_document" will
not be called.
For stable, it can be solved with a bridge module.
For Master or for future versions, I think the implementation in
https://github.com/odoo/odoo/blob/15.0/addons/l10n_gcc_invoice/views/report_invoice.xml#L18
should be inheriting "account_report_invoice_document" instead
of overriding it. this will help eliminate the need for such
bridge modules in the future and reduce redundancy
Fix:
Create a bridge module between `l10n_gcc_invoice` and `stock_account`
OPW-2893130
closesodoo/odoo#96933
X-original-commit: 0d781b636f5fd19408e858323e83c223451adad6
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>
When a table was deleted and the ticket screen was already loaded once with orders, if a table was deleted, the ticket screen cache would keep the tables recorded on the order.
Now, when a table is deleted, the ticketScreen cache is reseted.
This fix also delete the table from the list of the model.
closesodoo/odoo#97157
X-original-commit: 134c3228e02b3fbabdb411de872ff717a26a832e
Signed-off-by: Masereel Pierre <pim@odoo.com>
Before, when trying to do a refund from the floor plan, it was triggering an error.
Now we check if a table was set on the order. If the order was set on the order, then we make the refund on the same table.
If no table was set, then we take the first table available in the list.
X-original-commit: 53e2f382a18a7eda6e15934d36dfbe350b6a2e32
Part-of: odoo/odoo#97157
In the pos restaurant/bar the orders are linked to a table.
When a table is deleted, we try to load the table name to display it in
the order list. To avoid error, we only display the table name when a
table is set on an order.
OPW-2835603
X-original-commit: 974690616b953fc158a3cbcb49b12024258821e4
Part-of: odoo/odoo#97157
Check whether the product ID of the first item exists inside product_data
before trying to access it. Although it means the first item still does not
appear, both products will be present in the user's cookies.
When the user refreshes the page or navigates away, both products will be
visible in the comparison panel.
closesodoo/odoo#97152
X-original-commit: 5c6a92d0eb1e61cc2225a1b84ca1fb6c11365f2b
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
When the payment reference on an invoice is empty an error occurs when
trying to generate the edi xml. The error comes from trying to retrieve
a slice on a bool.
To solve this, a t-if has been added in this commit, such that the
function is not called when the field is empty.
closesodoo/odoo#97151
X-original-commit: 67616aac66a0b7895dfad80d825ecff7b4cd75b1
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Daniel Kosky (dako) <dako@odoo.com>
As we allow editing balances in processing state, we do not want
to check balances before the validation of the bank statement
(only in case of a bank journal).
Commit about editing balances: 03f83eb87da00938b9d2df78651c1e06cf8a6d58
This fix split the _check_balance_end_real_same_as_computed into
2 functions. One to check "bank" bank statement and one to check
"cash" bank statement. It allows to keep the same behavior for
a "cash" bank statement when we post the bank statement, and
having the right behavior for a "bank" bank statement.
opw-2835728
closesodoo/odoo#97153
X-original-commit: 2d97efb4c84f647be3eb03f249c52b236bf00d55
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
In the XML, on the field holds the untaxed amount but it should have the taxed amount.
The field inside the xml correctly takes the total amount of the
invoice, but on the invoice in Odoo when using a RC tax, the tax amount
is 0 in Odoo, so the total amount will be as it is untaxed on the XML.
That's because the repartition lines are +100%/-100% distributed, but in
the self-invoice they must be exported as +100%, so we re-add them to
the total.
Task link: https://www.odoo.com/web#id=2936967&model=project.task
opw-2936967
closesodoo/odoo#97147
X-original-commit: 83e41d6f1adc30e24cda95c5f4ab2a875e1bcaa0
Signed-off-by: Josse Colpaert <jco@odoo.com>
Fields with widget `radio` and `boolean` can't be edited
Steps to reproduce:
1. Install Discuss
2. Connect as demo and go to your preferences (top right)
3. You can't edit your notification type
Solution:
Use widgetOptions' mode along with hasReadonlyModifier to disable the
fields
Problem:
This PR https://github.com/odoo/odoo/pull/88223 modified the value of
hasReadonlyModifier which is used to disable radio and boolean fields
opw-2898464
closesodoo/odoo#97106
X-original-commit: 6befccd7c8ac22fe4da2a741efeecde2d036a7b9
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
Steps to reproduce the bug:
- Create a storable product “P1”:
- routes:
- MTO
- Manufacturing
- Create a SO:
- Select the product “P1”
- Confirm the SO
Problem:
The created MO is in confirmed state instead of draft.
This blocks the user, for example imagine that he has configured
the product with a first BOM without components and 2 others with
components. when the MO is created, the first bom will be selected,
and as the MO will be confirmed, the user will not be able to
select another BOM
Solution:
Since the MTO rule is not linked to an order point, we could be more
flexible, so the production created via `_run_manufacture()` without
bom or with a bom without component and operation via the MTO mechanism
will not be confirmed
opw-2897267
closesodoo/odoo#97099
X-original-commit: c623478aba040c0493e6da8a67c9742880572199
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
In the context of an action, one can specify the "dialog_size" key
(only useful for actions in target="new"), which impacts the size
of the dialog. Before this commit, the corresponding bootstrap
classname wasn't applied. As a result, the dialog size was always
"large". This commit fixes that issue.
closesodoo/odoo#97085
Signed-off-by: Géry Debongnie <ged@odoo.com>
An X2many always has at least 4 lines. If the X2many contains less
than 4 filled lines (Record or "Add a line") empty lines are added
to make up the difference.
For example, an X2many in edit mode containing only one record:
- Line containing a record
- Line containing "Add a line
- Empty line
- Empty line
closesodoo/odoo#97070
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Odoo may resize attachment image with side larger than 1920 pixels.
But for animated gifs, this resizement seems to in general increase size
file which is not what we want (in some case making it grow from 3MB to
60 MB).
So with this change, we only resize and optimize images that are not
gifs.
Reasoning: pillow doesn't seem to resize GIF (and seems to only increase
their size, especially animated GIF, because each frame is not
optimized) so we should just not touch them.
Note:
- currently tiff were not resized (because of a mimetype typo)
- currently image dimensions were not resized (from our test, resizing
on the dimension does not change the size much, quality is most
important).
both of these issue have been solved in this commit.
opw-2897291
closesodoo/odoo#97083
X-original-commit: 6d903d61adba11c9e46009511fd4065dbc8a9e0c
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Since the migration to BS5 at [1], the feature that makes a "+" button
appear at the end of the website menu was not properly working anymore
(the "+" button appeared while there were still enough spaces for more
menus).
This is because the logic uses regexes to match ml-auto and mr-auto
classes which do not exist in BS5 anymore, as they have been replaced by
ms-auto and me-auto classes (for "start" instead of "left" and "end"
instead of "right"). This also adds the new XXL breakpoint to the regex
(to match ms-xxl-auto and me-xxl-auto classes). This also adds a comment
so that if we were to grep searching for ms-auto or me-auto classes in
the future, we will find this code.
[1]: https://github.com/odoo/odoo/commit/971e5a91aab96d36129a823e03f1f9f1b1293968closesodoo/odoo#97081
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Before this commit, in a ListView, a field containing an invisible
attribute using an expression to be evaluated was never displayed.
Example:
<tree>
<field name="foo" invisible="context.get('notInvisible')"/>
</tree>
The foo column is never displayed.
The solution is to use the column_invisible modifier to know if the
column should be displayed or not. column_invisible contains the
evaluated expression of the invisible attribute by the server.
closesodoo/odoo#97066
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Steps to reproduce:
- Open Settings
- Add Languages
- Select a language
- Click Add
=> Text in the "Switch to..." button is miss-aligned and color is
unreadable.
This commit fixes the alignment by removing an exception to the dialog
footer's buttons alignment selector which is no longer needed and to
avoid confusion between inner-fields and buttons container.
Also, it fixes the color by rendering the language name as a readonly
text instead of a link inside a button (sic).
closesodoo/odoo#97007
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Before this commit : When using the cutoff option (e.g. on journal
entries), the percentage in the wizard is displayed with 6 digits precision
After this commit : The percentage is displayed using only 2 digits precision
opw-2896143
closesodoo/odoo#96876
X-original-commit: d71e46dc8369b4d4c929321277a104f6db3fa7a8
Signed-off-by: Laurent Smet <las@odoo.com>
Before this commit, the checkValidity of a record did not wait for
the application of the current updates. This was causing crashes or
records being abandoned despite an update being in progress. It is
necessary to wait until all updates have been applied before checking
the validity of a record.
For an x2many in list mode:
- create a new line
- edit the line in a valid way
- click outside the x2many while the onchange is in progress.
Result before:
- display a crash
Result after:
- X2many correctly updated
For a list view:
- Create a new record
- edit a field of the record in a valid way
- click outside the list view
Result before:
- abandon the record
Result after:
- the record was saved
closesodoo/odoo#96725
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
After [1] moved the website edition in the backend, we feel that the
code required to make the additional debug icon in the footer of the
frontend still work is not worth it.
Before this commit, on a website page, it was not working: clicking on
it from the WebsitePreview client action would only remove the debug
mode of the frontend, and the backend would keep it.
The user can now leave the debug mode from the debug menu systray item
and we consider that leaving debug mode as a visitor (from the
frontend) is not a feature worth keeping.
[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
task-2687506
closesodoo/odoo#95499
Related: odoo/upgrade#3721
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit redesigns the `TrackingValue` component.
Part of the ChatWindow/Discuss redesign
task-2823627
closesodoo/odoo#92872
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit redesigns the `Message` component for the ChatWindow,
Discuss and the Chatter. The purpose is to make the chats more
user-friendly.
task-2823627
Part-of: odoo/odoo#92872
Prior to this commit the placeholder color was different when inputs
used the `.form-control` class.
This commit fixes this color difference.
task-2823627
Part-of: odoo/odoo#92872
In this commit we fix the tax calculation
when applying a global discount in PoS.
Before this commit, when applying a discount
tax was calculated properly only in the use
case where in one order we had:
- products with a single one tax
After this commit, the calculation of discount
and taxes is extendeted to include these additonal
use cases:
- products with more than one tax applied to them
ex. Product A -> 10% + 20%
- products with different taxes in the same order
ex. Product A -> 10%
Product B -> 20%
- products with taxes that are included in prices
ex. Product A -> 10% (included in price) + 20%
Overall, we tried to follow a general approach
that will include as many use cases as possible
and every combination between them.
task-2421429
closesodoo/odoo#90505
Signed-off-by: Masereel Pierre <pim@odoo.com>
When making transaction with 'validation' type and where fees
were active, fees were added to the amount.
This behaviour is problematic because
validation operations are used for tokenization for example where
no credit should charged to the customer.
Now validation operations have no fees even if fees are active
on the acquirer.
Task - 2784765
closesodoo/odoo#96712
X-original-commit: 69b04e753ab4e90e68b9d3e678ebea277586e7ac
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Steps to reproduce the bug:
- Go to Inventory→ Configuration→ Warehouse Management →Operations Types
- Go inside “Manufacturing”, and disable the checkbox
“Create New Lots/Serial Numbers for Components” under the traceability
section
- create a MO with a traceable component
- Confirm the MO
Problem:
You can create a new SN for the component without any warning,
while the user is supposed to be blocked by a user error:
https://github.com/odoo/odoo/blob/master/addons/mrp/models/stock_lot.py#L11-L16
The solution:
We need to add the `active_mo_id` key in the context so that the user
error will be triggered
opw-2900256
closesodoo/odoo#96648
X-original-commit: 6d0ddc388d1c389e1911a6bb1c59c252870da1a7
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Steps to reproduce:
- install approvals
- in the approvals app go to filters>add custome filter> approval type
Issue:
- traceback
Cause:
- When no other module is installed, there is nothing to display under
the approval type filter. Even if the field is not required,
the javascript try to access the first element of the selection array
to auto-fill the menu.
Solution:
Add a check, if empty and not required, do not display it and leave the
field empty
opw-2895516
closesodoo/odoo#96617
X-original-commit: 7fdbb1783ec65919a709e5fcac111994d0eb3cd5
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
Co-authored-by: nle-odoo <nle@odoo.com>
This commit adds an 'Add To cart' snippet to the 'Web Editor'.
The snippet works as follow:
1. You choose the `product template` that you wish your users to buy.
2. If the product has more than 1 `variant`, a widget will offer you to either
let the visitor choose - this will open a modal for him to choose the variant
by himself - or select a variant yourself.
3. if `visitor choice` is not selected, a `buy_now` or `add_to_cart` action can
be configured; this will determine the behaviour of the button after the user
clicks it.
task-2824359
closesodoo/odoo#91882
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Co-authored-by: Morgane <morm@odoo.com>