# HG changeset patch # User Etienne Ferriere <etienne.ferriere@xcg-consulting.fr> # Date 1554305117 -7200 # Wed Apr 03 17:25:17 2019 +0200 # Branch 11.0 # Node ID af2f7565c198349132038c89fcb6fb77d049aa2e # Parent 805bbcf2c77afa4ca556844fed71a1956bd37fb0 The superuser rights must be used to create analytic codes. diff --git a/MetaAnalytic.py b/MetaAnalytic.py --- a/MetaAnalytic.py +++ b/MetaAnalytic.py @@ -466,7 +466,7 @@ vals[column] = force_code_id else: - new_code, vals = self._create_analytic_code( + new_code, vals = self.sudo()._create_analytic_code( vals, code_vals ) @@ -479,7 +479,7 @@ if cp is not None and cp: code_vals['code_parent_id'] = cp.id - new_code, vals = self._create_analytic_code( + new_code, vals = self.sudo()._create_analytic_code( { field: extract( getattr(res, field), field_data['type'] @@ -579,7 +579,7 @@ super(superclass, rec).write(rec_vals, **kwargs) elif rec_code_vals: - code.write(rec_code_vals) + code.sudo().write(rec_code_vals) if code_ref_ids and news is not False: for new in news: