[IMP]Partner coworker minor enhancements (model + views)
This commit is contained in:
parent
7d52c03561
commit
6c8e3a9ccf
@ -25,5 +25,5 @@
|
|||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'application': False,
|
'application': False,
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'depends': ['base', 'contacts']
|
'depends': ['contacts']
|
||||||
}
|
}
|
||||||
|
@ -25,11 +25,7 @@
|
|||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'application': False,
|
'application': False,
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'data': ['views/res_partner_views.xml',
|
'data': ['views/res_partner_views.xml'],
|
||||||
# 'views/res_partner_menu.xml'
|
|
||||||
# 'security/ir.model.access.csv',
|
|
||||||
# 'views/coworker_views.xml'
|
|
||||||
],
|
|
||||||
|
|
||||||
'depends': ['coworking_base']
|
'depends': ['coworking_base']
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ class ResPartner(models.Model):
|
|||||||
""" Coworker model """
|
""" Coworker model """
|
||||||
_inherit = 'res.partner'
|
_inherit = 'res.partner'
|
||||||
|
|
||||||
is_coworker = fields.Selection([('is_coworker', 'Coworker')])
|
is_coworker = fields.Boolean('Coworker', default=False)
|
||||||
# coworker_count = fields.Integer('Number of coworker',
|
# coworker_count = fields.Integer('Number of coworker',
|
||||||
# compute='_compute_coworker_count')
|
# compute='_compute_coworker_count')
|
||||||
|
|
||||||
|
@ -7,16 +7,13 @@
|
|||||||
<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">
|
||||||
|
<field name="type" position="after">
|
||||||
<field name="is_company" position="before">
|
<field name="is_coworker" />
|
||||||
<field name="is_coworker" widget="radio" class="oe_edit_only" options="{'horizontal': true}"/>
|
<field name="coworker_type"
|
||||||
|
attrs="{'invisible': [('is_coworker','=', False)]}" />
|
||||||
|
<field name="contact_date"
|
||||||
|
attrs="{'invisible': [('is_coworker','=', False)]}"/>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="parent_id" position="after">
|
|
||||||
<field name="coworker_type" attrs="{'invisible': [('is_coworker','!=', 'is_coworker')]}" />
|
|
||||||
<field name="contact_date" attrs="{'invisible': [('is_coworker','!=', 'is_coworker')]}"/>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="email" position="after">
|
<field name="email" position="after">
|
||||||
<field name="url" />
|
<field name="url" />
|
||||||
</field>
|
</field>
|
||||||
@ -59,22 +56,30 @@
|
|||||||
<field name="model">res.partner</field>
|
<field name="model">res.partner</field>
|
||||||
<field name="inherit_id" ref ="base.res_partner_kanban_view" />
|
<field name="inherit_id" ref ="base.res_partner_kanban_view" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr='//kanban/templates/t/div/div[3]/ul/li[4]' position="replace">
|
<field name="city" position="after">
|
||||||
<field name="full_contact_adress" />
|
<field name="full_contact_adress" />
|
||||||
<li t-if="!record.full_contact_adress.raw_value"></li>
|
</field>
|
||||||
|
<xpath expr="//div[@class='oe_kanban_details']/ul/li[4]" position="replace">
|
||||||
|
<li><field name="full_contact_adress" /></li>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//div[@class='oe_kanban_details']/ul/li[5]" position="attributes">
|
||||||
|
<attribute name="style">display: none;</attribute>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//div[@class='oe_kanban_details']/ul/li[6]" position="attributes">
|
||||||
|
<attribute name="style">display: none;</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- Calendar -->
|
<!-- Calendar -->
|
||||||
<act_window id="contacts.action_contacts" name="Contacts"
|
<act_window id="contacts.action_contacts" name="Contacts"
|
||||||
res_model="res.partner" view_mode="calendar,graph" />
|
res_model="res.partner" view_mode="kanban,form,calendar,graph" />
|
||||||
|
|
||||||
<record id="view_calendar_res_partner" model="ir.ui.view">
|
<record id="view_calendar_res_partner" model="ir.ui.view">
|
||||||
<field name="name">res.partner.calendar</field>
|
<field name="name">res.partner.calendar</field>
|
||||||
<field name="model">res.partner</field>
|
<field name="model">res.partner</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<calendar date_start="contact_date"
|
<calendar date_start="contact_date" mode="month"
|
||||||
display="First contact : [name]" >
|
display="First contact : [name]" >
|
||||||
<field name="name" />
|
<field name="name" />
|
||||||
</calendar>
|
</calendar>
|
||||||
@ -93,7 +98,7 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="view_pivot_res_partner" model="ir.ui.view">
|
<!-- <record id="view_pivot_res_partner" model="ir.ui.view">
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<pivot>
|
<pivot>
|
||||||
<field name="is_coworker" type="col" />
|
<field name="is_coworker" type="col" />
|
||||||
@ -103,5 +108,5 @@
|
|||||||
</pivot>
|
</pivot>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
-->
|
||||||
</odoo>
|
</odoo>
|
||||||
|
Loading…
Reference in New Issue
Block a user