Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Model definition:
- -----------------
- |~
- class Party(metaclass=PoolMeta): |~
- __name__ = 'party.party' |~
- debtor = fields.Boolean("Debtor") |~
- debtor_icon = fields.Function(fields.Char("Debtor Icon"), |~
- 'get_debtor_icon')
- |~
- def get_debtor_icon(self, name): |~
- if self.debtor: |~
- return 'tryton-money-bag' |~
- return None
- Tree view definition:
- --------------------
- <?xml version="1.0"?>
- <!-- The COPYRIGHT file at the top level of this repository contains the full
- copyright notices and license terms. -->
- <data>
- <xpath expr="/tree/field[@name='code']" position="before">
- <field name="debtor" icon="debtor_icon"/>
- </xpath>
- </data>
- Form view definition:
- --------------------
- <?xml version="1.0"?>
- <!-- The COPYRIGHT file at the top level of this repository contains the full
- copyright notices and license terms. -->
- <data>
- <xpath expr="/form/group[@id='checkboxes']" position="inside">
- <label name="debtor"/>
- <field name="debtor"/>
- <image name="tryton-money-bag" xexpand="0"/>
- </xpath>
- </data>
- ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement