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.
Otherwise recomputation may fail with "record does not exist or has been
deleted" when creating records with a value directly set for e.g.
'image_mediun' on a new product.
The issue comes from the storage of the images. When creating a product, the
creation of an attachment for storing the field `image_medium` triggers the
recomputation of that field before its dependency `image` is set. As `image`
is initially null, `image_medium` is recomputed as null, and this deletes the
attachment just created before the latter has completed its creation! As a
consequence, some code at the end of `create` for the attachment crashes
because the record has been deleted.
The following models have been fixed: `fleet.vehicle.model.brand`,
`hr.employee`, `im_livechat.channel`, `mail.channel`, `payment.acquirer`,
`pos.category`, `product.template`, `product.public.category`, `res.partner`.
opw 666330
Closes#11516
The transaction `type` of an order can depend according
to the order.
For instance, if the order leads to recurring payments,
the transaction type became `form_save`
instead of `form`.
This new method allow to easily override this `type` value
for other modules, so the entire button
rendering code does not have to be
copy/pasted.
If an issue is created without default stage, it is not counted in the
total of issues. However, a task without default stage is counted (see
commit 432c01c0).
Fixes#11398
opw-672380
On the project dashboard, a user needs to click exactly on the number or
on the label in order to open the issue list. If the user clicks outside
the text (but still inside the box), the project is open instead.
The reason is because the link is specifically defined on the
number/label. The fix defines the link on the box itself.
Fixes#11396
opw-672380
A public user is currenlty able to enter 'georges.pompidou' as email
address which is obviously not valid. We change the input type ffrom
text to email and let the browser manager the email format
validity
Could not edit t-field content if modified by inherit xpath,
and could not inherit qweb views with non "xpath" nodes with
`position="attributes"`.
Examples:
Can't edit: `<data><xpath expr="div[@t-field='object.test']"
position="replace"><div t-field="object.test"/></xpath></data>`
Inherit doesn't work: `<data><h1 position="replace"/><h1
class="test">tata</h1></data>`
Closes#11561Closes#11547
The price unit on the account move line is defined as a monetary field.
However, on a Sales Order or on a Purchase Order, the price unit is
defined as a float with precision 'Product Price'. Therefore, when an
invoice is generated from a SO or a PO, inconsistencies arise if the
product price precision is larger than the currency precision.
opw-673251
When a a refund is created from an open invoice and a different
date than today is selected as refund date, the invoice date of
this refund must be the selected date.
opw:673369
If the costing method of the product is "average", the price unit
of the stock move is set in the currency of the field "price_currency_id"
with the function "do_partial" (addons/stock/stock.py).
opw:672552
When a product is set up to generate a purchase tender instead of a
purchase order, the associated procurement is set in exception.
This is because the result of `make_po` is returned by the method `_run`,
and the result of `_run` is used to determine if the procurement is
running or in exception. Since a purchase tender does not generate the PO,
the method `make_po` returns an empty list, and therefore the procurement
is considered as in exception.
The fix is to return the procurement_id instead if a purchase order or a
purchase tender has been created.
opw-672170
The call to the method `run` is executed at the procurement creation if the
key `procurement_autorun_defer` is not in the context. This is not
necessary since the call to `run` is explicitly done afterwards.
opw-672170