|
|
@ -133,7 +133,7 @@ class opendons_payment_batch(models.Model): |
|
|
|
self.partner_id=partner_id |
|
|
|
self.operation_id=operation_id |
|
|
|
self.segment_id=segment_id |
|
|
|
res=self.action_ajouter_payment() |
|
|
|
res=self.action_add_payment() |
|
|
|
|
|
|
|
if self.input_mode=='prospect': |
|
|
|
inpt=self.payment_input.split(';') |
|
|
@ -159,10 +159,10 @@ class opendons_payment_batch(models.Model): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def action_ajouter_payment(self): |
|
|
|
def action_add_payment(self): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vals={} |
|
|
|
vals['payment_batch_id']=self.id |
|
|
|
vals['payment_mode_id']=int(self.payment_mode_id) |
|
|
@ -172,7 +172,7 @@ class opendons_payment_batch(models.Model): |
|
|
|
vals['segment_id']=self.segment_id.id |
|
|
|
vals['donation_date']=fields.Date.context_today(self) |
|
|
|
donation=self.env['donation.donation'].create(vals) |
|
|
|
|
|
|
|
|
|
|
|
#creation de l'affectation du don si affectation simple |
|
|
|
if self.assignment=='single': |
|
|
|
vals={} |
|
|
@ -184,16 +184,28 @@ class opendons_payment_batch(models.Model): |
|
|
|
vals['unit_price']=self.donation_amount |
|
|
|
donation_line=self.env['donation.line'].create(vals) |
|
|
|
|
|
|
|
donation.validate() |
|
|
|
vals={} |
|
|
|
donation.validate() |
|
|
|
vals={} |
|
|
|
|
|
|
|
vals['qrcode']=self.payment_input |
|
|
|
self.env['opendons.payment_batch_qrcode'].create(vals) |
|
|
|
vals['qrcode']=self.payment_input |
|
|
|
self.env['opendons.payment_batch_qrcode'].create(vals) |
|
|
|
# else: |
|
|
|
# view_id = self.env.ref('donation.donation_form').id |
|
|
|
# context = self._context.copy() |
|
|
|
# return { |
|
|
|
# 'name':'donation.form', |
|
|
|
# 'view_type':'form', |
|
|
|
# 'view_mode':'tree', |
|
|
|
# 'views' : [(view_id,'form')], |
|
|
|
# 'res_model':'donation.donation', |
|
|
|
# 'view_id':view_id, |
|
|
|
# 'type':'ir.actions.act_window', |
|
|
|
# 'res_id':self.id, |
|
|
|
# 'target':'new', |
|
|
|
# 'context':context, |
|
|
|
# } |
|
|
|
|
|
|
|
self.payment_input=False |
|
|
|
self.partner_id=False |
|
|
|
self.operation_id=False |
|
|
|
self.segment_id=False |
|
|
|
|
|
|
|
|
|
|
|
return True |
|
|
|
|
|
|
|