Commit b00fcdad by Odoo Committed by Yvon

Ajout fonctionnalité recalcul des statuts dans action en masse vue liste membres ou rattachés

parent 603c56c9
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# #
'category': 'Uncategorized', 'category': 'Uncategorized',
'version': '0.0.6', 'version': '0.0.7.2',
# any module necessary for this one to work correctly # any module necessary for this one to work correctly
'depends': ['base', 'coop_membership', 'coop_shift'], 'depends': ['base', 'coop_membership', 'coop_shift'],
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
'data/ir_config_parameter_data.xml', 'data/ir_config_parameter_data.xml',
'static/src/xml/templates.xml', 'static/src/xml/templates.xml',
'views/res_partner.xml', 'views/res_partner.xml',
'views/actions.xml'
], ],
'installable': True, 'installable': True,
......
...@@ -44,6 +44,12 @@ class ResPartner(models.Model): ...@@ -44,6 +44,12 @@ class ResPartner(models.Model):
"Number of shift done with both of the associate", "Number of shift done with both of the associate",
default= 0) default= 0)
@api.multi
def recompute_member_states(self):
for record in self:
record._compute_working_state()
record._compute_cooperative_state()
@api.model @api.model
def run_process_target_status(self): def run_process_target_status(self):
"""Method called by cron task""" """Method called by cron task"""
......
<?xml version="1.0"?>
<odoo>
<record id="res_partner_recompute_cooperative_state" model="ir.actions.server">
<field name="name">Recompute member status</field>
<field name="model_id" ref="lacagette_membership.model_res_partner" />
<field name="state">code</field>
<field name="code">action = self.recompute_member_states(cr, uid, context.get('active_ids', []), context=context)</field>
</record>
<record id="action_recompute_partner_status" model="ir.values">
<field name="model_id" ref="base.model_res_partner" />
<field name="name">Recompute member status</field>
<field name="key2">client_action_multi</field>
<field name="value" eval="'ir.actions.server,%d'%res_partner_recompute_cooperative_state" />
<field name="key">action</field>
<field name="model">res.partner</field>
</record>
</odoo>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment