|
|
@ -73,6 +73,7 @@ class EventRegistration(models.Model): |
|
|
|
age=fields.Integer('Age') |
|
|
|
gender=fields.Selection([('male','Male'),('femelle','Femelle')],string='gender') |
|
|
|
mobile=fields.Char('Mobile') |
|
|
|
|
|
|
|
kanban_color=fields.Char('kanban color',compute='_compute_kanban_color') |
|
|
|
|
|
|
|
invoice_state=fields.Selection(related='invoice_id.payment_state') |
|
|
@ -106,7 +107,16 @@ class EventRegistration(models.Model): |
|
|
|
if rec.down_payment_invoice_state!='paid':rec.payment_status='down payment not paid' |
|
|
|
if rec.down_payment_invoice_state=='paid' and rec.balance_payment_invoice_state=='paid' :rec.payment_status='paid' |
|
|
|
if rec.down_payment_invoice_state=='paid' and rec.balance_payment_invoice_state!='paid':rec.payment_status='down payment paid' |
|
|
|
|
|
|
|
if rec.payment_status=='paid': |
|
|
|
rec.state='open' |
|
|
|
else: |
|
|
|
rec.state='draft' |
|
|
|
|
|
|
|
|
|
|
|
# @api.onchange('payment_status') |
|
|
|
# def _onchange_payment_status(self): |
|
|
|
# if self.payment_status=='paid' :self.state='open' |
|
|
|
|
|
|
|
def _compute_kanban_color(self): |
|
|
|
for rec in self: |
|
|
|