forked from Yaltik/golem
Code cleaning + adding domaine to queue registration function
This commit is contained in:
parent
a0af3a680a
commit
b9eeb3a170
@ -20,32 +20,6 @@
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
|
||||
class YesNoQueuePopUp(models.TransientModel):
|
||||
"""GOLEM Resource wizard"""
|
||||
_name = "golem.queuepopup"
|
||||
|
||||
|
||||
#yes_no = fields.Char(default='Do you want to proceed?')
|
||||
|
||||
@api.multi
|
||||
def queueYes(self):
|
||||
print "########################################################"
|
||||
return {
|
||||
'name' : _('Do you want to add your registration to the queue?'),
|
||||
'type' : 'ir.actions.act_window',
|
||||
'res_model' : 'golem.activity.queue',
|
||||
'view_mode': 'form',
|
||||
'view_type': 'form',
|
||||
'target': 'new',
|
||||
}
|
||||
|
||||
@api.multi
|
||||
def queueNo(self):
|
||||
pass # don't do anything
|
||||
|
||||
|
||||
|
||||
|
||||
class GolemActivityQueue(models.Model):
|
||||
""" GOLEM Activity Queue """
|
||||
_name = 'golem.activity.queue'
|
||||
|
@ -41,11 +41,15 @@ class GolemMember(models.Model):
|
||||
}
|
||||
}
|
||||
|
||||
@api.multi
|
||||
def queue_register(self):
|
||||
self.ensure_one()
|
||||
member_id = self[0]
|
||||
return {
|
||||
'name' : _('Choose the activity to register in'),
|
||||
'type' : 'ir.actions.act_window',
|
||||
'res_model' : 'golem.activity.queue.choose.wizard',
|
||||
'view_mode': 'form',
|
||||
'context' : {'default_member_id' : member_id.id},
|
||||
'target': 'new',
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<data>
|
||||
|
||||
|
||||
<!--formulaire du modèle golem.resources-->
|
||||
<!--formulaire du modèle golem.activity.queue-->
|
||||
<record model="ir.ui.view" id="queue_form_view">
|
||||
<field name="name">queue.form</field>
|
||||
<field name="model">golem.activity.queue</field>
|
||||
@ -61,7 +61,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<field name="model">golem.activity.queue</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Queue Tree" editable="bottom">
|
||||
<field name="member_id"/>
|
||||
<field name="member_id" readonly="1"/>
|
||||
<field name="activity_id" readonly='1'/>
|
||||
<field name="season_id" readonly='1'/>
|
||||
<field name="create_date" readonly="1"/>
|
||||
|
@ -55,18 +55,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="wizard_form_view">
|
||||
<field name="name">queuepopup.form</field>
|
||||
<field name="model">golem.queuepopup</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Add motif">
|
||||
<footer>
|
||||
<button class="oe_highlight" name="queueYes" string="Yes" type="object"/>
|
||||
<button class="oe_highlight" name="queueNo" string="No" type="object"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
@ -25,6 +25,8 @@ class GolemActivityQueueChooseWizard(models.TransientModel):
|
||||
_name = "golem.activity.queue.choose.wizard"
|
||||
|
||||
activity_id = fields.Many2one("golem.activity")
|
||||
member_id = fields.Many2one("golem.member")
|
||||
|
||||
|
||||
|
||||
def ChooseActivity(self):
|
||||
@ -35,7 +37,9 @@ class GolemActivityQueueChooseWizard(models.TransientModel):
|
||||
'type' : 'ir.actions.act_window',
|
||||
'res_model' : 'golem.activity.queue',
|
||||
'view_mode': 'tree',#
|
||||
'context' :{'default_activity_id' : activityQueue.activity_id.id},
|
||||
'context' :{'default_activity_id' : activityQueue.activity_id.id,
|
||||
'default_member_id' : activityQueue.member_id.id
|
||||
},
|
||||
'domain' : [('activity_id', '=',activityQueue.activity_id.id )],# activity_id.name)],#"('activity_id', '=', True)"
|
||||
'flags': {'action_buttons': True},
|
||||
'target': 'new',
|
||||
|
@ -27,6 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<field name="arch" type="xml">
|
||||
<form string="Rejection reason">
|
||||
<group>
|
||||
<field name="member_id" invisible="1" />
|
||||
<field name="activity_id" options="{'no_create': True}" />
|
||||
</group>
|
||||
<footer>
|
||||
|
Loading…
Reference in New Issue
Block a user