Commit Graph

7612 Commits

Author SHA1 Message Date
Raphael Collet 3c203703db [FIX] ir_model: always setup models before calling _auto_init() 2014-11-13 14:54:04 +01:00
Raphael Collet b573077be6 [FIX] models: do not copy translations of fields that are not copied
Fixes #3272.
2014-11-06 16:42:41 +01:00
Raphael Collet 54140331f3 [FIX] fields: fix the translations of the labels of inherited fields 2014-11-06 16:42:41 +01:00
Raphael Collet 5cc863245b [IMP] fields: improve _determine_default() and add test for inherited fields 2014-11-06 12:20:39 +01:00
Christophe Simonis c825d0552d [MERGE] forward port of branch saas-3 up to ec27773 2014-11-05 21:46:42 +01:00
Christophe Simonis ec277732fe [MERGE] forward port of branch 7.0 up to 3e3e35e 2014-11-05 21:10:15 +01:00
Christophe Simonis 491372e865 [MERGE] forward port of branch saas-3 up to d36eee9 2014-11-05 20:26:36 +01:00
Christophe Simonis d36eee98fb [MERGE] forward port of branch 7.0 up to 65d92da 2014-11-05 19:34:18 +01:00
Olivier Dony 65d92dadf4 [FIX] base: incorrect code and locale for Bosnian
Stems from prebiblical commit f083aa2.

Fixes #3480
2014-11-05 19:09:23 +01:00
Antony Lesuisse c2bff2afae [IMP] safe_eval allow math 2014-11-05 17:25:41 +01:00
Olivier Dony 71247cebb6 [FIX] longpolling/gevent: automatically restart worker when killed
Whenever the longpolling/gevent worker dies, it
should be automatically restarted by the prefork
server, just like it happens for HTTP workers.
2014-11-05 17:09:10 +01:00
Olivier Dony 1719e6b922 [FIX] longpolling/gevent: log errors occurring in main loop 2014-11-05 17:09:10 +01:00
Simon Lejeune afce229e5a [FIX] ir_qweb: contact widget: use name_get instead of display_name
display_name field is overidden in res.partner in order to pop the context
key leading to show the address, and we want the address.
2014-11-05 13:37:56 +01:00
Raphael Collet 3dc2fcd363 [IMP] models: improve _mapped_func(), and add parameter 'reverse' in sorted() 2014-11-05 11:35:33 +01:00
Denis Ledoux fab2e29d50 [MERGE] forward port of branch saas-3 up to f7a76cb 2014-11-04 18:05:58 +01:00
Denis Ledoux f7a76cbb17 [MERGE] forward port of branch 7.0 up to be7c894 2014-11-04 17:54:48 +01:00
Manuel Vázquez Acosta 2fb2d9f956 [FIX] mail: partners with missing/invalid emails must not halt notifications to others 2014-11-04 17:32:32 +01:00
Raphael Collet 29da331f92 [IMP] models: improve query generation for _write() and _store_set_values() 2014-11-04 17:32:04 +01:00
Raphael Collet 3adbb49ec0 [FIX] ir_model: fix create/update/delete custom fields
Creating custom fields would crash on a model that has a related field without
string.  The crash was caused by the field not being set up, and method
BaseModel._field_create() violating a non-null constraint on the field string.
This has been fixed by setting up fields before updating ir_model_fields.

Deleting a custom field could also cause trouble when that field is inherited
in a child model.  In that case, the registry was simply no longer consistent.
The fix is to reload completely the registry.

The modification of custom fields was not reflected on field objects.  The fix
applies changes on fields before updating columns accordingly.
2014-11-04 14:52:13 +01:00
Raphael Collet f2e4a10e1a [IMP] use model._fields instead of model._all_columns to cover all fields
The old-api model._all_columns contains information about model._columns and
inherited columns.  This dictionary is missing new-api computed non-stored
fields, and the new field objects provide a more readable api...

This commit contains the following changes:

 - adapt several methods of BaseModel to use fields instead of columns and
   _all_columns

 - copy all semantic-free attributes of related fields from their source

 - add attribute 'group_operator' on integer and float fields

 - base, base_action_rule, crm, edi, hr, mail, mass_mailing, pad,
   payment_acquirer, share, website, website_crm, website_mail: simply use
   _fields instead of _all_columns

 - base, decimal_precision, website: adapt qweb rendering methods to use fields
   instead of columns
2014-11-04 13:47:57 +01:00
Richard Mathot ef862084c9 [DOC] fields.py: oldname key 2014-11-03 18:09:16 +05:30
hiekmann fcf0b278a9 [FIX] corrected a word in a comment
closes #3423
2014-11-03 10:19:15 +01:00
Raphael Collet 5eb6e58156 [FIX] fields: make field.store=False on old-style function fields
Clarify the semantics of field attributes:
 - field.store is True when the field is actually stored in the database;
 - field.column is the column corresponding to field or None.

The various field definitions correspond to:
 - new-style stored field: field.store and field.column
 - new-style non-stored field: not field.store and not field.column
 - old-style regular field: field.store and field.column
 - old-style function field: not field.store and field.column
