Guest User

Untitled

a guest
Oct 2nd, 2019
111
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. Model definition:
  3. -----------------
  4.  
  5. |~
  6. class Party(metaclass=PoolMeta): |~
  7. __name__ = 'party.party' |~
  8.  
  9. debtor = fields.Boolean("Debtor") |~
  10. debtor_icon = fields.Function(fields.Char("Debtor Icon"), |~
  11. 'get_debtor_icon')
  12.  
  13. |~
  14. def get_debtor_icon(self, name): |~
  15. if self.debtor: |~
  16. return 'tryton-money-bag' |~
  17. return None
  18.  
  19. Tree view definition:
  20. --------------------
  21.  
  22. <?xml version="1.0"?>
  23. <!-- The COPYRIGHT file at the top level of this repository contains the full
  24. copyright notices and license terms. -->
  25. <data>
  26. <xpath expr="/tree/field[@name='code']" position="before">
  27. <field name="debtor" icon="debtor_icon"/>
  28. </xpath>
  29. </data>
  30.  
  31. Form view definition:
  32. --------------------
  33.  
  34. <?xml version="1.0"?>
  35. <!-- The COPYRIGHT file at the top level of this repository contains the full
  36. copyright notices and license terms. -->
  37. <data>
  38. <xpath expr="/form/group[@id='checkboxes']" position="inside">
  39. <label name="debtor"/>
  40. <field name="debtor"/>
  41. <image name="tryton-money-bag" xexpand="0"/>
  42. </xpath>
  43. </data>
  44. ~
RAW Paste Data