Due to a compatibility problem between the new API
implementation and the @ormcache decorator, the
context parameter of ir.attachment._filestore()
was dropped at rev. 0beb14f0d2
However the need for caching this method has
disappeared in Odoo 8 (it used to require a
DB query). So it is even better to drop the
@ormcache decorator altogether, and keep the
context parameter.
This avoids a useless change of method signature,
even if that was on a private method.
This wasn't anymore possible to open the Lead/opp
form of a planned call if it was of type opp.
Regression introduced during rev. 81f56c9eda
opw-631807
Apparently, browsers decide how they want to style readonly inputs,
and it seems like Firefox is greying them out while Chrome doesn't.
We use an opacity: 0.5 rule to grey them out ourselves in Chrome,
but in Firefox they are not dark enough to read easily because of
the double greying. I checked with the designers but they don't
have any better fix for that.
When writing a message via the chatter with a template being in auto_delete
False, the notifications emails are always in auto_delete True.
This fix propagate the auto_delete option of a mail.template to these
notifications emails.
opw-630010
Make sure pass a list of ids instead of a single id to write calls.
Some models (e.g. blog.post, fixed at 12fc5ea) are assuming that it got a list
of ids and is not checking the type.
Always pass a list of ids as it's the expected format for the orm.
When trying to duplicate a database, while
having opened connections to it, postgresql throws
```
OperationalError: source database "duplicate_test"
is being accessed by other users
DETAIL: There is 1 other session using the database.
```
Connections must be dropped before trying duplication
using TEMPLATE to avoid this.
If a purchase order is created with free goods (e.g. 5 units offered if 100 are purchased),
the price_unit of stock.move and the cost of stock.quant were set to the product cost price
instead of zero. This would lead to inconsistencies in the 'Current Inventory Valuation'.
opw: 630593
Commit 540b753bf8 introduced
support for resources stored as ir.attachment records in
asset bundles too.
This is specifically useful for customizations.
However the HTTP route for reaching those resources
when they are *not* in a bundle was originally created
in the `website` module (as a special handling for
404 requests)
This means that these dynamic resources would only
be partially supported when `website` is not installed,
causing various problems:
- missing resources in debug mode where bundles are skipped
- errors when trying to define new client-side Qweb templates
via XML resources - which are loaded with a direct request
- ...
This commit moves back the supporting code to the web module.
The `mimetype` column is not present in ir.attachment without
the `website` module, but sniffing it based on the attachment
name works fine at serving time too.
Closes#6002
When showing a kanban, there is differences between dataset of types:
* DataSetStatic: self.view.dataset===self.dataset, their ids attributes are the entire ids list,
* DataSet and DataSetSearch: self.view.dataset.ids are the already in the view ids, self.dataset.ids are the last gotten ids.
Hence with DataSetStatic dataset, when self.view.dataset.ids.splice(0) is done
self.dataset.ids is also emptied. And in the read_slice function, the slice is
done on that (now empty) array.
This fix removes the splicing of this ids array (which doesn't change a thing
since the array is overwritten latter), a _.difference is used to remove
eventual duplicates since in the DataSetStatic case, the same array is being
concatenated to itself
opw-630654 opw-617090 opw-619563
The implementation of `ormcache` does not work on methods that take a `context`
parameter. Because of the decorator `decorator`, the arguments of the call are
passed positionally to the method `ormcache.lookup`, and positional arguments
are used in the cache key.
The fix consists in removing the `context` parameter from the faulty methods,
either directly, or by caching a private method called by the public method.
"Invoiced" stat button on the res.partner form view must not include cancelled and draft invoices.
The button triggered an action which shows a tree view with invoices where:
type in ['out_invoice'] and all states.
Now the button triggers a tree view with invoices where: type in ['out_invoice' , 'out_refund']
and state not in ['draft', 'cancel'].
opw:472318
If you try to import a file with a header 'Parent_id/id'
_match_header will not match Parent_id with parent_id
because it was comparing with case sensitive.
It's not a bug, but in most cases this new behaviour (non
sensitive case search) is what the end user was expected.
Hate Excel and the auto correct capitalization !
In BOM, when performing an advanced search
on "BOM Lines" contains "a name"
all lines were returned, whatever the lines content.
This was due to the simple fact no field 'name'
was set on the mrp.bom.line model.
We set "product_id" as _rec_name, it seems the more
logical choice.
opw-631335
On a line write in a account.move.line tree view, the on_write return all the
sibling move lines of the written move line. The lines are then displayed even
if they do not match the current search domain.
This fix adds the context on the given on_write callback request, and in
on_create_write use a on_write_domain in this context to filter the returned ids.
fixes#3161, closes#5727
opw-630093
In the ecommerce, when adding a product to the cart
while having website_sale_options installed
the product was added in the cart within the
website default language, not in the current
language of the visitor. The description of the product
was in the default website language (for instance, English)
instead of being in the visitor language (for instance, French).
The reason is quite simple: With website_sale_options, routes
are called in javascript, and these calls do not include the
website language within the url to the route
(e.g., call to '/shop/modal' instead of '/fr_FR/shop/modal)
and the language in the request context is therefore
the website default language.
The solution proposed here is probably not the cleanest possible,
a cleaner solution would be to define a new utility
JS function within website javascript to perform
Ajax calls, automatically adding the language to the url path
according to the current visitor language.
Another solution would be to set the lang of the session context
to the visitor language, and to use this lang instead of the
lang within request.context.
Nevertheless, none of the two above solutions can be performed in
stable releases, such as 8.0, to avoid any risks.
opw-631400
Skip the creation of the corrective valuation entry
when a negative quant is reconciled with an incoming
shipment, when:
- the cost has not changed, so the journal entry would
be useless (credit/debit = 0)
- or, when the accounting period for the move causing
the negative quant is already closed, and must not be
updated (presumably the valuation was manually
set before closing that period)
Since revs 53582c2ea6 & f65c913027,
this was no more possible for portal users to read groups
on purpose, for privacy reasons.
fields_get of res.users model is overriden, for
the access rights form view features
(The groups selections and checkboxes).
At each call to fields_get, which happens at each call
to fields_view_get on the res.users model, operations are
done on the model res.groups (basically, to
build the selection groups and checkboxes). So,
each time a view of model res.users is displayed,
whatever the view, operations on res.group model were performed.
The thing is, these operations on res.groups
are actually needed only for the user access rights
view, or at least only for users having the group
Administration > Access rights. These group operations
aren't needed for the preferences view, nor for portal users.
We therefore avoid to do these if the user is not part of the
Administration > Access rights group, which lead to
performances improvment, and solves the fact
portal users couldn't access their user preferences view.
opw-627391
After commit 0ed63d73a6,
the hack used to detect fields.function is not supported
anymore. Using `isinstance` is safer and cleaner anyway
(performance is not a concern here).
When switching an applicant to another stage,
there is the possibility to send an email template,
according to the given stage.
The attachments defined in the email templates should
be sent as well.
opw-630768
When auto subscribing to a message
(For instance, change the ```user_id``` field on a record,
like an invoice)
The new user is notified of the last message of the thread.
He must be notified of the parent message as well,
to have access to the first message of the thread,
to prevent access rights issues to the thread.
This mechanism is applied in the _notify method
of model ```mail.message``` as well, for the same reasons.
opw-630286