forked from Yaltik/golem
colorisation conditionnelle de la liste des attente + filtre activité liée pleine
This commit is contained in:
parent
3cc4ec92f0
commit
03c7ebc3d5
@ -30,7 +30,20 @@ class GolemActivityQueue(models.Model):
|
||||
member_id = fields.Many2one('golem.member', required=True, ondelete='cascade')
|
||||
is_current = fields.Boolean('Current season?',
|
||||
related='activity_id.is_current', store=True)
|
||||
#nombre de place disponible sur activité liée
|
||||
places_remain = fields.Integer(related='activity_id.places_remain')
|
||||
#activité liée est plein ou non
|
||||
is_activity_full = fields.Char(compute="_isActivityFull",store=True)
|
||||
|
||||
# decider si l'activity liée est pleine ou non
|
||||
@api.multi
|
||||
@api.depends('places_remain')
|
||||
def _isActivityFull(self):
|
||||
for record in self:
|
||||
if record.places_remain <=0:
|
||||
record.is_activity_full = "Full activity"
|
||||
else:
|
||||
record.is_activity_full = "Not full activity"
|
||||
def call_up_wizard(self):
|
||||
return {
|
||||
'name': 'Are you sure?',
|
||||
|
@ -51,6 +51,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
context="{'group_by': 'member_id'}"/>
|
||||
<filter name="group_by_activity" string="Activity"
|
||||
context="{'group_by': 'activity_id'}"/>
|
||||
<filter name="group_by_is_full_activity" string="Activity full"
|
||||
context="{'group_by': 'is_activity_full'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@ -60,11 +62,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<field name="name">queue.tree</field>
|
||||
<field name="model">golem.activity.queue</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Queue Tree" editable="bottom">
|
||||
|
||||
|
||||
<tree string="Queue Tree" editable="bottom" colors="grey: places_remain == 0; blue : places_remain >= 1">
|
||||
<field name="member_id"/>
|
||||
<field name="activity_id" readonly='1'/>
|
||||
<field name="season_id" readonly='1'/>
|
||||
<field name="create_date" readonly="1"/>
|
||||
<field name='places_remain' />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
Loading…
Reference in New Issue
Block a user