2014-10-30 13:29:21 +01:00
Christophe Simonis c846f16e1e [FIX] core: correct cron thread registry iteration
Fixes #3387
2014-10-30 11:05:07 +01:00
Christophe Simonis cc4fba6089 [IMP] core: manage registries via an LRU.
When working with a large number of databases, the memory allocated to
registries wasn't limited, resulting to waste memory (especially in the
longpolling worker, which is not recycled).
The size of the LRU is depending on the soft limit configured for
workers.
2014-10-29 18:28:07 +01:00
Florian Kisser c6741fb537 [FIX] sql_db: don't log dsn with unmasked passwords
The dsn may contain the connection password of the database when not accessed from a psycopg connection object.
Replace the unfiltered logs to use cxn.dsn avoiding password leakage in logs.
Fixes #1433
2014-10-28 14:49:57 +01:00
Raphael Collet 8db5b84fc1 [FIX] fields: inherited fields should get 'string' from their parent field
Because some parameters of a field may be determined during its setup, we have
to update the corresponding column after the setup, and recompute _all_columns
to make it consistent.
2014-10-28 09:12:31 +01:00
Fabien Meghazi 3e07eaa308 [FIX] Regression in image resize helper (Fixes #2529)
Commit 57ad514b makes the function preserve the aspect ration of the
original picture. Error of mine because the expected behavior was to
lose it for kanban view purpose.

For backward compatibility sake, this commit will keep the old behavior
by default.
2014-10-27 17:55:08 +01:00
Xavier Morel 4d2b24adcb [ADD] Stripe-style APIDoc: content 2014-10-27 17:23:16 +01:00
Raphael Collet 7b1ef7085a [IMP] fields: reduce the number of attributes on _column instances
This is a memory optimization: instead of setting all attributes on all
instances, set them with their default value on the class, and only set
specific ones on instances.  This reduces the memory footprint of around 14Mb
per registry with modules crm, sale, purchase and stock installed.
2014-10-27 14:36:09 +01:00
Christophe Simonis 89eaa8a8a8 [MERGE] forward port of branch saas-3 up to 309ca4f 2014-10-24 17:25:19 +02:00
Christophe Simonis 309ca4fcf7 [MERGE] forward port of branch 7.0 up to d2fd05e 2014-10-24 16:52:10 +02:00
Samus CTO d2fd05ef21 [IMP] config: Test that the config file is readable
Fixes #3237

cherry-pick of 8e72049
2014-10-24 16:48:27 +02:00
Christophe Simonis 472291b35c [FIX] When using "--stop-after-init", set the return code correctly. A non zero return code reflect the number of databases that fail to load/update
Backport of 2c4e370b76 and
33ce0e73db
2014-10-24 16:24:50 +02:00
Jeremy Kersten cd8bd872e8 [IMP] res_country: add relation from country to group_country. The purpose of this patch is to allow in domain (model.country_id.country_group_ids, '=', 'Europe') 2014-10-24 15:19:34 +02:00
Christophe Simonis 562272d9a0 [MERGE] forward port of branch saas-3 up to c89d1a0 2014-10-23 13:08:44 +02:00
Raphael Collet 4a65b61f2f [IMP] fields: remove unused imports 2014-10-23 10:35:27 +02:00
Raphael Collet ba1369fbef [IMP] fields: infer required=True on related fields
One can infer related=True on a non-stored related field if all fields on the
path are related.  This cannot be done if the related field is stored: when you
create a record, the database row is created first, and the related field is
computed and stored afterwards.  Making the field required in that case would
trigger a non-null constraint violation.
2014-10-23 10:28:13 +02:00
Raphael Collet 0873613767 [IMP] fields: initialized computed fields to a null value instead of a failed one
This should ease compute methods that assign a list to "update" a
one2many/many2many field.  With a failed value, the update crashes.
2014-10-23 10:14:24 +02:00
Denis Ledoux adf18765f6 [FIX] base: typo during forward port 0e4216361b 2014-10-22 19:27:00 +02:00
Denis Ledoux 0e4216361b [MERGE] forward port of branch 7.0 up to 3a0af6a 2014-10-22 19:26:27 +02:00
Raphael Collet 8e6d5beb35 [IMP] fields: reuse column objects when possible, instead of recreating them
This is a memory optimization: it reduces the memory footprint of each
registry.  We have observed a reduction of 10Mb on a database with modules crm,
sale, purchase, stock.
2014-10-22 16:22:39 +02:00
Jeremy Kersten add28795fb [FIX] ir_action: update context to get the real binary, else we have a traceback when we edit/view an ir_action_client where param is a binary field. Because we do safe_eval from the length and not from the binary 2014-10-22 16:20:05 +02:00
Cedric Snauwaert fa2f7b86bf [FIX] product: remove digits_precision from uom factor fields
Remove the hardcoded precision of 12 on factor and factor_inv,
to use the complete natural precision of NUMERIC types,
preserving all significant digits.

e.g. a UoM with a factor_inv of 6.0 used to be computed as:
factor_inv: 6.0 -> factor: 0.166666666667 (1.0/6.0, rounded to 12 digits) -> factor_inv: 5.999999999988 (1.0/factor)
which could lead to errors such 12*0.166666666667 = 2.000000000004 instead of 2.0

Slightly changed the way the ORM handles float fields to allow setting `digits=0`
as a way to explicitly require a NUMERIC value but without enforcing/rounding
the values at the ORM level, i.e. a truly full-precision field.

NUMERIC type has unlimited precision but is less efficient so should not be
used as the default behaviour, which is why we keep float8 as an alternative.

Modified the view to display the product UOM factor with a 5 digits value by default.
This value is for usability purpose only, the field still accepts bigger precision, by
setting the `digits` option on the field in the form view.

This change is safe in a stable series, the `digits=0` alternative is
treated the same as the default `digits=None` everywhere in the framework,
except when creating the database field.
2014-10-22 14:28:34 +02:00
Martin Trigaux 7705f883d2 [FIX] base: support float rounding with rounding_method=UP (ceiling)
Add rounding_method parameter on float_round method to offer
HALF-UP (default, usual round) or UP (ceiling) rounding method.
Use the second method instead of math.ceil() for product
reservations.

For UP, the python math.ceil() method uses "torwards infinity"
rounding method while we want "away from zero".
Therefore we use the absolute value of normalized_value to make
sure than -1.8 is rounded to -2.0 and not -1.

Fixes #1125 #2793

This is a cherry-pick of d4972ff which was reverted at 333852e due
to remaining issue with negative values.
2014-10-22 14:28:22 +02:00
Denis Ledoux 0a82397da3 [FIX] fields: selection, do not try to translate label if label is empty
- translate with no source returns first translation for this field, whatever the source
 - performance
2014-10-22 11:54:22 +02:00
Martin Trigaux 354b82bee0 [FIX] report: page numbering rml reports
Save the NumberedCanvas state before doing a page reset.
The order of execution when rendering an rml report is the following:
1. init canevas (_pageNumber = 1)
2. render the page element
3. if still pages to render, afterPage method
4. if still pages to render, showPage method (_pageNumber += 1)
5. back to step 2 for each page
6. draw the ResetPage element (setting flag _doPageReset=True)
7. end the document build with afterPage & showPage method

The PageReset element should be executed at the end of the rendering of a story (subdocument) to reinitialize the page numbers to 0 (for new story) and insert the pageCount element for that story with the total number of pages (needed if want to use tag <pageCount/> in rml).

In case of NumberedCanvas (e.g. used in Trial Balance report), the numbering is generated at the end of the build using the _saved_page_states dict in the canevas.
To have an accurate _saved_page_states content, it needs to be saved before the pageReset.

Fixes #2225
2014-10-21 15:36:01 +02:00
Christophe Simonis 262eb662de [MERGE] forward port of branch 8.0 up to d80376a 2014-10-21 14:33:36 +02:00
Christophe Simonis 22c390285f [MERGE] forward port of branch 7.0 up to 78a29b3 2014-10-21 13:06:27 +02:00
Julien Legros b00122ad99 [FIX] res_partner: add parent_name related field
In some cases (e.g. with record rules), the name_get might not have access
to the parent name. Therefore a parent_name related field solves the
issue (as it read with as superuser).
2014-10-20 15:50:49 +02:00
Arthur Maniet 6c61d3c800 [FIX] account: the partner of a bank account can only be a company or an individual not related to a company 2014-10-20 15:02:36 +02:00
Fabien Meghazi 088f9e5b12 [FIX] Do not lose session.db on authentication error 2014-10-17 17:09:01 +02:00
Raphael Collet 83b8e413ff [IMP] test_new_api, test_inherit: improve code of tests 2014-10-16 12:32:23 +02:00
Raphael Collet e9587bf130 [IMP] expression.py: add a check to forbid records in domains
Records in domains cause a "maximum recursion depth exceeded" error when
converted to SQL. Simply add a test to show a better error message.
2014-10-16 10:22:23 +02:00
Olivier Dony 2bdbe255a7 [FIX] config: fix parsing of geoip db paramater, rename command-line option for consistency 2014-10-15 17:26:54 +02:00
Raphael Collet 89031f5de6 [FIX] models: simplify partial setup of fields, let it crash silently
The setup of relational fields may be problematic, as they may refer to unknown
models via custom relational fields.  In a partial setup, do not try to skip
the field setup, but let it go and silently catch any exception if it crashes.
2014-10-15 11:39:12 +02:00
Raphael Collet 94e7dc6050 [FIX] models: do not look up the registry class when building cls._fields 2014-10-14 16:17:23 +02:00
Christophe Simonis 2e3f59181d [MERGE] forward port of branch saas-3 up to db75994 2014-10-14 15:13:14 +02:00
Raphael Collet 43abcb02ba [FIX] models: in _add_field(), set the field as an attr before setting it up
In the case of custom fields, the field's parameters were set up without the
field being present in the class hierarchy.  Because of this, the parameter
inheritance mechanism was missing the field itself.  As a consequence, custom
selection fields ended up without selection, for instance :-/
2014-10-14 11:56:59 +02:00
Olivier Dony c0644a5474 [FIX] read_group: date format: use natural year along with month names, do not mix with ISO week-year
The ISO week-year notation can produce confusing values
when the first week of the year is so short that it
becomes week 0 and is considered the last week of the
previous year, depending on the locale.

For instance, using ISO notation:
  'W53 2015' == dates.format_date(
      date(2015,1,1), format="'W'w YYYY", locale='en_GB')
  'W53 2005' == dates.format_date(
      date(2006,1,1), format="'W'w YYYY", locale='de_DE')

This is surprising but actually valid.

However it definitely yields wrong output when combined with
months formats:
  'January 2014' == dates.format_date(
      date(2015,1,1), format="MMMM YYYY", locale='en_GB')

As a result we must always use `y` to denote the year in
any date format, *except* when it is combined with the
week number `w`, in which case we must use `Y`.

See the documentation at:
   http://babel.pocoo.org/docs/dates/#date-fields
2014-10-13 19:15:37 +02:00
Jeremy Kersten c8e14f301f [FIX] GeoIP - allow to specify the path to GeoIP in the server config.
--geoip_db='the_path'  which can be used via openerp.tool.config['geoip_database']
2014-10-13 16:47:12 +02:00
Raphael Collet 41b55082ba [FIX] models: on update, call inverse function on field even when it is stored
The inverse function of a stored computed field was not called when creating or
writing on a record with such a field.
2014-10-13 13:45:52 +02:00
Raphael Collet 5db84cb07e [IMP] models: do not use compute methods to determine default values anymore
Compute methods could give results that should not be considered as default
values.  For instance, a related field usually defaults to a null value, which
is then set to the field with its inverse method by create().  This may violate
a non-null constraint if the original field is required.  Therefore, compute
methods are no longer used to determine default values.
2014-10-13 13:44:07 +02:00
Raphael Collet 044ed06fec [FIX] models: do not prefetch fields to recompute, and recompute once only
The method _prefetch_field() was accidentally prefetching fields to recompute;
which was skipping the actual recomputation, since a value was put in cache.
But sometimes the field's value was fixed by an extra recomputation of the
field.  Here we remove the extra recomputation and fix the cache corruption.
2014-10-13 12:38:59 +02:00
Olivier Dony edd94b623e [MERGE] Forward-port 7.0 up to 1b49a87 2014-10-10 19:21:18 +02:00
Olivier Dony 1b49a87619 [FIX] ir.mail.server: restore parsing of multiple RFC2822 addresses including non-ASCII chars
Rev f2cf6ced1 modified RFC2822 parsing in order to better support
unicode characters inside the Name part of an address header.
However the patch broke handling of multiple addresses (comma
separated) - silently discarding all recipients except the
first one, as soon as any non-ASCII character was present.

This patch restores the functionality while preserving the
fix from f2cf6ced1, and simplifies the code using email.utils
utility functions.

Fixes (again) lp:1272610, OPW 607683
2014-10-10 18:32:00 +02:00
Jeremy Kersten fc47823ab2 [IMP] ir_qweb: remove the option 'only_date' introducted in cefc9ad8e3. Now we can use widget='date' to do the same thing. That keeps the same behaviour that in the backend.
<span t-field=model.datetime_field t-field-options="{'widget': 'date'}"/>
2014-10-10 16:20:10 +02:00
Denis Ledoux eeb1f0355c [FIX] res.users: exactly match login when operator in ilike, equal 2014-10-09 18:57:37 +02:00
Raphael Collet 8a9027edd1 [IMP] fields: do not force required=True on related fields
This may cause issues if the field is stored: non-null constraint will prevent
saving records when no value is provided.
2014-10-09 17:18:28 +02:00
Raphael Collet ab8bd8066a [FIX] models: in _create() and _write(), mark fields to recompute earlier
An issue occurs when a constraint is checked before computed fields are marked
for recomputation: the constraint will read the field's current value, which
may be wrong.  If the field is marked soon enough, the constraint will trigger
the recomputation and use a correct value.
2014-10-09 17:14:34 +02:00
Xavier Morel bc59cfce61 [IMP] doc: add testing reference and improve docstrings 2014-10-09 15:38:36 +02:00
Raphael Collet 1c9ed9f534 [IMP] fields: rename attribute 'copyable' into 'copy' 2014-10-09 15:05:15 +02:00
Raphael Collet 8ddf145559 [IMP] fields: do not copy field objects anymore, but make new instances instead
Because of the parameter overriding mechanism implemented by fields, it is no
longer necessary to copy field objects.  It is even better to no copy them in
the case of related fields.
2014-10-09 15:05:15 +02:00
Martin Trigaux bd52298073 [IMP] mail: parsing emails with several html parts
If an email contains several text/html parts inside a multipart email, the previous code was only keeping the last content part.
The Content-Type: multipart/mixed allows several independent part (RFC1341 7.2.2), so two html is technically valid.
With this patch, the two parts are concatenated. (opw 614755)

Modify append_content_to_html regex to make sure the regex keeps the content of the html instead of removing it.
e.g.: "123 <html> 456 </html> 789" used to be stripped to "123  789" while we expect "123 456 789"
2014-10-09 13:53:23 +02:00
Raphael Collet be894166ef [IMP] fields: add assertions to check parameters (comodel_name, size, digits) 2014-10-09 10:50:40 +02:00
Raphael Collet 36174fcc6e [IMP] fields: set the default value to the closest field.default or _defaults
This solves a subtle issue: in the following case, the class Bar should
override the default value set by Foo.  But in practice it was not working,
because _defaults is looked up before field.default.

    class Foo(models.Model):
        _name = 'foo'
        _columns = {
            'foo': fields.char('Foo'),
        }
        _defaults = {
            'foo': "Foo",
        }

    class Bar(models.Model):
        _inherit = 'foo'
        foo = fields.Char(default="Bar")

The change makes field.default and the model's _defaults consistent with each
other.
2014-10-09 09:18:02 +02:00
Raphael Collet 3f31081bc2 [IMP] fields: make attribute 'default' callable 2014-10-09 09:18:02 +02:00
Olivier Dony 7439421ad2 [I18N] Update translations from Launchpad 8.0 branches 2014-10-08 17:52:25 +02:00
Xavier Morel 99d740ad7d [IMP] new-api-ify 'trigger' server action 2014-10-08 17:30:16 +02:00
Xavier Morel 8cfe731f76 [FIX] actions: match the behavior of multi actions with its help text
also fix the corresponding text and add explicit sequence number because I
don't understand what the bloody hell it does without that, except that it's
not the right thing. At all.
2014-10-08 17:29:36 +02:00
Raphael Collet 619a844428 [FIX] fields: in to_column(), returning self.column is generally not correct
Consider the following example:

    class Foo(models.Model):
        _name = 'foo'
        _columns = {
            'state': fields.selection([('a', 'A')]),
        }

    class Bar(models.Model):
        _inherit = 'foo'
        state = fields.Selection(selection_add=[('b', 'B')])

The attribute 'column' of the field does not have the full selection list,
therefore the column object cannot not be reused, even a copy of it.  The
solution is to systematically recreate the column from the field's final
specification, except for function fields that have no sensible way for being
recreated.
2014-10-08 16:39:59 +02:00
Raphael Collet 10142d7dc7 [FIX] openerp/osv/fields: fix method to_field() to pass some falsy parameters.
For instance, the attribute copy=False was not passed when converting the
_column to a Field.  Simply make sure those parameter are always passed.
2014-10-08 16:39:59 +02:00
Denis Ledoux c741d45ac1 [FIX] ir_actions: ids of unlink method can either be an ID list or one ID 2014-10-07 16:07:46 +02:00
Christophe Simonis 8ff7230e2d [FIX] migration: test if package is installed using its state.
checking if there is an installed version set is not enough because this field is not reset when the module is uninstalled
2014-10-07 14:57:26 +02:00
Olivier Dony 4202ea7c19 [FIX] ir.ui.view: creating custom views in backend did not compute view type
When creating new records in backend all field values are
sent to the server, including empty fields.
2014-10-07 13:12:38 +02:00
Xavier Morel 9cd2693286 [FIX] JS tutorial 2014-10-07 10:23:50 +02:00
Xavier Morel 5954335222 [ADD] pyqweb-specific stuff, pyqweb APIDoc 2014-10-06 19:13:46 +02:00
Xavier Morel c5dca416da [IMP] qweb: foreach handling
* fix mapping handling to match JS impl: current value set as _value instead
  of being lost
* add handling of integer parameter
* only set _size and _last if current iterable is sized
2014-10-06 19:13:45 +02:00
Xavier Morel 2ffcff8fa9 [ADD] qweb: handling of t-att=mapping
Changed render_att_att to return an iterable of pairs instead of a pair, and
dispatched t-att on whether its result is a Mapping.

Also changed qweb test runner so it uses ordereddict for JSON mapping in
params, otherwise iteration order (and thus order of attributes in output) is
unpredictable and results don't/can't match expectations (as both are
strings).

Note that this relies on JS implementation details wrt iteration order of
mappings. Tests would probably be somewhat less brittle if rendering output
was parsed to XML... if that's possible (?)
2014-10-06 19:13:44 +02:00
Xavier Morel 14a677090b [ADD] running of XML cases to python qweb 2014-10-06 19:13:43 +02:00
Xavier Morel 494dcbd0e3 [IMP] qweb doc, tests
* document qweb based (mostly) on JS version
* convert JS qweb tests to (mostly) language-independent XML so they can be
  used for JS and Python implementations
* add some more tests (e.g. precedence between t-value and body in t-set)
* remove ``t-import``
* fix parity in foreach(dict) (and rename some variables to make array and
  object versions more similar)
2014-10-06 19:13:43 +02:00
Martin Trigaux 8843974d04 Forward port of branch saas-3 up to fc9fc3e 2014-10-06 15:52:23 +02:00
Martin Zlámal fc9fc3e0b8 [FIX] common.py: missing import
It was not possible to call "about" function via remote control
(XML-RPC), because it contains string translation without import.
2014-10-06 12:28:45 +02:00
Raphael Collet afb91fde81 [FIX] models: fields_get() shall not return info about fields not set up yet
When processing data files during a module installation/upgrade, not all fields
are set up yet, in particular relational custom fields.  Make fields_get()
ignore those fields, so that views can be created/updated and validated,
provided they do not refer to those fields...
2014-10-06 11:56:03 +02:00
Denis Ledoux cd6dba5257 [MERGE] forward port of branch 7.0 up to 9066da3 2014-10-03 12:13:07 +02:00
Denis Ledoux 7cbd524448 [FIX] ir_translation: apply tools.ustr on the trad itself
tools.ustr(None) returns u'None', res[0] can be None.
2014-10-03 12:08:49 +02:00
Denis Ledoux 76fdbec3bb [MERGE] forward port of branch 7.0 up to 6d4e1cc 2014-10-03 11:22:47 +02:00
Denis Ledoux 6d4e1cc73e [FIX] ir_translation: remove control characters from translations
This is possible that control characters (such as line returns) are inserted wrongly in translations
These should not influence on the web interface
2014-10-03 11:20:19 +02:00
Denis Ledoux 1c6c289f7b [FIX] api: clear environments on module installation 2014-10-02 17:46:25 +02:00
Denis Ledoux 40c8dd9a28 [FIX] ir_qweb: search assets as superuser
A security has been introduce in eb9113c04d to restrict access to orphan attachments to employees only

Assets need to be build and accessed as superuser, thus
2014-10-02 16:36:17 +02:00
Denis Ledoux 14f3085776 [MERGE] forward port of branch saas-3 up to 77500e5 2014-10-02 15:36:58 +02:00
Denis Ledoux 77500e54ec [MERGE] forward port of branch 7.0 up to eb9113c 2014-10-02 15:34:02 +02:00
Denis Ledoux eb9113c04d [FIX] ir_attachment: restrict access to orphan attachments to employees 2014-10-02 15:17:48 +02:00
Jeremy Kersten cefc9ad8e3 [IMP] ir_qweb: allow to display a datetime like a date 2014-10-02 13:22:39 +02:00
Christophe Simonis a1eb27b8ef [FIX] migration: allow debugging of migration scripts + avoid useless copies 2014-10-01 16:34:13 +02:00
Raphael Collet 53ff84493f [IMP] fields: allow sorting on inherited field in list views 2014-10-01 16:00:44 +02:00
Raphael Collet a69996b50c [IMP] fields: split multi-purpose '_origin' into 'column' and 'inherited'
This makes it easier to determine when a field interfaces a column, and when it
implements an inherited field (with _inherits).
2014-10-01 16:00:44 +02:00
Raphael Collet 34ba5154e2 [IMP] fields: split the default value from the compute function
This separation allows to set a default value on a related field, for instance.
2014-10-01 09:24:09 +02:00
Denis Ledoux 30a0814159 [FIX] fields: copy origin to avoid sharing field objects between registries
Fix a bug introduced in revision f229974, where shared columns objects are
systematically reintroduced in registries.
2014-09-30 14:32:35 +02:00
Alexandre Fayolle 20267aa06c fix exception message in report seachr
when we get to the raise statement, `r` is `None`, so displaying it in the
exception message is useless. `name` is what we want to show.
2014-09-30 11:35:05 +02:00
Olivier Dony a01ce6a127 [MERGE] Forward-port of 7.0 up to 9b1a9c9 2014-09-29 19:39:02 +02:00
Olivier Dony 5e248f09c7 [FIX] tools: remove useless attributes 2014-09-29 18:41:58 +02:00
Olivier Dony 9b1a9c9518 [FIX] tools: remove useless attributes 2014-09-29 17:39:01 +02:00
xmo-odoo 77a0ca6864 Merge pull request #2620 from savoirfairelinux/8.0-http-unicode
Fix two possible UnicodeDecodeError when an exception occurs
2014-09-29 15:24:22 +02:00
Sandy Carter e6dd2a63c1 Fix two possible AsciiErrors when an exception occurs
Signed-off-by: Sandy Carter <sandy.carter@savoirfairelinux.com>
2014-09-29 09:05:58 -04:00
Denis Ledoux edf679cfab [REVERT] tests added in forward port e2e60bf4eb
This is related to the revert 333852e19d
2014-09-26 22:23:46 +02:00
Denis Ledoux 07ee2a1de9 [MERGE] forward port of branch saas-3 up to 39bb45a 2014-09-26 21:58:06 +02:00
Denis Ledoux 39bb45a8ea [MERGE] forward port of branch 7.0 up to 333852e 2014-09-26 21:32:40 +02:00
Denis Ledoux 333852e19d Revert "[FIX] product,float_utils: perform ceiling via float_round with new rounding_method UP"
This reverts commit d4972ffdb6.

Seems to break some cases, at least in _product_reserve from stock/stock.py

Actual use case:

SELECT product_uom, sum(product_qty) AS product_qty FROM stock_move WHERE location_dest_id=%s AND location_id<>%s AND product_id=3645 AND state='done' GROUP BY product_uom;
returning 1 | 6

SELECT product_uom,-sum(product_qty) AS product_qty FROM stock_move WHERE location_id=%s AND location_dest_id<>%s AND product_id=%s AND state in ('done', 'assigned') GROUP BY product_uom;
returning 1 | -6

results += cr.dictfetchall()
    total = 0.0
    results2 = 0.0
    for r in results:
        amount = uom_obj._compute_qty(cr, uid, r['product_uom'], r['product_qty'], context.get('uom', False))
        results2 += amount
        total += amount
Total = 1, amount = -5

It should actually be
Total = 0, amount = -6
2014-09-26 21:21:06 +02:00
Christophe Matthieu 77c41cc5cb [FIX] website: 'Display Editor Bar on Website' group stopped working at commit a2ef044c47
The Edit button never appeared anymore for these users.
The idea was that they should see an edit button with
limited editing capabilities depending on their other
access rights.
For example, someone with only Sales Manager access and
'Display Editor Bar on Website'
would be able to edit online quotes from the website_quote
module, but not change the actual website pages or menus,
for instance.
2014-09-26 16:50:34 +02:00
Christophe Simonis a3704beefb [FIX] base: correct non-copy of `login_date` + adapt tests 2014-09-26 13:54:37 +02:00
Christophe Simonis e2e60bf4eb [MERGE] forward port of branch saas-3 up to fe8106f 2014-09-26 12:53:59 +02:00
Christophe Simonis fe8106fb85 [MERGE] forward port of branch 7.0 up to af37b30 2014-09-26 12:33:17 +02:00
Denis Ledoux af37b3022b [FIX] cron: doall false by default
As in most cases, we do not want this doall
2014-09-26 10:17:50 +02:00
Denis Ledoux 074c7b6c25 [FIX] res_users: do not copy login_date when duplicating users 2014-09-25 17:00:59 +02:00
Denis Ledoux 76067367b2 [MERGE] forward port of branch 7.0 up to 5f6d324 2014-09-25 15:10:37 +02:00
Raphael Collet 330a3ff6ea [IMP] models: when checking for data in a table, do not use column 'id'
Replace the query "SELECT min(id) FROM xxx" by "SELECT 1 FROM xxx LIMIT 1".
Both requests are as efficient, and the second one does not crash if column
'id' is missing.
2014-09-25 10:37:28 +02:00
Raphael Collet 1f15055de3 [FIX] fields: a function field with fnct_search should be searchable 2014-09-24 18:41:20 +02:00
Cedric Snauwaert d4972ffdb6 [FIX] product,float_utils: perform ceiling via float_round with new rounding_method UP
Modified product ceiling() to use float_round() with special mode
for rounding UP (away from zero), avoiding pathological cases where
float representations errors were ceiling to the superior unit.

Also added correspding tests for rounding_method=UP

Fixes issue #1125, and replaces PR #1126.
2014-09-24 17:11:25 +02:00
Raphael Collet 24f26c0eeb [FIX] ir_models: fix registry when we add/remove/modify a custom model/field 2014-09-24 15:30:37 +02:00
Olivier Dony b74d830eb2 [I18N] Update translation templates with latest term changes 2014-09-23 19:13:50 +02:00
Olivier Dony 1c5b5e4290 [I18N] Update translations from Launchpad 8.0 branches
server: rev. 26 rev-id launchpad_translations_on_behalf_of_openerp-20140923072744-tkfs0yinu8msjh09
addons: rev. 39 rev-id launchpad_translations_on_behalf_of_openerp-20140923072715-5j7qvnuvmmb1zzy1
web: rev. 23 rev-id launchpad_translations_on_behalf_of_openerp-20140923072757-jvh9l6r2x0vfcyhb
2014-09-23 13:42:05 +02:00
Martin Trigaux 152c5c2b56 [IMP] base: safer locking at user login
When a users connects, a lock is taken on the res_user table to modify the last login date. If another running transaction uses a foreign key to res.users (e.g. write_uid column), postgres may detect the update as a concurrent update and rollback the transaction.
In pg 9.3, the lock_strength parameter 'NO KEY' allows a weaker lock which is less likely to break another transaction.
Fixes #552
2014-09-22 18:18:41 +02:00
Christophe Simonis c6290988ce [FIX] models: only check existance of inverse_field for one2many fields 2014-09-22 17:05:07 +02:00
Christophe Simonis dcca9b52c7 [FIX] models: correct lazy loading of manual fields 2014-09-19 16:51:29 +02:00
yingliu4203 fb4db6c938 [FIX] Packaging: Wndows: wrong handler used when logging to file 2014-09-19 11:17:13 +02:00
Olivier Dony 990d05e78d [REL] Odoo 8.0 2014-09-18 12:11:18 +02:00
Olivier Dony 53aa92d3c9 [I18N] Update translations from Launchpad branches 2014-09-18 11:47:16 +02:00
Thibault Delavallée 7cad4baa84 [FIX] [CLEAN] Various: fixed / cleaned use of dict.fromkeys.
Indeed using fromkeys with a list / dict as argument leads to the creation
of shared list / dict. This could create some ugly side effects when
used in loops. This commit fixes or cleans this kind of statement to avoid
unwanted side effects.
2014-09-18 11:18:30 +02:00
Martin Trigaux f0c3856be2 [IMP] gamification: allow to select fields of inherited models 2014-09-18 11:12:15 +02:00
Martin Trigaux 423a9f3011 [ADD] base: list of inherited models on a ir.model
This field is needed to retrieve the list of inherited fields (instead of only the fields of a current model) of a model using domain such as ('model_id', 'in', model.inherited_model_ids) on ir.model.fields
2014-09-18 11:12:15 +02:00
Raphael Collet 764c5acd81 [IMP] fields: reset decimal precision on new-style fields
When a decimal_precision record is created/modified, the float fields of the
models in the registry must be reset.  This was done on old-API columns only.
It is now handled by the new-API fields.
2014-09-18 11:11:19 +02:00
Simon Lejeune d9e72a3716 [FIX] Package: Debian, Windows: more odooification; Debian: correct Packages.gz 2014-09-18 00:17:32 +02:00
Fabien Meghazi 57ad514bb2 [FIX] Image resizing bug 2014-09-17 17:38:35 +02:00
Olivier Dony e5bff82aff [MERGE] Forward-port saas-5 up to f9bcd67 2014-09-17 16:39:06 +02:00
Denis Ledoux f9bcd67f5b [MERGE] forward port of branch saas-3 up to b6e6b57 2014-09-17 16:25:38 +02:00
Denis Ledoux b6e6b57326 [FIX] orm: typo during forward port 60a82133cc 2014-09-17 16:24:40 +02:00
Raphael Collet 6e0c73d2ad [FIX] fields: make convert_to_cache() more robust with inverse one2many
When a one2many field uses an integer field as inverse, the onchange method on
the second model may receive a dictionary for the value of the integer field.
This is because the client expects that field to be a many2one.
2014-09-17 16:01:02 +02:00
Fabien Meghazi 0084646475 [IMP] Refactor ir.ui.view's read_template cache invalidation 2014-09-17 15:52:47 +02:00
Olivier Dony c926b54a49 [MERGE] Forward-port saas-3 up to 09ab2d4 2014-09-17 15:16:30 +02:00
Olivier Dony 09ab2d4109 [MERGE] Forward-port 7.0 up to 938502a 2014-09-17 15:13:42 +02:00
Olivier Dony 938502aa37 [FIX] loading: always process auto-installed modules for new databases
If the server was started without -i or -u and
happened to initialize a fresh database,
auto-installed modules that depend
on `base` only would stay in status "to install"
without actually being installed (until the next
installation round was triggered).
This was of little consequence in 7.0, but causes
a crash in 8.0.

Fixes #953
2014-09-17 15:11:01 +02:00
Olivier Dony 5bfad4dd52 [IMP] base: show local modules in Settings until apps.odoo.com is migrated for 8.0 2014-09-17 14:37:29 +02:00
Denis Ledoux 47c3205229 [FIX] ir_ui_view: Active (boolean) should not be required
If so, impossible to uncheck the box in the webclient
2014-09-17 13:55:00 +02:00
Denis Ledoux 60a82133cc [MERGE] forward port of branch 7.0 up to f5f7609 2014-09-17 13:39:13 +02:00
Denis Ledoux f5f76094a7 [FIX] orm write: do not try to store computed & stored fields for relational records deleted by *2many fields
opw-613772
2014-09-17 13:32:30 +02:00
Fabien Meghazi 11d0970721 [FIX] double html escaping in qweb 2014-09-16 21:32:37 +02:00
Fabien Meghazi 7bc7757ec3 [IMP] add `url_for` hook to bundle urls 2014-09-16 19:55:00 +02:00
Fabien Meghazi 954f20c800 [ADD] image_save_for_web() format argument 2014-09-16 19:55:00 +02:00
Fabien Meghazi 7893645d9c [ADD] ir.qweb render_attribute() hook for postprocessing 2014-09-16 19:55:00 +02:00
Fabien Meghazi 89362bd6cd [ADD] tools.image_save_for_web() helper for image compression 2014-09-16 19:55:00 +02:00
Fabien Meghazi 3f27066019 [IMP] Compress resized /website/image's
Refactored and fixed tools.image_resize_image() that converted to RGBA
after making thumbnails, resulting in bad looking picture in case the
source is in 'P' mode (indexed palette)
2014-09-16 19:55:00 +02:00
Fabien Meghazi 6fd3982e23 [ADD] http.send_file() helper 2014-09-16 19:54:59 +02:00
Olivier Dony 3caafac8c0 [FIX] ir.ui.view: match translated terms without heading/trailing whitespace
As the whitespace is stripped when exporting terms
to translate, it must be done as well when matching
translations at runtime.

Fixes issue #1755 partly
2014-09-16 17:46:25 +02:00
Olivier Dony b7a2cc13ba [FIX] ir.translation: translated terms within view definitions were not loaded
The changes for QWeb template translation have introduced
res_id values in PO comments for all `#: view:` terms, as
the real database id needs to be resolved when loading them.

For non-QWeb views this is not necessary and actually caused
the terms to be dropped when the res_id could not be resolved.

Rather than having a different PO comment format for QWeb and
non-QWeb views, we can extend the QWeb hack to force the
res_id to 0 for non-QWeb views.

Fixes issue #1755
2014-09-16 17:46:25 +02:00
Raphael Collet f2299749fe [FIX] models: make field inheritance work when source field is defined in old api 2014-09-16 16:03:16 +02:00
ssh-odoo acdb43b6cb [REM] report: remove openerp/report/pyPdf
Distributing our version of pyPdf is not required anymore since we
introduced the new reporting tool.

In order to keep reports working, the standard python library
`python-pypdf` has to be installed instead (through pip or your
distribution's package manager)
2014-09-16 15:42:02 +02:00
Denis Ledoux d6741c8b54 [FIX] fields: convert_to_read, handle missing many2one foreign keys 2014-09-16 12:29:37 +02:00
Raphael Collet 2cbdd7ab0e Merge branch 'acsone-8.0-onchange-one2many-test': add test for onchange on one2many field 2014-09-16 10:56:43 +02:00
Raphael Collet 8fc7cf74fc [FIX] models: improve implementation of _compute_display_name()
The method was expecting that name_get() returns complete and in-order values.
Because of this, some records in the recordset could end up without a value.
2014-09-16 09:36:58 +02:00
Raphael Collet e724f3adec [FIX] fields: in *2many.convert_to_cache, fix the effect of command "1" 2014-09-15 15:31:30 +02:00
Martin Trigaux 32f5168974 [FIX] orm: do not drop foreign keys of transient models
During the update of a module, the existing foreign keys are dropped if they have a different ondelete_rule than the one specified on the field.
The foreign keys for many2one transiant -> non-transiant are created with cascade rule by default (see `m2o_add_foreign_key_checked` method) so the check needs to be realised in the same conditions.
2014-09-15 15:24:53 +02:00
Samus CTO 176e14d2bc [IMP] api: compute methods cannot depend on field 'id'
This feature hasn't been implemented because of complexity problems.
Therefore, we should not allow the developer to use it.
2014-09-15 15:06:44 +02:00
Denis Ledoux 51e7e03502 [MERGE] forward port of branch saas-5 up to 163d7f5 2014-09-15 14:25:02 +02:00
Denis Ledoux 163d7f5a53 [MERGE] forward port of branch saas-3 up to b5b7dcc 2014-09-15 14:23:58 +02:00
Christophe Simonis 780dd9891f [MERGE] forward port of branch saas-5 up to 7eab880 2014-09-15 14:00:02 +02:00
Christophe Simonis 7eab880660 [FIX] orm: correct read_group() on models with `_group_by_full` (introduced by previous forward-port)
also add tests of `_group_by_full` functionality
2014-09-15 12:09:35 +02:00
Denis Ledoux 782fec88ca [MERGE] forward port of branch 7.0 up to b601015 2014-09-15 11:58:10 +02:00
Denis Ledoux b601015800 [FIX] tools: restrict available attributes 2014-09-15 11:55:53 +02:00
Christophe Simonis 56f2b7ae0f [MERGE] forward port of branch saas-3 up to fdc6271 2014-09-12 18:53:48 +02:00
Daniel Reis ec0b770ed3 [IMP] modules: add support for loading module description from README.{md,rst,txt}
Showcase the feature by moving auth_ldap's description to README.rst

(Manual rebase of PR #1759)
2014-09-12 18:31:32 +02:00
Olivier Dony ddc78626e1 [IMP] ir.model:.fields allow setting ondelete=restrict foncustom fields 2014-09-12 17:51:56 +02:00
Christophe Simonis fdc62713a5 [MERGE] forward port of branch 7.0 up to 9b1cdea 2014-09-12 17:28:55 +02:00
Raphael Collet 7c0387c952 [FIX] fields: in computed fields, handle AccessError and MissingError
When computing a field on a recordset, a subset of the records may be missing
or forbidden by access rules.  In that case, evaluate the compute method record
by record, and mark failed records as such in cache.
2014-09-11 11:57:18 +02:00
Raphael Collet 85533e1841 [FIX] models: in onchange(), do not send a field value if it has not changed
The method onchange() executes onchange methods in cascade.  Suppose onchange()
is called and a field F=1 in the form.  If an onchange method set F=2, that
value is put in the result variable.  If another onchange method set it back to
F=1, the binding F=2 must be removed from the result variable.

Fixes #2309
2014-09-11 11:45:23 +02:00
Martin Trigaux f2cf6ced17 [FIX] mail: encoding of sender name with unicode
When sending an email, both formats 'Name <email>' or '"Name" <email>' can be used for fields 'From', 'To' and others. If the name contains unicode characters, a regex only matching '"Name" <email>' was used to encode the name with RFC2047. That meant that the name was not encoded and eventually dropped, using only the email part.
Instead of using a limited regex, use the parseaddr method from email library.
Fixes lp:1272610, opw 607683
2014-09-10 17:36:00 +02:00
Raphael Collet ad14acab32 [FIX] models: in method onchange(), check for record dirtiness only on *2many fiels
Cascading onchanges can be caused by a related field computed in cache.  This
causes a bug in sale order lines, were setting the uom field forces reading
product fields, which are inherited from product templates.  The inherited
fields are computed as related fields, which marks the product record as dirty.
This subsequently triggers an onchange on the product field, which resets the
uom field!
2014-09-10 14:26:12 +02:00
Denis Ledoux 2459cd5dd1 [FIX] ir_attachment: attachements removed on record unlink 2014-09-10 12:18:14 +02:00
Raphael Collet 7428464004 [FIX] openerp/osv/fields: disable prefetching when reading inverse of one2many fields
This fixes issue #2146.  The inverse of a one2many field can be an inherited
field (_inherits).  In that case, we cannot read its value with a simple
database query.  Instead, we let the related field read it, but for performance
considerations we disable the prefetching of other fields.
2014-09-10 09:41:36 +02:00
Denis Ledoux b1f4a61705 [MERGE] forward port of branch 7.0 up to 8dff247 2014-09-09 18:23:32 +02:00
Simon Lejeune 2266a96420 [FIX] ir_qweb: contact widget: properly pass the context when browsing the contact
As the context was not transferred, it was never translated.
2014-09-09 18:16:21 +02:00
Denis Ledoux e447a46ec8 [MERGE] forward port of branch 7.0 up to 33e0910 2014-09-09 18:02:30 +02:00
Denis Ledoux 8dff247096 [FIX] orm, read_group: read_group_fill_results handle no_leaf 2014-09-09 16:47:40 +02:00
Christophe Simonis e9a4603cb4 [FIX] fields.py: One2many fields only set inverse field on Many2one fields 2014-09-09 13:28:48 +02:00
Christophe Simonis ab6318e538 [FIX] base: ir.model.data.name_get() respect expected behavior.
name_get() must return a value for each ids and keep order of ids.
2014-09-09 13:28:47 +02:00
Raphael Collet ab3ec1ef6c [IMP] openerp/http.py: accept mimetype application/json-rpc for json-rpc calls 2014-09-09 10:11:33 +02:00
Xavier Morel c5fbb47abf [ADD] doc: model inheritance stuff 2014-09-09 09:19:32 +02:00
Olivier Dony fac96241df [I18N] Update 8.0 translations with latest changes from Launchpad 2014-09-08 19:04:25 +02:00
Olivier Dony d32d120a0a [MERGE] Forward-port of saas-5 up to 9ce08b7 2014-09-08 16:54:10 +02:00
Olivier Dony 491162e653 [FIX] ir.qweb: consider empty cached bundle as a cache miss
Sometimes a cached bundled could be missing in the
ir.attachment filestore (for example after copying
a database for test purposes without duplicating
the filestore as well).
When this happens ir.attachment will return an empty
file contents ; treat this as a cache miss.

This means empty bundles would not be cached, which
is not a big issue - there is little benefit in
caching them, and they should not be common nor
useful.
2014-09-08 16:52:42 +02:00
Olivier Dony a03dfefda9 [FIX] ir.attachment: less non-transactional side-effects during deletion
When deleting filesystem-backed attachements, the
deletion on the file-system is not transactional.
In the event of a transaction rollback, the file
deletion would not be rolled back, which is a
dangerous side-effect.

This can happen for example when several transactions
try to delete the same file(s) at the same time.
The duplicate deletions might be detected by the
database (being concurrent update errors), and rolled
back at the point of the DELETE query, to be retried.
If the files have already been deleted in the file
system it before the rollback, it leaves the system
in an inconsistent state, at least temporarily.

One case where we have seen it is when web bundles
are loaded by many web users at the same time, right
after being updated (and thus invalidated).
As they are currently cached as ir.attachment records,
this often causes a corruption of the cache.
2014-09-08 16:52:42 +02:00
Olivier Dony 46784659f9 [IMP] ir.attachment: include traceback when logging low-level filesystem errors 2014-09-08 16:52:41 +02:00
Xavier Morel 7558e2e786 [IMP] distribute branding on @groups instead of disabling edition
Avoids 2 rendering passes, and allows editing e.g. events detail page, which
couldn't be done (due to groups=public in a mail component)

fixes #1994
2014-09-08 11:16:06 +02:00
Denis Ledoux 1e374b4ad7 [FIX] ir_attachment: ignore if model uninstalled
if the model of an attachement no longer exists (the according module have been uninstalled, for instance), ignore the security check
2014-09-08 10:51:46 +02:00
Leonardo Pistone 9b78f06e47 yaml: use selected user and not admin for defaults 2014-09-05 17:31:59 +02:00
Leonardo Pistone 0edfc3fbc9 yaml: use selected user and not admin for onchange
Fixes: #1885
2014-09-05 17:31:47 +02:00
David Monjoie 6e5b09acfa [FIX] removed bad comments from previous commit 2014-09-05 17:12:49 +02:00
David Monjoie f3333f9c57 [ADD] website_sale_digital 2014-09-05 17:11:12 +02:00
Fabien Meghazi c981d068ab [FIX] Restore /login redirection on SessionExpired
The feature was broken due to an incompatibility
when forward porting 624f256 and a78e27f
2014-09-05 16:24:59 +02:00
Denis Ledoux d824769b3c [FIX] tools,mail: improve parsing of references from rev. 0bee015dd6
Backport of 8.0 fix was not enough for 7.0, because it still fails for the legacy reference match (model+res_id), which is not used in 8.0
2014-09-05 11:44:20 +02:00
Christophe Simonis 41afeec7f1 [MERGE] forward port of branch saas-5 up to 9363bc9 2014-09-04 18:03:24 +02:00
Christophe Simonis 9363bc9182 [MERGE] forward port of branch saas-3 up to 3d80dc2 2014-09-04 17:51:42 +02:00
Christophe Simonis 80a932479b FIX] packaging: odoo-ification 2014-09-04 16:27:58 +02:00
Raphael Collet 68777c5860 [IMP] models: inherited fields are related fields read as the current user
Add an attribute 'related_sudo' (True by default) for related fields.
A related field is computed as superuser if related_sudo is True.

Add explicit related fields 'name' and 'email' on 'res.users', as these should
be readable by the public user with module website_forum.
2014-09-04 16:10:48 +02:00
Raphael Collet d6f375df61 [IMP] models: "X in self" is now equivalent to any(X == rec for rec in self)
Fix modules with code like "record.id in other.stuff_ids".
2014-09-04 15:31:04 +02:00
Raphael Collet 070f28dce6 [FIX] base: remove test_ir_model, which causes bugs
The test in test_ir_model creates a custom model.  This causes a full reload of
the registry, which recursively installs the required modules while 'base' is
being tested.  As a side effect, it commits stuff from the database, so that
the effects of test_ir_model are actually not rolled back.
2014-09-04 14:59:45 +02:00
qdp-odoo f4e350ca36 [FIX] account: several fixes on the new bank statement reconciliation widget 2014-09-04 11:32:16 +02:00
Raphael Collet 4ce06c238b [FIX] openerp.api.Environment: move recomputation todos into a shared object
This fixes a bug which is usually triggered in module account_followup, but
does not occur deterministically.  Some recomputations of computed fields are
apparently missing.  Environment objects containing recomputations todos and
kept alive by a WeakSet, are removed by the Python garbage collector before
recomputation takes place.  We fix the bug by moving the recomputation todos in
a non-weakref'ed object.
2014-09-04 10:18:55 +02:00
xmo-odoo 9a3b48de0f Merge pull request #2173 from pedrobaeza/8.0-module_icon_field_size
[FIX] Size for icon field of ir_module_module table in base.sql

fixes #2095
2014-09-04 09:38:23 +02:00
Pedro M. Baeza a717c2a24a [FIX] Size for icon field of ir_module_module table in base.sql 2014-09-04 01:46:44 +02:00
antonylesuisse 5065b38159 Merge pull request #2134 from odoo-dev/8.0-improve-packaging3-sle
v8 packaging by sle
2014-09-03 16:40:52 +02:00
Stéphane Wirtel 1ff7ed2758 [IMP] Optimize the schedulers of the calendar, fetchmail and base_action_rules modules
Disable the the crons when they'd have nothing to do, re-enable them when a
task is (probably) introduced
2014-09-02 18:32:27 +02:00
Cédric Pigeon 919869907d [ADD] add new test for onchange on one2many field 2014-09-02 16:11:37 +02:00
Simon Lejeune 7e41903110 [FIX] config.py: do not use appsdir to define the user's data dir when he has no home directory on unix
Force it to be '/var/lib/(appname)' in this case
2014-09-02 14:13:00 +02:00
Raphael Collet f2f1f3465d [IMP] models: prefetch fields with groups (those to which user has access) 2014-09-02 14:11:11 +02:00
Raphael Collet 4f11ff379a [IMP] models: do not prefetch too many records at once 2014-09-02 14:11:11 +02:00
Raphael Collet e7b8e107f1 [IMP] fields: update inverse fields lazily for performance
When a relational field is assigned in an onchange, its inverse field is
updated in cache.  Reading the current value of the inverse field may be
costly, for instance in the case of a one2many field with thousands of records
as a value.  Instead, put in cache a SpecialValue that reads and updates the
field; it will be triggered only when it is accessed.
2014-09-02 14:07:03 +02:00
Martin Trigaux 4a10295823 [FIX] fields: avoid prefetching of one2many fields
When reading a one2many field, the inverse mapping of the lines (matching m2o -> lines of corresponding record) was instantiating each line and then triggering the prefect of fields.
To improve the performances, the inverse mapping is done in sql to avoid triggering the prefetching.
2014-09-02 13:34:57 +02:00
Xavier Morel eab52acccd [ADD] initial theme guide + scaffolding
incomplete, incorrect, committed for testing
2014-09-02 12:43:17 +02:00
xmo-odoo 9c2f093611 Merge pull request #2113 from yvaucher/8.0-fix-ir_model-undefined-xml_id
fix typo on undeclared variable xml_id
2014-09-02 07:56:27 +02:00
Yannick Vaucher bdfa970d3d fix typo on undeclared variable xml_id 2014-09-01 16:26:55 +02:00
Christophe Simonis 0f122cc50c [FIX] http.py: session id is `sid` attribute 2014-09-01 15:49:26 +02:00
Xavier Morel cccd3c888f [ADD] openerp.http reference doc
* fix some docstrings so they can be autodoc'd
* intersphinx mapping (and links to) werkzeug and python
2014-09-01 14:16:14 +02:00
Antony Lesuisse 2d296cb779 [MERGE] ir-ui-view split active and show_customize
Split the ternary field application in active and show_customize, all four
possible value are now needed for the customize theme popup.
2014-08-31 16:56:44 +02:00
Christophe Simonis 0c05a376d5 [FIX] base, mail: access to ir.config_parameter is now handled by by
record rules.

Partial revert of commit 80017b04c2.

Conflicts:
	addons/web/static/src/js/chrome.js
2014-08-29 12:01:50 +02:00
Christophe Simonis 1d2fe3330c [MERGE] forward port of branch saas-5 up to 24c25f5 2014-08-29 11:36:35 +02:00
Christophe Simonis 010dd70894 [MERGE] forward port of branch saas-3 up to c914893 2014-08-28 19:25:08 +02:00
Christophe Simonis 6f6197fb7c [MERGE] forward port of branch 7.0 up to f65c913 2014-08-28 18:15:10 +02:00
Christophe Simonis f65c913027 [FIX] base: security: employee must have access to res.groups 2014-08-28 18:14:08 +02:00
andreparames 0908376221 [FIX] Load translations for selection fields
Selection fields in the new QWeb reports aren't being translated, because the context with the language isn't being passed.
2014-08-28 16:41:45 +01:00
Christophe Simonis 8046b7367d [MERGE] forward port of branch saas-5 up to 7e117b1 2014-08-28 16:51:11 +02:00
Christophe Simonis 7e117b18a0 [MERGE] forward port of branch saas-3 up to ada9724 2014-08-28 16:21:27 +02:00
Christophe Simonis ada9724655 [MERGE] forward port of branch 7.0 up to 3509e15 2014-08-28 16:12:55 +02:00
Xavier Morel e6b56412a0 [ADD] views documentation 2014-08-28 15:02:33 +02:00
Leonardo Donelli 3509e15cc9 [IMP] report_sxw: missing parameter without_company for display_address
Fixes #811
2014-08-27 16:55:02 +02:00
Fabien Meghazi 34c5a5cf9c [IMP] Increase statics cache from 12 hours to 1 week 2014-08-27 16:54:25 +02:00
Denis Ledoux dd86d41eb4 [FIX] security: disallow read on ir.sequence for externals 2014-08-26 16:17:24 +02:00
Denis Ledoux 53582c2ea6 [FIX] security: res.groups should be readable by admins only 2014-08-26 13:31:41 +02:00
Denis Ledoux 72d3697fbc [FIX] security: externals should be able to read attachements
without having the rights to read ir.config_parameter
2014-08-26 12:55:48 +02:00
Denis Ledoux 80017b04c2 [FIX] security: ir.config_parameter should not be readable by externals 2014-08-26 12:50:04 +02:00