Browse Source

[IMP] put on the waiting list

Add the possibility to put a subscription request on the waiting list.
add a waiting state the action to update the state and the related
button on the form
pull/1/head
houssine 6 years ago
parent
commit
68277e9cdb
  1. 5
      easy_my_coop/models/coop.py
  2. 3
      easy_my_coop/view/subscription_request_view.xml

5
easy_my_coop/models/coop.py

@ -125,6 +125,7 @@ class subscription_request(models.Model):
state = fields.Selection([('draft','Draft'),
('block','Blocked'),
('done','Done'),
('waiting','Waiting'),
('transfer','Transfer'),
('cancelled','Cancelled'),
('paid','paid')],
@ -359,6 +360,10 @@ class subscription_request(models.Model):
def cancel_subscription_request(self):
self.write({'state':'cancelled'})
@api.one
def put_on_waiting_list(self):
self.write({'state':'waiting'})
class share_line(models.Model):
_name='share.line'

3
easy_my_coop/view/subscription_request_view.xml

@ -34,7 +34,8 @@
<field name="arch" type="xml">
<form string="Subscription Requests">
<header>
<button string="Validate" type="object" name="validate_subscription_request" attrs="{'invisible':['|',('state','!=','draft'),('validated','=',False)]}"/>
<button string="Validate" type="object" name="validate_subscription_request" attrs="{'invisible':['|',('state','not in',['draft','waiting']),('validated','=',False)]}"/>
<button string="Waiting list" type="object" name="put_on_waiting_list" states="draft"/>
<button string="Cancel" type="object" name="cancel_subscription_request" states="draft,done,block" groups="easy_my_coop.group_energiris_manager"/>
<field name="state" widget="statusbar" statusbar_visible="draft,cancelled,done,failed"/>
</header>

Loading…
Cancel
Save