Commit Graph
409 Commits
Author SHA1 Message Date
Christophe Simonis 9b5ba8b238 [MERGE] forward port of branch saas-10 up to 21c7ef8 2016-04-12 12:38:02 +02:00
Christophe Simonis 21c7ef8bf5 [MERGE] forward port of branch saas-9 up to eb44341 2016-04-12 11:56:44 +02:00
Christophe Simonis eb443410ff [MERGE] forward port of branch 9.0 up to afba8ce 2016-04-12 11:12:57 +02:00
Christophe Simonis 87d160a742 [FIX] models: partial loading of manual fields
Related and function manual fields may not be loadable during initial
setup (partial=True) due to dependencies being not loaded. Ignore
theses fields during partial loading.
2016-04-11 14:52:42 +02:00
Fabien Pinckaers ec12e529c8 [IMP] Stock: minor report layout issues: delivery order / picking list
[FIX] ORM: crash in group by (example: pipeline analysis -> graph)
2016-04-08 13:14:08 -07:00
Thibault Delavallée 84ac2559cd Revert "[IMP] layout of picking report, alignment details [FIX] group by bug, visible in opportunity pipeline"
This reverts commit a206114d4c.

This commit breaks several of our long standing and widely appreciated policy

 - one commit for one feature; do not forget to put the correct impacted addon
 - commit message should explain why the change is performed
 - a bug fix in master seems weird, why not in stable. If not applicable to
   stable the commit message should explain why
 - a bug fix in the ORM should come with a test case
 - code is not clean
2016-04-08 09:52:09 +02:00
Fabien Pinckaers a206114d4c [IMP] layout of picking report, alignment details [FIX] group by bug, visible in opportunity pipeline 2016-04-07 15:01:07 -07:00
Christophe Simonis 6c8141a1df [MERGE] forward port of branch saas-10 up to 2483327 2016-04-01 16:15:35 +02:00
Kinjal Mehta 1409de5d36 [IMP] Convert UserError into ValidationError when only a message to display
When only a message argument is given to the crash manager, the popup display
"Error while validating constarint" and "None" with the warning message
which does not make any sense for the common user.
2016-03-30 09:17:42 +02:00
Xavier Morel bc4d10f48d [IMP] groupby domains & unformated dates
* ensure groupby domains are normalised, that's significantly more
  convenient for subsequent manipulations and combinations (e.g. OR-ing
  domains of multiple groups)
* split off "raw" groupby which provides ISO-8601 date and datetime
  ranges[0] (half-open) as values for grouped date/datetime fields

  for instance when grouping weekwise on a date field, the group
  including May 11th, 1930 would have the following value for
  the (grouped) date field: `("1930-05-05/1930-05-12", "W19 1930")`[1]

  this means callers can access the programmatic date range value
* fix website_mail_channel and website_blog to *not* go and randomly dig
  into the domains assuming a bunch of unspecified stuff about its
  formatting (such as it not being normalized)

[0] https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
[1] actual week number turns out to be locale-dependent...
2016-03-29 10:34:25 +02:00
Christophe Simonis da1fafff32 [FIX] models.py: correct code indent
Error introduced by kdiff3 during previous forward-port.
2016-03-24 17:11:55 +01:00
Christophe Simonis ddb0fb2739 [MERGE] forward port of branch saas-9 up to 59d3f63 2016-03-24 16:53:45 +01:00
Christophe Simonis 59d3f63c58 [MERGE] forward port of branch saas-7 up to 9e4157b 2016-03-24 15:12:00 +01:00
Martin Trigaux b54b888305 [MERGE] Forwardport of branch 9.0 up to revision 87578177 2016-03-22 14:30:21 +01:00
Raphael Collet 4ddc323139 [FIX] base: fix and complete migration of base/ir
- add or fix decorators on methods
- fix most compute methods (wrong dependencies)
- revert changes in `eval_context` of `ir.actions`
- various code simplifications and improvements
- migrate methods that were not
- ir_qweb: modify `QWebContext` to take an environment instead of `cr`, `uid`, `context`
- ir_qweb: convert `AssetsBundle` to use new API `env`
- ir_ui_view: use decorator `multi` on method `read_combined`
- ir_ui_view: ensure that method `render` is never called with an xml_id
- ir_ui_view: factor out part of the `ormcache` key of method `_read_template`
2016-03-21 13:46:44 +01:00
Raphael Collet 2d77941844 [FIX] models: enable modification of the help of custom fields
The field was not used when building the registry, hence when synchronizing the
field back to the database, the field `help` was set to `NULL`.
2016-03-21 12:23:17 +01:00
Aaron Bohy 6c57935443 [IMP] openerp,web: cache of actions, fields(_views) and filters
Introduction of 'data_manager' service which handles meta-data related to
actions and views (fields_views, fields and filters). Ideally, all RPCs to
get that kind of information should go through data_manager, as it holds an
internal cache.
2016-03-18 10:44:52 +01:00
Aaron Bohy 002660a9b0 [IMP] openerp, web(_*): batch views RPCs
Load the fields_view of all views of the action together. If a searchview is
required, also load its fields_view and its filters.

