Commit Graph
47 Commits
Author SHA1 Message Date
Christophe Simonis 68176d80ad [MERGE] forward port branch saas-14 up to eddefc9948 2017-03-01 16:49:15 +01:00
Christophe Simonis eddefc9948 [MERGE] forward port branch 10.0 up to 8c55e57c7f 2017-03-01 16:14:41 +01:00
Christophe Simonis 7abeace770 [MERGE] forward port branch saas-11 up to 5c4744cd1f 2017-03-01 15:17:55 +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 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
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
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
Christophe Simonis 6a942a9e96 [MERGE] forward port branch 10.0 up to 8a0151b4bc 2017-02-02 12:42:51 +01:00
Christophe Simonis 59d1f9b564 [IMP] core: only mark updated fields as modified at model reflection
`model` field of `ir.model` may be used as related stored field.
Marking it as modified force recomputation of these, even no change
occurs (by definition).
2017-01-31 13:56:28 +01:00
Christophe Simonis 6c4389df41 [MERGE] forward port branch 10.0 up to 6804085b8c 2017-01-23 14:33:53 +01:00
Raphael Collet b0646f9d2c [REF] move support for sparse fields into a separate module (#15070)
This removal has led to a necessary refactoring:
- make the setup of field attributes extensible;
- make the instantiation of custom fields extensible;
- delegate model and field reflection to `ir.model` and `ir.model.fields`;
- move the implementation of sparse and serialized fields to module `base_sparse_field`;
2017-01-19 16:29:29 +01:00
Christophe Simonis 879c323578 [MERGE] forward port branch saas-11 up to 6825ddf9ad 2017-01-18 14:42:04 +01:00
Martin Geubelle 9876a77b14 [IMP] odoo: modify the default kanban view
This commit adds a div `content` around the first field in the
default kanban view.
2017-01-07 15:13:50 +01:00
Raphael Collet 6453e4eb23 [IMP] base: tighten ir.model.data access rights 2017-01-03 16:52:50 +01:00
qdp-odoo 4f29b77e3d [MERGE] foward port of 10.0 up to revision 84a650e33a 2016-12-30 17:21:25 +01:00
qdp-odoo 4dd27bba34 [REF] base: enhance inheritability
split fields_view_get() and used an abstact mixin class in place of of FormatAddress

[IMP] base: added a m2o field (ir.ui.view) on res.country to decide the layout of the form view to input addresses.
2016-12-28 11:20:47 +01:00
Raphael Collet 7d19661fb6 [FIX] models: allow @constrains on fields with inverse method 2016-12-15 09:53:58 +01:00
Christophe Simonis c292202a47 [MERGE] forward port branch 10.0 up to 18456b9 2016-12-09 15:58:39 +01:00
Christophe Simonis 18456b9d42 [MERGE] forward port branch saas-11 up to 321b7dc 2016-12-09 15:44:01 +01:00
Raphael Collet b62d078c9d [FIX] models: identify sparse fields with field.sparse 2016-12-08 11:08:01 +01:00
Yannick Tivisse 98cb4719db [REM] workflow: Remove workflow engine, documentation and tests 2016-11-23 11:52:39 +01:00
Christophe Simonis 53d8f76a40 [MERGE] forward port branch saas-12 up to e8e4145 2016-10-17 16:00:39 +02:00
Sébastien BEAU f72c7c3adf [REF] models: rename __export_rows to _export_rows to make it inheritable
Closes #10270.
2016-10-14 15:00:37 +02:00
Christophe Simonis 0acd63d073 [MERGE] forward port branch saas-12 up to 27dc061 2016-10-12 17:03:55 +02:00
Christophe Simonis 341bea8f88 [MERGE] forward port branch saas-12 up to 43cb4ac 2016-10-10 13:00:05 +02:00
Raphael Collet 6b1f6aa1d4 [IMP] models: in model/field reflection, trigger recomputations
This enables extensions of `ir.model` and `ir.model.fields` with computed
fields without messing up too much with reflection itself.
2016-09-28 16:55:51 +02:00
Raphael Collet 1c4661ee9d [IMP] models: refactor _add_manual_fields to make it extendable 2016-09-28 16:55:51 +02:00
Martin Geubelle 442355518d [ADD] add default view for kanban and graph 2016-09-28 16:55:51 +02:00
Christophe Simonis 856476d441 [MERGE] forward port branch saas-12 up to b1b700a 2016-09-22 15:23:45 +02:00
Raphael Collet f642727248 [IMP] models: in _read_group_fill_results, rewrite the merge of results 2016-09-16 17:35:24 +02:00
Raphael Collet fa082019a0 [IMP] models: change API of _group_by_full
The dictionary `_group_by_full` is replaced by a field parameter `group_expand`
that is assigned to the method name.  The API of the method has been simplified
as well:

    @api.multi
    def _read_group_stage_ids(self, domain, read_group_order=None, access_rights_uid=None):
        # the stages are given by self.ids (wrong model);
        # read_group_order is the order given to read_group() on self;
        # return stages.name_get(), {stage.id: stage.fold)

    _group_by_full = {'stage_id': _read_group_stage_ids}

is now written:

    stage_id = fields.Many2one(..., group_expand='_read_group_stage_ids')

    @api.model
    def _read_group_stage_ids(self, stages, domain, order):
        # stages is a recordset;
        # order is the order to use on stages' model;
        # return a recordset which is a superset of stages
2016-09-16 17:35:24 +02:00
Raphael Collet 1e5ecfd183 [REF] models: add methods to efficiently concatenate and union recordsets 2016-09-06 12:23:01 +02:00
Olivier Dony 6ea36beec5 [FIX] models: preserve order when merging recordsets
RecordSets were not preserving order when combined
with AND/OR set operators. Order was lost as well
through mapped().

This caused various recurring "heisenbugs" during
tests executions on runbot, specifically comming
in the test of stock_landed_costs.

Using OrderedSets instead of basic Sets to resolve
these operation avoids the indetermination.

This required an implementation of __or__ / __and__
for OrderedSet.
2016-09-05 12:17:04 +02:00
Raphael Collet 4a700d0ad9 [FIX] odoo: rename imports and adapt import hooks 2016-09-02 17:28:12 +02:00
Raphael Collet 9e64f9f951 [REF] openerp: move openerp to odoo 2016-09-02 17:28:12 +02:00