[FIX] account: accounting advisers can create taxes

Since revision 4acec418ce
it was no longer possible for an accounting adviser
to create taxes.

This is because when creating a taxes,
as the related field `hide_tax_exigibility` wasn't readonly,
it attempted to write on the field
`tax_exigibility` of the model `res.company`,
and the adviser do not has that access right.

There is no reason for this field not to be readonly,
as it is used only to compute an invisible attrs
for the tax form view.

opw-1846265
This commit is contained in:
Denis Ledoux
2018-05-17 12:56:00 +02:00
parent 7313ce7d3c
commit 59a8a1cd8e
+1 -1
View File
@@ -767,7 +767,7 @@ class AccountTax(models.Model):
tag_ids = fields.Many2many('account.account.tag', 'account_tax_account_tag', string='Tags', help="Optional tags you may want to assign for custom reporting")
tax_group_id = fields.Many2one('account.tax.group', string="Tax Group", default=_default_tax_group, required=True)
# Technical field to make the 'tax_exigibility' field invisible if the same named field is set to false in 'res.company' model
hide_tax_exigibility = fields.Boolean(string='Hide Use Cash Basis Option', related='company_id.tax_exigibility')
hide_tax_exigibility = fields.Boolean(string='Hide Use Cash Basis Option', related='company_id.tax_exigibility', readonly=True)
tax_exigibility = fields.Selection(
[('on_invoice', 'Based on Invoice'),
('on_payment', 'Based on Payment'),