Use lazy-loading for fields as they are required for the Pivot and Graph
views only, and may be used by Filters and GroupBy menus of the Search view
if the users clicks on 'Add a custom Filter/Group'.

The fields are thus also loaded directly if the first view of the action is
Pivot or Graph, and otherwise, they are lazy-loaded when/if the user opens
a Pivot or Graph view, or if he wants to add a custom Filter/Group.

Some refactoring of views API as well:
- Views must now be instantiated with their fields_view
- Move code requiring fields_view from start() to init(), or willStart() for
  heavy processing.
- Remove view_type attribute from views as it was used to call
  fields_view_get.
- Remove view_id parameter to views' init as it is no longer used.
- Move duplicate code from various views' init to the View widget.
- Remove view_loading() function from views as they now follow the classical
  lifecycle of widgets (init -> willStart -> start -> destroy).
- Searchview now extends View like all other views.
- Remove useless function guard_active() as it was used for the form_view's
  action buttons to wrap handlers to ensure that they are executed only if
  the form_view is the current active view. This is not useful anymore as
  from v9, views and their control panel are appended in the DOM
  simultaneously, so one can't click on a button of a view which is not the
  current active view.
2016-03-18 10:44:52 +01:00
qdp-odoo 7a3d63b377 [MERGE] forward port of branch saas-7 up to revision 71d16a369e 2016-03-16 10:27:19 +01:00
qdp-odoo 71d16a369e [MERGE] forward port of branch 9.0 up to revision 083e172dd9 2016-03-16 10:08:49 +01:00
Raphael Collet dd048ae730 [FIX] fields: skip missing triggers for computed custom fields
This improves ddafbab3e4 by still loading the
field, but be tolerant if setting its triggers fails.
2016-03-15 15:03:44 +01:00
Raphael Collet ddafbab3e4 [FIX] models: do not load custom fields with depends when partial=True
Upgrading a module in the presence of computed custom fields can fail, if a
computed custom field depends on another field from a module that is not loaded
yet.  The patch simply prevents custom fields with dependencies from being
loaded in partial mode.
2016-03-15 14:30:39 +01:00
Denis Ledoux 6e09293b7d [MERGE] forward port of branch 9.0 up to 8e69043 2016-03-11 11:42:43 +01:00
David Beal 4fed1026e0 [IMP] models: extract metamodel method _get_addon_name
Easier to reuse that way.

Closes #11223
2016-03-08 16:53:43 +01:00
Denis Ledoux db95dcd8bc [FIX] models: translate fields label, even for en_US
In Odoo 7.0 & 8.0, this was possible to translate
a field label, from `en_US` to `en_US`. It was
used as an easy way to change the fields label,
instead of creating an inherited view changing
the string attribute of the field everywhere it was needed.

This was no longer the case in 9.0,
following the revision 9593a29.

The translated terms for `en_US` have been
excluded, for performance reasons
as it was considered not possible to have
translated terms for the `en_US` language.

The fact is, this is very possible: Nothing
prevents to add a translated term
in `en_US` for a translate-able field,
as this is the case for the fields label,
as mentioned above. This field is then
used as the display value instead of the source
term when being in the `en_US` language.

Besides, the above revision was mainly to
give the possibility to sort a model records
on a translated field, using a join on the translations
table. It was then considered that the join could
be avoided, in the case where the user language was `en_US`,
for performance reasons, but, as this is possible
to give another value to the field value trough
the translations, it should actually be done, even
for the records sorting.

opw-670814
2016-03-03 13:21:56 +01:00
Christophe Simonis 1c7f5a45e5 [MERGE] forward port of branch saas-7 up to d016457 2016-02-29 12:30:27 +01:00
Christophe Simonis 3b6c243440 [MERGE] forward port of branch 9.0 up to c169c59 2016-02-24 18:50:09 +01:00
Christophe Simonis dd875ed1a1 [MERGE] forward port of branch saas-6 up to f5ed710 2016-02-24 18:02:53 +01:00
Christophe Simonis f5ed710c74 [MERGE] forward port of branch 8.0 up to d4e5019 2016-02-24 16:37:41 +01:00
Nicolas Martinelli 68f9f99ed3 [FIX] models: export of booleans
In the case of a `raw_data` export, a boolean which has the value
`False` will not be exported correctly.

The fix handles the `False` value as a valid value for a field.

