Commit b41706c5 authored by santi's avatar santi
Browse files

Issue 8, show some fields conditionally

parent 11f32ffa
......@@ -13,7 +13,7 @@ class ResPartner(models.Model):
faircoin_address = fields.Char('FairCoin user address', help="The FairCoin address for the user", translate=False)
boc_id = fields.Char('BotC', help='The Bank of the Commons User Id', translate=False)
betabank_id = fields.Char('Betabank User Id', help="The user id in betabank to print in the invoice", translate=False)
prefered_payment = fields.Selection([('betabank','BetaBank'),('faircoin','FairCoin address'), ('boc','Bank of the Commons'), ('spark','Spark')],
prefered_payment = fields.Selection([('betabank','IBAN to BetaBank (Germany)'), ('boc','IBAN to Bank of the Commons (Spain)')],
help="Your prefered payment method",
default="betabank")
is_member_boc = fields.Boolean('Membership of the BOTC', help="When checked the user is member of the Bank of the Commons")
......@@ -7,17 +7,20 @@
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='website']" position="after">
<field name="prefered_payment" widget="selection"/>
<field name="betabank_id" groups="account.group_account_user" />
<field name="boc_id" groups="account.group_account_user" />
<field name="faircoin_address" groups="account.group_account_user" />
<field name="spark_id" groups="account.group_account_user" />
<field name="lang"/>
<field name="prefered_payment" string="Payment Account" widget="selection"
attrs="{'invisible': [('customer','=', False)]}" />
<field name="is_member_boc" attrs="{'invisible': ['|',('supplier','=',True),('customer','=', True)]}" groups="account.group_account_user" class="oe_inline"/>
<field name="boc_id" groups="account.group_account_user" attrs="{'invisible': [('is_member_boc','=', False)]}"/>
<field name="betabank_id" attrs="{'invisible': ['|',('supplier','=',True),('customer','=', True)]}"
groups="account.group_account_user" />
<field name="faircoin_address" attrs="{'invisible': ['|',('supplier','=',True),('customer','=', True)]}"/>
<field name="spark_id" attrs="{'invisible': ['|',('supplier','=',True),('customer','=', True)]}"/>
<field name="lang" required="True"/>
<label for="vat"/>
<div name="vat_info2">
<field name="vat" on_change="vat_change(vat)" placeholder="e.g. BE0477472701" class="oe_inline"/>
<field name="vat" required="True" on_change="vat_change(vat)" placeholder="e.g. BE0477472701" class="oe_inline"
help="Format: CountryCode Letter Number. e.g. ESA00000000"/>
<button colspan="2" name="button_check_vat" string="Check Validity" type="object" icon="gtk-execute" class="oe_inline"/>
<field name="vat_subjected" class="oe_inline"/>
</div>
</xpath>
<xpath expr="//notebook[@colspan='4']" position="attributes">
......@@ -26,6 +29,21 @@
<xpath expr="//page/group/group/field[@name='lang']" position="replace">
<div></div>
</xpath>
<xpath expr="//field[@name='title']" position="attributes">
<attribute name="invisible">[('is_company','=',True)]</attribute>
</xpath>
<xpath expr="//field[@name='street']" position="attributes">
<attribute name="required">True</attribute>
</xpath>
<xpath expr="//field[@name='city']" position="attributes">
<attribute name="required">True</attribute>
</xpath>
<xpath expr="//field[@name='country_id']" position="attributes">
<attribute name="required">True</attribute>
</xpath>
<xpath expr="//field[@name='zip']" position="attributes">
<attribute name="required">True</attribute>
</xpath>
</field>
</record>
<record id="partner_form_view_inherit_account" model="ir.ui.view">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment