Commit Graph

732 Commits

Author SHA1 Message Date
Vo Minh Thu 067cd7d15a [FIX] ir_model_data: create the _inherits parent external ID prior to the child.
This is needed so the uninstall process can simply go through
the installed data by using the ir_model_data entries in reverse
order (when ordered by IDs), so that parents are deleted before
children.

bzr revid: vmt@openerp.com-20130321133202-igea1vxlszfpk6pe
2013-03-21 14:32:02 +01:00
Xavier Morel 9494f21ea8 [FIX] __getattr__ implementation on BaseModel
object has no __getattr__, in the usual case super(BaseModel,
self).__getattr__ will blow up with an AttributeError (but the wrong
one).

On the other hand, if a BaseModel descendant class is used in MI
alongside a non-BM descendant (e.g. res_partner inheriting from Model
and format_address) and the non-BM descendant also implements
__getattr__, we want to forward the failed attr search to the other
__getattr__ implementation.

So check if super() has a __getattr__, call it if it does otherwise
AttributeError right there.

bzr revid: xmo@openerp.com-20130315115302-z7jla334gb9a5e43
2013-03-15 12:53:02 +01:00
Vo Minh Thu c79c23d26e [REF] orm:
- isinstance(ids, dict) is done at the end, but not at the beginning,
so if ids was a single dict, it would break in the map(lambda).
- The loop to convert None to False can be done in _read_flat instead
of read (there is already plenty of loops in _read_flat)
- The __getattr__ was breaking the stacktrace.

bzr revid: vmt@openerp.com-20130314154418-0wmxfw1ot92kjmzf
2013-03-14 16:44:18 +01:00
Vo Minh Thu f1adca94c0 [MERGE] netsvc/service.model: added missing/removed unnecessary `except` clauses.
bzr revid: vmt@openerp.com-20130225155828-a364gk3ii2prxe0b
2013-02-25 16:58:28 +01:00
Fabien Pinckaers b831c5aa15 [iMP] error message simplified for required values
bzr revid: fp@openerp.com-20130224135248-wdxg8d3fi79lp88z
2013-02-24 14:52:48 +01:00
Olivier Dony a961e5e377 [MERGE] search: when count=True, execute main query as a subquery to avoid side effects with offset and limit
Granted, calling search() with both count=True and
offset or limit is not extremely useful, but
it is still better to accept it and apply it
to the inner query rather than have silly
errors

bzr revid: odo@openerp.com-20130220174416-yoos2py8dc9jc3md
2013-02-20 18:44:16 +01:00
Vo Minh Thu 9412351315 [IMP] Only unhandled exceptions are logged to the console by the netsvc layer.
bzr revid: vmt@openerp.com-20130220115337-6319hshm4vfwlr1o
2013-02-20 12:53:37 +01:00
Raphael Collet 0f43032b82 [FIX] search: when count=True, execute main query as a subquery to avoid side effects with offset and limit
bzr revid: rco@openerp.com-20130218145100-4q24j8ko9j9elwpw
2013-02-18 15:51:00 +01:00
Quentin (OpenERP) 0a27066e54 [REF] code review
bzr revid: qdp-launchpad@openerp.com-20130215143503-6a6x53gdeb6j33tm
2013-02-15 15:35:03 +01:00
Antonin Bourguignon 74ba45d1fc [MERGE] trunk
bzr revid: abo@openerp.com-20130214173522-2ama9xjn4c2hloap
2013-02-14 18:35:22 +01:00
Raphael Collet 70bda50f7d [IMP] rename model method 'trigger_workflow' into 'step_workflow' (less confusing)
bzr revid: rco@openerp.com-20130213150134-wocd9ey2pubpa3xn
2013-02-13 16:01:34 +01:00
Raphael Collet f78eb868fd [IMP] remove model methods _workflow_trigger and _workflow_signal, and replace calls to new workflow methods
bzr revid: rco@openerp.com-20130213140046-84aa1xtlndltlhzy
2013-02-13 15:00:46 +01:00
Antonin Bourguignon f929ebc73b [MERGE] trunk
bzr revid: abo@openerp.com-20130213105620-xyez3q7ddgc0x5x8
2013-02-13 11:56:20 +01:00
Raphael Collet 6f045b48e8 [MERGE] from trunk
bzr revid: rco@openerp.com-20130213082352-t3wbhkxfh3z10ukt
2013-02-13 09:23:52 +01:00
Raphael Collet e76befd6c6 [MERGE] trunk-service-thu (remove the class openerp.netsvc.ExportService)
bzr revid: rco@openerp.com-20130212154230-y54s2rbetllwnh4q
2013-02-12 16:42:30 +01:00
Vo Minh Thu c99c4091ce [REM] Deleted .apidoc lines.
They were probably used by some tools. How sad.

