Browse Source

lot de paiement

master
raynald 3 years ago
parent
commit
876b134a40
15 changed files with 30 additions and 14 deletions
  1. +2
    -0
      .gitignore
  2. BIN
      controllers/__pycache__/__init__.cpython-37.pyc
  3. BIN
      controllers/__pycache__/controllers.cpython-37.pyc
  4. BIN
      models/__pycache__/__init__.cpython-37.pyc
  5. BIN
      models/__pycache__/address.cpython-37.pyc
  6. BIN
      models/__pycache__/email.cpython-37.pyc
  7. BIN
      models/__pycache__/mailing_mailing.cpython-37.pyc
  8. BIN
      models/__pycache__/operation.cpython-37.pyc
  9. BIN
      models/__pycache__/partner.cpython-37.pyc
  10. BIN
      models/__pycache__/phone.cpython-37.pyc
  11. BIN
      models/__pycache__/qualifier.cpython-37.pyc
  12. BIN
      models/__pycache__/relationship.cpython-37.pyc
  13. +1
    -1
      models/partner.py
  14. +24
    -12
      models/payment_batch.py
  15. +3
    -1
      views/payment_batch.xml

+ 2
- 0
.gitignore View File

@ -1 +1,3 @@
__pycache__/
models/__pycache__/
controllers/__pycache__/

BIN
controllers/__pycache__/__init__.cpython-37.pyc View File


BIN
controllers/__pycache__/controllers.cpython-37.pyc View File


BIN
models/__pycache__/__init__.cpython-37.pyc View File


BIN
models/__pycache__/address.cpython-37.pyc View File


BIN
models/__pycache__/email.cpython-37.pyc View File


BIN
models/__pycache__/mailing_mailing.cpython-37.pyc View File


BIN
models/__pycache__/operation.cpython-37.pyc View File


BIN
models/__pycache__/partner.cpython-37.pyc View File


BIN
models/__pycache__/phone.cpython-37.pyc View File


BIN
models/__pycache__/qualifier.cpython-37.pyc View File


BIN
models/__pycache__/relationship.cpython-37.pyc View File


+ 1
- 1
models/partner.py View File

@ -238,7 +238,7 @@ class partner(models.Model):
@api.constrains('mobile')
def _onchange_mobile(self):
if self.mobile:
regex = re.compile(r'(^(?:(?:\+|00)33[\s.-]{0,3}(?:\(0\)[\s.-]{0,3})?|0)[1-9](?:(?:[\s.-]?\d{2}){4}|\d{2}(?:[\s.-]?\d{3}){2})$)+')
# 0123456789


+ 24
- 12
models/payment_batch.py View File

@ -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


+ 3
- 1
views/payment_batch.xml View File

@ -54,7 +54,7 @@
<field name="company_id" invisible="1"/>
</group>
<button name="action_ajouter_payment" type="object" string="Add" class="oe_highlight"/>
<button name="action_add_payment" type="object" string="create donation" class="oe_highlight oe_edit_only"/>
<field name="donation_ids"/>
@ -84,6 +84,8 @@
<menuitem id="payment_batch_menu" action="payment_batch_action"
parent="payment_batch_title_menu" sequence="10"/>
<menuitem id="payment_batch_account_payment_order" action="account_payment_order.account_payment_order_inbound_action"
parent="payment_batch_title_menu" sequence="20"/>
</data>
</odoo>

Loading…
Cancel
Save