When the Product Price precision is greater than the currency precision,
it can lead to incorrect data
To reproduce the error:
(Enable debug mode)
1. Settings > Technical > Database Structure > Decimal Accuracy, edit
Product Price:
- Digits: 3
2. Create a PO
- Add a product:
- Quantity: 12
- Unit Price: 0.001
3. Save, Confirm, Edit the PO:
- Qty Received: 12
- (Note that the total is $0.01)
4. Create a bill:
- Add the PO to the field "Auto-Complete"
Error: The unit price is $0.000 and so does the total
The rounding of the unit price should be based on the Product Price
precision, not the currency precision.
OPW-2601867
closesodoo/odoo#74813
X-original-commit: 1123856c77cce4b69059b63c2bcbb382c7f0719e
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
In the "view" service, there is a cache s.t. we don't do the
load_views rpc each time we enter an act_window action. However,
before this commit, we never did cache hits because we modified
(in place) the "views" key inside the action, which is used to
generate the cache key.
closesodoo/odoo#74783
Signed-off-by: Bruno Boi <brboi@users.noreply.github.com>
Added context to _rpc call in _onTemplateChange function for improved inheritability and easing customizations
closesodoo/odoo#74806
X-original-commit: c6467305c88fb3ba3c832a4cca525220f977ba53
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Remove an unnecessary default search when opening the journal entries
of a bank statement.
closesodoo/odoo#74802
X-original-commit: e9f6bbb9093a4c2bf6e728d2882f6dab65658c01
Signed-off-by: William André (wan) <wan@odoo.com>
When duplicating an invoice, a new edi should be generated, therefore l10n_it_edi_transaction and l10n_it_edi_attachment_id should by copy=False.
closesodoo/odoo#74799
X-original-commit: 7ea86c2662369aa8d09e6bafaf2fe024e8f57f40
Signed-off-by: Josse Colpaert <jco@openerp.com>
The dependencies of the public_root module were recently updated, but
the manifest of im_livechat was not, causing it to fail to load. This
commit adds those missing dependencies to the manifest.
This commit also adds a test that checks that all modules are properly
loaded on the support page, since this has been broken on multiple
occasions while changing the dependencies or the path of some of the
modules this page needs to work.
closesodoo/odoo#74756
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Previously, when an Error was thrown inside an async module, that error
would not cause boot.js to log information about missing, failed or
rejected modules. This is because we were only using guardedCatch to
mark modules returning a rejected promise with something other than an
error as rejected, but the case where a real error was thrown was not
handled, which left the job to be forever pending.
This commit fixes that by catching real errors after the previous
processing, and treats it like an error in a synchronous module.
The purpose of this is to improve the generic UX of portal for timesheet
app.
In this commit, done the below changes:
- add a sort by employee, project, task, sales order item
- rename 'sale order item' into 'sales order item'
- In search, reorder the fields in the following order:
Employee, Project, Task, Description, Sales Order, Sales Order Item, Invoice
- In group by, switch the SO/SOL fields from place
closesodoo/odoo#73699
Taskid: 2531322
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
When inside a specific color preset, active dropdown items' background
color is set to that preset's primary color. However, their text color
was not properly computed mainly because of [1] which forced other rules
as important.
[1]: https://github.com/odoo/odoo/commit/2172295cefa1d8780332709bf0c97cfa23def3a5closesodoo/odoo#74776
X-original-commit: 67fb206e2ef4828712a53052282aa0791edb74e7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Set the payment method line to cascade when deleting a journal.
This way, we do not keep unneeded lines, and it is not an issue
since we cannot delete journals linked to a payment/move anyway.
Also add a check on the journal id in the constrains checking their
name to avoid taking into account lines without journals.
closesodoo/odoo#74767
X-original-commit: e5cff1af3b8d407c7f0f0d2c9f9c021dcea41512
Signed-off-by: William André (wan) <wan@odoo.com>
*: tools
The app received many fixes and its code was improved and cleaned. It
was about time to include it directly into the website features.
task-2215118
closesodoo/odoo#74697
Related: odoo/design-themes#478
Related: odoo/upgrade#2709
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, users returning from Adyen to Odoo after payment
could see their session renewed, depending on their browser's
implementation of the `SameSite` cookie attribute. This prevented Odoo
from retrieving the transaction from the users' session.
This commit flags the return route of Adyen with `save_session=False`,
hence allowing all users to immediately post-process their transactions
when they return to Odoo.
While we're at it, the docstrings of the return routes of PayUmoney and
SIPS' have been updated for better clarity.
closesodoo/odoo#74763
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Before this commit, the popover would be displayed on top of the clicked
element if that element was a menu in a dropdown.
Indeed, there was not enough room for the popover to be shown correctly, as the
available space was the dropdown itself.
Note that if there was more than 2 menus in the dropdown, it would work
correctly as it would create enough space for the popover to be shown bellow or
above the menu.
Step to reproduce:
- Create a menu and a submenu
- Click on the menu, it opens a dropdown with the submenu inside it
- Click on the submenu, the popover position is wrong
task-2618494
closesodoo/odoo#74755
X-original-commit: b0b9fd2fd07fec96dd870467e8d9d8da7996c8ef
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
If you a user with only group 'group_pos_user' it is not possible to print the sale details.
Because during the compute_all of the taxe, account.account.tag need read access.
This PR allow 'group_pos_user' to print the sale details.
closesodoo/odoo#74749
X-original-commit: 9212ee2a79189802ae9a7cbc7a8446e71b2b215a
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
When a purchase order is generated via the scheduler with a reordering rule, the gst_treatment is not retrieved
opw-2540090
closesodoo/odoo#74669
X-original-commit: 17b5d75e69200d2a8fc2d5b2792bded0a37072e5
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
Every popup/modal was not correctly aligned in the mobile screen. It was never in the center and the right portion of the popup was never visible.
With this commit, all popups are now correctly placed in mobile.
closesodoo/odoo#72793
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
In order to avoid a rescue session opened for ages, the point of sale dashboard also shows if there are more than one opened session at the same time.
task-2492631
In order to give the user a better information view, if set, the tip's amount is shown on the button and on the popup. The value is selected for the sake of intuitiveness.
task-2492631
In order to easily spot the Odoo PoS UI and Odoo back end when several tabs are open in the browser, the color of the initial favicon has been changed to gray
task-2492631
The product configurator modal was too wide and the items were not correctly aligned. This commit changes the general aspect of the radio input and add responsiveness.
task-2492631
When the discount policy of a pricelist was set to `without_discount`, the discount information was shown in the order line of the product screen and on the receipt but not in the invoice.
task-2492631
Before this commit, when the webhook was processing a notification,
if there was a validation error, the webhook was sending the whole
traceback to Adyen. Since this was still a response code 200, this
didn't cause any problem, but we could see the response received in
the Adyen backend.
So we will now catch any validation error and send `'[accepted]'` in the
response.
closesodoo/odoo#74733
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Issue:
- [1] Edit mode > Set a shape on image (mimetype = 'image/jpeg')
- [2] Replace it by an animated GIF.
- [3] Replace the .GIF image again by the old one.
- The shape is not applied on it.
After the step [2], the image a dataset of:
{..., mimetype: "image/svg+xml", originalMimetype: "image/gif"}.
But when replaced by the JPG image in [3], we get (in '_applyOptions()')
an image with the following dataset:
{..., mimetype: "image/jpeg", originalMimetype: "image/gif"}
This incoherent state is caused by the fact that the mimetype from
attachment will be added on shape image in loadImageInfo(), which
affects the result of '_isImageMimetypeSupported()' method
(image is considered as a .GIF), and as a consequence, the shape
won't be applied.
We already have code (in '_onImageChanged()' method) to fix mimetype
in this case, but the goal of this commit is to move this code to
'_loadImageInfo()' to prevent this kind of incoherent mimetype values.
IMPORTANT: after this commit, the right mimetype value for GIF images
is passed and shapes cannot be applied on them (shape data will be
removed from non-supported images)
task-2578242
closesodoo/odoo#72639
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, we use the total_timesheet_time field in the kanban
view of `project.project` to know if there are some timesheets into each
project. The problem is this field is computed and its compute method
take more execution time than just use `timesheet_ids` field to allow if
a project has at least one timesheet.
This commit replaces the using of `total_timesheet_time` field by the
`timesheet_ids` field in project kanban view to check if the project
has at least one timesheet.
closesodoo/odoo#74730
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
When using several certification together, there was an issue
when we tried to modify the quantity of an orderline.
The "this" context was lost and we were unable to call the function
anymore.
In order to fix that, we bind the context when calling the function.
closesodoo/odoo#74725
X-original-commit: 183c3cfded14e716781ae701ec92e2ba68808eb7
Related: odoo/enterprise#20070
Signed-off-by: William André (wan) <wan@odoo.com>
Before this commit, the validation flow with verification (payment of a
small amount with immediate refund) was performed with the use of
validation routes: after payment, the customer was redirected to the
validation route stored on the transaction to trigger the refund. This
implementation had an issue: if the customer never reached the
validation route, they were not refunded their validation amount. This
could happen if the customer closed the tab after paying with an
acquirer offering payments with redirection, or if the validation
payment was asynchronously confirmed through a webhook notification.
This commit gets rid of validation routes and requires acquirers to
immediately refund the validation amount when the payment is confirmed.
This way, a payment confirmation coming from a webhook can trigger the
refund too.
As the only acquirer that implements the validation with verification
flow, Authorize.net now voids validation transactions as soon as they
are authorized.
While we're at it, the logging of processing values is adapted to only
log specific rendering values if a redirect form is rendered.
task-2612977
closesodoo/odoo#74707
Related: odoo/enterprise#20060
Related: odoo/upgrade#2710
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Added documentation to the methods of the ImageTools SnippetOption.
Also, removed unnecessary config from the transform method, which was
specific to the wysiwyg transform method to allow for reset on double
click.
The ImageTools transform and crop options now correctly set their button
to active or not.
Two reset buttons are added next to the transform and crop buttons,
visible when a transformation was made on the image.
Part of https://github.com/odoo/odoo/pull/74592
task-2554608
closesodoo/odoo#74592
X-original-commit: fc3706a0736c2c76dfd1a261a1455146b1699ce7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit adds two events to either enable or disable and cancel
loading effects at the SnippetsMenu level.
This is useful if we want for a snippet to be edited without showing the
loading effect. In the context of this PR it is used for image
transforms.
Part of https://github.com/odoo/odoo/pull/74592
task-2554608
X-original-commit: c45896fdd5a89e7954d8afeeb89ff51bb16ab438
Before this commit, the editor overlay was not correctly applied to
rotated elements.
After this commit, we apply the transformation of the element to the
overlay. For that, we needed the original top and left offsets of the
element. These values are obtained by cancelling the transform before
computation, and reapplying it after application to the overlay.
With these original top and left values and the transform property also
applied to the overlay, we are able to display it with the correct
rotation over transformed elements.
Part of https://github.com/odoo/odoo/pull/74592
task-2554608
X-original-commit: 8c7815bc02b06914966aca524cf95675706944b8
REASON FOR THE FIX
To correctly display the overlay over a rotated element, we need to
reset the transform of the element, to be able to apply it on the
overlay.
Changing the style of the element in the SnippetEditor cover method
would trigger a DOM mutation, which will result in setting the
odooEditor observer unactive.
The issue was that flushing the observer (when setting it unactive)
would always send an event observerApply, even if no record was
processed.
It was an issue as the SnippetsMenu was triggering a content_changed
event at the reception of this event, which would rerender the
SnippetEditor overlay cover (and create an infinite loop of events).
SOLUTION
To avoid that, the observerApply event is sent only if records were
processed.
Part of https://github.com/odoo/odoo/pull/74592
task-2554608
Issue: When making a return for a transfer, the precision_rounding was taken from the UoM of the product given in the transfer, but the quantity was taken in the UoM of the product defined on its form
Steps to reproduce :
1) Create a UoM "Hundreds", rounding precision 1 (has to be different than "Dozen"), Bigger than the reference Unit of Measure, ratio 100
2) Create a test product with "Dozen" as UoM
3) Inventory > Operations > Transfers > Create
4) Add test product, Demand=2, Unit of Measure=Hundreds
5) Validate
6) Create a Return for that transfer
7) Quantity is set to 17 Dozen instead of 16.67
Why is that a bug:
The quantity to return is `quantity = stock_move.product_qty` (in UoM of the product form) but the rounding is made with rounding precision `stock_move.product_uom.rounding` (in UoM of the line of the transfer) which can be different in case of manual transfer creation for example
opw-2543304
closesodoo/odoo#74588
X-original-commit: 4f962846ad0e47f7939f0181ecbae7954c23b615
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Nathan Marotte <nmarotte@users.noreply.github.com>
Due to the following PR: https://github.com/odoo/odoo/pull/70092
the download icon wasn't present in the document viewer.
We had to do this to avoid crash in mobile apps (Android and iOS).
But even if there are multiple other ways to download file, some
of our users are used to use pdf js download button that was previously
hidden.
So in this commit, we restore it on desktop as we can now correctly
handle the error on Android tablets and hide this button on iOS tablets.
Note that pdfjs button is not needed on mobile as we doesnt' have
attachements preview on small screens. Another button is available
when you open the file.
Steps to reproduce:
- Go to Accounting
- Customer Invoices
- After printing it once, the download icon wasn't present in pdfjs preview
closesodoo/odoo#74675
X-original-commit: 036c2475ac5c9ae3a0692486badfceb45de1f52b
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Before this commit, since we use 'total_timesheet_time' field to see if
any timesheets exist for each project in the kanban view.
The render of this view is slower because of the compute of this field.
This commit improves the performances of this compute.
closesodoo/odoo#74727
X-original-commit: 4dfa75e5b8d170532c0dd36f609eac1718aab4a8
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
Suppose such a SO line:
- Unit Price: 541.26
- Qty: 38
- Discount: 2%
The line amount is computed thanks to application of the discount on the
price, then the multiplication of the result with the quantity. The
rounding eventually happens after these steps:
https://github.com/odoo/odoo/blob/254b2a0840d3e817cc6062c483b5213c10088af5/addons/sale/models/sale.py#L1013-L1024https://github.com/odoo/odoo/blob/b76e9ef658bde0178fa1660b6ad27b880e91632a/addons/account/models/account.py#L1138
Therefore, in the above case, we have:
```
Total = round(541.26 * 0.98 * 38)
= round(530.4348 * 38)
= round(20156.5224)
= 20156.5224
```
However, when confirming the SO and setting the delivered quantity, the
Untaxed Amount To Invoice is computed using the unit price with both the
discount and the rounding already applied:
```
Total = round(541.26 * 0.98) * 38
= round(530.4348) * 38
= 530.43 * 38
= 20156.34
```
As a result, the amount is not the same than the first one, this is
incorrect.
OPW-2525975
closesodoo/odoo#74709
X-original-commit: 014a40448ca7854646d929ab369f92c6dede1eb4
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>