lot of fixing
This commit is contained in:
parent
07b8054c0c
commit
a415f65a7a
4 changed files with 102 additions and 5 deletions
|
|
@ -22,7 +22,8 @@
|
||||||
'data/company_data.xml',
|
'data/company_data.xml',
|
||||||
'data/partner_tags_data.xml',
|
'data/partner_tags_data.xml',
|
||||||
'data/partner_relations_data.xml',
|
'data/partner_relations_data.xml',
|
||||||
'views/res_partner_relation.xml'
|
'views/res_partner_views.xml',
|
||||||
|
'views/res_partner_relation_views.xml'
|
||||||
],
|
],
|
||||||
'demo': [
|
'demo': [
|
||||||
# Reference to demo data files
|
# Reference to demo data files
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,41 @@ class ResPartner(models.Model):
|
||||||
cyberimpact = fields.Boolean(string='Cyberimpact')
|
cyberimpact = fields.Boolean(string='Cyberimpact')
|
||||||
specification_date = fields.Date(string='Specification date')
|
specification_date = fields.Date(string='Specification date')
|
||||||
crm_stage_activity = fields.Text(string='Activity Stage')
|
crm_stage_activity = fields.Text(string='Activity Stage')
|
||||||
interest_level = fields.Selection(selection=[('1','None'),
|
|
||||||
('2','Low'),
|
interest_level = fields.Selection(
|
||||||
('3','Average'),
|
selection=[
|
||||||
('4','High')], string='Interest Level')
|
('1', 'None'),
|
||||||
|
('2', 'Low'),
|
||||||
|
('3', 'Average'),
|
||||||
|
('4', 'High')],
|
||||||
|
string='Interest Level')
|
||||||
|
|
||||||
company_use = fields.Text(string='Company related')
|
company_use = fields.Text(string='Company related')
|
||||||
|
|
||||||
|
relation_owner_ids = fields.One2many(
|
||||||
|
"res.partner.relation.all",
|
||||||
|
compute="_compute_owner_ids",
|
||||||
|
string="Owner ids"
|
||||||
|
)
|
||||||
|
|
||||||
|
relation_property_ids = fields.One2many(
|
||||||
|
"res.partner.relation.all",
|
||||||
|
compute="_compute_property_ids",
|
||||||
|
string="Property ids"
|
||||||
|
)
|
||||||
|
|
||||||
|
@api.depends('relation_all_ids')
|
||||||
|
def _compute_owner_ids(self):
|
||||||
|
for record in self:
|
||||||
|
record.relation_owner_ids = record.relation_all_ids.filtered(
|
||||||
|
lambda line: (
|
||||||
|
line.type_id.name == 'Owner' and not line.is_inverse)
|
||||||
|
)
|
||||||
|
|
||||||
|
@api.depends('relation_all_ids')
|
||||||
|
def _compute_property_ids(self):
|
||||||
|
for record in self:
|
||||||
|
record.relation_property_ids = record.relation_all_ids.filtered(
|
||||||
|
lambda line: (
|
||||||
|
line.type_id.name == 'Owner' and line.is_inverse)
|
||||||
|
)
|
||||||
|
|
|
||||||
65
bemade_sethy_configuration/views/res_partner_views.xml
Normal file
65
bemade_sethy_configuration/views/res_partner_views.xml
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
<record id="partner_default_contacts_view_form" model="ir.ui.view">
|
||||||
|
<field name="name">bemade_sethy_configuration.res_partner.defaults.form</field>
|
||||||
|
<field name="model">res.partner</field>
|
||||||
|
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//page[@name='contact_addresses']" position="after">
|
||||||
|
<page string="Property" name="bemade_sethy_configuration.res_partner.defaults.form">
|
||||||
|
<group string="All relations">
|
||||||
|
<field name="relation_all_ids">
|
||||||
|
<tree editable="top">
|
||||||
|
<field name="this_partner_id" required="True" options="{'no_create': True}" attrs="{}" invisible="1"/>
|
||||||
|
<field name="type_selection_id" required="True" options="{'no_create': True}"/>
|
||||||
|
<field name="other_partner_id" required="True" options="{'no_create': True}"/>
|
||||||
|
<field name="date_start"/>
|
||||||
|
<field name="date_end"/>
|
||||||
|
<field name="active" invisible="1"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</group>
|
||||||
|
<group string="All Owners">
|
||||||
|
<field name="relation_property_ids">
|
||||||
|
<tree editable="top">
|
||||||
|
<field name="this_partner_id" required="True" options="{'no_create': True}" attrs="{}" invisible="1"/>
|
||||||
|
<field name="type_selection_id" required="True" options="{'no_create': True}" invisible="1"/>
|
||||||
|
<field name="other_partner_id" required="True" options="{'no_create': True}"/>
|
||||||
|
<field name="date_start"/>
|
||||||
|
<field name="date_end"/>
|
||||||
|
<field name="active" invisible="1"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</group>
|
||||||
|
<group string="All Properties">
|
||||||
|
<field name="relation_owner_ids">
|
||||||
|
<tree editable="top">
|
||||||
|
<field name="this_partner_id" required="True" options="{'no_create': True}" attrs="{}" invisible="1"/>
|
||||||
|
<field name="type_selection_id" required="True" options="{'no_create': True}" invisible="1"/>
|
||||||
|
<field name="other_partner_id" required="True" options="{'no_create': True}"/>
|
||||||
|
<field name="date_start"/>
|
||||||
|
<field name="date_end"/>
|
||||||
|
<field name="active" invisible="1"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</group>
|
||||||
|
</page>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- <record id="view_res_partner_filter_inherit" model="ir.ui.view">-->
|
||||||
|
<!-- <field name="name">res.partner.select.inherit</field>-->
|
||||||
|
<!-- <field name="model">res.partner</field>-->
|
||||||
|
<!-- <field name="inherit_id" ref="base.view_res_partner_filter"/>-->
|
||||||
|
<!-- <field name="arch" type="xml">-->
|
||||||
|
<!-- <xpath expr="//search" position="inside">-->
|
||||||
|
<!-- <filter string="Owner" domain="[('category_id.name', '=', 'Owner')]" />-->
|
||||||
|
<!-- <filter string="Property" domain="[('category_id.name', '=', 'Property')]" />-->
|
||||||
|
<!-- </xpath>-->
|
||||||
|
<!-- </field>-->
|
||||||
|
<!-- </record>-->
|
||||||
|
|
||||||
|
|
||||||
|
</odoo>
|
||||||
Loading…
Reference in a new issue