Add filter and group_by activity for animator
This commit is contained in:
parent
b9639ebef6
commit
a8807a9798
@ -137,10 +137,10 @@ class GolemActivity(models.Model):
|
|||||||
date_stop = fields.Date('End date', copy=False)
|
date_stop = fields.Date('End date', copy=False)
|
||||||
|
|
||||||
@api.constrains('animator_id')
|
@api.constrains('animator_id')
|
||||||
def save_animator_id(self):
|
def save_activity_id(self):
|
||||||
""" Enabling is_animator flag """
|
""" Saving Activity in animator_id """
|
||||||
for activity in self:
|
for activity in self:
|
||||||
activity.animator_id.is_animator = True
|
activity.animator_id.activity_id = activity
|
||||||
|
|
||||||
|
|
||||||
@api.onchange('date_start')
|
@api.onchange('date_start')
|
||||||
@ -233,4 +233,4 @@ class ResPartner(models.Model):
|
|||||||
""" GOLEM Member partner adaptations """
|
""" GOLEM Member partner adaptations """
|
||||||
_inherit = 'res.partner'
|
_inherit = 'res.partner'
|
||||||
|
|
||||||
is_animator = fields.Boolean()
|
activity_id = fields.Many2one('golem.activity', ondelete='set null')
|
||||||
|
@ -26,12 +26,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<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">
|
||||||
<filter name="filter_my_partners" position="before">
|
<filter name="filter_my_partners" position="before">
|
||||||
<filter name="is_animator" string="Is Animator"
|
<filter name="filter_is_animator" string="Is Animator"
|
||||||
domain="[('is_animator', '=', True)]" />
|
domain="[('activity_id', '!=', False)]" />
|
||||||
<separator />
|
<filter name="by_activity" string="By Activity"
|
||||||
|
context="{'group_by': 'activity_id'}"/>
|
||||||
</filter>
|
</filter>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user