add right management for fields pg_ic_num & pg_ic_flag
parent
4ac2f0ad4b
commit
7beeb70e6a
|
|
@ -38,6 +38,12 @@ class AccountInvoice(models.Model):
|
||||||
|
|
||||||
pg_ic_num = fields.Char('PG_IC_Nummer')
|
pg_ic_num = fields.Char('PG_IC_Nummer')
|
||||||
pg_ic_flag = fields.Boolean(string='IC', help='Rechnung nach PG exportiert')
|
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
|
@api.multi
|
||||||
def _compute_inter_company_supplier_isset(self):
|
def _compute_inter_company_supplier_isset(self):
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,9 @@
|
||||||
<button class="btn btn-primary" type="object" name="action_unset_all_wv_flag" string="Löschen"/>
|
<button class="btn btn-primary" type="object" name="action_unset_all_wv_flag" string="Löschen"/>
|
||||||
</div>
|
</div>
|
||||||
<field name="reimburse_invoice_id" attrs="{'invisible':True}"/>
|
<field name="reimburse_invoice_id" attrs="{'invisible':True}"/>
|
||||||
<field name="pg_ic_num"/>
|
<field name="pg_admin" attrs="{'invisible':True}"/>
|
||||||
<field name="pg_ic_flag"/>
|
<field name="pg_ic_num" attrs="{'readonly': [('pg_admin','=',False)]}"/>
|
||||||
|
<field name="pg_ic_flag" attrs="{'readonly': [('pg_admin','=',False)]}"/>
|
||||||
<!--
|
<!--
|
||||||
<field name="pg_ic_flag" attrs="{'readonly':[('state','not in',('draft','sent'))]}"/>
|
<field name="pg_ic_flag" attrs="{'readonly':[('state','not in',('draft','sent'))]}"/>
|
||||||
-->
|
-->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue