forked from Yaltik/golem
Add queue liste to activity form
This commit is contained in:
parent
ca326c9ded
commit
98c8ad3767
@ -24,9 +24,19 @@ class GolemActivity(models.Model):
|
||||
|
||||
|
||||
#ajout d'un champs O2M vers activity_id
|
||||
activity_queue_ids = fields.One2many('golem.activity.queue', 'activity_id')
|
||||
activity_queue_ids = fields.One2many('golem.activity.queue',
|
||||
'activity_id','Pending registration')
|
||||
# un boolen pour determiner si une fille d'attente est autorisé
|
||||
queue_allowed = fields.Boolean(default=True)
|
||||
#ajout d'un champs pour calculer le nombre d'inscription en file d'attente
|
||||
queue_activity_number = fields.Integer(compute="_queue_activity_number",
|
||||
store=True , string='Pending registration number')
|
||||
|
||||
|
||||
@api.multi
|
||||
def _queue_activity_number(self):
|
||||
for activity in self:
|
||||
activity.queue_activity_number = len(activity.activity_queue_ids)
|
||||
|
||||
@api.multi
|
||||
def queue_register(self):
|
||||
|
@ -33,6 +33,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
string="Register in the queue" type="object"
|
||||
attrs="{'invisible':[('places_remain','>', 0)]}"/>
|
||||
</xpath>
|
||||
<!--onglet queue sur activity-->
|
||||
<page name="invoicing" position="before">
|
||||
<page name="queue" string="Queue">
|
||||
<group>
|
||||
<field name="queue_activity_number" readonly='1'/>
|
||||
<field name="activity_queue_ids"
|
||||
context="{'default_activity_id': active_id}">
|
||||
<tree editable="top">
|
||||
<field name="member_id"/>
|
||||
<!-- domain="[('season_ids', '=', season_id)]" /> -->
|
||||
<field name="activity_id" readonly="1" />
|
||||
<field name="season_id" readonly="1" />
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
</page>
|
||||
</page>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user