Browse Source

Add currency, fix view, rename capital_country.

pull/224/head
Jairo Llopis 9 years ago
parent
commit
b073c336b0
  1. 6
      partner_capital/models/res_partner.py
  2. 22
      partner_capital/views/res_partner_view.xml

6
partner_capital/models/res_partner.py

@ -9,14 +9,18 @@ from openerp import models, fields
class ResPartner(models.Model): class ResPartner(models.Model):
_inherit = 'res.partner' _inherit = 'res.partner'
capital_country = fields.Many2one(
capital_country_id = fields.Many2one(
'res.country', 'res.country',
"Capital country", "Capital country",
oldname="capital_country",
help="Country of origin of this company's capital.") help="Country of origin of this company's capital.")
capital_amount = fields.Float( capital_amount = fields.Float(
"Capital amount", "Capital amount",
oldname="capital_amount", oldname="capital_amount",
help="Publicly registered capital amount.") help="Publicly registered capital amount.")
capital_currency_id = fields.Many2one(
"res.currency",
string="Capital currency")
turnover_range_id = fields.Many2one( turnover_range_id = fields.Many2one(
'res.partner.turnover_range', 'res.partner.turnover_range',
"Turnover range", "Turnover range",

22
partner_capital/views/res_partner_view.xml

@ -11,18 +11,16 @@
<field name="model">res.partner</field> <field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/> <field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//page[@name='sales_purchases']" position="inside">
<group name="captial" string="Capital">
<field name="capital_country"
attrs="{'invisible': [('is_company', '=', False)]}"/>
<field name="capital_amount"
attrs="{'invisible': [('is_company', '=', False)]}"/>
<field name="turnover_range_id"
attrs="{'invisible': [('is_company', '=', False)]}"/>
<field name="turnover_amount"
attrs="{'invisible': [('is_company', '=', False)]}"/>
<field name="company_size"
attrs="{'invisible': [('is_company', '=', False)]}"/>
<xpath expr="//page[@name='sales_purchases']/group">
<group name="captial"
string="Capital"
attrs="{'invisible': [('is_company', '=', False)]}">
<field name="capital_country_id"/>
<field name="capital_amount"/>
<field name="capital_currency_id"/>
<field name="turnover_range_id"/>
<field name="turnover_amount"/>
<field name="company_size"/>
</group> </group>
</xpath> </xpath>
</field> </field>

Loading…
Cancel
Save