Commit Graph

483 Commits

Author SHA1 Message Date
Olivier Dony 74ed36e416 [IMP] orm,ir.model: improve registration and deletion of schema ext_ids
Also handle the very common cases of inheriting classes
that must *not* trigger deletion of the m2m tables and
constraints of their parent classes!

bzr revid: odo@openerp.com-20120331004215-413lcxaxvg0u6oxw
2012-03-31 02:42:15 +02:00
Thibault Delavallée 94075df78e [DOC] Added comments.
bzr revid: tde@openerp.com-20120330102419-n2co6dwf00q0muue
2012-03-30 12:24:19 +02:00
Thibault Delavallée 3ee9f70343 [IMP] Renamed added fields. Added comments and improved help.
bzr revid: tde@openerp.com-20120330101929-18opxctcz1eeyl4u
2012-03-30 12:19:29 +02:00
Quentin (OpenERP) b1a29c5a6a [REF] base: small refactoring of things related to the merge of res.partner and res.partner.address
bzr revid: qdp-launchpad@openerp.com-20120329114331-hmlld7fxlw6sh1ks
2012-03-29 13:43:31 +02:00
Quentin (OpenERP) 808e441390 [MERGE] merged the main server code
bzr revid: qdp-launchpad@openerp.com-20120329111943-wt81xc8if89rpy4w
2012-03-29 13:19:43 +02:00
Thibault Delavallée 8196c9e1b1 [REF] Refactored needaction mechanism. Added functional fields in ir.ui.menu so the web client only has to manage the values.
bzr revid: tde@openerp.com-20120328163549-4g3dc5mwdagenrq1
2012-03-28 18:35:49 +02:00
Olivier Dony 63f3c4e988 [MERGE] Latest trunk
bzr revid: odo@openerp.com-20120326182926-5kjps7hjxb17rju8
2012-03-26 20:29:26 +02:00
Samus Aran 25e699d72d [IMP] Creating new row in db also update write_date and write_uid
bzr revid: cto@openerp.com-20120323150850-26j5ht8eexue86sh
2012-03-23 16:08:50 +01:00
Vo Minh Thu 634a1090e0 [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20120323111750-jwvm1m533x2qc25t
2012-03-23 12:17:50 +01:00
Vo Minh Thu 05422654b6 [IMP+FIX] fields: removed references to one2one, but also
corrected some typo `.. in (xxx)` instead of `.. in (xxx,)` (Note the trailing comma).
There is still a (non-harmful) reference to one2one in the base_synchro addons.

bzr revid: vmt@openerp.com-20120322164540-9rl8iidj4wrjohru
2012-03-22 17:45:40 +01:00
Vo Minh Thu 46a190aaf8 [IMP] fields: removed any reference to integer_big.
bzr revid: vmt@openerp.com-20120322163850-sxfd9g1x96jstr51
2012-03-22 17:38:50 +01:00
Vo Minh Thu c5ef5e1394 [IMP] fields: removed deprecated fields (time, integer_big, one2one).
bzr revid: vmt@openerp.com-20120322161825-dlbnj9p2xe0mhhxx
2012-03-22 17:18:25 +01:00
Atul Patel (OpenERP) 258722cc1c [MERGE]: Merge with lp:openobject-server
bzr revid: atp@tinyerp.com-20120316042909-gb2e5cmrilyyhsef
bzr revid: atp@tinyerp.com-20120320050251-bgk9xhsfmb1fws1p
2012-03-20 10:32:51 +05:30
Quentin (OpenERP) 3f9ce80a7d [MERGE] merge with main server trunk
bzr revid: qdp-launchpad@openerp.com-20120316125320-6ua2vcsajlsxsr1p
2012-03-16 13:53:20 +01:00
Atul Patel (OpenERP) 5bf4aa302a [ADD]: ADd condition for insert constraint if not exists.
bzr revid: atp@tinyerp.com-20120312095355-q3r8bz8i7n50bf47
2012-03-12 15:23:55 +05:30
Atul Patel (OpenERP) 180a23c7cc [FIX]: uninstall module.
Remove foreign key references.
Remove sql constraint .
Remove workflow activity and transition based on deleted cascade.
Drop ir model fields columns and drop table.

bzr revid: atp@tinyerp.com-20120309124753-c4yzeoij5p2fmhgg
2012-03-09 18:17:53 +05:30
olt@tinyerp.com 6aa9f06dae [FIX] 'create_instance' method: the check for parent_model existence need to be done before accessing that object attributes or methods
bzr revid: olt@tinyerp.com-20120309081929-g4b8d34e93at49wf
2012-03-09 09:19:29 +01:00
Bhumika (OpenERP) a3a2c698ab [Fix]base/res: res.parnter.address inherit compatiblity and open the address view
bzr revid: sbh@tinyerp.com-20120309065422-2wz5ch29x9qs8lf3
2012-03-09 12:24:22 +05:30
Vo Minh Thu 43b8317657 [MERGE] merged 6.1.
bzr revid: vmt@openerp.com-20120305163730-tkva77i5hhdy9jd1
2012-03-05 17:37:30 +01:00
Atul Patel (OpenERP) 3465869df7 [FIX]: Remove workflow activity and drop constraint during uninstalling module.
bzr revid: atp@tinyerp.com-20120229135343-g0v04jb5nc723w9q
2012-02-29 19:23:43 +05:30
Olivier Dony 769ea34281 [FIX] orm: model auto-init - better algorithm for detecting stale constraints during update
bzr revid: odo@openerp.com-20120223175851-bihxp0l0ax1xhf5g
2012-02-23 18:58:51 +01:00
Olivier Dony 819334f0aa [FIX] orm: inherited `active` fields should be used for the implicit filtering
This is for example used by hr.employee which
inherits from resource.resource, with the
`active` field located on the resource model.
Simplified some code too.

bzr revid: odo@openerp.com-20120223141635-p117b5wvvreuj40c
2012-02-23 15:16:35 +01:00
olt@tinyerp.com 3be394de8a [FIX] pep8: tab -> space
bzr revid: olt@tinyerp.com-20120223094355-ejsm256vn58bn4i2
2012-02-23 10:43:55 +01:00
Olivier Dony 3f6524a6e2 [FIX] Correct remaining SQL now() calls, must use UTC
This is essential to have the proper behavior for
timestamps: on the database side we exclusively 
store UTC data (no DST issues, etc.) as naive
timestamps (to prevent Postgres from messing with them).
Inside OpenERP server/addons we work again with
pure UTC data (much simpler), and only render
them according to the user's timezone when they
are displayed in the user interface or rendered
in a PDF report.

lp bug: https://launchpad.net/bugs/918257 fixed

bzr revid: odo@openerp.com-20120220105943-v3m0i50phrurt8x6
2012-02-20 11:59:43 +01:00
Vo Minh Thu 64ba0da663 [FIX] fields: duplicate float fields per registry (because they are stateful).
lp bug: https://launchpad.net/bugs/929483 fixed

bzr revid: vmt@openerp.com-20120215101714-zjsdcizzb1m2x6k5
2012-02-15 11:17:14 +01:00
Vo Minh Thu 589c12ada0 [IMP] gunicorn: moved database signaling to RegistryManager.
bzr revid: vmt@openerp.com-20120208142834-52oxaq72gghj687h
2012-02-08 15:28:34 +01:00
Florent Xicluna d8b25ca182 [MRG] merge trunk.
bzr revid: florent.xicluna@gmail.com-20120208141358-emgwspa0s58gtsez
2012-02-08 15:13:58 +01:00
Vo Minh Thu 1ab6f8883c [IMP] logging: _logger.warn() replaced by _logger.warning().
bzr revid: vmt@openerp.com-20120202092634-pylu3098p5c0mays
2012-02-02 10:26:34 +01:00
Antony Lesuisse 91ef8c1c51 [FIX] review according to xmo :)
bzr revid: al@openerp.com-20120201235604-tr5iq676pzk8bi1m
2012-02-02 00:56:04 +01:00
Antony Lesuisse 1a62602c86 [MERGE] trunk
bzr revid: al@openerp.com-20120131211744-whzzo0dh6w1kptng
2012-01-31 22:17:44 +01:00
Vo Minh Thu 283304f9a2 [IMP] warnings: turn warnings.warn into logging.warning:
Warnings are handled with the other logs (and not always sent to stderr),
they also appear under a module __name__ channel instead of py.warn.
The disadvantage is that there is no longer specific warnings,
such as pending deprecation warning or deprecation warning.

