Commit Graph

43 Commits

Author SHA1 Message Date
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
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
Christophe Simonis fd4fd35e32 [MERGE] forward port of branch saas-5 up to e4cb520 2014-07-30 20:52:14 +02:00
Denis Ledoux 88c022dfc8 [MERGE] forward port of branch 7.0 up to bbb8d8f25a 2014-07-29 11:42:10 +02:00
Olivier Dony ef53a831c6 [MERGE] Forward-port saas-5 up to a5f7891 2014-07-23 16:58:00 +02:00
Martin Trigaux 1f878f152a [MERGE] forward port of branch 7.0 up to 680f955 2014-07-22 13:39:15 +02:00
Martin Trigaux 3dec09079e [FIX] ir_values: fallback when no condition
When searching for default values, if we set a condition (e.g. 'type=out_invoice'), fetch also the default values without any condition set. Thanks to the order by clause, the one with a condition have an higher priority than the one without and will not affect existing result.
This fixes default journal/currency on an invoice where the journal is retrieved in the onchange_company_id method (domain is forced). Without this patch only ir.values with a domain set will match, opw 610645
2014-07-17 15:07:58 +02:00
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00
Jaydeep Barot 026e38b48f [REM] Unnecessary `size` parameters on char fields 2014-06-25 17:13:43 +02:00
Martin Trigaux b87db84c0d [FIX] ir_values: try to evaluate the given expression before saving it in pickle form (opw 607398)
The value_unpickled given by xml data is usualy already evaluated but when it is given by the web client, a str is recieved by the method (as the field is a text field). In the later case, we need to evaluate the field before storing to be correctly evaluated as a default value.

bzr revid: mat@openerp.com-20140509130412-ki211x7qdccdnv5w
2014-05-09 15:04:12 +02:00
Ravi Gohil (OpenERP) 166b8efabb [FIX] Modifying default value for other than char/string/selection fields from 'Setting/Technical/Actions/User-defined Defaults' view sets wrong pickle value for respective record. (Maintenance Case: 607398)
lp bug: https://launchpad.net/bugs/1153628 fixed

bzr revid: rgo@tinyerp.com-20140506055725-ryorjswf236plhlc
2014-05-06 11:27:25 +05:30
Ravi Gohil (OpenERP) 636e825876 [FIX] Modifying default value for other than char/string/selection fields from 'Setting/Technical/Actions/User-defined Defaults' view sets wrong pickle value for respective record. (Maintenance Case: 607398)
lp bug: https://launchpad.net/bugs/1153628 fixed

bzr revid: rgo@tinyerp.com-20140506054055-xse0aywu6p3hl138
2014-05-06 11:10:55 +05:30
Ravi Gohil (OpenERP) 1e1c2230fd [FIX] Modifying default value for other than char/string/selection fields from 'Setting/Technical/Actions/User-defined Defaults' view sets wrong pickle value for respective record. (Maintenance Case: 607398)
lp bug: https://launchpad.net/bugs/1153628 fixed

bzr revid: rgo@tinyerp.com-20140505115121-lwz1crjjoxyqfgax
2014-05-05 17:21:21 +05:30
Christophe Simonis b8950c14c8 [FIX] ir.values: be tolerant to actions pointing to non existing actions (aka old wizards)
bzr revid: chs@openerp.com-20140213110937-hc3u6fwfclhf5mmn
2014-02-13 12:09:37 +01:00
Christophe Matthieu de9777bf56 [IMP] Improve typos in warning (Grammar mistake, Capitalize title, Typos)
bzr revid: chm@openerp.com-20130607090251-2ym7dx73jdigq93w
2013-06-07 11:02:51 +02:00
ggh-openerp dd7614e716 [IMP] Remove space before Exclamation marks [!] in Warning
bzr revid: ggh@tinyerp.com-20130429072938-knas9ymmny5o2z0v
2013-04-29 12:59:38 +05:30
Raphael Collet 09be864f1d [IMP] replace all tests like 'registry.get(X)' by 'X in registry' where X is non static
bzr revid: rco@openerp.com-20130329140723-dnrl02saky570xg0
2013-03-29 15:07:23 +01:00
Cecile Tonglet ad8b76de53 [MERGE] From trunk (second time)
bzr revid: cto@openerp.com-20121217144753-1rboqdw01h8yrehj
2012-12-17 15:47:53 +01:00
Cecile Tonglet 5f0070dcb6 [FIX] Remove unused imports and fix some imports that doesn't use the new namespace
bzr revid: cto@openerp.com-20121217143029-e9ki4ftwihq7pdme
2012-12-17 15:30:29 +01:00
Xavier Morel 5155f30303 [REM] unused local variables
bzr revid: xmo@openerp.com-20121214132533-aafgbov19ckb9ksp
2012-12-14 14:25:33 +01:00
Xavier Morel 5d3d3868f6 [IMP] use augmented assignments
bzr revid: xmo@openerp.com-20121214131924-bpl48ht21ic4g34b
2012-12-14 14:19:24 +01:00
Vo Minh Thu 509a084e79 [IMP] use the openerp namespace.
bzr revid: vmt@openerp.com-20121210152723-mv4dykfu6ip1991h
2012-12-10 16:27:23 +01:00
Raphael Collet 1a3a33b6d5 [MERGE] from trunk
bzr revid: rco@openerp.com-20120403082743-7lf3rb6h0ff95w7f
2012-04-03 10:27:43 +02:00
Olivier Dony 697e034d54 [FIX] ir.values: predictible ordering for sidebar items (based on IDs i.e. creation order)
bzr revid: odo@openerp.com-20120320113851-lsg8ju1w0cvdo0tj
2012-03-20 12:38:51 +01:00
Raphael Collet c05563ff6f [ADD] base: add model res.config.settings for preferences wizard
bzr revid: rco@openerp.com-20120302134156-afohe4jxay2eq0id
2012-03-02 14:41:56 +01:00
Raphael Collet 2c2432ad33 [FIX] ir_ui_menu: do not create a menu binding when field 'action' is False
bzr revid: rco@openerp.com-20120210082637-tn4cyvgfa4jrxpj4
2012-02-10 09:26:37 +01:00
Olivier Dony d163de7b55 [FIX] ir.values: avoid returning conditional defaults when condition is not set
This should un-break the tests introduced
 in previous revision

