Skip to content
Snippets Groups Projects
Commit 92f7bc7a authored by Marco Folco's avatar Marco Folco
Browse files

Merge branch 'minor_changes' into '12.0-stage'

[MOD] view and health_insurance

See merge request !20
parents de428d5d 579a7ad9
No related branches found
No related tags found
1 merge request!20[MOD] view and health_insurance
......@@ -34,6 +34,7 @@
"views/menuitem.xml",
"views/health_insurance_view.xml",
"views/health_insurance_plan_view.xml",
"views/res_partner_views.xml",
"data/general.xml",
"data/res_partner_data.xml",
# "views/health_insurance_tariff_view.xml",
......
......@@ -30,7 +30,8 @@ class Partner(models.Model):
partner_type = fields.Selection(
[('insurance', 'Insurance')],
string="Partner type")
string="Partner type",
default=lambda x: x._get_default_partner_type())
health_insurance_plan_ids = fields.One2many(
'health.insurance.plan',
......@@ -44,6 +45,10 @@ class Partner(models.Model):
can_import_roll = fields.Boolean(string='Can import roll?')
@api.multi
def _get_default_partner_type(self):
return 'insurance'
@api.model
def create(self, vals):
if 'ref' not in vals.keys() and vals.get('partner_type', '') == 'insurance':
......
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<record id="view_partner_form_health_insurance_inherit" model="ir.ui.view">
<field name="name">view.partner.form.health.insurance.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='document_type_id']" position="after">
<field name="partner_type"/>
</xpath>
</field>
</record>
</data>
</odoo>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment