Commit Graph

1241 Commits

Author SHA1 Message Date
Xavier Morel 8a5314b15e [FIX] context usage (context may be None in _default_value), dict.get (no need for a False default value in a conditional)
bzr revid: xmo@openerp.com-20111010081021-ijcuchd53dbdr9lc
2011-10-10 10:10:21 +02:00
Xavier Morel 26140ce8f4 [IMP] further improve reading of o2m commands, first read the record itself if an id was provided then update it with the record data if any
bzr revid: xmo@openerp.com-20111010080911-ykosbh8kp3tljyri
2011-10-10 10:09:11 +02:00
Xavier Morel fc28192527 [IMP] if no address value is provided for res.partner.bank default_get context, try to read the address from its id
the web client currently does not send all record data when an o2m is used as a context value, it only sends the ids (at least when the o2m records have not been locally modified)

bzr revid: xmo@openerp.com-20111007131052-4qqo027b2mp16nd6
2011-10-07 15:10:52 +02:00
Olivier Dony f3cf4c359a [IMP] ir.sequence: tone down get_id() deprecation WARNING to DEBUG
For 6.1 we will still support get_id(), but should start phasing it
out for 6.2, so we will switch it back to WARNING after 6.1

bzr revid: odo@openerp.com-20111007145406-9rmfowimthedvoni
2011-10-07 16:54:06 +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
Olivier Dony 5aca6a91fa [IMP] tools.ustr: fix possible stack overflow for exception_to_unicode + tabs->spaces
bzr revid: odo@openerp.com-20111007144806-lodke0woag32sin5
2011-10-07 16:48:06 +02:00
Stephane Wirtel 33963719aa [FIX] base: set the right xml_id for the hidden/link category
bzr revid: stw@openerp.com-20111006142946-qebop8c2gs620ma7
2011-10-06 16:29:46 +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
Vo Minh Thu 3606959a1a [MERGE] expression: no active_test when rewriting the main query.
bzr revid: vmt@openerp.com-20111006075655-gl444vgzcbu1j887
2011-10-06 09:56:55 +02:00
Vo Minh Thu f8e797ea28 [MERGE] fields.property: correctly tests for many2one/relative fields.
bzr revid: vmt@openerp.com-20111006074753-e505g95tcz8js5ju
2011-10-06 09:47:53 +02:00
Antony Lesuisse 21ebf62d23 [MERGE] base_setup dynamic category defintions
bzr revid: al@openerp.com-20111005165259-2xbmw8vo5k1neikn
2011-10-05 18:52:59 +02:00
Vo Minh Thu 491dc693d6 [IMP] fields.property: be more explicit when testing if something is a browse_record.
bzr revid: vmt@openerp.com-20111005154857-ic3yzb3dead33us3
2011-10-05 17:48:57 +02:00
Stephane Wirtel 61c65fc0a0 [FIX] base: set the right category for base
bzr revid: stw@openerp.com-20111005144249-p46i4up2omsuymqj
2011-10-05 16:42:49 +02:00
Stephane Wirtel 54fcb73fc1 [FIX] base: Add the visible field in the ir.module.category, this field will be used by the new base.setup.installer
bzr revid: stw@openerp.com-20111005142315-r9ypz1jeqbi8rfpo
2011-10-05 16:23:15 +02:00
Vo Minh Thu c629763a0f [FIX] two loops one loop (a previous commit) was wrongly done :(.
bzr revid: vmt@openerp.com-20111005135549-xvhtt57fl1ib7o6e
2011-10-05 15:55:49 +02:00
Vo Minh Thu 25a883b2aa [FIX] expression: we dont add any restriction on the main ids
as the possible active=True/False is already present in the main domain.

bzr revid: vmt@openerp.com-20111005133337-p8nvv26tlii7x253
2011-10-05 15:33:37 +02:00
Vo Minh Thu 478854aac0 [FIX] fields.reference: post-process reference fields to test if the referenced record exists.
bzr revid: vmt@openerp.com-20111005113434-itjuj0u3d6fhryn8
2011-10-05 13:34:34 +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 7ccc7f388f [IMP] fields.reference: two loops one loop.
bzr revid: vmt@openerp.com-20111005105103-cutnuvfkgsjej3vc
2011-10-05 12:51:03 +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
Olivier Dony e0a68f3be1 [REM] res.partner: moved opt_out field to email_template module
bzr revid: odo@openerp.com-20111005094843-ov5p9em7mzxb2pkn
2011-10-05 11:48:43 +02:00
Yogesh (OpenERP) 07121a762b [MERGE]
bzr revid: ysa@tinyerp.com-20111005093709-u3rg6g10rcs7tf8f
2011-10-05 15:07:09 +05:30
Yogesh (OpenERP) 2fe1e8c0d8 [MERGE]
bzr revid: ysa@tinyerp.com-20111005093516-u8v7e58ndsyuxh9u
2011-10-05 15:05:16 +05:30
Yogesh (OpenERP) 36b97bc3d7 [MERGE] Merge wtih trunk server upto revision no 3722.
bzr revid: ysa@tinyerp.com-20111005091223-uznjimebpwh0r6a4
2011-10-05 14:42:23 +05:30
Olivier Dony 57d1cbfe38 [IMP] base: update default web.base.url: port 8002->8069
bzr revid: odo@openerp.com-20111005085022-krq4qe95q84s7gol
2011-10-05 10:50:22 +02:00
Olivier Dony e510a9ce61 [REM] base: removed unused pdf test file
bzr revid: odo@openerp.com-20111005084621-totk30u0e0weol2o
2011-10-05 10:46:21 +02:00
Vo Minh Thu 6067cd3609 [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20111005080049-mv0ml30tti01cvba
2011-10-05 10:00:49 +02:00
Yogesh (OpenERP) 2fd484263a [MERGE] Merge wtih trunk server upto revision no 3722.
bzr revid: ysa@tinyerp.com-20111005071001-x8cdfvarwfk4brkb
2011-10-05 12:40:01 +05:30
Yogesh (OpenERP) 4de6b85979 [FIX] fix problem of poperty filed. if property field have a default value then check the id.
bzr revid: ysa@tinyerp.com-20111005065155-nfwersyv05ddjq40
2011-10-05 12:21:55 +05:30
Yogesh (OpenERP) 92b6181556 [MERGE] Merge wtih trunk server upto revision no 3722.
bzr revid: ysa@tinyerp.com-20111005055756-h6fp84gpjwg42w2v
2011-10-05 11:27:56 +05:30
Launchpad Translations on behalf of openerp ce903eb54a Launchpad automatic translations update.
bzr revid: launchpad_translations_on_behalf_of_openerp-20111005044429-thiikup2n1y3ayb9
2011-10-05 04:44:29 +00:00
Olivier Dony 33947042fd [IMP] safe_eval: allow OPCODES for try/except/finally
bzr revid: odo@openerp.com-20111005010136-xkowcqda3kres691
2011-10-05 03:01:36 +02:00
Olivier Dony a25933be83 [IMP] res.currency: better/working default values
bzr revid: odo@openerp.com-20111005002956-1tfe5u13qid3intk
2011-10-05 02:29:56 +02:00
Olivier Dony 5cc7c4002e [IMP] res.currency: name_search() implementation to match name_get()
bzr revid: odo@openerp.com-20111005002416-vz0vzfpb2uosxu4c
2011-10-05 02:24:16 +02:00
Antony Lesuisse 5dd1e2e43c [FIX] complexity default, and base category
bzr revid: al@openerp.com-20111004231534-ay78ghc46ihb91mx
2011-10-05 01:15:34 +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
Antony Lesuisse 2e00f144ec [MERGE] basesetup-dynamic-stw
bzr revid: al@openerp.com-20111004223410-pbwkn5k4zq9ze1mj
2011-10-05 00:34:10 +02:00
Olivier Dony de6b69f654 [REM] edi: moved edi to a separate addon
bzr revid: odo@openerp.com-20111004205254-82krwzabg0wuf2ka
2011-10-04 22:52:54 +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
Olivier Dony f07e1dc558 [IMP] res.company: temporarily comment out res.company edi helpers, needs review
bzr revid: odo@openerp.com-20111004143800-lzca5kp7hng2djee
2011-10-04 16:38:00 +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
Olivier Dony 82a4a9de0a [IMP] edi: review/corrected edi logic
bzr revid: odo@openerp.com-20111004143050-wvpp2b9r81cho3m3
2011-10-04 16:30:50 +02:00
Olivier Dony 4900560931 [IMP] res.partner.edi: working edi implementation for res.partner + smoke test
bzr revid: odo@openerp.com-20111004142951-klopyd7zn5sxf65g
2011-10-04 16:29:51 +02:00
Olivier Dony 3a224dfc06 [IMP] res.partner: better context management in name_get/name_search
bzr revid: odo@openerp.com-20111004142540-689vy1exk60druhy
2011-10-04 16:25:40 +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