bzr revid: odo@openerp.com-20120209130854-x73j0ouyjsjnhsdg
2012-02-09 14:08:54 +01:00
Numerigraphe - Lionel Sausin a2f4f2669b [IMP] Added missing vim mode lines
lp bug: https://launchpad.net/bugs/524279 fixed

bzr revid: ls@numerigraphe.fr-20111122085848-1atcrcw8e64altcp
2011-11-22 09:58:48 +01:00
Vo Minh Thu b04d607ec4 [FIX] ir_values: missing trimming of the condition (as done elsewhere).
bzr revid: vmt@openerp.com-20111003154008-k8dm2r3yhintm0ql
2011-10-03 17:40:08 +02:00
Olivier Dony fbb6e5e56a [FIX] ir.values.get_defaults: typo in SQL query - spotted by Naresh, thanks!
bzr revid: odo@openerp.com-20110908113833-z2cgkj093940usys
2011-09-08 13:38:33 +02:00
Olivier Dony e333a2eb2e [IMP] ir.values: improved defaults doc + removed `object` column completely
The `object` column actually directly depended on the value of
the `key` column, so it can be totally removed with no side-effects.
Docstrings updated following review comments.

bzr revid: odo@openerp.com-20110905141058-xa01o77l1rto6hg9
2011-09-05 16:10:58 +02:00
Olivier Dony d0af2f830c [FIX] ir.values: get_defaults() should cut the condition at 200 chars to match the conditions that were set
bzr revid: odo@openerp.com-20110902151442-rqrh62z67g8k921o
2011-09-02 17:14:42 +02:00
Olivier Dony 32020e1353 [FIX] ir.values: re-binding of actions should properly delete the previous one
bzr revid: odo@openerp.com-20110902125648-x0cir5m7818h9ba6
2011-09-02 14:56:48 +02:00
Olivier Dony 38ddb76960 [IMP] ir.values: minor cleanup/view improvements
bzr revid: odo@openerp.com-20110902101530-13r328uwhwdpudn5
2011-09-02 12:15:30 +02:00
Olivier Dony 75e0749542 [IMP] ir.values: separated defaults and actions API, added different views
This should prepare for a future split of the two parts
currently composing ir.values entries: user defaults and
action bindings to a model's UI.

bzr revid: odo@openerp.com-20110901181254-g14lyeogs0wv23bz
2011-09-01 20:12:54 +02:00
Vo Minh Thu d4adda9d06 [MERGE] ir_values: added asserts on the models argument type.
bzr revid: vmt@openerp.com-20110610101924-al1z5vvmcehbcgva
2011-06-10 12:19:24 +02:00
P. Christeas ba03d85325 ir.values: whitespace cleaning, put assertions on arg types
res.lang was calling with modules='string', which was not right.
Don't allow such a case.

bzr revid: xrg@linux.gr-20110610091852-y8083s085gn6kwcs
2011-06-10 12:18:52 +03:00
Vo Minh Thu 5d83528841 [MERGE] merged trunk
bzr revid: vmt@openerp.com-20110525151722-w9qt1qjficpv71re
2011-05-25 17:17:22 +02:00
Vo Minh Thu 261cb1079d [REF] ir_values:
- context=None instead of context={}
- removed common.ir_{set,get,del} from xmlrpc as it is not used anymore.

bzr revid: vmt@openerp.com-20110518154832-42f1k6ii093r12vs
2011-05-18 17:48:32 +02:00
Vo Minh Thu b9b3251af5 [IMP] ir_value: forgot to add some comment.
bzr revid: vmt@openerp.com-20110517141552-3hrj3itt7axxjol0
2011-05-17 16:15:52 +02:00
Vo Minh Thu 6a189e8c96 [Fix] Set default value for current login user
lp bug: https://launchpad.net/bugs/780418 fixed

bzr revid: vmt@openerp.com-20110517140410-1f3rlewsa5f4238r
2011-05-17 16:04:10 +02:00
RGA (OpenERP) e48c0c8ef2 [Fix] Set default value for current login user
lp bug: https://launchpad.net/bugs/780418 fixed

bzr revid: rga@tinyerp.com-20110513102119-aw4n336m5wcm0c9o
2011-05-13 15:51:19 +05:30
Vo Minh Thu f8572e5c60 [IMP] openerp python module.
- Some logging code moved from netsvc.py to loglevels.py
- Changed imports to use the new openerp module
- config and netsvc initialization calls move to openerp-server.py
- Moved openerp-server.py outside the old bin directory
- Some imports in tools moved inside the methods to break mutual-dependencies

bzr revid: vmt@openerp.com-20110207125723-ooee7d7ng5elmkso
2011-02-07 13:57:23 +01:00