bzr revid: vmt@openerp.com-20120125132407-u33idc0qh7ecs1i5
2012-01-25 14:24:07 +01:00
Xavier Morel d181a5e7ac [IMP] move browse_record to logging, __init__ docstring to sphinx info fields
bzr revid: xmo@openerp.com-20120125113429-6stglci05rxpfo5j
2012-01-25 12:34:29 +01:00
Vo Minh Thu f057f2afa5 [IMP] openerp.loglevels: removed calls to openerp.loglevels.Logger().
bzr revid: vmt@openerp.com-20120124173017-c66z3kq11wmbrrke
2012-01-24 18:30:17 +01:00
Vo Minh Thu f22f2fc770 [IMP] openerp.{modules,osv}: _logger with fully qualified module name.
bzr revid: vmt@openerp.com-20120124124252-91g3ysf33zsq4nhd
2012-01-24 13:42:52 +01:00
Florent Xicluna efef81654b [REF] replace deprecated <> symbol.
bzr revid: florent.xicluna@gmail.com-20120119191838-r07oybyiqbkfehsz
2012-01-19 20:18:38 +01:00
Florent Xicluna e7838dfbc4 [REF] fix weird indentation, not multiple of four.
bzr revid: florent.xicluna@gmail.com-20120119191756-niny262vp1nvmpp8
2012-01-19 20:17:56 +01:00
Vo Minh Thu 0ed4377cf8 [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20120112155027-u3bagec0g9fqr0yi
bzr revid: vmt@openerp.com-20120116110434-ckhp01ze83cwm32y
2012-01-16 12:04:34 +01:00
Vo Minh Thu daa41b61c1 [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20120110154333-kdwsff0faftcwvku
2012-01-10 16:43:33 +01:00
Vo Minh Thu 013794b978 [IMP] orm: cosmetics (and the runbot will build this branch again).
bzr revid: vmt@openerp.com-20120110153448-ot1vpcmwjbeykx9t
2012-01-10 16:34:48 +01:00
Vo Minh Thu 455e47e5e8 [IMP] openerp.addons: openerp.addons is used instead of
openerp.modules as the namespace of the OpenERP addons.

bzr revid: vmt@openerp.com-20120109124120-06gguu3lzxv49i3j
2012-01-09 13:41:20 +01:00
Vo Minh Thu f24a29717e [FIX] orm: correctly set the module name on the model, even when imported with
`import openerp.modules.<module_name>`.

bzr revid: vmt@openerp.com-20120109101647-4hvy3n6eifzeozzq
2012-01-09 11:16:47 +01:00
Fabien Pinckaers 91cafbee7e [FIX] import/export fully working through web interface
bzr revid: fp@tinyerp.com-20111228205757-vxdw1j6gcsyvjj3m
2011-12-28 21:57:57 +01:00
Fabien Pinckaers ae92ec17ea [FIX] import/export
bzr revid: fp@tinyerp.com-20111228194506-nag2kqk1w1uyk43p
2011-12-28 20:45:06 +01:00
Olivier Dony a58a2a5e18 [MERGE] orm: dead code removal, courtesy of Olivier Macchioni
bzr revid: odo@openerp.com-20111222212859-z8svmrd3yosduelo
2011-12-22 22:28:59 +01:00
Olivier Dony 24b283567d [FIX] orm: typos
bzr revid: odo@openerp.com-20111222182023-kspwaukocijhh4cq
2011-12-22 19:20:23 +01:00
Olivier Dony d925235e62 [MERGE] sync with trunk
bzr revid: odo@openerp.com-20111222102555-bydsozbdu6urkj31
2011-12-22 11:25:55 +01:00
Olivier Dony 250772d403 [FIX] read_group: NULL->False for grouped boolean fields
We need to coalesce NULLs to False when grouping
boolean fields, otherwise we get duplicate groups
sharing the same rows.

bzr revid: odo@openerp.com-20111220151131-xir8dv7sdy9hbrfx
2011-12-20 16:11:31 +01:00
Fabien Pinckaers 3d364c3de1 [IMP] allow non integer for ID's
bzr revid: fp@tinyerp.com-20111219220954-mlqe3f6gkonlzor3
2011-12-19 23:09:54 +01:00
Olivier Macchioni f3eedcd6e3 [FIX] removed dead code
bzr revid: mac@olivier-macchionis-macbook-pro-2.local-20111214222102-s22izy21xejtwrmu
2011-12-14 23:21:02 +01:00
Naresh (OpenERP) 74fbbc36e1 [FIX]:Properties should be deleted when the related record is deleted
lp bug: https://launchpad.net/bugs/891580 fixed

bzr revid: nch@tinyerp.com-20111202102202-0jzzlqu68fypbbl3
2011-12-02 15:52:02 +05:30
Olivier Dony 7fa02d56b2 [MERGE] Bug 303455: orm.create() - use local before inherited, courtesy of Thibaut DIRLIK (Logica)
bzr revid: odo@openerp.com-20111201121503-bf7671is06atteb4
2011-12-01 13:15:03 +01:00
Xavier Morel 84004e8923 [REM] import_data: unused variables, redundant parens and variables
bzr revid: xmo@openerp.com-20111201121257-3uq3fyjumd9bvi9a
2011-12-01 13:12:57 +01:00
Xavier Morel f17633dad7 [FIX] correctly restore partial import index when restarting an import
bzr revid: xmo@openerp.com-20111201121040-c0547g8ev38r6u7t
2011-12-01 13:10:40 +01:00
Olivier Dony 90041e5d81 [IMP] read_group: pass superuser uid to group_by_full methods to avoid access right issues
This helps avoid access right issues in restricted
contexts, such as embedded web client, or shared
access (via portal or share wizard).

bzr revid: odo@openerp.com-20111123133312-a4ywnivnex97xtk2
2011-11-23 14:33:12 +01:00
Olivier Dony a50af56a05 [FIX] orm.read_group: fix merge logic for read_group_full:
- Properly merge results with list of values, even with reversed sort
- Pass `read_group_order` to `_group_by_full` implementations to let them
  handle sorting if they want.

bzr revid: odo@openerp.com-20111121164326-un722g5nsuzq94m5
2011-11-21 17:43:26 +01:00
Olivier Dony e17b51e384 [FIX] orm.read_group: check for empty groupby list
This is very ugly and needs a real refactoring,
just adding one more test for the time being.

bzr revid: odo@openerp.com-20111118153333-2skgbd197q8tb7uc
2011-11-18 16:33:33 +01:00
Olivier Dony 57d0d62b38 [MERGE] orm.read_group: partial refactoring, by xmo
bzr revid: odo@openerp.com-20111118152629-o4ult41v905dfj1t
2011-11-18 16:26:29 +01:00
Olivier Dony ca458dd539 [FIX] orm.read_group: fix issues in read_group_full and rewrite/cleanup
Attempt to make it into a more maintainable/readable
separate method.

bzr revid: odo@openerp.com-20111118133642-b3126a5sph8bivmu
2011-11-18 14:36:42 +01:00
Fabien Pinckaers 34a9ecf339 fix
bzr revid: fp@tinyerp.com-20111118121103-vmlus5c14icgpvdv
2011-11-18 13:11:03 +01:00
Olivier Dony ca5fcc2bdf [IMP] orm,fields: some cleanup for sparse field implementation (wip)
bzr revid: odo@openerp.com-20111117143010-9nv7inr5ijzykgem
2011-11-17 15:30:10 +01:00
Olivier Dony 3bf3279f25 [MERGE] Implementation of sparse field (to review), by Sebastien Beau, Akretion
bzr revid: odo@openerp.com-20111116172525-rmri79n9hpf2plwg
2011-11-16 18:25:25 +01:00
Olivier Dony 61c0e012b9 [MERGE] warn when create()/write() touches unknown field, courtesy of Stefan Rijnhart (Therp)
A patch will follow in addons to get rid of most of the
warnings introduced here.

bzr revid: odo@openerp.com-20111116113858-52nzw58ts7xnlxhe
2011-11-16 12:38:58 +01:00
Christophe Simonis 19e7261bc0 [FIX] group_by_full
bzr revid: chs@openerp.com-20111115155355-s7j3s27i2hl7xi11
2011-11-15 16:53:55 +01:00
Xavier Morel c83d6d88a0 [IMP] selection of fields to aggregate in read_group
bzr revid: xmo@openerp.com-20111115120028-wal8o839s4u427m3
2011-11-15 13:00:28 +01:00
Xavier Morel 2b7a072a3e [IMP] orm: make creation of dict from key names (with constant value) clearer
also only generate False values for float and integer fields, since they're the only aggregated values in the first place

bzr revid: xmo@openerp.com-20111115114527-t92a37kdw4yqqs4p
2011-11-15 12:45:27 +01:00
Fabien Pinckaers 1c2ab2927d unusedcode
bzr revid: fp@tinyerp.com-20111114001216-etl5g0dl3ya1xfvs
2011-11-14 01:12:16 +01:00
Fabien Pinckaers e25fe1f261 [FIX] count 0, need to fix the web client
bzr revid: fp@tinyerp.com-20111113124848-r1youtgj7c5li8b2
2011-11-13 13:48:48 +01:00
Fabien Pinckaers 8ea267b822 [IMP] _group_by_full implementation
bzr revid: fp@tinyerp.com-20111113121405-oa9ggpf115gv3cbe
2011-11-13 13:14:05 +01:00
Xavier Morel e77abb81fe [IMP] Use babel's locale-aware date formatting when formatting dates in read_group titles
bzr revid: xmo@openerp.com-20111110154614-ok0i1w11xvace41y
2011-11-10 16:46:14 +01:00
niv-openerp dbb82b089b [fix] exception when querying a tree view for an osv which does not contain any column (common in the wizards)
lp bug: https://launchpad.net/bugs/877989 fixed

bzr revid: nicolas.vanhoren@openerp.com-20111110135106-crieyt6cnscqocs5
2011-11-10 14:51:06 +01:00
Stefan Rijnhart 998add6e89 [FIX] replace exception by warning, for friendly deprecation
bzr revid: stefan@therp.nl-20111102202254-jllcl905swnwatm5
2011-11-02 21:22:54 +01:00
Stefan Rijnhart c9b91cae01 [FIX] model and field name were reversed in exception message
bzr revid: stefan@therp.nl-20111101141446-acxui2dymoul71ma
2011-11-01 15:14:46 +01:00
Stefan Rijnhart 65f4975ac1 [FIX] Raise when an unknown field is being written to
lp bug: https://launchpad.net/bugs/727727 fixed

bzr revid: stefan@therp.nl-20111101135731-uo203jmag5nuf56p
2011-11-01 14:57:31 +01:00
Xavier Morel e317c222a1 [IMP] alias some values in data import, for readability
bzr revid: xmo@openerp.com-20111019114618-6ih4wgfr5hu1kgiy
2011-10-19 13:46:18 +02:00
Xavier Morel b0a92831b3 [IMP] iterate over list indexes + ids via enumerate() rather than via range(len()) + __getitem__
bzr revid: xmo@openerp.com-20111019110215-9jykf1xrzavh00j2
2011-10-19 13:02:15 +02:00
Vo Minh Thu bfbfbc4ac6 [FIX] orm.copy(): corrected return value in docstring.
bzr revid: vmt@openerp.com-20111012090357-2lt8md5s37qp2vm1
2011-10-12 11:03:57 +02:00
Olivier Dony 76c702ca3c [FIX] Model.import_data docstring: cleanup + clear RST warnings for autodoc
The pipe character is taken as an inline substitution
marker, and is easy to avoid in most cases except within
literal blocks.

bzr revid: odo@openerp.com-20111011171148-rluwokcsx7i38i6e
2011-10-11 19:11:48 +02:00
Olivier Dony 4140e3546a [FIX] expression: proper handling of empty string in m2o domain criterions
Also fixed incorrect name_search() implementations in
res.partner and res.currency, and added corresponding
tests.

lp bug: https://launchpad.net/bugs/861350 fixed

bzr revid: odo@openerp.com-20111011163435-szj9vm6x9x8nryn8
2011-10-11 18:34:35 +02:00
Olivier Dony c16befa983 [IMP] orm: resolve_o2m_commands_...: simplify assert, remove context doc following guidelines
bzr revid: odo@openerp.com-20111011144146-b9rt5kc9sb5lj0dr
2011-10-11 16:41:46 +02:00
Xavier Morel 34fcc08a1f [IMP] docstring for resolve_o2m_commands_...
bzr revid: xmo@openerp.com-20111011094551-vr27on7iibdd9tv6
2011-10-11 11:45:51 +02:00
Xavier Morel 8507ceddcf [IMP] make resolve_o2m_commands_to_record_dicts's result eager as per vmt's suggestion
bzr revid: xmo@openerp.com-20111011085715-cvcficcy4di9q29i
2011-10-11 10:57:15 +02:00
Xavier Morel 2646a34cf0 [ADD] don't blow up on a singleton DELETE_ALL command (that command takes no parameters, so can have just (5,))
bzr revid: xmo@openerp.com-20111011084852-hborz317ru5pbzux
2011-10-11 10:48:52 +02:00
Xavier Morel 8734ffb6c2 [IMP] raise assertion error if an o2m command is not one of CREATE, UPDATE or LINK_TO
bzr revid: xmo@openerp.com-20111011083824-4g0ros6f3xgslkq4
2011-10-11 10:38:24 +02:00
Xavier Morel 4d0a189796 [IMP] handle case where o2m commands are pairs instead of triplets
bzr revid: xmo@openerp.com-20111011081202-y1ou74u038o2kl58
2011-10-11 10:12:02 +02:00
Xavier Morel b5ee13a845 [IMP] rename serialize_o2m_commands to resolve_o2m_commands_to_record_dicts
bzr revid: xmo@openerp.com-20111011080338-hup42vivlvk4dly0
2011-10-11 10:03:38 +02:00
Xavier Morel d5accc0fae [ADD] method to correctly serialize o2m commands into a sequence of record-dicts for e.g. onchanges
also alters res.partner.bank _default_value to use it with res.partner addresses, and adds a few tests to ensure behavior is correct

bzr revid: xmo@openerp.com-20111010135157-dafgcwwcni5gkeom
2011-10-10 15:51:57 +02:00
Olivier Dony d86c283434 [FIX] orm.browse_record: avoid printing unrelated traceback upon KeyError
bzr revid: odo@openerp.com-20111007144944-j4obwcbvx9awkj30
2011-10-07 16:49:44 +02:00
Xavier Morel 65456808bc [ADD] wrapper to the modifiers setup process to simplify its call by third parties
bzr revid: xmo@openerp.com-20111006142727-spfj8foiln6m2jb9
2011-10-06 16:27:27 +02:00
Vo Minh Thu 9990d8126e [IMP] orm: added small comment.
bzr revid: vmt@openerp.com-20111006114444-4llzirnl4tg4p5qy
2011-10-06 13:44:44 +02:00
Vo Minh Thu 4dc26443d1 [MERGE] orm: cleand get_pg_type(). Changes as written in the merge prop.:
* Extracted creation of VARCHAR pg_type into a separate function, make missing 
  size (or size 0) create an unlimited VARCHAR field (effectively limited by
  postgres to 1GB data)
* Extracted fields to pg_types mapping outside of get_pg_type
* Made fields.function recursively forward to get_pg_type (via a type overload) 
  instead of reimplementing half get_pg_type in itself
* Simplified some get_pg_type cases

Note: if this is merged, it might be nice to convert fields.selection to use an 
API similar to fields.function: default to VARCHAR storage, if there's a type
attribute override use that type. Currently, fields.selection is handled the
following way:

* If the selection is a list and the type of the first half of the first item 
  is an integer, use type int4
* If the field has a __size=-1__ attribute, use type int4
* Else use type varchar (with size specified on the field, if any)

One change from previous version is that if type of the first half of the first 
item of the selection was str or unicode, it tried to find the longest string
and used that as the field's size. This meant silent loss of data if new,
longer items were added to the selection without recreating the whole db (or at
least manually altering the relevant fields). It also used the field's size or
*16* as a minimum default, for some reason, and if there was no size specified
on the selection (or size=0) it just hardcoded the size to 16.

bzr revid: vmt@openerp.com-20111006081336-uka6srvdmvs0s4lm
2011-10-06 10:13:36 +02:00
Xavier Morel 5eeeb67e6d [IMP] raise error when iterating over browse_record
Python has an iteration fallback protocol: when iterating over an
object which does not define __iter__, if the object defines
__getitem__ it considers that it's a list, and invokes __getitem__
from index `0`.

This can be a problem in openerp in methods which expect an list of
ids but are only given a single id (not a singleton list), in that
case self.browse() will return a single browse_record (instea of a
list) and the method tries to iterate over it by calling
browse_record.__getitem__.

Problem is that browse_record.__getitem__ is pretty deep and does
little validation, so the error appears 3 frames below where the
actual issue is with a completely cryptic message of "KeyError: 0",
which makes the actual harder to track.

By raising an error immediately in browse_record.__iter__, this kind
of issues is much easier to handle, the stack points precisely to the
frame in error with a clearer message.

bzr revid: xmo@openerp.com-20111005112444-jcp9fw6pa36ahpsd
2011-10-05 13:24:44 +02:00
Vo Minh Thu cab4e9c4a5 [FIX] orm: allow negative varchar size (meaning no limit) as used in some addons.
bzr revid: vmt@openerp.com-20111005101401-7jweikyl9ztibe4q
2011-10-05 12:14:01 +02:00
Olivier Dony d13fb7fe7e [MERGE] various bugfixes/improvements (coming from EDI development)
- _original_module is now available on model/browse_records
 - context usage in res.partner.*
 - proper name_search() + default values for res.currency
 - active_model in wkf exec context
 - safe_eval allows try/except/finally
 - yaml_import: !ref {id: xml_id} works
 - ir_mail_server: support for alternative body/subtype
 - default value for web.base.url config parameter
 - consistency rename: Model.*get_xml_id* -> *get_external_id*

bzr revid: odo@openerp.com-20111005100954-c8mbd4kz6kkqaj84
2011-10-05 12:09:54 +02:00
Vo Minh Thu 6067cd3609 [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20111005080049-mv0ml30tti01cvba
2011-10-05 10:00:49 +02:00
Olivier Dony 982b2a0894 [FIX] orm: typo in computation of Model._original_module
bzr revid: odo@openerp.com-20111004225439-xnb77gtbl77onysm
2011-10-05 00:54:39 +02:00
Olivier Dony bfdbbb51cb [FIX] orm.export_data: 'module' column is required when creating external IDs
The 'module' field of ir.model.data is required, so we
we need to set it when auto-generating ir.mode.data
entries. This acts as the namespace of the record.
Because we don't want exported records to look like they
belong to an existing module (and risk being garbage
collected at the next module update), we put these
auto-generated names in a reserved '__export__' module
namespace.

bzr revid: odo@openerp.com-20111004205140-duaww77ng4qmktj2
2011-10-04 22:51:40 +02:00
Olivier Dony edf68f510c [REM] orm: annoying INFO log lines
bzr revid: odo@openerp.com-20111004204800-f4470vy0ou3ugxnm
2011-10-04 22:48:00 +02:00
Olivier Dony 51b1201daa [IMP] orm: remember Model._original_module when constructing inheritance
ORM Models already have a _module attribute that contains the
name of the module that declared this class, however
sometimes we also need the name of the module that
declared this model the first time.
This will be stored in _original_module and is the
name of the module to which the first parent with 
the same _name belongs to.

bzr revid: odo@openerp.com-20111004204705-8z9o70n1ynpvng3i
2011-10-04 22:47:05 +02:00
Vo Minh Thu 68a0858c9c [FIX] orm: a typo made all models treated as if they were transient in check_access_rule().
bzr revid: vmt@openerp.com-20111004143335-7etc6y2kje1y20ef
2011-10-04 16:33:35 +02:00
Vo Minh Thu 8dc80c7c7c [MERGE] orm: use directly lxml.etree to generate default views.
bzr revid: vmt@openerp.com-20111004092828-79hhaiwgw4dltimd
2011-10-04 11:28:28 +02:00
Vo Minh Thu 9e082fad89 [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20111003145135-5ysm8hpp83wey437
2011-10-03 16:51:35 +02:00
Vo Minh Thu 7b90c7e5de [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20111003144503-lx28ennrz0mt590g
2011-10-03 16:45:03 +02:00
Olivier Dony 288e8ebcfc [IMP] browse_record._table -> browse_record._model
bzr revid: odo@openerp.com-20111003144049-d6o4igae8mslns5x
2011-10-03 16:40:49 +02:00
Olivier Dony 0489f83a44 [IMP] orm: rename/cleanup: get_xml_id* -> get_external_id*
bzr revid: odo@openerp.com-20110930222355-jtuo4z9dz995emxk
2011-10-01 00:23:55 +02:00
Olivier Dony babb7aa0ec [FIX] fields: m2m SQL names may be dynamic now, care for it in field_to_dict()
Also cleaned up field_to_dict signature and callers to
honor conventions.

lp bug: https://launchpad.net/bugs/863019 fixed

bzr revid: odo@openerp.com-20110930112348-4c8undh1d6h1y3ps
2011-09-30 13:23:48 +02:00
Xavier Morel 3cee85eaba [FIX] typo syntax error
bzr revid: xmo@openerp.com-20110929132822-3qbbl1qttnvfhl40
2011-09-29 15:28:22 +02:00
Xavier Morel 0618731f6b [MERGE] trunk
bzr revid: xmo@openerp.com-20110929132454-oweaht1oel4st1m8
2011-09-29 15:24:54 +02:00
Xavier Morel 22b1bb8abb [FIX] do not remove 'multi=True' actions in fields_view_get for tree view
fields_view_get removed multi=True actions from the result of
ir_values.get_actions('client_action_multi', ...), so that multi
actions would not be displayed in the form view's sidebar in the GTK
client.

The web client has a sidebar in both cases, the GTK client just
ignores 'toolbar' key if not in tree view, so don't remove 'multi'
actions in tree view toolbar, to avoid having to perform one more RPC
call (explicit ir_values.get) in web client.

lp bug: https://launchpad.net/bugs/856378 fixed

bzr revid: xmo@openerp.com-20110929130701-65ubx1o0swk889nl
2011-09-29 15:07:01 +02:00
Vo Minh Thu 27f9a9676f [FIX] exceptions: except_osv in already a synonym for o.e.Warning, except_orm should not be qualified.
bzr revid: vmt@openerp.com-20110929073124-kxwwatr8l697ng8r
2011-09-29 09:31:24 +02:00
Vo Minh Thu ebd8ca5df5 [IMP] orm: expose ir.model.access check shortcuts.
bzr revid: vmt@openerp.com-20110928130107-5y5di6nx0al3q8mh
2011-09-28 15:01:07 +02:00
Olivier Dony 762637518b [MERGE] osv_memory removed, merged into database-backed Model/TransientModel
bzr revid: odo@openerp.com-20110927213712-9aa0x0aqoh13f6ga
2011-09-27 23:37:12 +02:00
Olivier Dony 209390d627 [MERGE] sync with latest trunk
bzr revid: odo@openerp.com-20110927165133-uwl7px6bxl6eu7us
2011-09-27 18:51:33 +02:00
Fabien Pinckaers ae0649df5f merge
bzr revid: fp@tinyerp.com-20110927140526-ld9eost69hspy69i
2011-09-27 16:05:26 +02:00
Fabien Pinckaers c3afdca2ab [IMP] generate XML id when exporting an ID that does not exists
bzr revid: fp@tinyerp.com-20110927140450-2b78h9dsb1fh7t11
2011-09-27 16:04:50 +02:00
Naresh (OpenERP) 7101204a22 [FIX/IMP]:stored function override were not removed
lp bug: https://launchpad.net/bugs/789576 fixed

bzr revid: nch@tinyerp.com-20110927105821-3rmydltdyv4gv830
2011-09-27 16:28:21 +05:30
Olivier Dony ad4a216e7d [IMP] fields.m2m: support implicit generation of m2m SQL names
This allows for transparent inheritance of m2m columns via _inherit,
as long as the m2m relationship table is not explicitly named in 
the declaration.

bzr revid: odo@openerp.com-20110926171451-n2jg8pbl5mq715vk
2011-09-26 19:14:51 +02:00
Olivier Dony f81fe2dc6e [IMP] orm: enforce proper m2o ondelete rules between TransientModels and Models
bzr revid: odo@openerp.com-20110926111226-fu834vqwm4gbxk8l
2011-09-26 13:12:26 +02:00
Olivier Dony 6462c85f6c [IMP] start unifying the SUPERUSER_ID constant
bzr revid: odo@openerp.com-20110926090156-2smbh0ypzitauhmt
2011-09-26 11:01:56 +02:00
Xavier Morel 0de487e029 [IMP] doc for import_data
bzr revid: xmo@openerp.com-20110926075115-bsdyjzk5nhp0cbnh
2011-09-26 09:51:15 +02:00
Olivier Dony 1bf74fa77e [MERGE] no-op merge of trunk, discarding osv-memory fix, obsolete already
bzr revid: odo@openerp.com-20110924022846-p08bawfxh5lym37u
bzr revid: odo@openerp.com-20110924025346-1khpike23e2honll
2011-09-24 04:53:46 +02:00
Olivier Dony dfccbaf28b [FIX] orm,expression: special-case previous commit for osv_memory
This will soon be obsolete and deleted, as soon
as osv_memory will be removed and merged inside
normal osv.

bzr revid: odo@openerp.com-20110924024928-awgncvhcyfkmnak5
2011-09-24 04:49:28 +02:00
Olivier Dony 67dcd97ea6 [FIX] orm,expression: sanity checks for domain terms, cleanup, tests
bzr revid: odo@openerp.com-20110924020303-2amkx95ij1yp8ofk
2011-09-24 04:03:03 +02:00
Olivier Dony 334dee0479 [IMP] orm: fix Model hierarchy to avoid TransientModel leaking downstream
bzr revid: odo@openerp.com-20110923174018-8l2b4qc1vecgs0sc
2011-09-23 19:40:18 +02:00
Olivier Dony 3b974972a3 [IMP] review/cleanup + fix TransientModels inheritance
bzr revid: odo@openerp.com-20110923163027-50ov6qj3daax8hpi
2011-09-23 18:30:27 +02:00
Olivier Dony f2f3c916c9 [REM] orm: m2m._no_foreign_keys attribute removed, replaced by SQL check
bzr revid: odo@openerp.com-20110923162929-nhl32ie6zc6uuj8h
2011-09-23 18:29:29 +02:00
Olivier Dony 49be41eceb [FIX] orm.py: missing patch, lost during last merge
See corresponding patch from trunk at revision
3612 revid:odo@openerp.com-20110919091952-05lfl2kncr3ep9nj

bzr revid: odo@openerp.com-20110923145517-odyq9z1h5ibck6nu
2011-09-23 16:55:17 +02:00
Olivier Dony 2e7a134228 [IMP] orm: introduce cleaner class hierarchy for models
We'll now have a BaseModel with 3 subclasses, AbstractModel,
TransientModel and Model. Model is for regular models, 
TransientModel for automatically-vacuumed models, and
AbstractModel for common superclasses meant to be 
inherited by other models only, and not directly used.

bzr revid: odo@openerp.com-20110923124525-jfzk55dk3ban2ps2
2011-09-23 14:45:25 +02:00
Olivier Dony 0d3085d14f [MERGE] sync with latest trunk
bzr revid: odo@openerp.com-20110922154155-jq811w768d9zfgim
2011-09-22 17:41:55 +02:00
Olivier Dony 1edacff497 [MERGE] unaccent support + domain parsing cleanup/improvements
bzr revid: odo@openerp.com-20110922140856-p8q0ib1lirgv1g02
2011-09-22 16:08:56 +02:00
Vo Minh Thu 2cb580673c [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20110922131744-20bc3jsdfrbxmu8p
2011-09-22 15:17:44 +02:00
Xavier Morel 36b947c425 [IMP] use same fieldpath-splitting function in data_import and data_export, document it a bit
bzr revid: xmo@openerp.com-20110922122542-eradrjva23894wpr
2011-09-22 14:25:42 +02:00
Olivier Dony 6e4a93cd22 [MERGE] sync w/ latest trunk
bzr revid: odo@openerp.com-20110921162128-22sp59cn4xv983q5
2011-09-21 18:21:28 +02:00
Vo Minh Thu 4e90af3e4e [IMP] orm: get_pg_type() does not use early return.
This is the style advocated by the R&D team. But in fact,
I am not that sure it proves more readable... Bike shedding
is hard.

bzr revid: vmt@openerp.com-20110921082044-cfqksvka6yqvkfci
2011-09-21 10:20:44 +02:00
sebastien beau b243c0567c [REF] ir_model_field replace the serialisation_field by serialization_field_id
change request in base.sql as a new field is created in ir_model_fields

bzr revid: sebastien.beau@akretion.com.br-20110920170707-2wmfs1sg37hgvbl1
2011-09-20 19:07:07 +02:00
Vo Minh Thu e5c95611b3 [MERGE] orm: better exception messsages.
lp bug: https://launchpad.net/bugs/777472 fixed

bzr revid: vmt@openerp.com-20110920122411-iykenv7sq7r710vy
2011-09-20 14:24:11 +02:00
Vo Minh Thu 8a83f57888 [MERGE] orm: properly handle multi-level _inherits.
lp bug: https://launchpad.net/bugs/823691 fixed

bzr revid: vmt@openerp.com-20110920075401-50z6crlhj7a8sv1g
2011-09-20 09:54:01 +02:00
Olivier Dony c6370622e5 [FIX] orm: quote column names in queries to respect case and be consistent
Quoting column names make the case-sensitive in PostgreSQL,
and this is the default strategy we are using so far. It is
important to be consistent there.
We might want to do the same to table names too.
This allows create fields with mixed cases names for example.

bzr revid: odo@openerp.com-20110919201845-heer0rttcouvtc9x
2011-09-19 22:18:45 +02:00
Olivier Dony 4517dbb852 [MERGE] refactoring: view inheritance query moved to ir.ui.view, courtesy of Sebastien Beau (Akretion)
bzr revid: odo@openerp.com-20110919152434-uohc9mqr4n0b1sc8
2011-09-19 17:24:34 +02:00
Naresh (OpenERP) 1d71f8484a [MERGE FROM TRUNK]
bzr revid: nch@tinyerp.com-20110919093224-5i3dslmw5ubatdjt
2011-09-19 15:02:24 +05:30
Olivier Dony ad23141729 [FIX] orm: refactoring and fix of stored functions processing by _store_get_values
- Refactoring to make the function readable and maintainable
- Fixed algorithm to properly take into account the priority of all stored functions,
  and not just the priority of the first function for a given model, which could hide
  other stored function with higher priorities.

lp bug: https://launchpad.net/bugs/715470 fixed

bzr revid: odo@openerp.com-20110919091952-05lfl2kncr3ep9nj
2011-09-19 11:19:52 +02:00
sebastien beau 043f50ba12 [REF] refactor code in order to add the possibility to overwrite the way to inherit the view
bzr revid: sebastien.beau@akretion.com.br-20110918235947-5k6bxg2fbshhtrsd
2011-09-19 01:59:47 +02:00
sebastien beau 29297ed841 [IMP] add the posibility to create sparse field dynamically
bzr revid: sebastien.beau@akretion.com.br-20110917183535-idzw9wg340gywduy
2011-09-17 20:35:35 +02:00
Vo Minh Thu 70898d7287 [MERGE] orm: export boolean values as strings, even for False.
lp bug: https://launchpad.net/bugs/831009 fixed

bzr revid: vmt@openerp.com-20110916103726-x7nmconcxem915m1
2011-09-16 12:37:26 +02:00
Vo Minh Thu 94662b9727 [MERGE] orm: convert exception to unicode.
lp bug: https://launchpad.net/bugs/811519 fixed

bzr revid: vmt@openerp.com-20110915145933-p2apahreex255nd6
2011-09-15 16:59:33 +02:00
Xavier Morel 662c8842f4 [IMP] fields_view_get: listcomps are still awesome
also use itertools.chain to iterate over multiple lists in sequence, instead of concatenating them

bzr revid: xmo@openerp.com-20110915124741-v5uneqmt2c3v6cmp
2011-09-15 14:47:41 +02:00
Xavier Morel a09be0e9b9 [IMP] simplify search view generation: rely on etree.SubElement to graft new nodes to the search view
bzr revid: xmo@openerp.com-20110915123707-901mkfkz8e6ikre4
2011-09-15 14:37:07 +02:00
Xavier Morel 7bb856b834 [IMP] search view generation: update fields set in place instead of creating a new set via union
bzr revid: xmo@openerp.com-20110915123155-a5ht8nhfp9kq0kst
2011-09-15 14:31:55 +02:00
Xavier Morel eeb31efa88 [IMP] automatic search view generation: comprehensions are awesome
bzr revid: xmo@openerp.com-20110915122834-0ec4dkaznbhtc0kc
2011-09-15 14:28:34 +02:00
Xavier Morel e878560c74 [ADD] small helper to calendar generation code, in order to make flow clearer
bzr revid: xmo@openerp.com-20110915122443-hvk1u2372ppd77m1
2011-09-15 14:24:43 +02:00
Xavier Morel 74e98f4220 [ADD] error when neither date_stop nor date_delay can be generated for a default calendar view
bzr revid: xmo@openerp.com-20110915121544-eq3mumulb0qp9yfa
2011-09-15 14:15:44 +02:00
Xavier Morel 4cdda26b6c [IMP] convert default calendar view generation (from fields_view_get) to lxml.etree
bzr revid: xmo@openerp.com-20110915121129-fcdq8e0rix2ocpwt
2011-09-15 14:11:29 +02:00
Xavier Morel 005e2b87a5 [IMP] etree-ify default view generations
* Search already used etree internally, remove serialization to string
* form and tree were easy to convert
* pull down fvg's parsing (etree.fromstring) into calendar generator before converting it

bzr revid: xmo@openerp.com-20110915120429-syz190w61iq52rel
2011-09-15 14:04:29 +02:00
Xavier Morel ebb2072207 [IMP] regroup all __get_default_$name_view calls into a single parametric getattr
Also rename __get_default_ to _get_default_ so it can be found by getattr

bzr revid: xmo@openerp.com-20110915111255-1i0y555er3nwtkzg
2011-09-15 13:12:55 +02:00
Xavier Morel 734c1a43a0 [REF] extract the two inlined default view generators left into fields_view_get into their own methods
follow the preexisting __get_default_$name_view

bzr revid: xmo@openerp.com-20110915111221-20ktl1bi2qne5wz7
2011-09-15 13:12:21 +02:00
Xavier Morel 8a9c0dbad7 [IMP] bulk-update fields_view_get result via dict.update instead of a bunch of __setitem__
bzr revid: xmo@openerp.com-20110915111213-zigij077k9ss9p6e
2011-09-15 13:12:13 +02:00
Olivier Dony 863f0d003f [FIX] orm: avoid passing undefined context in browse_record getattr()
bzr revid: odo@openerp.com-20110913144702-7g56odiorqdiea28
2011-09-13 16:47:02 +02:00
Olivier Dony 0c675b2758 [IMP] browse_record: getattr method execution propagates context
The only requirements for this to work are:
 - all model methods likely to be called on a browse_record must support
   a context parameter (positional or keyword, doesn't matter)
 - callers should never pass the context as a positional args, otherwise
   we'll have multiple values for the context.
Both requirements seem sensible enough.

bzr revid: odo@openerp.com-20110913130826-d7fme3mznv55ok5f
2011-09-13 15:08:26 +02:00
Olivier Dony 0624e4ab5c [IMP] orm.name*: better docstrings
bzr revid: odo@openerp.com-20110912171210-pmeqvy71l4iu8ulz
2011-09-12 19:12:10 +02:00
Naresh (OpenERP) d02fc10280 [FIX]:problem when coping the _inherits record the base class record was not created resulting the new record to refer the same parent that the old record is referring
bzr revid: nch@tinyerp.com-20110912091418-l71l0xj5lovrf8f1
2011-09-12 14:44:18 +05:30
Xavier Morel e575211116 [IMP] add a pair of assertions on the parameter to VARCHAR, just in case
bzr revid: xmo@openerp.com-20110909162929-w1l328oh14ccn7f8
2011-09-09 18:29:29 +02:00
Xavier Morel 9c83238f18 [FIX] reimplement quality selection field API
a size attribute of -1 means the selection field is an int4, even if the selection is a callable

bzr revid: xmo@openerp.com-20110909161623-nab218ea48ucj4qt
2011-09-09 18:16:23 +02:00
Xavier Morel 0d965c2fca [FIX] if types can be overridden, type-checking against the overriden type instead of the non-overridden instance might be a good idea as well
bzr revid: xmo@openerp.com-20110909155848-5no3pvtfugqmhm8q
2011-09-09 17:58:48 +02:00
Olivier Dony 2f47cf8558 [IMP] orm,orm_memory: more consistent implementations of exists() and check_access_rule()
bzr revid: odo@openerp.com-20110909154926-1sk6kypbb11fx7oq
2011-09-09 17:49:26 +02:00
Xavier Morel cbaa36c8cc [FIX] typo, might want to launch the software from time to time while changing stuff
bzr revid: xmo@openerp.com-20110909154242-gve3dgsbmg6crkya
2011-09-09 17:42:42 +02:00
Xavier Morel 4b8be3a051 [IMP] use early returns instead of a single return point
bzr revid: xmo@openerp.com-20110909153935-uk4cggyv78nfdjqt
2011-09-09 17:39:35 +02:00
Xavier Morel f74c55182a [IMP] lift mapping from field types to PGTYPES outside get_pg_type
bzr revid: xmo@openerp.com-20110909152622-114y4401x6gw6a79
2011-09-09 17:26:22 +02:00
Xavier Morel b9ed013504 [IMP] use logging API in get_pg_types
bzr revid: xmo@openerp.com-20110909152445-pol8ko3ckzc6p7s0
2011-09-09 17:24:45 +02:00
Xavier Morel 7a3960f736 [IMP] remove size inference for selection lists with str|unicode value choices, simplify selection pg_type selection
* if the first element of the choices list is an integer, use int4
* if the field has a size, use that size
* else use an unrestricted varchar

bzr revid: xmo@openerp.com-20110909152307-ralzt1g8l1b3e46x
2011-09-09 17:23:07 +02:00
Xavier Morel 8668ad7ed3 [IMP] have function fields delegate their pg_type discovery to get_pg_type
* add a type override to get_pg_type, so the function field can pass itself as another field type
* special-case the 'selection' role, not sure it's correct but it was pretty special last time around (I guess since we don't have the field's values available we can't just do the type/size inference of get_pg_type)

bzr revid: xmo@openerp.com-20110909145213-y172z8eyfnond43w
2011-09-09 16:52:13 +02:00
Xavier Morel cf44b49c93 [IMP] extract VARCHAR typing, if no size is provided (or the size is 0) don't put a limit on the varchar
bzr revid: xmo@openerp.com-20110909143349-5sykc4lpsn3rxf5w
2011-09-09 16:33:49 +02:00
Xavier Morel 09b63ae6ea [FIX] don't *eval* field names to get the field type associated with a function field
bzr revid: xmo@openerp.com-20110909141541-p172s7jqu597sjc9
2011-09-09 16:15:41 +02:00
Olivier Dony caef9821a3 [MERGE] latest trunk
bzr revid: odo@openerp.com-20110906080822-tyadkxvycrx7bl1d
2011-09-06 10:08:22 +02:00
sebastien beau 4fc1ffe10a [REF] refactor serialized field based on a patch sent by xrg by email, thanks xrg ;)
bzr revid: sebastien.beau@akretion.com.br-20110904234304-6uablzky9kwn5x3k
2011-09-05 01:43:04 +02:00
Xavier Morel ddadb2ce75 [FIX] issue in splitting field paths for export: would create empty path sections because too eager
do replacement in two passes of re-base replacement: replace old-style 'field:id' and 'field.id' in resp. 'field/id' and 'field/.id', don't touch anything else (especially not 'field/.id') and leave them through instead.

bzr revid: xmo@openerp.com-20110831094547-8evd7ecm5qojspnr
2011-08-31 11:45:47 +02:00
Vo Minh Thu b8a633e578 [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20110831091325-t5gfm57tmkr0fbee
2011-08-31 11:13:25 +02:00
Vo Minh Thu bdd0c7cf3f [IMP] simplified cache implementation (and stored on the osv), does not support contexts.
bzr revid: vmt@openerp.com-20110830121541-abov2wezdn6kl2dc
2011-08-30 14:15:41 +02:00
Vo Minh Thu e1b2dec200 [IMP] orm: option to make many2many relation tables without foreign key constaint.
The option is not completely flexible (no possibility to choose to have a foreign
key on one of the fields. No similar option is provided for many2one either.
It is seldom used (e.g. in account_followup addons).

bzr revid: vmt@openerp.com-20110829094354-0yf6t6329j8e765q
2011-08-29 11:43:54 +02:00
Antony Lesuisse be328ad7c3 [MERGE] trunk
bzr revid: al@openerp.com-20110827213628-4kflylkgtln6o4k4
2011-08-27 23:36:28 +02:00
Olivier Dony 3f00bfc405 [FIX] registry: use a unique list of models to load per module
This is necessary to preserve the model loading order
as defined in the module. This was broken when the 
metaclass was introduced to make the explicit model
constructor call optional.
One consequence is that the order in which the classes
are declared in the module really defines their
initialization order, even if the constructors are 
later called explcitly in a different order.
This latter case should be fairly rare, and easy to
fix too - simply putting the class declaration in the
right order.

bzr revid: odo@openerp.com-20110826161736-lgnpurtbcqtbseey
2011-08-26 18:17:36 +02:00
Naresh (OpenERP) 8d0cf999ac [FIX]:_inherits for multilevel inheritence
lp bug: https://launchpad.net/bugs/823691 fixed

bzr revid: nch@tinyerp.com-20110826103516-o220jqwqdr3uwjhn
2011-08-26 16:05:16 +05:30
Thibaut DIRLIK f0cc97b2e4 [FIX] create() does not write in the _inherits parent when fields have the same name.
The problem is that when you have a field in an object, and that field
is also defined in its parent (defined with _inherits), when OpenERP creates
the object, the field value was used to fill the parent value, not object.

bzr revid: t.dirlik@adep.com-20110825145856-2qa7im2awmm5gxjz
2011-08-25 16:58:56 +02:00
Vo Minh Thu 6fdadb04f5 [IMP] tools.cache: added missing clean_caches_for_db replacement.
bzr revid: vmt@openerp.com-20110825124711-y2uckmvcoa0arz4h
2011-08-25 14:47:11 +02:00
Antony Lesuisse 86965e3884 [FIX] orm ir.translation get_source to use positional args
bzr revid: al@openerp.com-20110824231131-y33ng5x4d6j2vr6w
2011-08-25 01:11:31 +02:00
Antony Lesuisse fd83621463 [MERGE] trunk
bzr revid: al@openerp.com-20110824160936-ej26wcvgvku3lkm7
2011-08-24 18:09:36 +02:00
tfr(OpenERP) ca673b88dc [FIX]:import boolean fields
lp bug: https://launchpad.net/bugs/831009 fixed

bzr revid: nch@tinyerp.com-20110823092737-t85rn3kirir3g749
2011-08-23 14:57:37 +05:30
Olivier Dony 3fa9dcea34 [MERGE] latest trunk
bzr revid: odo@openerp.com-20110819150201-pas7z2md5sa3bk7e
2011-08-19 17:02:01 +02:00
Vo Minh Thu 51117db344 [REF] osv: replace isinstance(m,osv_memory) by m.is_transient().
bzr revid: vmt@openerp.com-20110816095755-2g5cblolcvchtewx
2011-08-16 11:57:55 +02:00
Vo Minh Thu 9964cd1d84 [REF] osv: previous diff makes unneccessary one of makeInstance/createInstance.
bzr revid: vmt@openerp.com-20110816074431-v16wfzcy55ojkhwi
2011-08-16 09:44:31 +02:00
Vo Minh Thu 80f6562618 [REF] orm: merged orm_template inside orm.
Things could be re-ordered but this way the diff remains small.

bzr revid: vmt@openerp.com-20110812142814-6dbd0wodllw8xn37
2011-08-12 16:28:14 +02:00
Vo Minh Thu 7797702a9f [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20110812130941-z2x2bjr310r4ynu8
2011-08-12 15:09:41 +02:00
Vo Minh Thu ddd65ab5c1 [REF] osv: removed orm_memory, adapted the distinguished bits to osv_memory,
so yes, there are still two user-visible classes instead of a boolean flag.

bzr revid: vmt@openerp.com-20110812124128-43rr422swy6h2vs8
2011-08-12 14:41:28 +02:00
Vo Minh Thu 2f5e8d48b3 [REF] osv: moved (and adapted) vacuum code to osv_memory.
bzr revid: vmt@openerp.com-20110812113355-lylavdsc3mqjovrj
2011-08-12 13:33:55 +02:00
Antony Lesuisse 2f9f557e18 [FIX] get rid of unsued menus and submenu
bzr revid: al@openerp.com-20110811181217-y2yxdz34uswijwza
2011-08-11 20:12:17 +02:00
Olivier Dony c90c1a735d [MERGE] latest trunk
bzr revid: odo@openerp.com-20110809160953-i1yrg5knplw4jy9l
2011-08-09 18:09:53 +02:00
Vo Minh Thu 091e9989d5 [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20110809154337-5l5hbbhot347ci82
2011-08-09 17:43:37 +02:00
Antony Lesuisse 330e12c557 [MERGE] trunk-usability-config-log-rco
bzr revid: al@openerp.com-20110806015221-jumsqgm6a9ofknr7
2011-08-06 03:52:21 +02:00
Raphael Collet 2d353ca2f8 [IMP] disable res.log when running config wizards; to be tested
bzr revid: rco@openerp.com-20110805153134-snpfjuw859wkrq36
2011-08-05 17:31:34 +02:00
gpa 66b0db7d3b [FIXED] Fixed the problem keyerror id
bzr revid: gpa@tinyerp.com-20110729133455-oed1zbu6qv9aa4uo
2011-07-29 19:04:55 +05:30
Vo Minh Thu 44d41334d7 [REF] osv: osv_memory is really just osv,
the change is not enough as we still want to differentiate between regular osv and osv
that should be wiped from the db from time to time.

bzr revid: vmt@openerp.com-20110728082752-39jur9oo0m93ebzh
2011-07-28 10:27:52 +02:00
Vo Minh Thu 8522366247 [FIX] hack to (not) evaluate normalized domains:
expression.py now always normalize its given domain, but the evaluation code
for the orm_memory is just lacking. The fix simply skips any operator.

bzr revid: vmt@openerp.com-20110726152122-hi8y65fixcx65me8
2011-07-26 17:21:22 +02:00
Vo Minh Thu a9e89a49b2 [REF] expression: instanciating an expression now "parses" it, moved some methods as functions, introduced some nice globals.
bzr revid: vmt@openerp.com-20110722153649-atojff0vp34076id
2011-07-22 17:36:49 +02:00
Nimesh (Open ERP) 7f367572ed Invalid error message when import failed
lp bug: https://launchpad.net/bugs/811519 fixed

bzr revid: nco@tinyerp.com-20110720100445-4ia0d7y3rs4ryzjf
2011-07-20 15:34:45 +05:30
Vo Minh Thu f59a0b6025 [MERGE] import: support for comma-separated ids in one2many, actually link the records.
- not a real merge, as I just recovered the diff. original code by tfr.

bzr revid: vmt@openerp.com-20110719122802-64jxm0h5uftsf94k
2011-07-19 14:28:02 +02:00
Olivier Dony 9f3fd2a1fc [FIX] orm: avoid crash when an osv inherits from an osv_mem that has no _sql_constraints
bzr revid: odo@openerp.com-20110718173151-hsq5pyzq8l5w1j7n
2011-07-18 19:31:51 +02:00
Olivier Dony aa749dd921 [IMP] browse_record: add refresh() method for discarding the cache
bzr revid: odo@openerp.com-20110718173044-56mxet191sog3hfm
2011-07-18 19:30:44 +02:00
Xavier Morel d45e291329 [FIX] name of ordering param in read_group docstring: it's orderby not order
bzr revid: xmo@openerp.com-20110713092003-83ot1xsivziy4p33
2011-07-13 11:20:03 +02:00
Antony Lesuisse 7c01ea22f3 [FIX] apply some merge review feeback
bzr revid: al@openerp.com-20110712143532-s0jeuh5rglzwijpn
2011-07-12 16:35:32 +02:00
niv-openerp 4793c68939 [imp] Improved modifiers algorithm to also take the "states" attribute into account.
bzr revid: nicolas.vanhoren@openerp.com-20110707155135-jjinihfc6kylwf9k
2011-07-07 17:51:35 +02:00
Vo Minh Thu a13109ea93 [REVERT] re-apply the 4 commits that were reverted just after, 4 commits ago.
bzr revid: vmt@openerp.com-20110705122222-bhim9uft3l3sqee8
2011-07-05 14:22:22 +02:00
P. Christeas 7c8665bb69 [MERGE] docstrings improvements and preparation for api-doc structure
bzr revid: odo@openerp.com-20110701231956-93zu7xtibpo06eqm
2011-07-02 01:19:56 +02:00
Olivier Dony 1ac0c5f053 [REVERT] last 4 revisions on fields_view_get, need further review
bzr revid: odo@openerp.com-20110701151839-g8nhfr4z8pmkflah
2011-07-01 17:18:39 +02:00
Vo Minh Thu 8845ae1259 [IMP]: fields_view_get: respect priority of node over fields, and of static invisible over dynamic invisible.
bzr revid: vmt@openerp.com-20110630153334-d34qep1727gdbh8l
2011-06-30 17:33:34 +02:00
Vo Minh Thu b8cc3b0d47 [REF]: fields_view_get: continuing the merge of attrs:
- pass a flag to __view_look_dom indicating if we are in a tree view
(this is needed as it can contain more complex expression, and its meaning
is different as it affects the tree column, instead of a single field on a line).
- pass the result of fields_get to __view_look_dom to let it augment
the nodes with info from the python fields.

bzr revid: vmt@openerp.com-20110628142753-7819z5sp39qxfxev
2011-06-28 16:27:53 +02:00
Vo Minh Thu 8beaaedd0a [IMP] fields_view_get: began to handle states attr server-side.
bzr revid: vmt@openerp.com-20110623101030-95t095jp5evdb1c3
2011-06-23 12:10:30 +02:00
P. Christeas cf6e623f7d API docs: settings file and titles at modules
bzr revid: xrg@linux.gr-20110623090357-nazly8vpfnw0iskr
2011-06-23 12:03:57 +03:00
P. Christeas b0f06f7e52 orm, tools, addons: Doc strings improvements
bzr revid: xrg@linux.gr-20110623090228-4gn6xoyykcvfhv13
2011-06-23 12:02:28 +03:00
Vo Minh Thu 0e6668a391 [MERGE] ir_model_data unlinking does not use _unlink anymore, clears caches.
bzr revid: vmt@openerp.com-20110622135344-i4u23z22binbq8h1
2011-06-22 15:53:44 +02:00
Vo Minh Thu 88b74dd315 [REF] fields_view_get: merge fields attributes inside the architecture as a new attribute.
bzr revid: vmt@openerp.com-20110622083833-xoh5b5r08xxgljqs
2011-06-22 10:38:33 +02:00
Vo Minh Thu 027d082936 [MERGE] some refactoring in fields_view_get.
bzr revid: vmt@openerp.com-20110627132601-qw6ejx2v4xywq4ai
2011-06-27 15:26:01 +02:00
Vo Minh Thu a8facfdb38 [MERGE] fix regression
introduced at revno: 3466, revision-id: vmt@openerp.com-20110617072608-5tmwf2g2qb0pwrhk

bzr revid: vmt@openerp.com-20110627104748-hvvc3sb7nmxk85db
2011-06-27 12:47:48 +02:00
Vo Minh Thu ab0d721416 [REF] orm: added TODOs.
bzr revid: vmt@openerp.com-20110627095059-lf8lctk1z0yawgrk
2011-06-27 11:50:59 +02:00
Olivier Dony 8654be5ca3 [FIX] orm.unlink(): cascade deletion of ir.model.data performed as admin
Also replaced all uid == 1 references with a ROOT_USER_ID constant, 
to make it more explicit.

bzr revid: odo@openerp.com-20110627092538-kq8hrjoii5o9l7k4
2011-06-27 11:25:38 +02:00
Olivier Dony 301497c543 [IMP] lint cleanup
bzr revid: odo@openerp.com-20110624133335-jf5kg6dh9kgxw2dg
2011-06-24 15:33:35 +02:00
Olivier Dony 60cbf9bf14 [MERGE] sync with trunk
bzr revid: odo@openerp.com-20110624102631-kiy8j2d1fc7heeco
2011-06-24 12:26:31 +02:00
Vo Minh Thu f3b7293c2e [REF] orm: add a column_info class to represent entries in _inherit_fields,
code comes from the trunk-sharing-features branch (by odo).

bzr revid: vmt@openerp.com-20110621155342-8a3o153rkpsd5s12
2011-06-21 17:53:42 +02:00
Vo Minh Thu 802ecdd6cf [REF] orm/_inherits_reload: unnecessary dict.update() (the entries are manually updated afterwards).
bzr revid: vmt@openerp.com-20110621144543-z03m9rceohmayjxu
2011-06-21 16:45:43 +02:00
Vo Minh Thu 41b066a085 [FIX] fields_view_get: corrected an error introduced at rev 3467.
bzr revid: vmt@openerp.com-20110620141005-togs3phmto931wle
2011-06-20 16:10:05 +02:00
Vo Minh Thu ee5eb80951 [FIX] orm/fields_view_get: translate correctly confirm/sum/help:
- view_header_get can override the string attribute but should
  not prevent the translation of the other attributes.
- the problem goes back to revno 319 when there was only a string and sum was added.

bzr revid: vmt@openerp.com-20110620120600-lu9csho8ws2habfp
2011-06-20 14:06:00 +02:00
Vo Minh Thu 53f594eb67 [REF] orm/fields_view_get: replaced simple loop by dict.update().
bzr revid: vmt@openerp.com-20110620120157-xwf09egoyq3xc5qo
2011-06-20 14:01:57 +02:00
Yogesh (OpenERP) f6c88941f5 [FIX] fix problem of improve condtion of checking key is available in dict.
lp bug: https://launchpad.net/bugs/799637 fixed

bzr revid: ysa@tinyerp.com-20110620110330-brg01vy68rmo6wiq
2011-06-20 16:33:30 +05:30
Vo Minh Thu 8645487d61 [FIX] orm: typo in fields_view_get.
bzr revid: vmt@openerp.com-20110620095642-3vx11f7cqad2e71k
2011-06-20 11:56:42 +02:00
Olivier Dony 36d98cb14f [FIX] orm.fields_get: typo in last refactoring
bzr revid: odo@openerp.com-20110619115701-q06la7l6jhmihdk6
2011-06-19 13:57:01 +02:00
Olivier Dony 6df3bc8b67 [FIX] orm.fields_get: typo in last refactoring
bzr revid: odo@openerp.com-20110619115410-bdmd4zcm3o69515o
2011-06-19 13:54:10 +02:00
Olivier Dony 4f6bee5bf7 [MERGE] latest trunk
bzr revid: odo@openerp.com-20110617170517-pvhf772lewqk3z8c
2011-06-17 19:05:17 +02:00
Vo Minh Thu f46cfc589d [REF] fields_viw_get: trying to get something clearer...
bzr revid: vmt@openerp.com-20110617154440-i013qj8qukxhqhnl
2011-06-17 17:44:40 +02:00
Vo Minh Thu aca951da39 [REF] orm: simpler `_find` function, renamed `locate`.
bzr revid: vmt@openerp.com-20110617093126-v0951wvy48r1db4h
2011-06-17 11:31:26 +02:00
Vo Minh Thu ccca7e938a [REF] orm: fields_get in pieces, now with docstring.
bzr revid: vmt@openerp.com-20110617072608-5tmwf2g2qb0pwrhk
2011-06-17 09:26:08 +02:00
Vo Minh Thu abb606aa7c [MERGE] orm: _auto_init made of smaller methods, use a metaclass to discover new models.
bzr revid: vmt@openerp.com-20110615160123-7bk8u94y916mdpkj
2011-06-15 18:01:23 +02:00
Vo Minh Thu dc4ee86376 [REF] osv: use a metaclass to discover new models.
bzr revid: vmt@openerp.com-20110615102115-sjobt06ag72xiqaf
2011-06-15 12:21:15 +02:00
Vo Minh Thu 26f22874d9 [LINT] removed unused variable, forgot to change two variables in last commit, corrected typo introduced at 3417.6.6.
bzr revid: vmt@openerp.com-20110615072231-jh977xk1jupekkpp
2011-06-15 09:22:31 +02:00
Vo Minh Thu e375049414 [REF] osv: moved osv_pool to modules/registry.
bzr revid: vmt@openerp.com-20110614142226-yd3y39a8z3ubwvxm
2011-06-14 16:22:26 +02:00
Vo Minh Thu 8965db1ec2 [DEL] orm: removed half-baked fix.
bzr revid: vmt@openerp.com-20110614113354-rcsyua15m1kqhrgj
2011-06-14 13:33:54 +02:00
Vo Minh Thu e360ae580a [REF] orm: added some comments.
bzr revid: vmt@openerp.com-20110614101311-bjy33thvzfnla74t
2011-06-14 12:13:11 +02:00
Vo Minh Thu 08b750af47 [REF] orm: brake _auto_init in shorter methods.
bzr revid: vmt@openerp.com-20110614093715-yxaiqd2xzf6vdy8w
2011-06-14 11:37:15 +02:00
Vo Minh Thu 75b8291486 [IMP] orm: added comment, and delete an attribute when it is no more needed.
bzr revid: vmt@openerp.com-20110614084415-0noz6dlclnr09sbh
2011-06-14 10:44:15 +02:00
Nimesh (Open ERP) 7779f83e4a Improving error messages when writing invalid values to reference/selection fields
lp bug: https://launchpad.net/bugs/777472 fixed

bzr revid: nco@tinyerp.com-20110613131202-30bic6891ezlnq2e
2011-06-13 18:42:02 +05:30
Nicolas Vanhoren 68102fecd1 [MERGE] addition of name_create() ORM method for new m2o behavior in 6.1
bzr revid: odo@openerp.com-20110610173130-3dvj5t2ji8buwjrg
2011-06-10 19:31:30 +02:00
niv-openerp f888b06959 [imp] added method name_create to orm
bzr revid: nicolas.vanhoren@openerp.com-20110610161002-76kfpwb1xexryfmh
2011-06-10 18:10:02 +02:00
Vo Minh Thu 1b45a892dd [REF] orm: defer foreign key creation.
bzr revid: vmt@openerp.com-20110610140521-mdd6zvvzeoubier4
2011-06-10 16:05:21 +02:00
Antony Lesuisse 970b19b8b4 [IMP] new tools.cache cleaner, 10% speedup and more to come...
bzr revid: al@openerp.com-20110608030330-d0dsv2k6n0w3lyd5
2011-06-08 05:03:30 +02:00