When copying a record in an other language L than US, first a translation
was created for L by the create called in the copy function and afterwards,
a second translation was created by the function copy_translations
So there were two duplicated translations for L instead of one.
opw:706865
The fields containing the quantity of product doesn't display numbers
over 999 correctly: only 3 digits display in the field.
We add a specific class `quantity` for input fields, with a padding of
zero. The class `js_quantity` is not used since it is linked to jQuery
events.
opw-727640
opw-725671
- Set discount policy: Show public price & discount to the customer
- Set a product with 100% discount
When added to a SO, the product discount is 0 %.
opw-727519
In case of error, paypal return some lines where error message and not a
string with 'key=value'.
This commit fix traceback:
ValueError: dictionary update sequence element #0 has length 1; 2 is required
In monetary field refactoring (3407fb70e4) there was a small issue that
made context lost so the language use to render the field could be
different from the one to render the view.
For example: if the user has english, and print a report using the lang
of a partner in language spanish, the report would use spanish to format
number for all fields but monetary (which would use english).
opw-708197
In case a product is a single variant we should not leave it with a BoM
of zero as soon there is a BoM for its template. This would for example
hide the `compute_price` object button which relies on the `bom_count`to
be visible.
BoM is not found for a single variant product and compute price not
possible from the `product.product` view although it is implemented
actually there.
Closes#16237
The constraint should only check for move lots with a lot number already
filled in. Indeed, in case we use work orders, we can potentially create
move lots without S/N, and fill in the S/N later.
opw-727679
Create a product P with a price = 1799
Make a pricelist P1 in USD with an item I1 for a product P with a
fixed price to 100.
Set P1 with discount_policy = "with_discount"(include in price)
Make another pricelist P2 in USD with an item I2 based on P1.
I2 is a formula = 50% of the price
Set P2 with discount_policy = "without_discount"
Create a SO with P2 for the product P
Bug: The subtotal of P is 899.5 instead of 50
The problem came from _get_display_price wich in this case recomputed
the price according to the discount(in this case equal to 50% and this is
the good discount to display because P1 include the discount) and the lst_price
of the product(=1799) So the displayed price was equal to 899.5 instead of
50.
All the other cases worked because
1. P1 without_discount and P2 without_discount:
Price returned by _get_display_price was equal to 1799 with a discount of 97,2%
So the subtotal was equal to 50
2. P1 without_discount and P2 with_discount:
Price returned by _get_display_price was equal to 100 with a discount of 50%
So the subtotal was equal to 50
3. P1 with_discount and P2 with_discount:
Price returned by _get_display_price was equal to 50 with a discount of 0%
So the subtotal was equal to 50
And the last case(P1 with_discount and P2 without_discount) didn't work because:
Price returned by _get_display_price was equal to 1799 with a discount of 50%
So the subtotal was equal to 899.5
NB: The subtotal is computed with function "_compute_amount" with the following line:
price = line.price_unit * (1 - (line.discount or 0.0) / 100.0)
opw:724924
When getting the default sales team, we could get erroneously the
team of another company (either because the use is in a team of another
company or the default sales team was in non-bethren company).
This fix when searching a sales team:
- search only teams the user should see (with access rules)
- make default teams "Website Sales" and "Direct Sales" not restricted
to one company (and it's ancestors).
opw-726461
When the quantities on a purchase or sale line decrease,
the amount of the receipt or delivery order is not adapted.
Also, when the quantities increase, it is good to follow it up.
That is why, when we change some quantity, a message is
posted in the chatter of the purchase/sale to indicate about
the change. There is also a message when you add a new line.
When grouping by a field datetime in kanban view, the name of the
column is an abreviated datetime. Afterwards, when making a quick
create, the abreviated datime was set in the context and
used as default value. So it raised a tracebacks because the value
of the datetime was not in the correct format.
Now it's only possible to make a quick create if the type of the field grouped
is a char, a boolean or a many2one.
opw:727266
Fixes#15101 (cf comment 273208287 for details)
Closes#15862
Restore the rescue mechanism from v9, without the field it will be based on
the session name containing '(RESCUE FOR'
Add tests
As show is needed to call super it is impossible to override the
function without running into the immediate print. It is possible though
that you might need some delay that local CPU has rendered everything on
the PoS Ticket before printing...based on this you are able to override
the handle_auto_print and add a delay there.
Closes#16174
When creating a SO with a quote template(QT), the website_description
of the QT is transfered with the lang of the partner to the field
website_description of sale.order model(in onchange_template_id on
sale.order model). But when changing the partner_id on the SO, the
lang of the new user was taken into account.
opw:697893
On mobile view, in the product detail page, the image of the product
fills the largest part of the screen. However, when the user tries to
scroll by clicking on the image, it zooms on the image instead of
actually scrolling. This is confusing for the users who report that they
cannot buy anything on the webshop.
A solution is to simply deactivate the zoom on mobile.
opw-704026
Main journal is not accessible for user from different company,
a security error is raised during the default get
A pos manager could not create a new pos configuration without create rights on
ir.sequence (only admin has by default)
Closes#16063
When posting journal entries for an hr.expense.sheet with several expense lines
(by clicking on the button "Post journal entries"), all the account move lines
created for the same sheet must be linked to the same account move because
the model hr.expense.sheet has just a field "account_move_id" to access all the entries
(by clicking on button "Accounting Entries")
This commit reverts f97eb0ac2b
opw:715523,709930,725798,716239
When there is a lot of texts to display in a tooltip, it will overflow
the viewport vertically as the max-width of the tooltip is set at 200px
(bootstrap default). This commit increases the max-width to the
viewport full-width.
opw-725804
Before this patch, #15920 was happening. The problem was that calling `render_cell` produced a call to [`record.set(column.id + '__display', value)`][1], which triggers the `change` event, which called `render_record` the first time, which called again `render_cell` and produced the 2nd data fetch.
After this patch, `render_record` is only called if there is some place where to put the result, which does not happen in those situations.
There is still the problem that there is one call to name_get for each many2many widget found in a list view (instead of one per full view rendering), but at least they are not two calls!
[1]: https://github.com/odoo/odoo/blob/5d17749ff47c02294d5ff2ae56bbcef9d082562e/addons/web/static/src/js/view_list.js#L1125