bzr revid: vmt@openerp.com-20130212142410-zqdjd8jw3gtvxab0
2013-02-12 15:24:10 +01:00
Antonin Bourguignon fbb51ee106 [MERGE] trunk
bzr revid: abo@openerp.com-20130212125650-3r8lsai6p5c8ls2h
2013-02-12 13:56:50 +01:00
Antonin Bourguignon e274ccc7cb [MERGE] trunk
bzr revid: abo@openerp.com-20130211150920-c5yam3yykht1qdpn
2013-02-11 16:09:20 +01:00
Xavier Morel 4a9d82621e [IMP] don't log from import when converting psycopg exceptions to output messages
add conversion for unique constraints, test behavior on unique constraint failure

bzr revid: xmo@openerp.com-20130211143647-l16ssw9z73stbgyc
2013-02-11 15:36:47 +01:00
Xavier ALT 4db48cc102 [MERGE] BUG 1082003: orm: _rec_name should be checked on _all_columns not _columns
bzr revid: xal@openerp.com-20130211092411-3eeo2ann5jnttliq
2013-02-11 10:24:11 +01:00
Vo Minh Thu 6b459a1f27 [DOC] orm: documented workflow-related methods.
bzr revid: vmt@openerp.com-20130206150244-hs67hhe35okl42ei
2013-02-06 16:02:44 +01:00
Anand Patel (OpenERP) a52d21e1cb [IMP]Improved code for the base_import requirde field
bzr revid: pan@tinyerp.com-20130201102750-ozxa3xwqa4rsnt60
2013-02-01 15:57:50 +05:30
Vo Minh Thu a57b655e43 [REF] object_proxy is no longer used by audittrail (which patches directly openerp.service.model).
bzr revid: vmt@openerp.com-20130131161442-17rwinwygte6usfg
2013-01-31 17:14:42 +01:00
Vo Minh Thu e86f90b0c7 [FIX] osv.object_service must be called osv.object_proxy.
bzr revid: vmt@openerp.com-20130130135859-vy96niq19fjsp8g4
2013-01-30 14:58:59 +01:00
Vo Minh Thu 674056c4a5 [REF] services: somewhat clean use of openerp exceptions.
bzr revid: vmt@openerp.com-20130130134451-yft2y56hkpnoxgwa
2013-01-30 14:44:51 +01:00
Vo Minh Thu 19b0315f68 [REF] model service: removed the unneeded object_service class.
bzr revid: vmt@openerp.com-20130130113646-pviw5d6gnohk7wrb
2013-01-30 12:36:46 +01:00
Vo Minh Thu 271aafd8de [IMP] added create_workflow, delete_workflow,redirect_workflow as ORM methods.
bzr revid: vmt@openerp.com-20130129122710-ypvk9x7ndq84mq8r
2013-01-29 13:27:10 +01:00
Vo Minh Thu 200d008fc4 [FIX] orm: call super in __getattr__.
bzr revid: vmt@openerp.com-20130125165314-66j55mtobvt61c7r
2013-01-25 17:53:14 +01:00
Vo Minh Thu ad7d846106 [IMP] orm: expose a signal_xxx() method to call workflow.trg_validate().
bzr revid: vmt@openerp.com-20130125155132-nhyntobe5xm1g7h0
2013-01-25 16:51:32 +01:00
Antonin Bourguignon 11dbed0fb7 [IMP] only call ir.translation when necessary
bzr revid: abo@openerp.com-20130123153722-iijbl8hvesstneq3
2013-01-23 16:37:22 +01:00
Antonin Bourguignon 0b65aa2231 [IMP] fix a comment's indentation, remove a few whitespaces
bzr revid: abo@openerp.com-20130123152234-g2ou48xajxsq8sqj
2013-01-23 16:22:34 +01:00
Antonin Bourguignon 8214854b79 [IMP] doc
bzr revid: abo@openerp.com-20130117144755-r9oboeaw8rr1seqa
2013-01-17 15:47:55 +01:00
Olivier Dony 8e5f0e2ce2 [FIX] fields.date[time]: context_today()/context_timestamp() should fallback to user TZ if context TZ is missing
This takes care of cases where the context is missing,
e.g. for workflow-based operations, and is similar
to the way tools.translate._() falls back to the user
language.

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

