summaryrefslogtreecommitdiff
path: root/addons/website_form/models
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-07-04 14:40:20 +0200
committerChristophe Simonis <chs@odoo.com>2017-07-04 14:40:20 +0200
commit10cb34bcacc0983cdab722e528d413a996df3a7b (patch)
tree749977ed99f5895080eac3d0fd842033eb276b7b /addons/website_form/models
parent81d0bfa4738c5563a26df5cd666ef895cd59d3d0 (diff)
parent97258040d80f3435b6d461de35f86a615ee2b106 (diff)
[MERGE] forward port branch saas-14 up to 97258040d80
Diffstat (limited to 'addons/website_form/models')
-rw-r--r--addons/website_form/models/models.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/addons/website_form/models/models.py b/addons/website_form/models/models.py
index 7ac2c38d715..e9a4614cdae 100644
--- a/addons/website_form/models/models.py
+++ b/addons/website_form/models/models.py
@@ -20,12 +20,6 @@ class website_form_model(models.Model):
website_form_default_field_id = fields.Many2one('ir.model.fields', 'Field for custom form data', domain="[('model', '=', model), ('ttype', '=', 'text')]", help="Specify the field which will contain meta and custom form fields datas.")
website_form_label = fields.Char("Label for form action", help="Form action label. Ex: crm.lead could be 'Send an e-mail' and project.issue could be 'Create an Issue'.")
- def _all_inherited_model_ids(self):
- return list(itertools.chain(
- [self.id],
- *(m._all_inherited_model_ids() for m in self.inherited_model_ids)
- ))
-
def _get_form_writable_fields(self):
"""
Restriction of "authorized fields" (fields which can be used in the
@@ -33,16 +27,16 @@ class website_form_model(models.Model):
builders and are writable. By default no field is writable by the
form builder.
"""
- excluded = {
+ included = {
field.name
for field in self.env['ir.model.fields'].sudo().search([
- ('model_id', 'in', self._all_inherited_model_ids()),
- ('website_form_blacklisted', '=', True)
+ ('model_id', '=', self.id),
+ ('website_form_blacklisted', '=', False)
])
}
return {
k: v for k, v in self.get_authorized_fields(self.model).iteritems()
- if k not in excluded
+ if k in included
}
@api.model