The boolean field `is_mail_thread` on `ir.model` allows to create custom models
that inherit from model `mail.thread`. The selection field `track_visibility`
on `ir.model.fields` allows to add tracking on custom fields.
Also change the order on model `ir.model` to make mail thread models appear first.
The fields objects are responsible for creating their column/table and indexes.
The methods that update the schema are overridden to handle cases specific to
each type of field.
Simplify the API as much as possible, and delegate all the implementation
details to the models `ir.model`, `ir.model.fields`, `ir.model.constraint` and
`ir.model.relation`.
In a lead:
- Fill in contact information (phone, address, email...)
- Create a new contact
All information is copied to the new contact, except the email.
opw-706711
If a bundle contains a file whose URL does not match any file in the
filesystem, its content is searched in the ir.attachment records.
The problem was that the content was base64-decoded but also had to
be utf-8 decoded to make its use work (like it would have been done
if the file was found in the filesystem).
Before this commit, when a LESS bundle compilation failed, web pages
were displayed without any style and the error appeared in the DOM
thanks to a custom ::before style which was ugly and not selectable.
Now the error is displayed like any other error in Odoo: in a dialog
with selectable content. The pages are also displayed with the last
style which was successfuly compiled.
If odoo dialog are not defined (a page without any javascript), a
fallback has been implemented to show the LESS error with a JS alert.
When using read_group() and grouping by many2one fields, the many2one groupby
fields get updated from an integer id to a tuple from name_get() at the end
of the method.
e.g.: {'user_id': 1, ...} -> {'user_id': (1, u'Administrator'), ...}
To do this, it reads the many2one field by browsing on self.
When self is a model with _auto = False (typically an SQL view), searching by
id can be costly as the id column may not have usual properties for performance
(in some cases a full computation of the table is required to look up 1 id).
Add a method to format a date in a given language. This appears to be
useful since formatting is not always done by QWeb, but also:
- in mail templates
- in formatted strings (error messages, pre-filled text fields)
Move the post-install tests execution outside `Registry.new`, and add a flag on
class `HttpCase` to enable/disable the registry "test mode".
This allows a test to run actual transactions that will reload the registry,
which may be used to test the creation of `ir.model` instances, etc.
When self.name is False, the following expression:
"self.parent_id._get_full_name(level - 1) + MENU_ITEM_SEPARATOR + self.name"
raised:
"TypeError: coercing to Unicode: need string or buffer, bool found"
opw:706202
Before the fix:
*Scenario 1:
create company A as a res.partner
on company A, add an individual contact B
on individual B, add an individual contact C
on individual C, go in accounting tab, click on 'parent company' link, you arrive on company A
*Scenario 2:
create individual B
add a contact individual C on individual B
create company A
on individual B, select a parent company A
on individual C, go in accounting tab, click on 'parent company' link, you arrive on B
After the fix, on each scenario, you arrive on company A.
opw:706757
With the user who is trying to access and the record they are trying to access
to.
This way it is easier to understand the reason of the error.
Do not show record and user ids in the popup as it is a technical information.
Closes#13030
If a database had no base module or no latest_version, mark it as incompatible.
This should not happen in standard but as we are considering local databases
that may be non-odoo, we should be more fault tolerant.
The `log` method of a server action uses the same cursor than the
transaction. Therefore, if an error is raised during the server action
execution, the log messages are lost since the transaction is rolled
back.
We introduce a new cursor in the `log` method, so the log messages are
kept even when an exception is raised.
opw-704036