By default auto_search is set to `True` on window actions, this mean
that for example on a list or kanban view the records will be searched
on the view opening without any user action needed.
Setting it to `False` disable this.
Doing this had two drawbacks:
- depending on race condition, the view could be displayed before the
search view was loaded,
- the code expected `active_search` to be present which was not the case
in this instance.
Before 151c9074 the second issue would not happen (active_search was set
directly resolved if a search was not to be done) and this commit also
wait for the search view being ready before showing the view.
opw-741186
opw-741546
closes#16805
- Create an article with one supplierinfo (with a delivery delay and a
min. quantity > 0) and a customer delivery delay
- Trigger the creation of a PO by a procurement order for this article
The supplier delivery delay is not taken into account in the date order
of the PO because the seller is not selected.
This is because the procurement quantity is not sent to the seller
selection.
opw-16702
Closes#16702
- Create 5 PO with 40 lines each for Partner A
- Create an invoice
- Add each PO thanks to the field "Add Purchase Order"
The process takes more and more time for each PO.
Most of the time is spent in the recomputation of the secondary fields
(in the `onchange` method of "models.py"). The root cause is the cache
invalidation due to the relational fields recomputed as superuser by
default.
opw-740485
The calendar view display records with the start corresponding to the
record field set as `date_start`, and the stop to the record field set
as `date_stop`.
Since ef886aed2 there some issue when mingling calendar with
`date_start` or `date_stop` date fields and `all_day` unset:
- if user had timezone between UTC+8 and UTC+14, when moving as
"All day", the record start would be saved on the previous day.
- if used had timezone between UTC-12 and UTC-5, when moving as
"All day", the record end would get on the following day.
- if the event was moved onto a given time (in the "Day view"), the
event start would be set to the previous day if it was before midnight
in UTC time, and the end would be set on the following day if it was
after UTC 23:59.
The source of the issue was that after ef886aed2 a datetime was always
sent to the server, so depending on the browser timezone the server
could for example receive '2017-04-27 23:00' instead of '2017-04-28'.
This fix go back to the previous behavior.
fixes#15540
opw-15540
closes#16698
In some email templates of Odoo, the From: field is generated from the
company name. If this name contains an "&" character, this will lead in
an escaping eg; &
Sender header will look like:
From: Machin & Brol <machinbrol@toto.com>
This case is not well handled by email providers like Gmail, that
splits the line on the ";" and considers there are 2 senders, and then
discards the email.
We then fix the templates, waiting for a better fix in master.
To reproduce, see issue #16611.
In the mentioned use case, a line with a quantity of zero is created,
which generates a traceback at invoice validation.
Fixes#16611
opw-741055
Mass mailing `mail templates` when selected in a mass mailing are
always used in the english version.
But when another language is involved the edition of mass mailing
`templates` had a number of issue. For example saving the edited english
would only modify the user current language.
These issues are cause because the widget with snippets used for mass
mailing templates edition is not compatible.
Several fixes were proposed, what was choosen finally was to use the
correct widget with the following behavior changes:
- the snippets are not showed anymore in mass mailing templates,
- the current language can be edited and is saved rightly,
The shortcoming this give mass mailing templates can be partly
compensated by:
- editing the template back (if someone want the old behavior),
- duplicating mass mailings which keep the snippets and translations,
- doing a customization to improve the situation
closes#16255fixes#16165
opw-726746 opw-727232
note: this fix is only needed for 9.0 and saas-11.
When creating a pad before this change these were the steps:
- modify pad URL for new pad URL
- end of record loading
This caused an issue because modifying the record at this point would
mark it as dirty before displaying it (which would result in a erroneous
warning "The record has been modified, your changes will be discarded.
Are you sure you want to leave this page ?").
With this fix:
- modifying the pad URL is done after the record is ready
- deferred have been unified (to remove possible race conditions)
closes#15239
opw-702797
forward port note: this change is needed up to saas-15, over saas-15
only a small part is needed (because x2many views are loaded with the
root view and there is one widget instance per record).
code note: it would be better to modify load_record of form view and
delay `record_loaded` upto after x2many views are loaded, but possible
impacts have been judged too risky so this is done only in pad widget.
Don't check ids with "id is None" statements, as it won't match if id is False. This caused some bugs with MRP when confirming a MO with no calendar defined, if mrp_operations was installed.
When a partner has a lot of contacts, the computation of the issue total
takes a lot of time. Indeed, it performs the computation for the
partner, but also for all the children, despite the fact that the amount
is not displayed.
opw-726355
Currently the amounts of all invoices (linked to sale or purchase
journals) is summed regardless of these invoices being bills or
refunds, this means e.g. if you create an invoice for 1000 then a
refund for 500 on this invoice, the dashboard will display an
"awaiting payment" total of 1500 which while technically correct is
not really logical or helpful from a user's POV.
Fix summation to take in account the invoice type (invoice or refund)
and remove refund amount from the total amount.
Intent validated by @lap-odoo, also not ignoring or removing refunds
from count to avoid situations like "0 Awaiting Payments [for] $-1200"
which would be really strange.
OPW-728860
To substract the included tax from the unit price when it's mapped
by a fiscal position in the POS.
To keep the same behavior introduced by this commit odoo@503820a
opw:710437
SQL that retrieves data for the "Due Payments" report doesn't include
any filter for excluding AR/AP move lines already reconciled, which
shouldn't be presented in this report.
Courtesy of Pedro Baeza. Was PR #16440
On IE (from 9.0 up to at least IE EDGE 14) we have this behavior
for the method serializeToString of XMLSerializer:
> (new XMLSerializer()).serializeToString($('<b>"</b>')[0])
'<b xmlns="http://www.w3.org/1999/xhtml">"</b>'
> (new XMLSerializer()).serializeToString($('<b>"</b>')[0].firstChild)
'"'
Whilst browser such as chromium or firefox have:
> (new XMLSerializer()).serializeToString($('<b>"</b>')[0])
'<b xmlns="http://www.w3.org/1999/xhtml">"</b>'
> (new XMLSerializer()).serializeToString($('<b>"</b>')[0].firstChild)
'"'
Hence for IE9 and over, if in a `<t t-extend/>` a `t-jquery`
sub-directive (without `t-operation`) is available, we can have
broken javascript if a " is transformed into an " at a unfortunate
location.
This commit favour node.data over XMLSerializer serializeToString to
avoid the possibility of this issue when a text node is processed.
opw-727283
When deduplicating contacts, the function _process_query doesn't use
the orm to fetch the partners to merge according to the criteria.
So there were some access error in multi company when trying to merge
contacts from a not allowed company.
Now a check is made with the orm before merging the contacts.
opw:708457
- Create a SO with a product that is a service and will be invoiced
based in delivery quantities and will be tracked on timesheets and
contract.
- Confirm
- Use a simple user that only has for rights: "Employee"
- Create a timesheet as the employee for the contract created by the sale
- Log some time
- Save it
- Check the SO: ok the number of hours should be "to be invoiced"
- Edit the timesheet and set one day to 0 hours => Access Error
In case of a zero value, the timesheet widget sends an unlink command
for the corresponding entry. In this case, the `sudo` is not set at the
appropropriate moment since the context key `force_so_lines` will resue
lines which are not defined in the `sudo` environment.
opw-728453
Issue: when a field is computed on a new record, the record is not marked as
"being computed", and it could therefore be invalidated. The fix consists in
using the standard method that marks records before calling the compute method.
- Create 2 stockable products (A & B).
- Sell these products in the POS, but leave the qty of Product A to
zero.
- Validate and pay
- In the backend, return the products and register payment
Two pickings are created, and one of them is empty.
Products with a quantity of zero are not included in a picking.
Therefore, we should ignore them when the pickings are created.
Fixes#16292
opw-728101
Steps to reproduce:
-Create a product P with a standard price = 0 and its internal category
is in perpetual valuation
-Create a SO with an analytic account and a line with one product P
-Confirm the SO
-Create and validate the invoice
Bug: The delivered qty on the SO was equal to 2 instead of 1 because two
analytic lines are created by function create_analytic_lines with amount=0.
So in function _compute_analytic, the domain was [('so_line', 'in', self.ids), ('amount', '<=', 0.0)]
and it summed the two analytic lines for these two lines. Now analytic lines with amount=0 and linked
to a move line are summed if the they are linked to entries for an account of type "Expenses"(user_type_id).
opw:727302
Step to reproduce the bug:
1.Create a product with a customer tax(15%) for a price=100
2.Create a customer invoice with this product
3.Change the amount of the tax to 10(instead of 15)
4.Validate the invoice
5.Click on "Refund invoice"
6.Select the refund method "Modify: create refund, reconcile
and create a new draft invoice"
Bug the new draft invoice has 15 as amount of tax
Now all the taxes from the invoice when preparing the refund in function
_prepare_refund, in this it keeps all the modified taxes.
opw:726491