summaryrefslogtreecommitdiff
path: root/addons/website_form/models
diff options
context:
space:
mode:
authorRaphael Collet <rco@openerp.com>2016-08-11 10:06:13 +0200
committerRaphael Collet <rco@openerp.com>2016-08-11 12:09:57 +0200
commit305ff7a31eadca1a72c6eee2262f790aa1e93e30 (patch)
tree1f1698324fc1fcff2f35426f8c649f853c721970 /addons/website_form/models
parent9fb53a5055dbeb89dd9a47cc81ff491d0495ff87 (diff)
[MIG] complete migration of special methods like `init`
Diffstat (limited to 'addons/website_form/models')
-rw-r--r--addons/website_form/models/models.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/addons/website_form/models/models.py b/addons/website_form/models/models.py
index 1f3ec5d374d..54425b383bc 100644
--- a/addons/website_form/models/models.py
+++ b/addons/website_form/models/models.py
@@ -71,18 +71,19 @@ class website_form_model_fields(models.Model):
_name = 'ir.model.fields'
_inherit = 'ir.model.fields'
- def init(self, cr):
+ @api.model_cr
+ def init(self):
# set all existing unset website_form_blacklisted fields to ``true``
# (so that we can use it as a whitelist rather than a blacklist)
- cr.execute('UPDATE ir_model_fields'
- ' SET website_form_blacklisted=true'
- ' WHERE website_form_blacklisted IS NULL')
+ self._cr.execute('UPDATE ir_model_fields'
+ ' SET website_form_blacklisted=true'
+ ' WHERE website_form_blacklisted IS NULL')
# add an SQL-level default value on website_form_blacklisted to that
# pure-SQL ir.model.field creations (e.g. in _field_create) generate
# the right default value for a whitelist (aka fields should be
# blacklisted by default)
- cr.execute('ALTER TABLE ir_model_fields '
- ' ALTER COLUMN website_form_blacklisted SET DEFAULT true')
+ self._cr.execute('ALTER TABLE ir_model_fields '
+ ' ALTER COLUMN website_form_blacklisted SET DEFAULT true')
@api.model
def formbuilder_whitelist(self, model, fields):