Skip to content

Commit

Permalink
Merge PR #1411 into 8.0
Browse files Browse the repository at this point in the history
Signed-off-by sergiocorato
  • Loading branch information
OCA-git-bot committed Oct 25, 2019
2 parents bb262b6 + 9886410 commit 3f38bbc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
21 changes: 13 additions & 8 deletions l10n_it_fatturapa/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,24 @@ class FatturapaFiscalPosition(models.Model):
class WelfareFundType(models.Model):
# _position = ['2.1.1.7.1']
_name = "welfare.fund.type"
_description = 'welfare fund type'
_description = 'Welfare Fund Type'
_rec_name = 'display_name'

name = fields.Char('name')
description = fields.Char('description')
display_name = fields.Char(string='Name', compute='_compute_display_name')
name = fields.Char('Name')
description = fields.Char('Description')
display_name = fields.Char(string='Name',
compute='_compute_clean_display_name')

@api.depends('description', 'name')
@api.multi
def _compute_display_name(self):
@api.depends(
'description', 'name'
)
def _compute_clean_display_name(self):
for record in self:
record.display_name = u'[%s] %s' % (
record.name, record.description)
name = record.name
if record.name and record.description:
name = u'[%s] %s' % (record.name, record.description)
record.display_name = name


class WelfareFundDataLine(models.Model):
Expand Down
9 changes: 9 additions & 0 deletions l10n_it_fatturapa/views/account_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,14 @@
</field>
</field>
</record>
<record id="welfare_fund_type_tree" model="ir.ui.view">
<field name="name">welfare.fund.type.tree</field>
<field name="model">welfare.fund.type</field>
<field name="arch" type="xml">
<tree string="">
<field name="display_name" />
</tree>
</field>
</record>
</data>
</openerp>

0 comments on commit 3f38bbc

Please sign in to comment.