It was the purpose of this commit fea667a243
However it uses purchase uom in any cases and not
only vendor bill.
This commit correct it by using it only if a purchase
order is linked to the invoice.
As the field digit doesn't exist on currency, we use decimal_places
instead which is the field containing the number of digits of the
corresponding rounding field
As there's a check for unique supplier reference numbers, you can't duplicate them as the field is copied on the duplicated record. This patch removes the copy for emptying the error.
@Tecnativa
Before this commit, when a localization defined default payable or receivable
accounts on partners (like l10n_do does)
The reconciliation tests that involve an invoice on the one hand and a payment on the other hand
broke just because the accounts of the payment and the one of the invoice did not match
After this commit, we force the receivable or payable account to be the partner's (if available)
and the tests do not break
Before this commit, when printing all orders from the POS interface,
the ticket sometimes showed weird amounts (like 128.25000000001).
This was due to the usual problem of representing a float and has nothing to do with Odoo.
After this commit, the templates correctly display the amounts, rounded according to the currency
We do this by applying the relevant qweb widget (or calling the right format function in JS)
OPW 784626
Related fields that are not readonly are rewritten each time you save the
associated record, provoking performance problems.
Moreover, we don't want to allow an employee to change its department through
an attendance record.
Closes#21441
In Pick - Ship:
- validate a sale order which scheduled date is an hour in the future.
- validate the WH/PICK picking
Before this commit the WH/OUT picking 's scheduled date was set a day in the **past**
This was due to the implementation of datetime substraction and timedelta, which,
in case of a negative value, would take -1 day and some complementary values (hours, minutes etc...)
(the difference is complementary)
After this commit, the WH/OUT picking 's scheduled date stays what it was in that particular use case.
OPW 784452
Several issues arise with the virtual keyboard.
Issue 1
- Go in client list
- Go back to product list
The keyboard is still connected to the client search field.
Issue 2
- Go in client list
- Add a new client
- Click on any field
The keyboard is still connected to the client search field, it's
impossible to fill in any client data.
opw-784613
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
3ad1867e could lead to wrong results in a multicompany setting because
the change got the company from the lead but it was intended to be
gotten from the user.
Since ('company_id', 'child_of', False) returned "root" companies, the
code still got a sales team but possibly one from another company if the
user was on another company that its sales team.
This would lead to an access issue that this commit solves.
opw-784455
closes#21428
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
Cherry-Pick of c338e24ee7 as previous
forward-port has been badly done...
When updating the quantity of an MO, the qty we are producing on a work
order should possibly be updated. When the finished product is tracked
by serial number it should be 1.0 when some quantity is still to be
treated. (and not 0 as before)
opw-785190
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
Before this commit, when a product category had a similar name than an other
e.g. ALL / Exp and ALL / Expenses
When entering the list view of its products, it displayed the product linked to the category with the similar name
e.g. When opening ALL/Exp products list, it displayed its products **plus** the products of ALL/Expenses
After this commit the list view just contains the active category's products
OPW 782905
Before this commit, the smart button on the form of product category
only displayed the number of product for the current category,
whereas the list view of products (when you clicked on the smart button)
displayed all sub-categories products.
After this commit, the behavior is harmonized: all sub-categories products
should be accounted for and displayed
OPW 782905
Before this commit, when editing the shipping id of a partner having a company_id,
an Error 500 was thrown because of recursive hierarchies.
On top of that, since no employees should be able to modify its company's address,
we hide the dit button in that case
BUT we display addresses type=other (the one that a child of a company has anyway)
meaning that the billing address appears also as a shipping one.
OPW 782524
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
Archive the associated analytic account when a project is archived. Once
a porject is archived, it is assumed that we don't want to use the
analytic account anymore.
Moreover, it might be tempting for a user to delete these "useless"
analytic accounts, and therefore it would delete the archived projects
and tasks without notification.
Closes#21224
opw-784685
Let's have:
- on res.company a binary file field named x_file
- on res.users a related binary field to company_id.x_file, and make it readonly
On the res.users form view, display the new field
Before this commit in create mode, upon clicking on download the file, the server crashed, because the record id was empty.
Then, the JS crashed in turn because of the unhandled 404 from the server.
Since the id of a new record will always be unset, we choose to disable the download event in this very specific case
OPW 777042
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
- Create 2 FPos (1 & 2)
- Create 3 customers:
Customer A has no FPos
Customer B has FPos 1
Customer C has FPos 2
- Set-up the POS so that FPos 1 is the default FPos (FPos 2 is not
accepted in the POS)
Issue 1
- Select Customer A
The FPos is set to blank, while one would expect to keep the default
FPos.
Issue 2
- Select Customer B
- Deselect Customer B
The FPos is set to blank, while one would expect to keep the default
FPos (as it was before selecting B).
Issue 3
- Select Customer C
The FPos is set to blank, while one would expect to keep the default
FPos since his FPos is not accepted.
opw-782855
Commit 763d714 introduced cron job locking for databases which had
modules with states set to 'to x', however if an
installation/uninstallation/upgrade fails, the state will stay at 'to
x', and it may stay in that state for an indefinite amount of time,
meaning that cron jobs could stay locked forever.
This commit fixes this in part by adding a cleanup function to loading.py that
will be executed whenever load_modules fails, the function will change
every 'to x' module to their original state, effectively unlocking the
execution of cron jobs.
This however only works to prevent "zombie" transient states for
brand new databases, however for existing databases which already
contain some modules in a zombie state it won't do anything unless
a module is installed/uninstalled/upgraded, which may never happen.
This is where the second part comes in (ir_cron.py), when failing to
execute crons, we check if the failure was due to bad module state
and if an arbitrary amount of time (5 hours as of this commit) has passed
since the last time it was supposed to be executed, if it is the case, it means
that the cron execution failed around 5 * 60 times (1 failure per minute for 5h)
in which case we assume that the crons are stuck because the db
has zombie states and we force a call to reset_module_states.
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