From 19d340c712bb7db76b03ebba28967b7b1e074341 Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Tue, 9 Jul 2019 08:06:01 +0000 Subject: [PATCH] [FIX] l10n_ch: write access to create invoices - Having a user with access to create an invoice in Accounting, but without the rights to create or modify Currency's objects; - Install the Switzerland localization; - Create an invoice with this user. Before this commit, the user will have an access error. This issue arise because when saving an invoice it will also try to save the name of the currency. In the Switzerland localization a field(l10n_ch_currency_name) is related to the currency's name of the invoice. Now, this field is tagged as read-only, and when saving an invoice, it won't try to save also the currency's name. opw-2032756 closes odoo/odoo#34680 Signed-off-by: Nans Lefebvre (len) --- addons/l10n_ch/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_ch/models/account_invoice.py b/addons/l10n_ch/models/account_invoice.py index 01c8b747329..b8982977552 100644 --- a/addons/l10n_ch/models/account_invoice.py +++ b/addons/l10n_ch/models/account_invoice.py @@ -26,7 +26,7 @@ class AccountInvoice(models.Model): l10n_ch_isr_valid = fields.Boolean(compute='_compute_l10n_ch_isr_valid', help='Boolean value. True iff all the data required to generate the ISR are present') l10n_ch_isr_sent = fields.Boolean(defaut=False, help="Boolean value telling whether or not the ISR corresponding to this invoice has already been printed or sent by mail.") - l10n_ch_currency_name = fields.Char(related='currency_id.name', readonly=False, string="Currency Name", help="The name of this invoice's currency") #This field is used in the "invisible" condition field of the 'Print ISR' button. + l10n_ch_currency_name = fields.Char(related='currency_id.name', readonly=True, string="Currency Name", help="The name of this invoice's currency") #This field is used in the "invisible" condition field of the 'Print ISR' button. @api.depends('partner_bank_id.bank_id.l10n_ch_postal_eur', 'partner_bank_id.bank_id.l10n_ch_postal_chf') def _compute_l10n_ch_isr_postal(self):