forked from michel/Coworking
[Contact-date for all] [Sup xpath to search view] [add search group by month and year for all]
This commit is contained in:
parent
2ce2c58a82
commit
affa853857
@ -10,8 +10,8 @@ class ResPartner(models.Model):
|
|||||||
_inherit = 'res.partner'
|
_inherit = 'res.partner'
|
||||||
|
|
||||||
is_coworker = fields.Boolean('Coworker', default=False)
|
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')
|
||||||
|
|
||||||
|
|
||||||
company_ids = fields.One2many(
|
company_ids = fields.One2many(
|
||||||
@ -34,9 +34,8 @@ class ResPartner(models.Model):
|
|||||||
@api.depends('is_coworker')
|
@api.depends('is_coworker')
|
||||||
def _compute_coworker_count(self):
|
def _compute_coworker_count(self):
|
||||||
""" Computes number of coworker """
|
""" Computes number of coworker """
|
||||||
for res_partner in self:
|
for coworker in self:
|
||||||
if self.is_coworker():
|
coworker.coworker_count = len(coworker.coworker_type)
|
||||||
self.coworker_count = len(self.is_coworker)
|
|
||||||
|
|
||||||
@api.depends('street', 'zip', 'city')
|
@api.depends('street', 'zip', 'city')
|
||||||
def _compute_full_contact_adress(self):
|
def _compute_full_contact_adress(self):
|
||||||
|
@ -11,8 +11,7 @@
|
|||||||
<field name="is_coworker" />
|
<field name="is_coworker" />
|
||||||
<field name="coworker_type"
|
<field name="coworker_type"
|
||||||
attrs="{'invisible': [('is_coworker','=', False)]}" />
|
attrs="{'invisible': [('is_coworker','=', False)]}" />
|
||||||
<field name="contact_date"
|
<field name="contact_date" />
|
||||||
attrs="{'invisible': [('is_coworker','=', False)]}"/>
|
|
||||||
</field>
|
</field>
|
||||||
<field name="email" position="after">
|
<field name="email" position="after">
|
||||||
<field name="url" />
|
<field name="url" />
|
||||||
@ -42,11 +41,16 @@
|
|||||||
<field name="model">res.partner</field>
|
<field name="model">res.partner</field>
|
||||||
<field name="inherit_id" ref ="base.view_res_partner_filter" />
|
<field name="inherit_id" ref ="base.view_res_partner_filter" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//search" position="inside">
|
<search position="inside">
|
||||||
<filter name="is_coworker" string="Coworker"
|
<filter name="is_coworker" string="Coworker"
|
||||||
domain="[('is_coworker','!=',False)]" />
|
domain="[('is_coworker','=',True)]" />
|
||||||
</xpath>
|
<separator />
|
||||||
|
|
||||||
|
<filter name="group_month" string="Month"
|
||||||
|
context="{'group_by': 'contact_date:month'}" />
|
||||||
|
<filter name="group_year" string="Year"
|
||||||
|
context="{'group_by': 'contact_date:year'}" />
|
||||||
|
</search>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
@ -73,7 +77,7 @@
|
|||||||
|
|
||||||
<!-- Calendar -->
|
<!-- Calendar -->
|
||||||
<act_window id="contacts.action_contacts" name="Contacts"
|
<act_window id="contacts.action_contacts" name="Contacts"
|
||||||
res_model="res.partner" view_mode="kanban,form,calendar,graph" />
|
res_model="res.partner" view_mode="kanban,form,calendar,graph,pivot" />
|
||||||
|
|
||||||
<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>
|
||||||
@ -93,20 +97,21 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<graph type="bar">
|
<graph type="bar">
|
||||||
<field name="is_coworker" />
|
<field name="is_coworker" />
|
||||||
<field name="is_coworker" type="measure" />
|
|
||||||
</graph>
|
</graph>
|
||||||
</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="name">res.partner.pivot</field>
|
||||||
|
<field name="model">res.partner</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<pivot>
|
<pivot>
|
||||||
<field name="is_coworker" type="col" />
|
<field name="is_coworker" type="col" />
|
||||||
<field name="user_id" />
|
<field name="user_id" />
|
||||||
<field name="date_deadline" interval="week" />
|
<field name="contact_date" interval="week" />
|
||||||
<field name="effort_estimate" type="measure" />
|
|
||||||
</pivot>
|
</pivot>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
-->
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user