From 7beeb70e6a6a6c3504ee11b9dca81e02fa96bdba Mon Sep 17 00:00:00 2001 From: Andreas Osim Date: Thu, 12 Jul 2018 18:08:54 +0200 Subject: [PATCH] add right management for fields pg_ic_num & pg_ic_flag --- .../dp_intercompany_invoicing/models/account.py | 6 ++++++ .../dp_intercompany_invoicing/views/account_views.xml | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ext/custom-addons/dp_intercompany_invoicing/models/account.py b/ext/custom-addons/dp_intercompany_invoicing/models/account.py index bee85fbc..0f788d6c 100644 --- a/ext/custom-addons/dp_intercompany_invoicing/models/account.py +++ b/ext/custom-addons/dp_intercompany_invoicing/models/account.py @@ -38,6 +38,12 @@ class AccountInvoice(models.Model): pg_ic_num = fields.Char('PG_IC_Nummer') pg_ic_flag = fields.Boolean(string='IC', help='Rechnung nach PG exportiert') + pg_admin = fields.Boolean(compute='_is_pg_admin', default=False, store=False) + + @api.multi + def _is_pg_admin(self): + for record in self: + record.pg_admin = self.env.user.has_group('base.group_system') @api.multi def _compute_inter_company_supplier_isset(self): diff --git a/ext/custom-addons/dp_intercompany_invoicing/views/account_views.xml b/ext/custom-addons/dp_intercompany_invoicing/views/account_views.xml index 39e98c9f..be1f2dac 100644 --- a/ext/custom-addons/dp_intercompany_invoicing/views/account_views.xml +++ b/ext/custom-addons/dp_intercompany_invoicing/views/account_views.xml @@ -20,8 +20,9 @@