When computing the total_cost of a landed cost make sure to round the
individual costs of the valuation lines the same way as done by the
ORM (i.e. with the 'Product price' precision).
Otherwise the sum of the additional costs on the valuation lines will
not equal the price of the cost lines. This is wrong and leads to
errors during validation.
opw-804396
- In some languages the kanban images are not displayed because of a bug in human_size method in JS.
This method translates the Unit Size for data and strip with the string with a comma as separator.
When the translatation contains spaces after the commas (like in the French translation), there is extra spaces in the final result.
This then cause an issue with the method is_bin_size that expects a unique space between the value and its unit.
Resulting in a bug in the method 'kanban_image'.
opw #804973#804970#804648
This field should be required.
This commits closes#21997
@kangol: diff in addons/website/models/ir_http.py is for existing db
It can be ignored in master because required will be apply
Before this rev., the default filters were ignored in Discuss. The
SearchView was instantiated and correctly retrieved the default
filters. However, a first manual 'do_search' needs to be done by
the client action for the search view to provide the domain, and
for Discuss to correctly filter the messages.
Steps to reproduce the issue:
- In Discuss (e.g. in Inbox), add to Favorites a given search,
and tick 'Use by default'
- Leave Discuss, and then go back: the default filter correctly
appears in the search view, but the messages aren't filtered.
Before this commit, all tooltip users was showing website and parent_name from
the Main company and not the current focsed partner.
This commits closes#18430
@kangol: fwd-port company_name
If you set 200 kamra to allow to flag a post and 300 to edit all post, you was
not able to flag the post before this commit.
This commit closes#21274
@kangol: warning, fwd port need to add tag_ids into trusted_keys
When there are too many labels to display on the x-axis, they overlap
and it simply becomes unreadable. By slightly rotating them, this can be
avoided in most cases.
Back-port of this commit 388e258ce8
opw:802925
Purpose
=======
When you create a budget, the field analytic account on the budget line is not mandatory but if you don't set one, it doesn't work, the practical amount always stays at 0 even if there are journal items in the accounts defined in the budgetary positions
The field `price_subtotal_signed` contains the price converted in the
company currency. However, we should make sure to use the exchange rate
of the invoice date for its computation.
An use problematic use case is the creation of a deferred revenue from
an invoice (commit 7fe89d08b3).
opw-702352
As admin every tax is loaded, which is wrong anyway.
When the admin opens a session a change the cashier in the POS interface,
every order is made with every tax ever (on the product)
which could lead to major faulty records
See the case on OPW 786803 which is critical
The web planner specified no language for frontend so the website
planner on the frontend was never translated.
This commit add a specialized fallback for this use case so the planner
on the website is in the language of the current user.
The code is the same that get_context from web_editor.base but requiring
that would possibly adds delays (for dom_ready) that we don't want.
note: this is for 9.0 up to not including 11.0, in 11.0 another solution
is used and in master a bigger change is being worked on.
opw-781727
fixes#20829closes#21004
When an user goes to its cart and removes all the items, the checkout
button is hidden so that the user cannot start an order with no product.
This behavior was not working in languages which are not the default
language of the website, as the button was found in JS relying on the
fact it started by "/shop/checkout", while it can be something like
"/fr_FR/shop/checkout".
Closes https://github.com/odoo/odoo/issues/21722
On a tree view:
- Add a button returning an `act_url` action; e.g.:
```
@api.multi
def open_google(self):
return {
'type': 'ir.actions.act_url',
'url': 'https://google.fr/',
'target': 'new',
}
```
- Click on a button
The action call works only once because the button is never re-enabled.
The button is actually enabled only at view rendering. Therefore, we
call `on_close` in order to reload the view.
opw-784587
- Sell a Product A
- From receipt screen, scan the barcode of Product B
- B will be in tab along with A
- Pay and validate
- Close the session
Only an order with Product A is recorded in the session (order 1).
When performing this set of actions, a new order is not created: the POS
simply reuses the current order. However, `create_from_ui` (called in
the receipt screen) discards an order if the reference already exists.
This means that the first order is correctly synchronized at validation,
while the second order is silently discarded.
Closes#16781
opw-766459
- Added taxes for year 2018 of sales and purchase with percentage 3.7 and 7.7
- Added tags to show newly added tax in VAT report(enterprise branch) for Switzerland
Was PR #20851. Was task 39082.
Summernote uses `document.execCommand` to apply most styles when
editing, leveraging the implementation to the browser.
Summernote is configured to use HTML styling (`'styleWithSpan': false`),
and in this case, browsers such as Firefox use HTML attributes for
styling text align, while Chrome still uses CSS for that. In fact,
`document.execCommand` is browser-inconsistent... but so is the
`styleWithSpan` option. Indeed, setting the option to `true` will make
Firefox use CSS property for alignment too... but not Internet Explorer.
So we might consider changing this option's value but this would not
solve the current problem.
Indeed, any CSS `text-align` style in Firefox takes precedence above
the element's `align` attribute, so when users were trying to align text
on stuff that was pre-aligned, they were unable to do so.
We can better explain the situation with this example:
A user tries to left-align in Firefox a `p.text-center` element, and
produces this:
```html
<p class="text-center" align="left"/>
```
(`align` attribute is ignored because of the `text-center` class)
On Chrome, this would be produced with the same steps:
```html
<p class="text-center" style="text-align:left"/>
```
With this patch, we actually make that HTML look like expected by the
user, no matter the browser he's using, by forcing the editor to use
the text-align CSS property. Note that the implementation is quite
ugly but had to take care of compatibility.
See https://github.com/odoo/odoo/pull/20900
(thanks to @Yajo for original PR)
The order of production was first based on "priority DESC" and then
"date_planned ASC".
So for production with the same priority/date_planned the order is not
deterministic.
This commit make the order deterministic as it seems preferred.
opw-784243
closes#21644
Main resource document to be found at https://www.economie.gouv.fr/files/files/directions_services/dgfip/controle_fiscal/actualites_reponses/logiciels_de_caisse.pdf
This document states that only business operations with partners not being subject to VAT should be inalterable and secure.
We adpat the module by differentiating between b2c and b2b journals and apply hashing on the former's moves
Protection against account_cancel is not necessary anymore
By default, this module considers a sales journal being a b2c, thus activating hashing on its move.
Since we can't afford to lose information, when a b2c journal contains hashed moves, its b2c characteristic cannot be changed
[ADD] l10n_fr_pos_cert: module to adapt the POS to the recent French regulation CGI art. 286, I. 3° bis.
The module adds following features:
- Inalterability: deactivation of all the ways to cancel or modify key data of POS orders, invoices and journal entries
- Security: chaining algorithm to verify the inalterability
- Access to download the mandatory Certificate of Conformity delivered by Odoo SA (only for Odoo Enterprise users)
[ADD] l10n_fr_sale_closing: module to store automatically the total of daily/monthly/annualy sales.
(both of the period and cumulative).
This fulfills another requirement brought by the recent French regulation CGI art. 286, I. 3° bis related to the storage of data
Was PR #20581. Was task 29922
When you have e.g. an SO with a product MTO generating a manufacturing
order, and you put the delivery order to done, before the MO is done,
you can not cancel the MO anymore, because the cancel method checks if
the move is not done (and raises an error).
As the user stays blocked in this case, it is better to just not try to
cancel the destination move by not propagating the cancel when the destination
move is done.
opw-786571
Before this commit, you could never get the user's facebook email. Since there
was no email field on facebook response, email would be then set to an auto
generated value like 'provider_2_user_0123456789123456' by odoo.
Now, we correctly request user's email to facebook.
opw-782771
When searching for a partner the ' ' (SPC) character can be used as a
field separator. You can search for e.g.:
'agr namur'
which will return the 'Agrolait, 69 rue de Namur,...' partner.
For some reason only the first space was considered a separator. So
e.g.:
'agr namur belgium'
wouldn't work.
This commit makes it so that every space character is considered a
separator.
Fixes#21357
When doing a group_by in a tree view, and then ordering by an
aggregated field which contains at least one capital letter in its name,
you will get an error and won't be able to ordery by this field.
Why? read_group is called when sorting a group by, which calls
_read_group_raw which then goes to call _read_group_prepare, which will
return order by terms in this manner ['id asc', 'x_Test desc']
the problem with this is that postgres automatically converts
non-quoted/non-qualified column name to lowercase, of course this means
that if we have a field "x_Test" but no field "x_test", it will try to
look up "x_test" instead of "x_Test" and since the column doesn't exist,
it will throw a ProgrammingError.
This commit changes this behavior by wrapping the order_by terms generated in
_read_group_prepare with double quotes, which postgres interprets
correctly.
Fixes#21348
Mixing positive and negative values in a pie chart is not possible.
However, in this case, a crash occurs instead of displaying an error
message.
opw-786137
Before this commit, it was not possible to save a page
containing a snippet with a SVG tag.
To support SVG elements, we need to use 'Element.getAttribute'
and 'Element.setAttribute' as mentionned in the documentation:
https://developer.mozilla.org/en-US/docs/Web/API/Element/className
For more information, see GH-14485
Before this commit:
1. If user wrote text in the quantity field to add to his cart, it would crash
and show a server error.
Now, if the user insert a non-valid quantity in the field, we set it to 1
Step to reproduce:
With website_sale only
- Go to a product page on the shop
- Insert 'abc' in the quantity field and click 'Add to Cart'
- Server will throw an error 'Can't parse float..'
With website_sale_options
- Go to a product page on the shop
- Insert 'abc' in the quantity field and click 'Add to Cart'
- Popup confirmation with optional product will show with 'NaN' in the qty
- Click 'Proceed to checkout'
- Server will throw an error 'Can't parse int..'
2. On the checkout, if user typed text in qty field it would create infinite
quotations.
Some modules (eg: website_event_sale) would hide this behavior because they
override the RPC call to '/shop/cart/update_json' and throw an error on the
RPC.
Now, if user type incorrect integer quantity, we set the quantity to 1.
Step to reproduce:
1. On base (website_sale only)
- Add an item to your cart
- On checkout page, set qty to 'abcd' or whatever text
- Check your browser console, every 500ms their will be a RPC call
- Check your quotations in backend, their will be a new one every 500ms
2. On db-all
- Add an item to your cart
- Set qty to 'abcd' or whatever text
- Check your browser console, it will throw an error on the second call
This closes#20482, closes#20904
It's needed in phantomjs tests.
Without this commit it printed only error stack, which doesn't provide enough
information to fix it. This is a problem when the error is not reproduced on
running tours manually in browser.
In the case where:
- you are too fast editing a mass mailing, trigger an onchange (e.g. mailing_model) and then save
You can use the edit/save shortcuts to make yourself believe you are Flash Gordon
- your internet is too slow (Down: 4Mb/s, Up: 500kb/s, Latency: 20ms)
Before ths commit, the onchange will return *before* the field (the iframe actually) is loaded.
This onchange contains a signal *in* the body_html of the field to allow communication with the iframe.
If you save before the iframe is loaded, this body_html keyword will be saved.
After this commit we deactivate the save button until the iframe is loaded.
We could have gone for a python user error on the value of the body_html too.
But it would have added a supplementary click and potential reloading
OPW 783616
Before this commit, when an user added a video in his page (an <iframe>)
it was then duplicated each time the snippet in which the video is was
edited and saved again, slowing the page loading.
As the code responsible for that is quite outdated, it should be
reviewed and refactored in master. This commit only fixes the problem
with more code. This commit will also fix existing databases, if the
user edit the video snippet once again.
(Note: even if this commit's code will be even more strange in master,
it *should* be forward-ported anyway).