Before this commit, we had an issue with the width calculated
for data cell (see. sizeOfDataCell).
In some case, the width was 50% instead of taking 100% of the
available space.
This was because some elements of the inner groups that should not
have been visible were computed as if they were, taking an effective
slot in an innergroup's row.
E.g. with two labels:
Before:
"invisible label" and "label" on the same line with `style="width: infinite"`
"data field" on a second line with `style="width: 50%"`
After this commit:
"label" and "data field" on the same line with `style="width: 100%"`
Note that as `infinite` is not a valid value, this wasn't interpreted and
style attribute was empty.
Thanks to grid for still aligning elements even if they are technically
in different rows. It's why we only saw this issue because of the
width of the data cell.
Steps to reproduce:
- Go to Accounting
- Customer -> Invoice
- Create a new invoice
-> See Customer field
Thx to @kebeclibre
closesodoo/odoo#105489
X-original-commit: e177c63e3618e4b9e492a27d1301c098a0066cb6
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Before this commit, following this flow in the Website Builder:
- Enter edit mode,
- Drop a snippet with text,
- Paste a youtube video link,
- Click on the "Embed Youtube Video" option of the powerbox,
=> There is a traceback.
This is coming from the bad function calls in the Wysiwyg to create a
video node.
When [1] reworked the MediaDialog in owl, a first implementation was
done exporting some utils (saveVideos, videoSpecificMediaClasses). But
this implementation was not kept and later changed to use static methods
and properties on the VideoSelector class (createElements and
mediaSpecificClasses).
Unfortunately, the outdated util methods used in the Wysiwyg were not
changed, and it was breaking the youtube video instertions.
This commit changes the Wysiwyg to use the existing
VideoSelector.createElements and VideoSelector.mediaSpecificClasses
static method and property to fix this flow.
[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
task-2687506
closesodoo/odoo#105475
X-original-commit: 4923c20c29170407d43908f983f2a168241f4817
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Younn Olivier (yol) <yol@odoo.com>
When editing a m2m avatar field in the list view, keyboard navigation,
e.g. pressing arrow-left when the focus is on the right-most item,
results to a crash. Also, the "delete" button when in edit mode
is not there anymore so the user is unable to remove items.
This is because we are not building the proper list of tags. More
specifically, we fail to provide `onKeydown` and `onDelete` handler
to the tags, thus, it crashes and no delete button. This proposed
change fixes both issues.
closesodoo/odoo#105467
X-original-commit: 02a046708a96567a41b5f9aec0f71cefc92ab981
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Only server wide modules are being taken into account when calculating translations hash.
So user probably can't get translations of new installed modules unless it is forced by hard page reload (Ctrl+Shift+R).
Problem exists since https://github.com/odoo/odoo/commit/80d74e7ee0eab83dc5100e0776df09d04b882fec and the cause in that `mods = odoo.conf.server_wide_modules or []` string was unpaired with the following `if` statement during refactoring.
This commit restores computation of hash based on all loaded modules.
closesodoo/odoo#105466
X-original-commit: 859cd0463aec4533df30e4839367832fef0685fd
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Before this commit, when uploading an attachment then delete
then re-upload attachment again, the reupload was unsuccessful.
This happens because it should clear the `<input>` of type `file`,
but the condition was wrong and therefore `<input>` was not cleared,
thus keeping same value as before so input was not detected as
changed. A change on this file input is necessary to detect user
interaction file upload.
This commit fixes trigger for clearing the `<input>` of type file,
so that any file upload is properly detected, including uploading
same attachment.
Task-3060429
closesodoo/odoo#105465
X-original-commit: 97f445ae15663486d0100d7127287f9ec3d1d4cc
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit fixes premature usage of `purchase_price` field on
sale.order.line model, before its definition in sale_margin module.
Since this test requires both sale_mrp and sale_stock_margin to pass,
this commit adds an auto-install bridge module that solely address this
issue.
Steps to reproduce:
- Install sale_mrp module
- Run tests (at least .test_kit_cost_calculation)
Problem:
Traceback:
AttributeError: 'sale.order.line' object has no attribute 'purchase_price'
See #100126closes#104891closesodoo/odoo#105458
X-original-commit: ac921c88909110deefa9b91be104244bda12458f
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Co-authored-by: Thibault Libioulle <thibault.libioulle@aerospacelab.be>
name, shortdec, summary fields are added to name search based on the fields set in the filter domain of existing search view of apps menu
closesodoo/odoo#105457
X-original-commit: a33165a78ab888b8c690b5424ed997b94ee8be05
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Unused catch block arguments are now forbidden even when prefixed with an
underscore: if the argument on the catch block is not needed, the use of the
optional catch binding is enforced.
Part-of: odoo/odoo#105433
### Steps to reproduce
* go to Accounting > Settings and activate 'Cash Basis'
* got to Chart of Accounts and create a new account of type
`Current Assets`. We'll call it `A`.
* create a new tax, we'll call it `T`, with the following parameters:
* Tax type: Purchases
* Tax computation: Percentage of Price
* Amount: 22%
* Distribution of invoices:
* add a line with the following parameters:
% = 40, Based On = 'of tax' and Account = the tax paid account.
* add a second line with the following parameters:
%= 60, Based On = 'of tax'
* Distribution of Credit Notes: Add the same lines as
'Distribution of invoices'
* In the Advanced Options tab, set :
* Tax Eligibility = 'Based on Payment'
* Cash Basis Transition Account = `A`
* create a new vendor bill and add a product line to it and set
Taxes = `T` on that line
* confirm and register payment
Now go to Accounting > Journal Items, group by Journal. Look through the
'Cash Basis Taxes' group and find the entries related to the vendor bill
you just made. One of the debit lines on account `A` is not correct.
Here, the account should be the one specified on the invoice line.
opw-2796727
closesodoo/odoo#105445
X-original-commit: b69fc397aad019cc18bd00975d38dde9ffcc985b
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Nshimiyimana Serge Séna (sesn) <sesn@odoo.com>
Before in a legacy client action, using a link to change view and
going back to the client action with breadcrumb does not restore the
scroll position.
Now with this commit, the scroll position is restored when going back to``
the client action.
Steps to reproduce:
- Install Accounting
- Go to `Accounting -> Reporting -> Balance Sheet`
- Unfold the tree to make the window scrollable
- Click on a link at the bottom of the window
- Go back to Balance Sheet
closesodoo/odoo#105443
X-original-commit: 225e809aa3ce1c506be69287e8084adf877547d7
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Website themes make customizations to the default snippets. In
particular, some are applying shapes on default images. To do that, the
customization is not applied on the image directly but by changing its
src to a special web_editor route in charge of automatically adding the
shape on whatever default image the configurator chose for this snippet.
Typically, in a snippet with an image whose src is:
/web/image/website.my_snippet_default_image
The src is replaced by the theme with:
/web_editor/image_shape/website.my_snippet_default_image/website/some_shape.svg
That controller/route crashed since [1], making those images blank
areas in pages generated by the configurator. Indeed, the image from
the filestore was accessed via `file_open` which only allows reading
inside the addons_paths.
[1]: https://github.com/odoo/odoo/commit/da8def8e410de68256ba4ab09ebf7a8b699355acclosesodoo/odoo#105421
X-original-commit: d536e0a23cf0aa06c3ee13fb2c105e83201434e0
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Julien Castiaux <juc@odoo.com>
The search bar had a trace back when searching on a name, and searching on the code prefix did not work.
This was not working because using str(self) does not work in v16, str is not defined in filter domain.
By removing the str and adapting the filter domain logic, it now works as it should. And the behavior of version 15 is restored
closesodoo/odoo#105381
Task-id: 3058778
X-original-commit: 9173e4da3912f8e46f163cc0d38a4a037b591c60
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
**Issue:** When creating a custom filter for a selection field,
the selected value is not properly displayed. Note however that
applying the filter still works. The problem is only in the displayed
value.
This is caused by setting the "value" attribute of the selection
element which is always an empty string (because formatField doesn't
properly work for selection field). However, the empty string is not
the issue because it doesn't matter what "formatted value" is returned,
it is not needed. The selection field's value is based on the value
of the selected option.
**Solution:** To properly show the display text of the selection item,
we need to make sure that value of the selection field is not overridden
during its onChange event. As a result, the selected option will become
the value of the selection field, displaying the proper text.
Therefore, in the onValueChange event handler, if the field type is
selection, we don't reset the value of the the selection element.
closesodoo/odoo#105420
X-original-commit: afadac5e21e6af2111ef42852243e78bb085d7c3
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Current behavior:
When you open the order list, the orders are displayed in UTC.
Steps to reproduce:
- Be sure you are in a timezone different than UTC
- Start a PoS restaurant session
- Go on a table and make and order
- Go on the order list
- Go back on the table, then go back on the order list
- The time showed for the order is not correct (it's in UTC)
This bug was happening because `moment(order.validation_date)` consider
that the date is already in the local timezone, so it doesn't apply the
timezone offset. So we have to apply the offset manually before sending
it to the frontend.
opw-3002417
closesodoo/odoo#105417
X-original-commit: bd366a6d11fd8864b4c2fd2819463449d6da5278
Signed-off-by: Masereel Pierre <pim@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
Before this commit
==================
When we post a Customer Invoice by adding 2 products first one has a positive
unit value and the second one has a negative unit value than the wrong JSON
is generated.
The issue happens because of abs method converts the negative value into a positive.
After this commit
==================
In this commit, we are using the sign amount instead of the abs method.
Effected from this PR https://github.com/odoo/odoo/pull/99401closesodoo/odoo#104876
X-original-commit: 99b99bc672a54665b59efaa3a4e696f6250065c3
Signed-off-by: Josse Colpaert <jco@odoo.com>
Prevent the PowerBox command bar to open in (non html) Odoo field
embedded inside the editable zone.
task-3040872
closesodoo/odoo#105372
X-original-commit: cab3a9b9b89a6b1c0d430e5374feb2f963e466fc
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
To Reproduce
============
- enable QR code on Accounting settings
- with a customer who has a bank account create a credit note for him/her
- in other info tab, make sure that the qr code method is empty
- send or print the credit note
The Problem
===========
the qr code method field will be filled with SEPA, and a QR code will be added to the PDF
Solution
========
Generating a QR code for a credit note doesn't make any sense, so the qr code method field must be hidden
and no QR code should be generated.
opw-3010649
closesodoo/odoo#105385
X-original-commit: 4b0c37833547ff45d2240e51272372a572a920d5
Signed-off-by: William André (wan) <wan@odoo.com>
Before this commit, some error messages and others messages are
not translated.
This commit uses the translation function to be able to translate
those messages.
task-3006627
closesodoo/odoo#105192
X-original-commit: 85ef44cd66474bf5dcda4d7478d566e462d1a550
Related: odoo/enterprise#33717
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Steps to reproduce
==================
- Go to project > My tasks
- Click on load More on the first column
- Nothing is loaded
Cause of the issue
==================
The orm groups by stages for each stage where the user is
the current one or null
-> This returns a null stage when the left join has not match
But we only want stages linked to the current user
Solution
========
When loading project kanban groups and isGroupedByPersonalStages is true:
Add the user_id to the domain
This is the same solution applied in saas-15.3
https://github.com/odoo/odoo/blob/f463d9a6ba95c0df64268b1c577f1b9d1c5bcb25/addons/project/static/src/js/project_kanban.js#L342
opw-3033943
closesodoo/odoo#105367
X-original-commit: 1294ff85aa54aa195e2f1554c6ef426869b90c75
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit, when point of sale order line (in table pos_order_line, Point of Sale app) and empty sale order (in table sale_order, Sales app) shares the same id number, it may create duplicate id in sale_report sql view. Empty sale order is an order with no products, so not connected to sale order line.
Additionally, these duplicates creates some discrepancies between pivot and list view in sale report in Sales app.
This commit fixes the issue by removing sale orders with no order lines.
Steps to reproduce the issue:
-----------------------------
1. Create order in Point of Sale app with minimum pos_order_line id equal to "n"
2. Create empty sale order (no order lines inside) with id equal to "n"
To reproduce issue on runbot, one may check the minimum order line for one of pos orders (assume this is n) and then delete all order lines from sale order with id equal to n.
Current behavior:
----------------------------
There will be two lines in sale_repot sql view with id equal to "-n"
Expected behavior:
----------------------------
Id in sale_report view should be unique
opw-2946444
closesodoo/odoo#105343
X-original-commit: 76711686a261cf0c42110902ab426756c5d43608
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
The image for the sample product was updated in 76141b0d which made the
'Sample quotation' onboarding step hang for databases without any
`product.product` record.
A simple unit test for `_get_sample_sales_order` is included.
Technically, it wasn't possible to add it to the existing onboarding test class
because these tests are run post_install, and would fail on ENT builds because
of pos_loyalty preventing archiving `product.product`s.
--Additional note for 15.3 fw-port:
As logic moved from pos_loyalty to loyalty, which is installed before sale on
runbots, the problem described above resurfaces. We chose this cross module but
simple and limited-impact fix to avoid it.
Task-3045287
closesodoo/odoo#105339
X-original-commit: 0698388aab821e21309cbb2dd2411dac60f71be6
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
In https://github.com/odoo/odoo/commit/4fb0933986534e31337aa1dce3478a67deea72de, we faced an owl error when changing the tour:
"Component is destroyed"
This is due to the tour leaving the kanban view right after clicking on the "Validate" button.
After the validation, the kanban view is reloaded that is triggering a call to "web_search_read".
For some reason, the 'web_search_read' was triggered right after the component is destroyed.
To fix that issue, some additional steps have been added to the tour but this was just making the tour failing in a not determinist way.
Since the root cause of the issue has been fixed since, such additional steps are no longer needed.
closesodoo/odoo#105332
X-original-commit: 6a35a1f5f694a1bf6448ace8b43a8e99e07cfb90
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The rpc service has a protection (when used via useService) that
prevents the returned promise from being resolved/rejected if the
component has been destroyed meanwhile.
However, as the FormView still uses the legacy BasicModel, all rpcs
done by its model do not go through our new rpc service. As a
consequence, before this commit, they did not benefit from the
protection. This caused a non deterministic issue in the main flow
tour.
This commit implements a similar protection as the rpc service, but
specialized for the BasicRelationalModel, which redirects all RPCs
done by the BasicModel.
This change highlighted two scenarios where we sometimes performed
RPCs (or could perform RPCs) on a destroyed component. This commit
fixes those as well.
X-original-commit: f613e916d5e8b465fc360e340094c09037450ff1
Part-of: odoo/odoo#105332
In the quick create form views in CRM, the 'recurring_plan' field is missing
(or rather invisible). It is a required field so it prevents the use
of the quick create.
The purpose of this commit is to let it be visible again to users.
Task-3007756
closesodoo/odoo#105311
X-original-commit: d0deb895bba8deeddb95fc8919ded29b80a869f9
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Before this commit, when compiling a form group, the scope class is
added to the elements of the outer group. It was added on the element
class attribute. The issue is that FormLabel don't have a class
attribute but a className attribute. So the class wasn't shown on the
DOM.
Now, the class is added on the FormLabel className attribute and shown
in the DOM.
closesodoo/odoo#105315
X-original-commit: 214beb39d7c1a315255f0a5a842e60f73e7900cc
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Before this commit, the labels tags that were after the fields losses
their attributes (i.e. classes) after the compilation of the form view
arch.
Now, the attributes are correctly copied after the compilation.
similar to : 873790f802
X-original-commit: 395bdf8880c5929652838a93351596b045708905
Part-of: odoo/odoo#105315
Co-authored-by: Patrick Hoste <pko@odoo.com>
**Issue**
Login as an ordinary user (demo) and open Apps to make a request
access to a module. A wizard will appear asking for the admin users
to request to and the reason for request. Input elements are not
properly shown.
This is because inside an inner group, as we remove the label (cf.
nolabel=1), the input field is put in the first column which is supposed
to be the location of the (non-existing) label.
**Solution**
Make the field take both columns (label + field) as it has no label.
closesodoo/odoo#105314
X-original-commit: 5ab8b9fb6273ebed3f89e8f7a20b8238ea1963ab
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Steps to reproduce:
- select a language where thousands separator is not (e.g. portugese)
- try editing any number input field
Bug:
error when parsing the new value when thousands separator is not defined
Fix:
fixed default value (only fallback to commas if it's not the decimal
Point separator)
opw-3041135
closesodoo/odoo#105312
X-original-commit: 71712acdf259aca7745a8a0b41a022d3abdcb047
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Field indexed by trigram cannot become translated because the
`convert_column_translatable` is based on the old index naming convention
(changed in https://github.com/odoo/odoo/pull/100736).
Then it generates a PostgreSQL error:
`psycopg2.errors.DatatypeMismatch: operator class "gin_trgm_ops" does not accept data type jsonb`
closesodoo/odoo#105295
Signed-off-by: Raphael Collet <rco@odoo.com>
The confirmation dialog to delete a token from a portal user is the
same whatever the linked records. This part of the code is now moved to
a separate function `_buildConfirmationDialog` in order to allow
overrides of the method in particular cases (e.g. Subscriptions).
task-3048269
closesodoo/odoo#105289
X-original-commit: 51d6b724f061af44bc07c342dfa9a34b4d1a2101
Related: odoo/enterprise#33741
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
Taxes on self-invoices for non-EU export actually have amount > 0,
l10n_it_has-exoneration = False but they must have the law reference
field filled out, so we're taking the "invisible" clause
out of the view.
Task: https://www.odoo.com/web#id=3010849&model=project.task
opw-3010849
closesodoo/odoo#105238
X-original-commit: cdb90133ae463f62ade82f67ac89293e09b69740
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
Before this commit, if two or more lines in sale_report had the same value as price_total, they were group together in _compute_kpi_sale_total_value and included in output sum only once. That leads to incorrect values in digest mail.
This commit fixes that issue by changing grouping column from price_total to company_id.
Steps to reproduce the issue:
----------------------------
1. Send Digest Mail for database and check values in it (assume we have both All Sales KPI and PoS KPI).
2. Create several sale_order_line and/or pos_order_line with exactly the same price_total (for example: 5 PoS transaction, each one for one product of value 10000).
2. Send Digest Mail again and check values in it.
Current behavior:
-----------------
The All Sales KPI will increase by value of only one of lines (in our example: PoS KPI will increase by 50000 = 5*10000, All Sales KPI will increase by 10000)
Expected behavior:
-----------------
All Sales KPI should include all transactions from sale_report in given period of time (all sale_order_line and pos_order_line).
opw-2938952
closesodoo/odoo#105248
X-original-commit: 804c485f6afe98c5d63cfe91ce65e0a8352fc92e
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Those tags should only be created by the tax reports; creating them manually makes no sense.
closesodoo/odoo#105227
X-original-commit: 116c8090da9d900c04c9257269b42c462ec77f98
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Prior to this commit, when we clicked on an article, it would flicker on
mobile.
This commit fixes this issue.
task-3058162
closesodoo/odoo#105200
X-original-commit: ec41980851fb98da25a06de3ef79cfcb152ab5dd
Signed-off-by: Masereel Pierre <pim@odoo.com>
Since this balance column is used for different things (e.g. total due),
adding a label allows to properly differentiate what is what.
closesodoo/odoo#105139
X-original-commit: 4aeeceea50ca41ce3ad18950632744bee9ce1a6e
Related: odoo/enterprise#33696
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>