bzr revid: odo@openerp.com-20130111175717-u8r1t7s8872bz2rx
2013-01-12 06:57:17 +13:00
Christophe Simonis c10d28e4e6 [FIX] orm: SUPERUSER is not restricted by groups on fields
bzr revid: chs@openerp.com-20130116164025-qns65cb78p8p57m1
2013-01-16 17:40:25 +01:00
Fabien Pinckaers aa86fb2bc1 [IMP] custom model allowed
bzr revid: fp@tinyerp.com-20121227172825-lny2fobb5g89edca
2012-12-27 18:28:25 +01:00
Raphael Collet c9bc74c5c9 [MERGE] lp:~therp-nl/openobject-server/ronald@therp.nl_trunk_lp1009014_new (improve transient models vacuum)
bzr revid: rco@openerp.com-20121221153122-q6j8vatd2xfmqr3n
2012-12-21 16:31:22 +01:00
Raphael Collet 8ead65d82a [IMP] orm: fix vacuum of transient model
bzr revid: rco@openerp.com-20121221152914-qs1s9h1zwnyzft1m
2012-12-21 16:29:14 +01:00
Raphael Collet e7ce4a4529 [MERGE] from trunk
bzr revid: rco@openerp.com-20121221134259-scc92nby1dn91pe8
2012-12-21 14:42:59 +01:00
Thibault Delavallée 919c0d1152 [REV] Reverted last improvement, because this was messing with the menus.
bzr revid: tde@openerp.com-20121221095934-ocbnwz2zvbdbmfug
2012-12-21 10:59:34 +01:00
Thibault Delavallée e2728306b3 [IMP] OROM: order_spec is overidden by self._order only if None (aka, not specified at all). False or void order_spec allows to avoid having any order_by clause. This is used now in needaction, to speedup the search.
bzr revid: tde@openerp.com-20121220205102-lx9ftf3l8qg0xqcu
2012-12-20 21:51:02 +01:00
Thibault Delavallée 36e5b6e88e [FIX] _search not uniquifies the results, because when using _auto_join we could have duplicates in the 'left part' of the result, i.e. a lead with several unread messages. This is done using a custom method instead of a set, because sets are unordered.
bzr revid: tde@openerp.com-20121220141842-or3bigz11qkb13qn
2012-12-20 15:18:42 +01:00
Raphael Collet 95b41b40e9 [IMP] register_hook: improve a bit the code
bzr revid: rco@openerp.com-20121219132138-npf12n5l5ug6ujvx
2012-12-19 14:21:38 +01:00
Raphael Collet fd5dee2267 [MERGE] from trunk
bzr revid: rco@openerp.com-20121219130750-3ljqo3dyz05zww08
2012-12-19 14:07:50 +01:00
Olivier Dony 9f77d2e2f4 [FIX] orm,registry: properly check m2o FKs during model update + fix some models `auto_init`ed multiple times
The case where no constraint existed at all was not working,
and after fixing it, the ORM started to re-create the same
constraints multiple times for some modules. This was for
models that are split within a module (such as res.users in
base, which is made of several small classes): all the
partial models were going through _auto_init instead
of only the final one - doing useless extra work.
      
Unfortunately establishing the FK happens before the
XML data files are loaded, so a number of FK and
NOT NULL constraints failed to apply due to missing
tables/records. base.sql had to be extended a bit
to cover these cases in a minimalist fashion

bzr revid: odo@openerp.com-20121217214645-av9n003yzterhujw
2012-12-17 22:46:45 +01:00
Raphael Collet 39fe69babe [FIX] expression: avoid delitem on a tuple
bzr revid: rco@openerp.com-20121217134559-cjc0b4ncs1drupn7
2012-12-17 14:45:59 +01:00
Raphael Collet 3040114651 [MERGE] trunk-style-improvements-xmo (Python stylistic improvement)
bzr revid: rco@openerp.com-20121217110150-4ijt04ic17miktq7
2012-12-17 12:01:50 +01:00
Raphael Collet 2679a49af4 [FIX] orm: replace incorrect usage of 'in' by '=='
bzr revid: rco@openerp.com-20121217104721-miqmtw2zm7r7lxrs
2012-12-17 11:47:21 +01:00
Raphael Collet eecc7de437 [MERGE] trunk-acl-thu (check read/write access restrictions on fields with a groups attribute)
bzr revid: rco@openerp.com-20121217101528-nt5hsjvvodaap57m
2012-12-17 11:15:28 +01:00
Antony Lesuisse f6fe592152 [MERGE] trunk
bzr revid: al@openerp.com-20121216014404-oonymtva4uww7bwk
2012-12-16 02:44:04 +01:00
Antony Lesuisse 0a35f78974 [MERGE] remove res.partner.address by chs
it also removes an ugly hack in the orm.

bzr revid: al@openerp.com-20121215182836-y15v2mwgdg9wyubi
2012-12-15 19:28:36 +01:00