Related and function manual fields may not be loadable during initial
setup (partial=True) due to dependencies being not loaded. Ignore
theses fields during partial loading.
Users may sometimes need to edit their own partner records directly,
although indirect access by writing on `res.users` directly works
fine in most cases.
The SQL view `crm_partner_report_assign`
makes a join on `account_invoice_report`
A column is added to
`account_invoice_report` in the module
`sale` (`section_id` is added to the view),
making the SQL view `account_invoice_report`
replaced automatically at the install/update
of the `sale` module, which leads
to the automatic deletion of the SQL
view `crm_partner_report_assign`,
because the SQL view `account_invoice_report` is
altered.
Therefore, after the install/update of the `sale`
module, the view `crm_partner_report_assign` was
deleted, and the "partnership anaylsis" unusable.
This revision makes sure to init the
`crm.partner.report.assign` report after
every init of the `account.invoice.report`.
opw-674177
For some reason, it was lost. Probably in the graph view/pivot view split.
This commit simply accepts the attribute, but default to true, so nothing
changes unless you have explicitely set it to false.
Also, fixes en error introduced by a forward port (the use of
openerp.web.format_value)
Following commit 5b380e13, the the taxes on the fees are not calculated
correctly. Moreover, setting the subtotal in the onchange is misleading
since it will be set to zero if the line is not invoiced. We just set
the price to zero by default, and the click on 'update' will set it
correctly afterwards.
opw-673984
This solved two issues. First, the price subtotal should contain the
price with taxes excluded, as it is the case in other modules.
Otherwise, the tax will be computed twice. Then, when an invoice is
generated, the taxes should be calculated...
This is an oversight of commit fe2b5f35a4.
opw-673984
The do_search method still had a race condition because the
read_slice method of datasets alter ids. So, what could happen is
this: a long search is started, then a shorter search is started and
ended before the first search is completed. The ui is rendered
properly, but then the long search ends and alter the dataset. As
a result, the Kanban view is broken (cannot open a record anymore
because the dataset has the wrong ids).
This commit fixes the issue by doing basically what the read_slice
method did, except the ids altering part. However, it introduced
a new problem for x2many kanban views: these kanban view don't have
the same dataset, they have a datasetstatic. The naive substitution
does not work, so I had to reintroduce the old method in X2ManyKanbanView.
The two fields used in the filter are not available on the
crm.activity.report model.
It is not possible to do a Lost filter until the fields are added (and
this can only be done in master).
opw-673533
note: should not be forward-ported over saas-10
request.website.get_languages returns a list of tuple in the form:
(`language code`, `language name`)
With this commit the code first check if there is a language exactly
matching, and only if failed check if there is a match on the short
form.
closes#11613
opw-672412
When adding a product to the cart via _website_product_id_change, some
information are set in the context to mimic `product_id_change` from sale.
In the context of a sale.order redacted in backend, using the language of the
`partner_id` makes sense as the quotation should be in the language of the
customer and not the user writing it.
In the ecommerce scenario, this is not the case. The language is set in the URL
and can be passed as an argument.
Scenario to fix:
Add a product to the cart when visiting the website in a different language.
The product name and description were in English (or language of public user if
different) instead of the language of the website when adding it to cart.
When displaying the `sale_amount_total` of an opportunity, the amount of
the related order are summed up in the opportunity company's currency.
But when creating a lead, we can leave the company empty which warranted
this commit adding in that instance a fall back on the current user
company currency.
closes#11611
opw-673167
The editable list view method 'edit' is supposed to wait for the
record to be completely loaded. But when loading the defaults values,
it ignored the actual loading and completed too early. This commit
chains the deferred with the form record.
This is related to revision 84b45515bd
It's actually the user on which the `active` field should be checked,
as this is possible to disable a user without disabling his partner,
but it should no longer be possible to mention him as soon
as the user is disabled.
opw-673719
The name of the static channels ('Inbox', 'Starred') are not translated
in the breadcrumb. The reason is that at intialization of the chat
manager, the translation are not yet loaded.
The fix is to use the lazy translate functionality, which applies the
translation when the string is displayed.
Courtesy of @aab-odoo
opw-673856
I recently removed some rpc from init fieldmany2manytag (it was in a
mutex) and moved it to the willStart method (without mutex). The
fieldmany2many tag widget needs this information before it can be
rendered. However, in editable list views, the rendering engine does
not wait for the fields to be ready before completing its initialization
process. As a result, the field many2many tag was rendered before it
was ready, which broke various things, including its position.
This commit attempts to bring sanity to this issue by making sure that
the rendering engine waits for its fields to be ready. Also, the
editable list view should detect correctly when the form is loaded.
If this commit introduces new issues with the editable list view and
onchanges, I will not be pleased. You don't want to bring me this sad
news without at least something to buy my good will.
Since calendar_event overrides read to handle virtual ids, we need to do
the same for mail_thread _get_message_unread and _get_message_needaction
methods. Otherwise virtual ids may end up in the cache and browsing them
would fail.
SQL dump:
- Recent export with -O to remove owners
- correct poor Ramzy name
purchase order CSV:
- use correct column names
- remove destination and pricelist columns
- first file should not contain order lines
- second file should be same as first + lines
When quickly changing the range in the calendar view, multiple
asynchronous read_slice requests will be launched. The read_slice
returns the records and sets the ids property on the dataset according
to a set domain, context etc.
This creates a race condition because although the read_slice calls will
be launched in the correct order, there is no guarantee that they will
resolve in the correct order. In practice issues will occur quite
frequently on a slower connection and with a big read followed by a
small read. The big read that matches a lot of records will be slower to
complete than the small read which will result in it resolving later
than the small read. This causes the dataset to not be in sync with the
rest of the view. When you click on an affected event everything will
look fine in the popup, but when clicking on edit the form view will
show a new event instead. The reason for this is that switching to the
form view requires a correct dataset.index, which is set by
dataset.get_id_index(id) which won't exist.
A potential way of fixing this would be guaranteeing the order of
read_slice calls by only allowing one of them to be active at a
time. This would not be ideal because you could end up with a long chain
of read_slice calls when changing the range fast on a slow
connection. In theory the UI would have to block as well then.
Instead of that, we will simply ignore responses to out-of-date
requests. This is done by manually resetting the ids property of the
dataset to its previous value when we detect the range of the calendar
has changed since the read_slice call was launched.
opw-673425
The code to fetch the fiscal position of a partner uses ACLs and
ir_rules to select the correct ones, but when calling the function
as admin, multi-company rules flight out the window.
By allowing to force a company in the context, we can get the fpos
as the admin from the pov of any company.
When the PO is related to a contact of a company, the current behavior
is to add the contact in the list of suppliers of the product. However,
there is little chance that this is actually the desired behavior.
Indeed, in most of the cases, this will simply add a lot of useless
suppliers on a product.
The fix is to add the parent company of the contact in the list of
vendors, since `_select_seller` wil also search in the parent companies
to get a purchase price.
opw-672862
We have an interesting problem when editing all custom float fields and all
fields with no explicit digit attributes: the propertiesmixin tries to
check if the number was changed, according to their declared precision.
But for these specific fields, it does not find a digit attribute, and
defaults to 2. Then, it makes sure that the changes are ignored if the
new value is too close to the old value (with 2 digits precision)
For example, if the user sets the value to 1.234, then save, then change
it to 1.235, then save, the form view will display 1.234 and totally
ignore the change.
Not that handling the digit precision is done in the propertiesmixin and
in the field float widget. Also, they do different things, and in some
case, may not be the same. All this logic should be moved to the
fieldfloat widget.