add fields 'campus' and 'party_related'

This commit is contained in:
sinergia 2022-06-27 12:30:12 -05:00
parent 7e2648e114
commit b61bcce44b
4 changed files with 19 additions and 2 deletions

View File

@ -1,9 +1,10 @@
from trytond.pool import Pool
from . import (party, product, purchase, sale,
from . import (address, party, product, purchase, sale,
equipment, subscription, measurements)
def register():
Pool.register(
address.Address,
party.Party,
product.Template,
product.Product,

View File

@ -1,9 +1,11 @@
from trytond.pool import PoolMeta
from trytond.model import fields
from trytond.pyson import Eval, If
class Address(metaclass=PoolMeta):
__name__ = 'party.address'
campus = fields.Boolean("Campus")
party_related = fields.One2Many('party.party', "Party related")
party_related = fields.Many2One('party.party', "Party Related",
states ={ 'invisible': (Eval("campus"))})

View File

@ -12,6 +12,7 @@ depends:
country
sale_subscription
xml:
address.xml
party.xml
product.xml
measurements.xml

13
view/address_form.xml Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="/form" position="inside">
<label name="party_related"/>
<field name="party_related"/>
</xpath>
<xpath expr="/form/group[@id='checkboxes']" position="inside">
<label name="campus"/>
<field name="campus"/>
</xpath>
</data>