Edit journal entries (account.move).
Create a new line. Credit and debit values are filled in with the default get.
Conveniently, if lines_ids is given in context this computes the right value to
balance existing move lines. However, this is done by float operations.
Let e be the resulting epsilon in balance.
As a result a new line may contain e, 0 for credit, debit (or respectively).
If the user fills in the 0 value with v, then the new line contains e, v.
This violates the constraint that exactly one of the two values should be nonzero.
We get the currency from the journal to round adequately the balance.
opw 2046137
closesodoo/odoo#35815
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Backport of 50ee1c964b.
Previous version was buggy, as it was already patched by 54c2c0874 and 862c2455.
When creating a journal entry manually, the computed value for the next line
was not taking into consideration all existing lines.
Was PR #25298. Courtesy of Pieter Paulussen (Dynapps)
Install the module "Product Comparison". Go to
Website>Configuration>Attribute Categories, then create or edit a category.
No translate button is present when editing the field, there should be one
on the right edge to enter the translation menu.
Adding the missing option in the model.
opw-2052331
closesodoo/odoo#35838
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The lxml.html.fromstring method does not accept an encoding parameter, so the
preview crash if the going through this branch, i.e. if the root is an empty tag.
opw 2054368
closesodoo/odoo#35817
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Backport of 4da82776ff.
Because of e38ed7c7 the code moved between versions, but is otherwise identical.
- Set an internal location as a return location
- Create a SO with a dropship product, validate and deliver
- Return the product, and choose the internal location as the return
location.
The received quantity on the PO is counted twice.
Since the return is an 'in' move linked to a PO, it is automatically
counted as incoming quantity.
This case is quite specific, so we explicitly add an exception in case
the origin move was a dropship, but the return is not a returned
dropship.
opw-1958228
opw 2045685
closesodoo/odoo#35831
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Open a livechat session between a visitor and a user
That is, open the / controller as public user, and click,
on the bottom right corner, on "Have a question ? Chat with us."
Exchange at least one message to open the session
From the visitor side, close the window. There is a proposal to rate the discussion
Assign either the green face or the yellow one
(The red one is a bit trickier)
Now, on the user side, check the list view of LiveChat sessions
Before this commit, the rating of those sessions were 0
This is because:
The rating.rating < Many2One > mail.channel link is not a foreign key
(rather, it is composed by char::res_model; Integer::res_id)
and doesn't make the reciprocal field recompute, which in turn doesn't make
our relevant field compute
After this commit, the last_rating field field is recomputed and appear in the list view
OPW 2052964
closesodoo/odoo#35830
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
The following rounding is incorrect:
```
>>> float_round(6.6 * 0.175, precision_digits=2)
1.15
```
Indeed, 6.6 * 0.175 = 1.155 ≈ 1.16.
In this specific case, the `epsilon` computed is not sufficient. A
precision of 53 gives:
normalized_value = 115.49999999999997
epsilon = 1.2823075934420547e-14
=> new normalized_value = 115.49999999999999
Bad luck, this is just not enough to tip the value in the right
direction.
However, a precision of 52 is sufficient:
normalized_value = 115.49999999999997
epsilon = 2.5646151868841094e-14
=> new normalized_value = 115.5
The value of 53 was chosen from the `binary64` number format precision.
In case of Python, the corresponding machine epsilon is 2^-52 [1].
Therefore, using 52 instead of 53 does make sense.
It is worth noting that the value of the machine epsilon
2^-52 = 2.2204460492503131e-16, which is still 2 orders of magnitude
below our dynamic estimation.
[1] https://en.wikipedia.org/wiki/Machine_epsilon
[2] `numpy.finfo(float).eps = 2.2204460492503131e-16`
opw-2047368
closesodoo/odoo#35565
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
For the ours need, we can not let the contentEditable behavior. Indeed,
this one does not have the same behavior according to the browser. The
DOM node could be erase, merge, cut, in them according to the keyboard
interactions. The problem is that if we have to manage these behaviors,
we have to manage everything. It was already the case in the previous
version, however before we created an editor by zone and by a hack we
mix the history.
In the case of the virtual keyboard of some OS / Phone, the events are
different and the autocompletion does not update (bug that prevents
modification interactions with javascript). In order to solve these
problems, we use another event for the insertion of the characters.
However, we must also force the update of the corrector by forcing a blur
and a focus.
The current version is a temporary version. We are currently working on a
version that uses a virtual dom and does not need to do excessive prevent
default.
Steps to reproduce the bug:
- Install stock_dropshipping module and enable Routes on SO lines
- Create a storable product P with a supplier S
- Create a SO with P and set this line with the route dropship
- Confirm the SO ( a PO has been created to S with P)
- Change P on the SO with an other product
Bug:
The product P stayed on the PO.
So a product linked to a PO line cannot be changed on a SO.
Do not forward-port in 12.0 and upper
opw:2040249
closesodoo/odoo#35454
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Make a transfer payment from bank to cash
validate, check the journal entries
You see that there are two moves, each with the name
given by their journal's sequence (one in bank, one in cash)
Now, unreconcile, and cancel the payment
set it to draft, re-confirm it
Before this commit, the entries created had the same name which was
the name of the previous journal entry
This was because, at cancel time, the move_name of the payment was not reset
After this commit, the move name is reset on cancel, and both
journal entries have a new sequence based name when
confirming the payment the second time
OPW 2046412
closesodoo/odoo#35478
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
In the customize theme modal, if one option enabled views which were
a subset of the views which are enabled by another option, both options
would be checked on modal opening if all the related views were active.
This is the case for the "choose an image" and the "choose a pattern"
options: the first one enables a view which adds an image on the body
and the second one enables the same view but also another which enables
the fact that the image must be repeated.
This commit solves the issue by always selecting the option enabling
the most views among the checked options in a same set.
opw-1958395
closesodoo/odoo#35465
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The design for accepted answers changed a lot and with it, the
possibility to remove or change accepted answers was gone. This commit
tries to reintroduce the possibility without breaking the design and
by making an unique attribute addition to the XML (stable change).
task-2034497
closesodoo/odoo#35445
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Allow to see the lot/serial number on the order form, only for the users
with group group_production_lot.
opw-2037285
closesodoo/odoo#35443
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
- Set the user language to a RTL language, e.g. Arabic
- Open a list view containing float or monetary fields, e.g. the invoice
list view
The numbers are left aligned while the corresponding columns headers are
right aligned, making the list view confusing.
The header alignment is hardcoded at rendering rather than in the SCSS.
Therefore, `rtlcss` doesn't affect it.
Instead of hardcoding the alignment, we use a proper CSS class so it is
adapted by `rtlcss`.
opw-2044019
closesodoo/odoo#35414
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Steps to reproduce the bug:
- Install stock_dropshipping module and enable Routes on SO lines
- Create a storable product P with a supplier S
- Create a SO with P and set this line with the route dropship
- Confirm the SO ( a PO has been created to S with P)
- Change P on the SO with an other product
Bug:
The product P stayed on the PO.
So a product linked to a PO line cannot be changed on a SO.
opw:2040249
closesodoo/odoo#35383
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
On the Time Off, spam click to create a new event, each click opens a
new event form modal.
When the modal form fields have not been cached yet, the frontend
fetches them and delay the modal form opening after those fields have
been fetched. As the interface is still available. It is possible to
re-click multiple time during the fetch, each click schedules a new
modal form. When the first finally shows, they all stack on screen.
opw-203577
closesodoo/odoo#35098
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Open the reconciliation widget, with a statement line that has
some move lines to reconcile with
Put your browser in Fast 3G to slow down stuff
then click multiple times on a move line to add it to
the reconciliation chain of the statement line
Before this commit, as many lines appeared in the reconciliation
chain as many clicks were made
After this commit, one can only click once on the lines
linked to #35194
OPW 2042751
closesodoo/odoo#35417
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
A user without stock acces rights was not able to read the fields
added by the stock module
The statbuttons display the number of items available which are
computed fields An accountant (no inventory or sale access rights),
opening the product view will trigger the recompute which will fail
(no access on stock.warehouse.orderpoint)
closesodoo/odoo#32499
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
The emoji was displayed in the list of choice but was not correctly rendered
when sent to the server.
Similar to 0e3d5941da but for broken heart
closesodoo/odoo#35367
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Mass mailing themes are redefining some bg-* classes their own way...
unfortunately that way was not working anymore with BS3. This commit
adapts the CSS code to solve the problem but ideally, themes should be
refactored to be more BS4 compliant.
opw-2032131
closesodoo/odoo#35333
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this patch Amount currency was always +ve and doesn't care about about Debit/Credit values.
See _check_currency_amount constrains.
Fixes: #35403closesodoo/odoo#35422
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
It was not possible to manually set a default analytic account as it was
overriden by the onchange, even if no account was returned by account_get
Apply the same logic as in _prepare_invoice_line on sale.order.line
closesodoo/odoo#30282
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
An user with portal access puts a product into the wishlist.
The same product is "unpublished" from the site backend, while still
into the wishlist of the user. The user now cannot access the website,
because because of the record rule website_sale.product_template_public
which prevent the unprivileged user from accessing the products.
OPW-2042511
closesodoo/odoo#35397
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>