* Remove AST in favor of pure Pyhon. This should make it easier for
developers to understand and create new directives because they do not
need to know AST.
* Remove `t-call-options` as it has been merged into `t-options` for more
consistency. Support for t-call-options is retained.
* Use generators for lists. This increases performances as the rendering
can be sent directly without having to wait for the creation of the
entire list.
* Optimize expressions runtime computation by pre-computing the static
parts.
Example:
'<' + 'div' + '>' + '<' + dynamic_value + '>'
Now compiles as:
'<div><' + dynamic_value + '>'
Steps to reproduce:
- Install purchase and accounting apps
- Set the database to a language that is not English
- Create a purchase order
- Remove purchase representative from PO (otherwise, no issue)
- Action -> Create Vendor Bill
- From the vendor bill, print invoice
Issue:
The pdf is in English (country names, date labels, etc...)
Cause:
If invoice type is `in_invoice` or `in_refund`, it will use the
`invoice_user_id` language (object.invoice_user_id.sudo().lang).
In the above case, there is no invoice_user_id on invoice.
Solution:
While preparing invoice values, set invoice_user_id to
self.env.user.id if not user_id on PO.
opw-2510134
closesodoo/odoo#74671
X-original-commit: 4b7569ce641a6fb20d5df676bf0b315d9b9d485d
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
When computing the inverse of `journal_id` on a batch of
`payment.acquirer`, a payment method is created if there isn't any.
As this process can only be done for one acquirer at a time, we must
populate the data accordingly.
closesodoo/odoo#74668
X-original-commit: 493b1ca54d6831f044726b2d8942e7e7f7ce3098
Signed-off-by: William André (wan) <wan@odoo.com>
Step to reproduce
- Change the language to another language than english
- Go to point of sale
- Open a session
- Click on 'Client'
- On the list screen, the button 'Select Customer',
'Deselect Customer' and 'Change Customer' are not translated
This fix is about to rewrite terms which has been deleted after a
first fix made on commit 00e177ba0a3e7e5d25e685c8d07732e3e11676de
opw-2596436
closesodoo/odoo#74662
X-original-commit: 615104b64eccf27670bc5ab88996ec7b93149769
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: guva-odoo <guva-odoo@users.noreply.github.com>
Issue: When preparing a work order for a product on which the bill of material had a line with duration set to 00:00, the work order expected_duration for that line was set to 60:00
Steps to reproduce :
1) Enable Work Orders under Manufacturing Settings
2) Create a Bill of Material for a new product "test"
3) On the BoM Form, go to Operation, add a line
4) Set an operation, a work center and for Duration Computation, set it to manually and 00:00 minutes and save
5) Create a manufacturing order for that product, check the Work Orders tab of the Manufacturing order form, the duration is set to 60:00
Why is that a bug:
Since we can set a duration of 00:00 in the Bill of Material, it means the work order can take 00:00 as expected duration, however it was set to 60.0 since 00:00 is evaluated as 0, which is considered `False` in a conditional assignment that was catching the case where the variable was `None`, which it can never be since it is a fields.Float that will be 0 in case of a `None` or `False`
opw-2603928
closesodoo/odoo#74660
X-original-commit: 331b4c3aa69b06316e762f79f17e882f40e1870e
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Previously, the debug manager was rewritten with the new webclient
architecture, however, because the frontend did not have access to the
new infrastructure (env and services), the old debug manager was kept
and used only in the frontend.
Since odoo/odoo#72675 the new env and services are now available, this
commit simply uses the new debug manager in the frontend and removes the
legacy code.
closesodoo/odoo#74609
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The error message when resetting a payment to draft and changing the date is not adequate. This aims to guide the user to the appropiate journal entry where changes are required.
part 2 of task [2533660]
closesodoo/odoo#73470
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Payments that are modified have no real traceability. It would be useful to see a list of modified fields in the chatter, therefore tracking was added to a number of fields.
Date changes on journal entries (account.move) are also tracked in the chatter
part 1 of task 2533660
Before this commit: When applying active filter using progressbar in activity
view, records are not displayed based on active filter, row was not getting
highlighted based on active filter also other records not getting hidden.
After this commit: When applying active filter in activity view using
progressbar, row will be highlighted and records will be sorted based on active
filter value, like if 'green' color is clicked in progressbar then records with
green color will be displayed on top also other color records will get hidden.
task-2550959
closesodoo/odoo#74405
X-original-commit: 0fbed7291d4d242d663f3b816904525dd5b65c0c
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Steps to reproduce:
! Chrome version >= 91.0.4472.114 (no issue on <= 90.0.4430.51)
- Install Accounting module
- Go to Customer Invoices and create a new one
- Add a customer with a very long name, add product then save
- Go back to list view
- Ensure that the column "Customer" does not display the full
customer name
- Try to resize "Customer" column
Issue:
All columns are resized.
Cause:
Since Chrome 91.0.4472.114, `max-width` on column cause
an issue with table.
The issue is triggerd when a <th> width size
exceeds the maxWidth size.
Also, when resizing, the maxWidth of current collumn stays the same.
Solution:
On resizing, update also, maxWidth with new width value.
opw-2585307
closesodoo/odoo#74649
X-original-commit: 0cc1a5863a1dee27ab5b8500c6de75628f1c441c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
The non readonly computed field with inverse on the company was raising
an access error for users that have accounting rights but not admin
rights to write on the company.
opw-2446242
closesodoo/odoo#74643
X-original-commit: 0b2fa7b0e5d826b1ba08cd7723a3f40b792e82ba
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: William André (wan) <wan@odoo.com>
Steps to reproduce the bug:
- Change the language in odoo preferences (e.g: FR)
- Go to pos app > Configuration > Point of sale
- Choose anyone > Edit > Enable “Global discounts” option
- Open new session with the same pos
- Click on “Discount”
- The button "cancel", “confirm” and "ok" are not translated
opw-2615309
closesodoo/odoo#74641
X-original-commit: ace4ac0568c63aef2bcb41f7c613a7f1275a092a
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
- Remove the class "text-uppercase" from "add to cart" and "buy now"
buttons.
- Increase font size of the product page breadcrumb.
- Rename "Default" into "Featured" in the sort by of the shop page.
- Add a scrollbar on the cart popover.
task-2574300
PR-73234
After this commit, the cart quantity (in the navbar) increase after
the animation instead of before the animation.
We also changed the animation of the cart quantity to have a small
zoom when the number changes instead of an hide followed by a fade in.
task-2574300
PR-73234
Transpile odoo-modules into async function rather than simple functions.
The aim of this change is to support top-level await.
closesodoo/odoo#74629
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Trying to delete forward a non editable was erasing the first
character of the non editable.
Trying to delete backward one character after the contenteditable false
made the cursor jump before the contenteditable.
closesodoo/odoo#74623
X-original-commit: 9b7d9ad3771579ccb60a1be526f5d7571f64e638
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
The generator was quite confusing and also
did not provide enough flexibility for when to
stop traversing and under which condition it is
going down the tree.
This refactor was necessary for a future commit
that require to use the new parameters `isNodeDescendantTraversable`
and `stopFunction`.
X-original-commit: c8d44120b49ac967ac12f3715bdaf83cdff3c4c6
Steps to reproduce:
- Install Expenses module
- Go to Expenses (list view)
- Select multiple expense in `To Submit` stage
- Click on Action -> Create report
Issue:
Report is directly in Submitted stage.
Cause:
Submitting report on creation.
Solution:
Do not set 'sumbit' satge on report creation.
opw-2586184
closesodoo/odoo#74615
X-original-commit: 7cb6cfad0dc8254c3668f6d3c5a0be1a85051ab3
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
This reverts commit 3190bbe8be9685bc936d92b9840d567be120b85c.
It introduced a bigger problem where the m2m table would have a width
of 0 and not be visible when switching page in the notebooks.
closesodoo/odoo#74619
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This tests should be part of the basic l10n test to ensure that the UI
is valid and can be opened.
closesodoo/odoo#74605
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Progress bar on image upload was introduced with #65828 in saas-14.3.
Since, it has been broken in saas-14.3 with 3765ac1 which broke the flow for
image unrecognized by PIL, see the other commit of this PR.
It was also completely broken in master (saas-14.5) with the wowl refactoring,
where no progress bar were shown at all. It would show empty toastr.
This was fixed with #74027
This commit introduces a complete testing suite for that progress bar:
- Single image upload
- Multi image upload
- Success upload
- Unsupported error
- Unrecognized error
task-2607393
Closes#74122closesodoo/odoo#74454
X-original-commit: 381d432faf8d19e71ff1d63c29a14064a6d7f57f
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Since 3765ac1f1f16, uploading an image not recognized as such by PIL would not
behaves as it should.
Step to reproduce:
- Enter edit mode, drag & drop a snippet with an image
- Double click on the image to open media dialog
- Upload a local image of type `.webp`
- 2 toaster are shown:
1. A progress bar toaster with a generic message "File could not be saved"
2. A generic warning toaster on top of the previous one with the correct
error message "[..] format is not supported. Try with: .gif [..]"
Instead, only the progress bar toaster should be shown, and the error message
should be displayed in it.
task-2607393
Closes#74122
X-original-commit: c143e7d27ce25c88854fc3c2980f399add848cb3
BEFORE: e.g. navigating with arrows in a dropdown menu when the home menu is showed conflicts (focused item changes in the same time in the dropdown and in the home menu)
AFTER: the home menu will not receive keydown events that are stopped by the hotkey service.
Taskid-2578926
closesodoo/odoo#73130
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
As the dropdowns have been reworked in the new webclient framework, here
is an improved version of this preliminary design.
Implemented specs:
- nested dropdowns open themselves horizontally (at right by default)
- keyboard navigation is fully adapted to this new design
- up/down focus previous/next item in opened menu
- tab/shift+tab focus next/previous item in opened menu
- home/end focus first/last item in opened menu
- right/left open/close a sub dropdown
- enter selects the focused item
- escape closes the current dropdown
- add "loop" behaviour for keeping pressed down arrowup and arrowdown keys
Taskid-2578926
This commit encapsulates the positioning logic of the Popover component
into a reusable hook. It also improves this logic by adding more
positioning directions and functionalities.
Before:
- only 4 directions (top, bottom, right, left : all middle aligned)
- the whole window viewport serves as a direction toggler
Now:
- 12 positions are available and are composed by 4 directions and 3
variants: {top,bottom,right,left}-{start,middle,end}
- the positioned element container is configurable. Default: window
Description:
When you use this hook, you make sure that your `popper` element (the
one you would like to position) is always placed at the given `position`
from the `reference` element. If positioning it so the `popper` element
is clipped off the `container` element, sensible fallback positions are
tried. If none is fully visible without being clipped off `container`,
the original position is used.
Usage:
usePosition(
reference, // [mandatory] HTMLElement or function giving HTMLElement
options // [optional] configure behaviour through options object
)
Options:
- popper (string): a t-ref reference. If none, component.el is used
- container (HTMLElement)
- margin (number)
- position (string): {top,bottom,right,left}-{start,middle,end}
Taskid-2578926
Margin has been added to both Order and OrderLine allowing the user to have a better view on his profitability. Margin also has been added to the order report as a measure.
Related task id: 2455794
closesodoo/odoo#66689
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
The `tz` field was no longer clickable on the employee form
because the warning tooltip was getting the click event even
though it was not visible.
closesodoo/odoo#74600
Taskid: 2591003
X-original-commit: 630b4db8a2f0a0faf2dd2230c76d9dc682a9bacb
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Before this commit, all items from the same category were grouped
together because we were sorting items within categories rather than
sorting all items after getting them from the various categories.
closesodoo/odoo#74598
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
In some use cases, the seller in point of sale needs to add a note on an
order line that has to be displayed on the receipt. So we've added a
field on the order line to set a note.
The note is also set on the invoice if the order is invoiced.
closesodoo/odoo#71598
Task-id: 2556994
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
As validation transactions are authorized rather than captured, they are
refunded with a void request. Before this commit, a voided validation
transaction was mistakenly flagged as canceled while it should have been
confirmed.
This commit makes the distinction between a voided regular transaction
and a validation transaction.
task-2612977
closesodoo/odoo#74581
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Currently, the default invoice origin for the sale action_view_invoice
is being passed as a list by using the mapped method. This causes that,
when an invoice is created from this view, the origin is set to ['SOXXXXX'].
With the fix, we properly pass the origin as a string so the origin is set
as SOXXXXX, which should be the expected. Notice also that the context is
only passed when dealing with a single SO.
closesodoo/odoo#74579
X-original-commit: 3ad1310eb88581333bb8ccb28b859abcbadabe42
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Steps to reproduce:
- Install "Point of sale" and "l10n_fr" modules
- Switch to french Company
- Go to user preference and change language to "French"
- Create a new POS with french certification installed
- Run the POS
- Try to change quantity of a product
Issue:
Impossible to encode a quantity with decimals (add a line at 0 instead)
Cause:
The popup return value is a string.
The value is used before coverting it to float.
Solution:
Parse quantity value like a float before using it.
opw-2608707
closesodoo/odoo#74578
X-original-commit: 6a265e2c334b55ad796c015a072d0c1b0be738b5
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
Even in the interface, when we empty a string, the value
in the database is '' and not NULL. So, we should let the user
put the field to '' again. (as it is not required)
This will require un update, but otherwise, it just relaxes
the constraint.
closesodoo/odoo#74572
X-original-commit: bc64805e27c9f31f446680aa2398affb945ffd83
Signed-off-by: William André (wan) <wan@odoo.com>
The goal is to take into consideration that in case the TAX ID
is issued by the same member state as the vendor's,
then VAT charge is not reversed.
The VAT ID must be foreign as from the vendor's point of view.
closesodoo/odoo#74566
Task: 2596204
X-original-commit: c92ebc91e261827dfafa602eae5408de2a072609
Signed-off-by: William André (wan) <wan@odoo.com>
Edit a website menu label with:
& < > " ` '
This is what is shown after saving:
& < > " ` '
This is happening since ea4dbcd240: characters &, <, >, ", `, and ' are
now always escaped. Before that commit, only < and > where escaped and
only when an image was inside the label.
With this change, we unescape the label when we are editing a menu.
opw-2609413
closesodoo/odoo#74558
X-original-commit: ab77054987287444c5f6141b047a63bab4b67baa
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Step to reproduce:
- Change the language to any language other than english
- Go to PoS and open a session
- Click on "Client" and select a client
- The button 'Select Customer', 'Deselect Customer' and 'Change Customer'
are not translated.
Cause of the issue
- The term 'Change Customer' was missing in pos.pot
- Translation was not enabled in JS file
This fix complete the one "done" in commit 00e177b
opw-2596436
closesodoo/odoo#74565
X-original-commit: da5b236f7375d35309a59d8e548309d5381a81cb
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Hook to be overridden when we need to add some field to product and use it in variable factor from price rules.
closesodoo/odoo#74561
X-original-commit: 6ec768d084da6bd7344c45750a2a5037ec366143
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
We are getting the order lines out of the main receipt template, to be
able to override it the sweden localissation module, and so having lines
separated depending on the type of products.
closesodoo/odoo#74554
Related: odoo/enterprise#20004
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Before this commit, the payment function `_get_validation_amount` was
overridden by Stripe to specify a validation amount of one currency unit
while that amount was in fact never passed to Stripe in the validation
flow. The amount stored on the transaction was therefore incorrect.
This commits removes the override to let the default amount of 0 being
set on validation transactions.
task-2612977
closesodoo/odoo#74543
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Prior to this commit, not all operations of the Stripe webhook were
encapsulated in a try/except clause. If a `ValidationError` was raised
outside of that clause, it was returned as-is to Stripe.
This commit encapsulates the whole webhook event processing with a
try/except clause to make sure that only an empty string is returned to
Stripe, hence properly acknowledging events.
task-2612977