|
@ -293,9 +293,8 @@ class BveView(models.Model): |
|
|
join_nodes = get_join_nodes(info) |
|
|
join_nodes = get_join_nodes(info) |
|
|
|
|
|
|
|
|
table_name = self.model_name.replace('.', '_') |
|
|
table_name = self.model_name.replace('.', '_') |
|
|
tools.drop_view_if_exists(self.env.cr, table_name) |
|
|
|
|
|
|
|
|
|
|
|
# this line is only for robustness in case something goes wrong |
|
|
|
|
|
|
|
|
# robustness in case something went wrong |
|
|
self._cr.execute('DROP TABLE IF EXISTS "%s"' % table_name) |
|
|
self._cr.execute('DROP TABLE IF EXISTS "%s"' % table_name) |
|
|
|
|
|
|
|
|
basic_fields = [ |
|
|
basic_fields = [ |
|
@ -344,6 +343,9 @@ class BveView(models.Model): |
|
|
vals.update({'selection': selection_domain}) |
|
|
vals.update({'selection': selection_domain}) |
|
|
return vals |
|
|
return vals |
|
|
|
|
|
|
|
|
|
|
|
# clean dirty view (in case something went wrong) |
|
|
|
|
|
self.action_reset() |
|
|
|
|
|
|
|
|
# create sql view |
|
|
# create sql view |
|
|
self._create_sql_view() |
|
|
self._create_sql_view() |
|
|
|
|
|
|
|
@ -358,7 +360,8 @@ class BveView(models.Model): |
|
|
for field in data |
|
|
for field in data |
|
|
if 'join_node' not in field] |
|
|
if 'join_node' not in field] |
|
|
} |
|
|
} |
|
|
model = self.env['ir.model'].sudo().create(model_vals) |
|
|
|
|
|
|
|
|
Model = self.env['ir.model'].sudo().with_context(bve=True) |
|
|
|
|
|
model = Model.create(model_vals) |
|
|
|
|
|
|
|
|
# give access rights |
|
|
# give access rights |
|
|
self._build_access_rules(model) |
|
|
self._build_access_rules(model) |
|
|