Commit Graph

116 Commits

Author SHA1 Message Date
Sylvain GARANCHER f4cb884cdc [FIX] base: Add missing return values
The _auto_init method was overriden without keeping the return value of
the super on some models.
This break the new stored computed fields computation at field creation.

Closes #11985
opw-677232
2016-05-17 10:39:54 +02:00
Olivier Dony 000c681f1e [FIX] ir.values: remove redundant deduplication logic
Handling update/create of existing values is already
handled by ir.values.set() itself.
2016-02-02 19:49:09 +01:00
Olivier Dony 6e23b2a807 [FIX] ir.model.data._update: create/modify XML IDs as super-user
When importing a CSV file with an "id" column containing
external IDs (XML IDs), the system automatically creates
or updates the corresponding ir.model.data entries.
This would fail for regular users who do not have
create/write access on this internal model.
2015-05-08 10:25:44 +02:00
Martin Trigaux 0ab88f54f9 [FIX] ir_model: invalidate cache when adding new fields
When a new ir.model.field is created, add the new field in the fields_by_model (cache of custom fields). This is required as the __init__ method would not retrieve the new field if fields_by_model is already set.
Otherwise, the _columns would not contain the new fields and we could not access it without restarting the server (e.g. the installation of a module adds ir.model.fields and use it in the a view.
2014-08-21 17:24:45 +02:00
Martin Trigaux 768b3592c2 [FIX] base: wrong model change check
Comparing an id and a browse record will always fail so the exception would have always been raised when changing a model (e.g. updating a module with custom fields).
2014-08-21 14:30:10 +02:00
Martin Trigaux 84e9a67cdf [FIX] orm: better removal of custom m2m fields
orm: do not try to create ir.model.relation for custom m2m as self._module is either empty (for custom models), either the one of the last inheriting module (which is wrong). The field should be removed manually and should not be impacted by the uninstallation of modules. The removal of the relation table can be done when removing manually the custom field (see rev 6af3193).

ir.model: when removing a model, drop the table with the CASCADE instruction. This will remove left constraints from remaining m2m tables.
This means that dropping a table (either manually removing a custom model or uninstalling a module) will not drop the relation table for a custom m2m field. This is not ideal but better than the previous behaviour (which was to fail the DROP TABLE instruction and keep the table with a few columns and unconsistent data).
2014-07-08 15:56:24 +02:00
Martin Trigaux 6af3193d17 [FIX] ir.model.fields: better unlink
When droping a column, remove also the relation table in case of custom m2m field.
The relation table needs to be dropped otherwise an unremovable constraint to the targetted table is kept (and anyway is not needed anymore).
2014-07-08 13:55:48 +02:00
Martin Trigaux 426993e06d uninstall: avoid errors during uninstall
When uninstalling a module, remove the ir.model.constraint after removing the non-model records and before fields and model definition.
Without this fix, some constraint would be removed too early allowing to have broken relations and data left from removed module.
2014-06-05 12:52:11 +02:00
Martin Trigaux 07e4e15f4d [FIX] ir_model_fields: when adding a new custom column to a custom model, set a valid _rec_name to this model (otherwise would require a server restart to reinstanciate the model) 2014-05-15 16:25:51 +02:00
Denis Ledoux 93ba7cc575 [FIX] base: ir.model.fields, write, use tools.ustr instead of str so it handle if the string is already unicode
Writing special chars in the field label resulted in a traceback (write only, no problem with creation)

bzr revid: dle@openerp.com-20140428110042-qeaswuwsquy1612h
2014-04-28 13:00:42 +02:00
Martin Trigaux b9f72dae74 [FIX] orm: do not drop low level columns (aka 'magic columns') when deleting ir.model.fields
lp bug: https://launchpad.net/bugs/1262150 fixed

bzr revid: mat@openerp.com-20140224161918-9pe1x3jeno8t82p1
2014-02-24 17:19:18 +01:00
Olivier 426a643c4f [BACKPORT] backport from saas-2 (r4976): ir.model: during garbage collection of obsolete records in _process_end, do it in anti-chronological order
bzr revid: olt@openerp.com-20131125144649-mib0vqic0nppziew
2013-11-25 15:46:49 +01:00
Olivier Dony dafa12d92c [FIX] ir.model: FK constraints for custom m2o fields were never created, creating possible data integrity errors
bzr revid: odo@openerp.com-20131010170718-lwoxkqc1tx7i8vhg
2013-10-10 19:07:18 +02:00
Olivier Dony d2ce7b4120 [FIX] ir.model: during creation of custom models, the _auto_init call should also take care of custom fields created on-the-fly
The _auto_init call in ir.model.fields creation will not
do it because it happens before the insertion of the model
in the registry. It will only work for later addition of
fields.

bzr revid: odo@openerp.com-20130730114645-185kbupcrbtnv1tf
2013-07-30 13:46:45 +02: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
Quentin (OpenERP) 01a3c67183 [REV] revert of commit 4953 that was not appropriate for a stable version. Will be back in trunk
bzr revid: qdp-launchpad@openerp.com-20130424093403-9dk8yap427kbndzi
2013-04-24 11:34:03 +02:00
Quentin (OpenERP) a98ae1d753 [IMP/FIX] ir_model_data: added check_object_reference() in order to return a value only if the uid has read access on the targeted object. It avoids raising access rights errors further in the process and prevents duplicating that same code in all addons
bzr revid: qdp-launchpad@openerp.com-20130423103706-u4wk2y65kam587c6
2013-04-23 12:37:06 +02:00
Chris Biersbach 15bd42f5e5 [FIX] Removes the limit of 64 characters from additional text fields added via the interface
lp bug: https://launchpad.net/bugs/1053511 fixed

bzr revid: cbi@openerp.com-20130327132335-tro1p1n5at042jfb
2013-03-27 14:23:35 +01:00
Olivier Dony 9770caedf3 [FIX] registry: another pass of cleanup for registry signaling
Some important points to consider:
 - signaling should be done after any schema alteration (including module [un]installation),
   service registration (e.g. reports)
 - the changes need to be committed to the database *before* signaling, otherwise an
   obvious race condition occurs during reload by other workers
 - any call to restart_pool() must be considered a possible candidate for
   signaling, and the 2 above conditions must be checked

The number of explicit calls was reduced by forcing the signaling at the end of
Registry.new() in case `update_module` was passed as True. In that situation
we always want to signal the changes - so all the redundant signaling calls
can be centralized. We can also assume that the relevant changes have already
been committed at that point, otherwise the registry update would not
have worked in the first place.
This means that there is no need for explicit signaling anymore everytime
`restart_pool` is called with `update_module=True`.

Some missing cr.commit() and explicit signaling calls were added or
moved to the right place. As a reminder: signaling must be done
*after* committing the changes, and usually *after* reloading the
registry on the current worker.

bzr revid: odo@openerp.com-20130301143203-e2csf5pkllwhmwqs
2013-03-01 15:32:03 +01:00
Olivier Dony b762551211 [FIX] ir.model: properly signal registry change for multi-process mode after altering model/db schema
bzr revid: odo@openerp.com-20130228113736-8novcpf3ibw7386s
2013-02-28 12:37:36 +01:00
dle@openerp.com dd91a1c94a [FIX]Uninstall : Savepoint before unlink
bzr revid: dle@openerp.com-20130121102245-dkha32uistm3hgca
2013-01-21 11:22:45 +01:00
Fabien Pinckaers aa86fb2bc1 [IMP] custom model allowed
bzr revid: fp@tinyerp.com-20121227172825-lny2fobb5g89edca
2012-12-27 18:28:25 +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 3ee178ab2c [FIX] unnecessary backslashes
bzr revid: xmo@openerp.com-20121214132113-1ofmm5x0ua3l2q5d
2012-12-14 14:21:13 +01:00
Xavier Morel 91f441d0cd [FIX] mutable default argument values
bzr revid: xmo@openerp.com-20121214131720-jll2i2y0ph7aexox
2012-12-14 14:17:20 +01:00
Xavier Morel 1954c7ae2b [FIX] unresolved reference: 'model' not available inside test body if generator used
bzr revid: xmo@openerp.com-20121214130507-qc1fqzbdttb2a0n2
2012-12-14 14:05:07 +01:00
Xavier Morel c6079dd6bb [REM] unnecessary parens
bzr revid: xmo@openerp.com-20121214123803-6xu2s1ndnoyj4i3e
2012-12-14 13:38:03 +01:00
Vo Minh Thu a1e2fdb69c [MERGE] fix the serialized field domain in the model view.
bzr revid: vmt@openerp.com-20121204150004-lq8t7qgeimeskysf
2012-12-04 16:00:04 +01:00
Olivier Dony 7f5ad72429 [MERGE] Forward-port 6.1 bugfixes up to rev. 4307
rev.4307 = rev-id launchpad_translations_on_behalf_of_openerp-20121125065030-g5if5pybr61la4yj

bzr revid: odo@openerp.com-20121126160320-t2suuik6lhk6wl0x
bzr revid: odo@openerp.com-20121126161836-mv8yymzgbnmif4ve
bzr revid: odo@openerp.com-20121126162023-ejvsapwouyudw6c6
bzr revid: odo@openerp.com-20121126181527-d4yx15372bis77qj
2012-11-26 19:15:27 +01:00
Xavier Morel 4a4fc38d5e [FIX] nuke ir.model.data caches before starting imports
Otherwise a previous validation (or 2) will poison the cache and the
import itself will fail even though the validation succeeeded (and
importing with no validation would have succeeded), as the orm cache
doesn't take DB rollbacks in account.

bzr revid: xmo@openerp.com-20121109113951-p3qgg6m5g7poay5e
2012-11-09 12:39:51 +01:00
Xavier Morel 5bd939f0ac [REM] useless intermediate lambdas in default values
bzr revid: xmo@openerp.com-20121102094705-6vcutz0bv4dc0jkl
2012-11-02 10:47:05 +01:00
Antony Lesuisse 8fa8551f01 [FIX] cleanup ir.xml mess, ir.ui.view name is now optional in xml files
bzr revid: al@openerp.com-20121013120924-xix9cbozm8kda7rj
2012-10-13 14:09:24 +02:00
Raphael Collet 5a971eca90 [FIX] ir: small fix to handle missing models when upgrading
bzr revid: rco@openerp.com-20121005102003-16vbr0aive2mbtid
2012-10-05 12:20:03 +02:00
Fabien Pinckaers f6ff157ca5 [MERGE] active of ACLs, courtesy of akretion
bzr revid: fp@tinyerp.com-20120929114236-lru7p4ibuclbn5nr
2012-09-29 13:42:36 +02:00
Vo Minh Thu 0b464f0882 [FIX] custom models: avoid calling twice __init__, use a correct _rec_name (calling twice __init__ caused the _rec_name to be `name` which does not exist on a custom model, and caused the assert on the _rec_name to fail.
bzr revid: vmt@openerp.com-20120824104242-wa5jq8h47im79ayd
2012-08-24 12:42:42 +02:00
Vo Minh Thu 33e9e66f71 [FIX] uninstall: pass IDs instead of names to _module_data_uninstall().
bzr revid: vmt@openerp.com-20120823161008-is5xqfe4et8xx51k
2012-08-23 18:10:08 +02:00
Xavier Morel 76f885299f [IMP] code style improvements
* Remove unused variables
* Simplify dict.get call in conditionals (default is None)
* Simplify dict.update calls (use kwargs)
* Merge dict.copy() with dict.update() as dict()
* Use isinstance instead of type() equality tests
* Simplify deeply nested code: merge conditionals and remove useless
  conditional, use dict.iteritems()
* Log traceback in exception handler logging

bzr revid: xmo@openerp.com-20120806071249-heh32pi1v0qd3m2j
2012-08-06 09:12:49 +02:00
Alexis de Lattre c28e975ee7 [IMP] add an 'active' field on ir.model.access and ir.rule objects
bzr revid: alexis@via.ecp.fr-20120713173734-2m7496qzm82gko5j
2012-07-13 19:37:34 +02:00
Sanjay Gohel (Open ERP) 6934080a3c [IMP]rename translate into translateble in ir model
bzr revid: sgo@tinyerp.com-20120703065321-atmoxi4i262jeayq
2012-07-03 12:23:21 +05:30
DBR (OpenERP) 3ca22fe02b [Merge]with :lp:openobject-server
bzr revid: dbr@tinyerp.com-20120629061344-jpncsl5q2p9kk1td
bzr revid: dbr@tinyerp.com-20120702101037-ffm5ac0ct3xudyjm
2012-07-02 15:40:37 +05:30
Hardik 350159c394 [IMP]Technical Database Structure Models :Form View Improved
bzr revid: hsa@tinyerp.com-20120628070358-djd63wemuc7x3ei9
2012-06-28 12:33:58 +05:30
Antony Lesuisse 453a1350fe [MERGE] trunk
bzr revid: vmt@openerp.com-20120620122005-2rghps6qjjkozt3n
bzr revid: al@openerp.com-20120627103900-0kgtskgipdazmgy9
2012-06-27 12:39:00 +02:00
Fabien Pinckaers a139c6fc6c [IMP] clean UI for ir.model.data form and tree view
bzr revid: fp@tinyerp.com-20120622141222-ddizks1sz66nqxgw
2012-06-22 16:12:22 +02:00
Vo Minh Thu 575e234cd4 [FIX] res.partner.category: the relation table name was manually chosen, which breaks under _inherit, so we use the automatic one.
bzr revid: vmt@openerp.com-20120619151626-2xho611icmq7e1ky
2012-06-19 17:16:26 +02:00
Vo Minh Thu 877ec2d7a8 [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20120619132718-ag1j3itm69u8h419
2012-06-19 15:27:18 +02:00
Olivier Dony 34965058ec [IMP] access rights: improve error messages for ACLs and record rules
bzr revid: odo@openerp.com-20120615153414-w4p4iczhl6lli50u
2012-06-15 17:34:14 +02:00
Vo Minh Thu eadd5e0a0a [IMP] uninstall: use a dedicated table for many2many relationships instead of overlaoding ir.model.data.
bzr revid: vmt@openerp.com-20120601153449-uj2sl7qjzz3s7xnj
2012-06-01 17:34:49 +02:00
Vo Minh Thu d790650bfb [IMP] uninstall: use dedicated table instead of overloading ir.model.data.
bzr revid: vmt@openerp.com-20120601131414-880vmpctmjfxl84f
2012-06-01 15:14:14 +02:00
Purnendu Singh (OpenERP) b26f2b5790 [MERGE] merge with mma branch
bzr revid: psi@tinyerp.com-20120424062906-b8wi1xwj9vkx86gt
2012-04-24 11:59:06 +05:30
Mayur Maheshwari (OpenERP) 6f2b8821e3 [IMP]all: Improve all typos
bzr revid: mma@tinyerp.com-20120424061128-1hy6izu39i56wvwb
2012-04-24 11:41:28 +05:30