forked from Yaltik/golem
enlvemenet de l'inscription en attente depuis membre sur 2 étapes
This commit is contained in:
parent
c9a4cc5950
commit
c4f01dee5e
@ -53,6 +53,7 @@ class GolemMember(models.Model):
|
|||||||
print self
|
print self
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
member_id = self[0]
|
member_id = self[0]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'name' : _('Choose the activity to register in'),
|
'name' : _('Choose the activity to register in'),
|
||||||
'type' : 'ir.actions.act_window',
|
'type' : 'ir.actions.act_window',
|
||||||
|
@ -24,25 +24,13 @@ class GolemActivityQueueChooseWizard(models.TransientModel):
|
|||||||
"""GOLEM Resource wizard : rchoose activity queue to register in """
|
"""GOLEM Resource wizard : rchoose activity queue to register in """
|
||||||
_name = "golem.activity.queue.choose.wizard"
|
_name = "golem.activity.queue.choose.wizard"
|
||||||
|
|
||||||
activity_id = fields.Many2one("golem.activity",
|
activity_id = fields.Many2one("golem.activity")
|
||||||
domain=[('places_remain','<',1)])
|
|
||||||
member_id = fields.Many2one("golem.member")
|
member_id = fields.Many2one("golem.member")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# lancer liste editable d'inscription sur attente
|
# lancer liste editable d'inscription sur attente
|
||||||
def register_in_queue(self):
|
def register_in_queue(self):
|
||||||
|
""" Choisir l'activité pour s'inscrire sur sa liste d'attente"""
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
activityQueue = self[0]
|
activityQueue = self[0]
|
||||||
return {
|
self.env['golem.activity.queue'].create({'member_id': activityQueue.member_id.id,
|
||||||
'name' : _('Register in the queue'),
|
'activity_id': activityQueue.activity_id.id})
|
||||||
'type' : 'ir.actions.act_window',
|
|
||||||
'res_model' : 'golem.activity.queue',
|
|
||||||
'view_mode': 'tree',#
|
|
||||||
'context' :{'default_activity_id' : activityQueue.activity_id.id,
|
|
||||||
'default_member_id' : activityQueue.member_id.id
|
|
||||||
},
|
|
||||||
'domain' : [('activity_id', '=',activityQueue.activity_id.id )],
|
|
||||||
'flags': {'action_buttons': True},
|
|
||||||
'target': 'new',
|
|
||||||
}
|
|
||||||
|
@ -28,7 +28,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<form string="Rejection reason">
|
<form string="Rejection reason">
|
||||||
<group>
|
<group>
|
||||||
<field name="member_id" invisible="1" />
|
<field name="member_id" invisible="1" />
|
||||||
<field name="activity_id" options="{'no_create': True}" />
|
<field name="activity_id"
|
||||||
|
domain="[('places_remain','<' , 1), ('queue_allowed', '=', True), ('is_current', '=', True)]"
|
||||||
|
options="{'no_create': True}" />
|
||||||
</group>
|
</group>
|
||||||
<footer>
|
<footer>
|
||||||
<button name="register_in_queue" string="Validate" type="object"
|
<button name="register_in_queue" string="Validate" type="object"
|
||||||
|
Loading…
Reference in New Issue
Block a user