Skip to content

Commit

Permalink
Add readonly=True on related fields
Browse files Browse the repository at this point in the history
  • Loading branch information
alexis-via committed Aug 16, 2017
1 parent c48bbc7 commit 1185d51
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion account_payment_unece/models/account_payment_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ class AccountPaymentMethod(models.Model):
"Commission for Europe (UNECE) defined in UN/EDIFACT Data "
"Element 4461")
unece_code = fields.Char(
related='unece_id.code', store=True, string='UNECE Code')
related='unece_id.code', store=True, readonly=True,
string='UNECE Code')
6 changes: 3 additions & 3 deletions account_tax_unece/models/account_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AccountTax(models.Model):
"nomenclature of the United Nations Economic "
"Commission for Europe (UNECE), DataElement 5153")
unece_type_code = fields.Char(
related='unece_type_id.code', store=True,
related='unece_type_id.code', store=True, readonly=True,
string='UNECE Type Code')
unece_categ_id = fields.Many2one(
'unece.code.list', string='UNECE Tax Category',
Expand All @@ -25,7 +25,7 @@ class AccountTax(models.Model):
"nomenclature of the United Nations Economic "
"Commission for Europe (UNECE), DataElement 5305")
unece_categ_code = fields.Char(
related='unece_categ_id.code', store=True,
related='unece_categ_id.code', store=True, readonly=True,
string='UNECE Category Code')
unece_due_date_id = fields.Many2one(
'unece.code.list', string='UNECE Due Date',
Expand All @@ -37,5 +37,5 @@ class AccountTax(models.Model):
"fiscal administration. For a purchase VAT tax, it is the date "
"on which that VAT can be deducted.")
unece_due_date_code = fields.Char(
related='unece_due_date_id.code', store=True,
related='unece_due_date_id.code', store=True, readonly=True,
string='UNECE Due Date Code')

0 comments on commit 1185d51

Please sign in to comment.