Commit Graph
3175 Commits
Author SHA1 Message Date
Christophe Simonis 5655b43929 [FIX] base: clear cache through model instead of method
This allow cached method to be overwritten.
2017-03-01 12:21:11 +01:00
Raphael Collet 1119fdd8a3 [IMP] mail: reflect inheritance of mail.thread on ir.model (#15107)
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.
2017-02-28 10:49:02 +01:00
Daniel Dico 2a2b64f079 [FIX] base: rename Canadian state
The province was renamed in 2001

Closes #15662
2017-02-28 09:05:07 +01:00
Odoo Translation Bot c224df04a5 [I18N] Update translation terms from Transifex 2017-02-26 04:31:11 +01:00
Jeremy Kersten 5b3d0b3bc8 [IMP] ir_qweb: allow to display only the time from a field datetime.
Can be usefull if we want to split date part (using widget:'date') and time part (new option)
2017-02-24 08:51:26 +01:00
Jeremy Kersten f4ae1a63c7 [FIX] base: fix dev mode when view is no more in addons-path 2017-02-24 08:51:26 +01:00
Christophe Simonis 85368d7f86 [MERGE] forward port branch 10.0 up to 387b2acfcb 2017-02-23 20:15:38 +01:00
Christophe Simonis 387b2acfcb [MERGE] forward port branch saas-11 up to 1730dca101 2017-02-23 19:40:03 +01:00
Raphael Collet c59d79da3c [IMP] models: better argument 2017-02-23 14:48:44 +01:00
Raphael Collet 68c9f1a673 [FIX] models: missing argument 2017-02-23 14:47:20 +01:00
Raphael Collet e78269664d [IMP] tools: use information_schema instead of pg-specific tables 2017-02-22 15:24:08 +01:00
Raphael Collet f8e573db23 [REF] models: refactoring of foreign keys 2017-02-22 15:24:08 +01:00
Raphael Collet dc82ff59ac [REF] models: in _auto_init, delegate field schema updates to fields
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.
2017-02-22 15:24:07 +01:00
Raphael Collet d024c76021 [REF] tools: add functions for SQL schema manipulation
This helps factoring out a certain number of similar queries, and removing a
few methods from `BaseModel`.
2017-02-22 15:24:07 +01:00
Raphael Collet 8225f36497 [IMP] models: speed up schema update for models
Simply remove most `commit()` statements from code that updates the database
schema.  This improves the performance of the schema update by 30%.
2017-02-22 15:24:06 +01:00
Raphael Collet daa1eb1fc4 [IMP] base: remove ir_model_* tables from base.sql 2017-02-22 15:24:05 +01:00
Raphael Collet 2b46025dd5 [REF] models: use Registry.post_init() for reflecting models, fields, relations and constraints 2017-02-22 15:23:48 +01:00
Raphael Collet b6103d0b1b [REF] models: foreign keys use Registry.post_init() instead of BaseModel._auto_end()
Also use Registry.post_init() for the creation of foreign keys in
`_sql_constraints`.
2017-02-22 15:22:26 +01:00
Raphael Collet a1d061080e [REF] models: improve the API for post-init functions
Add a method to the registry to register function calls that must be done after
methods `_auto_init` and `init` have been invoked on all models.
2017-02-22 15:22:26 +01:00
Raphael Collet d0591c18e5 [REF] base: refactor the API of model, field, constraint and relation reflection
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`.
2017-02-22 15:16:35 +01:00
Raphael Collet 3214ca9820 [ADD] test_new_api: add checks on a model's schema 2017-02-22 15:16:34 +01:00
Raphael Collet 3ae219f773 [IMP] base: minimize recomputations triggered by model and field reflection 2017-02-22 15:16:34 +01:00
Raphael Collet c605ffa62a [IMP] base: remove management of deprecated indexes
Those indexes have been removed in version 10.0 or before, dropping them on
module upgrade is no longer necessary.
2017-02-22 15:16:21 +01:00
qsm-odoo c5779ec30d [REF] *: replace uses of "<>" in xml domains by "!=" 2017-02-21 13:33:32 +01:00
Nicolas Martinelli 05810dc7de [FIX] base: default partner email
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
2017-02-21 11:04:54 +01:00
David Arnold 99f365523b [IMP] base: allow to extend synched of company address
To easily add fields

Closes #15213
2017-02-20 09:27:31 +01:00
Odoo Translation Bot 2ab080bcae [I18N] Update translation terms from Transifex 2017-02-19 04:30:24 +01:00
Luis Ernesto Torres Macías 4cb1750a61 [FIX] base: correct Mexican state code based in SAT catalog
The SAT provide this catalog to state codes:
http://www.sat.gob.mx/informacion_fiscal/factura_electronica/Documents/Complementoscfdi/catNomina.xls

This attribute is required in payroll v1.2.
Previous code version did not match the validation

Closes #15535
2017-02-17 15:04:56 +01:00
Martin Trigaux 9a0aaa9e88 [I18N] export saas-14 source terms 2017-02-15 11:40:28 +01:00
qsm-odoo ba72397fee [FIX] base: decode utf-8 for bundle ir.attachment files
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).
2017-02-14 16:31:36 +01:00
qsm-odoo c248674a5c [IMP] base: handle LESS compilation error a better way
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.
2017-02-14 16:29:27 +01:00
Odoo Translation Bot 4669c103cc [I18N] Update translation terms from Transifex 2017-02-12 04:30:17 +01:00
Fabien Pinckaers c56b746221 [IMP] base_automation: default to write instead of python code 2017-02-10 15:22:45 -08:00
Denis Vermylen d3703ecb4c [IMP] models: avoid searching by id in read_group
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).
2017-02-10 19:20:25 +01:00
Christophe Simonis a282d4ae7f [MERGE] forward port branch saas-14 up to be9dfb331f 2017-02-10 18:41:06 +01:00
Christophe Simonis cbdd0b20dc [MERGE] forward port branch 10.0 up to ffd4442b06 2017-02-10 13:17:02 +01:00
Christophe Simonis ffd4442b06 [MERGE] forward port branch saas-11 up to 06e9e45d03 2017-02-10 11:49:35 +01:00
mge-odoo bf26445057 [IMP] base: use image_small on res_partner_view
Complement to https://github.com/odoo/odoo/commit/025fa4791c966cc35ad81f5664f25c8bd0502fb5
See #9731
2017-02-09 15:41:54 +01:00
Nicolas Martinelli d2b9e8aa03 [REF] base, mail: use new format_date method 2017-02-09 15:15:59 +01:00
Nicolas Martinelli b1eb344479 [IMP] tools: add format_date method
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)
2017-02-09 15:15:59 +01:00
mge-odoo ff2f188d20 [IMP] tests: allow post-install tests to play real transactions
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.
2017-02-08 16:13:01 +01:00
Goffin Simon 4f8ae9f993 [FIX] base: Traceback when creating a submenu
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
2017-02-08 12:22:20 +01:00
Goffin Simon 0d68acff8e [FIX] base: _compute_commercial_partner
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
2017-02-07 22:53:40 +01:00
Odoo Translation Bot 17f3185994 [I18N] Update translation terms from Transifex
after API rate limit reached
2017-02-07 17:01:49 +01:00
Christophe Simonis d83d0999e0 [FIX] base: ondelete cascade on transien 2017-02-03 19:01:19 +01:00
Lorenzo Battistini 269dbc9872 [IMP] model: log a message when an AccessError happens
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
2017-02-03 15:42:47 +01:00
qdp-odoo 554ca7ba7f [FIX] base: set US back as main company's country in demo mode 2017-02-02 15:50:52 +01:00
qdp-odoo e0be5bb11c [FIX] requirements: add num2words. Needed in l10n_mx_edi 2017-02-02 15:31:34 +01:00
Martin Trigaux d436061ee6 [FIX] db: list db without a base module
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.
2017-02-02 14:23:16 +01:00
Nicolas Martinelli 5bd895721a [IMP] base: new cr for log method
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
2017-02-02 12:49:17 +01:00