opw-666142
2016-02-23 15:06:14 +01:00
Ravi Gohil 7eab8e26d3 [MIGR] base: migrate base/res to the new API
- `ir.property`, improve API of method `get_by_record`
- `res.bank`, `res.partner.bank`
- `res.company`
- `res.config`, `res.config.installer`, `res.config.settings`, fix usage of methods `get_default_`
- `res.country`, `res.country.group`, `res.country.state`
- `res.currency`, `res.currency.rate`
- `res.font`
- `res.lang`
- `res.partner`, `res.partner.category`, `res.partner.title`
- `res.request.link`
- `res.groups`, `res.users`, `res.users.log`, change password wizard
2016-02-23 12:06:25 +01:00
Christophe Simonis f2855c6c42 [MERGE] forward port of branch 9.0 up to 25c45a61 2016-02-19 18:10:57 +01:00
Martin Trigaux c51c3254b8 [FIX] models: escape colomn name in read_group
In PostgreSQL, if not double-quoted, the columns are considered as lower case.
http://www.postgresql.org/docs/9.4/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS

Courtesy of Philippe Halbardier, SimplyCIT
2016-02-19 12:13:30 +01:00
Raphael Collet 92144ef64b [FIX] fields: do not add triggers for the fields of an abstract model
This avoids recomputing a computed field defined on an abstract model, which
crashes because the model's table does not exist in database.
2016-02-16 17:05:05 +01:00
Raphael Collet e3ed3d67fb [IMP] models: factor code in _onchange_eval
The factorization enables new-API onchange methods to return values as old-API
onchange methods.
2016-02-16 16:39:18 +01:00
Christophe Simonis 9a805c90ed [MERGE] forward port of branch saas-9 up to d70fde0 2016-02-10 18:40:56 +01:00
Christophe Simonis d70fde0330 [MERGE] forward port of branch saas-7 up to cab5c48 2016-02-10 18:37:01 +01:00
Christophe Simonis cab5c480e2 [MERGE] forward port of branch 9.0 up to f7432ef 2016-02-10 18:33:01 +01:00
Christophe Simonis f7432efb95 [MERGE] forward port of branch saas-6 up to 07d7147 2016-02-10 18:17:21 +01:00
Christophe Simonis 07d7147846 [MERGE] forward port of branch 8.0 up to cdf21eb 2016-02-10 18:03:42 +01:00
Laurent Mignon d82e489add [FIX] models: use column._symbol_c as placeholder for the column value
When generating SQL queries, `column._symbol_c` must be used as placeholder as
for the method 'set' of the column itself.  Otherwise it is not possible to
define specialized columns.
2016-02-09 09:20:17 +01:00
Raphael Collet d273415beb [FIX] models: track correctly which module introduced a given constraint
If a module adds a constraint on a given model, deinstalling that module must
remove the constraint from all the models that inherited it.
2016-02-04 15:52:06 +01:00
Raphael Collet 408330a655 [FIX] fields: track correctly which module introduced a given field
If a module adds a field on a given model, deinstalling that module must remove
the field from all the models that inherited the given field.
2016-02-04 15:52:06 +01:00
Raphael Collet 53572ba4c6 [IMP] models: add the base model as an abstract model in the registry
The model `base` is implicitly inherited by all models, and can be extended as
any other model.
2016-02-04 15:52:06 +01:00
Raphael Collet 0040632696 [FIX] models: after extending a model, recompute its children models attributes
This is necessary when adding `_inherits`, `_depends` or constraints to a model.
2016-02-04 15:52:06 +01:00
Raphael Collet 8a7552e5b7 [FIX] models: exclude magic, custom and inherited fields from a model's proper fields
Those cases can now appear, since a model inheriting (with `_inherit`) from
another model can observe those extra fields from its parent model's class.
2016-02-04 15:52:05 +01:00
Raphael Collet b56cdc9e17 [FIX] models: make Model and TransientModel subclasses of AbstractModel
With this subclassing, the MRO of the model class will always traverse `Model`
before `AbstractModel`.  This guarantees that inheriting from an abstract model
does not make the current model abstract.
2016-02-04 15:52:05 +01:00
Raphael Collet 3eb4e919f4 [FIX] models: during setup, reset properties memoized on model classes
This is necessary, because a model's class is kept when applying model
extensions.
2016-02-04 15:52:05 +01:00
Raphael Collet fe2d819474 [IMP] models: add _inherit_children on models to handle base model extensions
When extending an inherited model, the registry now automatically updates the
schema of children models.
2016-02-04 15:52:05 +01:00
Raphael Collet d76979c03f [IMP] models: make model extensions visible to children models
When a model B inherits from model A, any extension of model A should be
visible in model B.  We achieve this by:
 - making B inherit from the class of A in the registry;
 - making model extensions modify the model's base classes.
2016-02-04 15:52:05 +01:00