Add filter and group_by activity for animator

This commit is contained in:
Youssef Elouahby 2018-10-26 08:56:58 +01:00
parent b9639ebef6
commit a8807a9798
2 changed files with 8 additions and 8 deletions

View File

@ -137,10 +137,10 @@ class GolemActivity(models.Model):
date_stop = fields.Date('End date', copy=False)
@api.constrains('animator_id')
def save_animator_id(self):
""" Enabling is_animator flag """
def save_activity_id(self):
""" Saving Activity in animator_id """
for activity in self:
activity.animator_id.is_animator = True
activity.animator_id.activity_id = activity
@api.onchange('date_start')
@ -233,4 +233,4 @@ class ResPartner(models.Model):
""" GOLEM Member partner adaptations """
_inherit = 'res.partner'
is_animator = fields.Boolean()
activity_id = fields.Many2one('golem.activity', ondelete='set null')

View File

@ -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="arch" type="xml">
<filter name="filter_my_partners" position="before">
<filter name="is_animator" string="Is Animator"
domain="[('is_animator', '=', True)]" />
<separator />
<filter name="filter_is_animator" string="Is Animator"
domain="[('activity_id', '!=', False)]" />
<filter name="by_activity" string="By Activity"
context="{'group_by': 'activity_id'}"/>
</filter>
</field>
</record>
</data>
</odoo>