Browse Source

supression controle ligne de donation suite a bug kalachakra

master
root 3 years ago
parent
commit
3ccfd4d8f3
1 changed files with 12 additions and 11 deletions
  1. +12
    -11
      models/donation.py

+ 12
- 11
models/donation.py View File

@ -244,18 +244,19 @@ class DonationDonation(models.Model):
@api.model
def create(self, vals):
#vals['tax_receipt_option']='annual'
if vals['tax_receipt_option']!='annual': raise Warning('The tax receipt option must be annual')
#si montant du PA=0 => message
total=0
if not vals['line_ids']:
raise Warning('please add a donation line')
else:
for line_d in vals['line_ids']:
# #vals['tax_receipt_option']='annual'
# if vals['tax_receipt_option']!='annual': raise Warning('The tax receipt option must be annual')
# #si montant du PA=0 => message
# total=0
# if not vals['line_ids']:
# total=0
# #raise Warning('please add a donation line')
# else:
# for line_d in vals['line_ids']:
total=total+float(line_d[2]['unit_price'])
if total==0:raise Warning('The total amount is null')
# total=total+float(line_d[2]['unit_price'])
# if total==0:raise Warning('The total amount is null')
res = super(DonationDonation, self).create(vals)


Loading…
Cancel
Save