Nimesh Contractor(Open ERP) has proposed merging
lp:~openerp-dev/openobject-server/trunk-bug-753653-nco into
lp:openobject-server.
Requested reviews:
Naresh(OpenERP) (nch-openerp)
Related bugs:
Bug #753653 in OpenERP Server: "[PS] Problem with duplication of custom
object"
https://bugs.launchpad.net/openobject-server/+bug/753653
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-bug-753653-nco/+merge/66859
Hello sir,
Problem with duplication of custom object, for that put the
_sql_constraints.
Thank You.
--
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-bug-753653-nco/+merge/66859
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-server/trunk-bug-753653-nco.
=== modified file 'openerp/addons/base/ir/ir_model.py'
--- openerp/addons/base/ir/ir_model.py 2011-06-24 13:33:35 +0000
+++ openerp/addons/base/ir/ir_model.py 2011-07-05 07:11:22 +0000
@@ -102,7 +102,9 @@
'model': lambda *a: 'x_',
'state': lambda self,cr,uid,ctx=None: (ctx and ctx.get('manual',False)) and 'manual' or 'base',
}
-
+ _sql_constraints = [
+ ('model_name_uniq', 'unique(name, model)', 'Duplication of models is not allowed, models must be created unique and manually !'),
+ ]
def _check_model_name(self, cr, uid, ids, context=None):
for model in self.browse(cr, uid, ids, context=context):
if model.state=='manual':
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp