diff --git a/evaluation.py b/evaluation.py index d24aa22..491a313 100644 --- a/evaluation.py +++ b/evaluation.py @@ -183,10 +183,13 @@ class Evaluation(ModelSQL, ModelView): if evaluation.dashb_actwin: to_delete_window.append(evaluation.dashb_actwin) - if len(to_delete_uiview) > 0: - UiView.delete(to_delete_uiview) - if len(to_delete_window) > 0: - ActWin.delete(to_delete_window) + with Transaction().set_context({ + '_check_access': False, + }): + if len(to_delete_uiview) > 0: + UiView.delete(to_delete_uiview) + if len(to_delete_window) > 0: + ActWin.delete(to_delete_window) @classmethod def uiview_create(cls, evaluations): @@ -202,22 +205,25 @@ class Evaluation(ModelSQL, ModelView): to_write_eval = [] for evaluation in evaluations: - view_graph, = UiView.create([ - cls.get_create_view_data(evaluation), - ]) + with Transaction().set_context({ + '_check_access': False, + }): + view_graph, = UiView.create([ + cls.get_create_view_data(evaluation), + ]) - dashb_actwin, = ActWin.create([{ - 'name': evaluation.dtype_string, - 'res_model': 'cashbook_report.eval_line', - 'usage': 'dashboard', - 'domain': '[["evaluation", "=", %d]]' % evaluation.id, - }]) + dashb_actwin, = ActWin.create([{ + 'name': evaluation.name, + 'res_model': 'cashbook_report.eval_line', + 'usage': 'dashboard', + 'domain': '[["evaluation", "=", %d]]' % evaluation.id, + }]) - dashb_actview, = ActView.create([{ - 'sequence': 10, - 'view': view_graph.id, - 'act_window': dashb_actwin.id, - }]) + dashb_actview, = ActView.create([{ + 'sequence': 10, + 'view': view_graph.id, + 'act_window': dashb_actwin.id, + }]) to_write_eval.extend([ [evaluation], @@ -228,7 +234,6 @@ class Evaluation(ModelSQL, ModelView): }]) if len(to_write_eval) > 0: - print('-- to_write_eval:', to_write_eval) Evaluation2.write(*to_write_eval) @classmethod diff --git a/ir.xml b/ir.xml index 0a7916a..96b603a 100644 --- a/ir.xml +++ b/ir.xml @@ -5,19 +5,37 @@ full copyright notices and license terms. --> - - - + + + + Owner: IR Act Window read + + - - - + + + + + + + + + + + - - - - Anon: IR UI View read + + + + Anon: IR Act Window read @@ -25,40 +43,17 @@ full copyright notices and license terms. --> - - - - - - - - - Owner: IR UI View edit - - - - - - - - + - - - - - + - - - - Administrator: IR UI View edit + + + + Admin: IR Act Window write @@ -66,12 +61,13 @@ full copyright notices and license terms. --> - + - + - - + + diff --git a/line.xml b/line.xml index 5aac1dd..6325a01 100644 --- a/line.xml +++ b/line.xml @@ -47,5 +47,10 @@ full copyright notices and license terms. --> + + + + + diff --git a/tryton.cfg b/tryton.cfg index 90013f0..7c0ce6c 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -1,14 +1,14 @@ [tryton] version=6.0.0 depends: - ir + res cashbook xml: icon.xml message.xml - ir.xml evaluation.xml line.xml evaluation_context.xml evaluation_wizard.xml + ir.xml menu.xml