diff --git a/models/direct_debit.py b/models/direct_debit.py
new file mode 100644
index 0000000..f9f32d8
--- /dev/null
+++ b/models/direct_debit.py
@@ -0,0 +1,19 @@
+from odoo import models, fields, api
+from odoo.exceptions import UserError, ValidationError
+from psycopg2 import sql, DatabaseError
+
+from werkzeug import utils
+
+class opendons_direct_debit(models.Model):
+ _name = 'opendons_direct_debit'
+ _description = 'manage direct debit'
+
+ partner_id = fields.Many2one(
+ 'res.partner',
+ string='partner',
+ required=True,
+ index=True,
+ readonly=True,
+ track_visibility='onchange',
+ ondelete='restrict'
+ )
\ No newline at end of file
diff --git a/models/payment_batch.py b/models/payment_batch.py
new file mode 100644
index 0000000..dcd8314
--- /dev/null
+++ b/models/payment_batch.py
@@ -0,0 +1,72 @@
+from odoo import models, fields, api
+from odoo.exceptions import UserError, ValidationError
+from psycopg2 import sql, DatabaseError
+
+from werkzeug import utils
+
+class opendons_payment_batch(models.Model):
+ _name = 'opendons_payment_batch'
+ _description = 'manage payment batch'
+
+ payment_mode=fields.Selection([('check', 'Check'),('credit card', 'Credit Card'),('pa', 'Prélèvement automatique') ],'Payment mode', default='check', required=True)
+
+
+ # product_id=fields.Many2one(
+ # 'product.product',
+ # string='Product',
+ # index=True,
+ # track_visibility='onchange',
+ # ondelete='restrict'
+ # )
+
+
+ operation_id=fields.Many2one(
+ 'opendons.operation',
+ string='Operation',
+
+ index=True,
+ track_visibility='onchange',
+ ondelete='restrict'
+ )
+ segment_id=fields.Many2one(
+ 'opendons.segment',
+ string='Segment',
+
+ index=True,
+ track_visibility='onchange',
+ ondelete='restrict'
+ )
+
+ # donation_ids = fields.One2many(
+ # 'donation.donation',
+ # 'payment_batch_id',
+ # string='donation',
+ # track_visibility='onchange')
+
+
+ payment_count=fields.Integer(string='payments count', readonly=True)
+ payment_input=fields.Char('Input field')
+
+ # payment_lines = fields.One2many(
+ # 'opendons_payment_batch.lines',
+ # 'payment_batch_id',
+ # string='Payment lines',
+ # track_visibility='onchange')
+
+ def action_ajouter_payment(self):
+
+ return True
+
+ class opendons_payment_batch_lines(models.Model):
+ _name = 'opendons_payment_batch.lines'
+ _description = 'manage payment batch lines'
+ _inherits = {
+ 'donation.donation': 'donation_id',
+ }
+
+ # payment_batch_id = fields.Many2one(
+ # 'opendons_payment_batch',
+ # string='Payment Batch',
+ # ondelete='set null'
+ # )
+
\ No newline at end of file
diff --git a/models/returnmail.py b/models/returnmail.py
new file mode 100644
index 0000000..edfd4fb
--- /dev/null
+++ b/models/returnmail.py
@@ -0,0 +1,84 @@
+# -*- coding: utf-8 -*-
+
+from odoo import models, fields, api
+from odoo.exceptions import UserError, ValidationError
+from psycopg2 import sql, DatabaseError
+
+from werkzeug import utils
+
+class opendons_returnmail(models.Model):
+ _name = 'opendons_returnmail'
+ _description = 'manage return mail'
+
+ return_type=fields.Selection(string='Type',
+ selection=[
+ ('npai', 'NPAI'),
+ ('decedee','Décédée'),
+ ('refusee','Refusée')
+ ],default='npai')
+
+ return_count=fields.Integer(string='returns count', readonly=True)
+ return_input=fields.Char('Input field')
+
+ npai_lines = fields.One2many(
+ 'opendons_returnmail.npai',
+ 'returnmail_id',
+ string='NPAI',
+ track_visibility='onchange')
+ #related_npai_partner_id = fields.Many2one(related='returnmailnpai_ids.partner_id')
+ def action_ajouter_npai(self):
+
+ data=self.return_input.split(';')
+ vals={}
+ vals['partner_id']=data[0]
+ vals['operation_id']=data[1]
+ vals['segment_id']=data[2]
+ vals['returnmail_id']=self.id
+
+ p=self.env['res.partner'].search_count([('id','=',int(vals['partner_id']))])
+ if p==0 : raise UserError("ce contact n'existe pas")
+
+ op=self.env['opendons.operation'].search_count([('id','=',int(vals['operation_id']))])
+ if op==0 : raise UserError("cette operation n'existe pas")
+
+ seg=self.env['opendons.segment'].search_count([('id','=',int(vals['segment_id']))])
+ if seg==0 : raise UserError("ce segment n'existe pas")
+
+
+ res=self.env['opendons_returnmail.npai'].create(vals)
+ self.env.cr.commit()
+
+class opendons_returnmailNpai(models.Model):
+ _name = 'opendons_returnmail.npai'
+ _description = 'gestion des retours NPAI'
+
+ returnmail_id = fields.Many2one(
+ 'opendons_returnmail',
+ string='return mail',
+ ondelete='set null'
+ )
+ partner_id=fields.Many2one(
+ 'res.partner',
+ string='Partner',
+ required=True,
+ index=True,
+ track_visibility='onchange',
+ ondelete='restrict'
+ )
+ operation_id=fields.Many2one(
+ 'opendons.operation',
+ string='Operation',
+ required=True,
+ index=True,
+ track_visibility='onchange',
+ ondelete='restrict'
+ )
+ segment_id=fields.Many2one(
+ 'opendons.segment',
+ string='Segment',
+ required=True,
+ index=True,
+ track_visibility='onchange',
+ ondelete='restrict'
+ )
+
diff --git a/views/direct_debit.xml b/views/direct_debit.xml
new file mode 100644
index 0000000..e69de29
diff --git a/views/payment_batch.xml b/views/payment_batch.xml
new file mode 100644
index 0000000..7b40162
--- /dev/null
+++ b/views/payment_batch.xml
@@ -0,0 +1,64 @@
+
+
+
+ opendons_payment_batch list
+ opendons_payment_batch
+
+
+
+
+
+
+
+
+
+
+
+
+ opendons_payment_batch Form
+ opendons_payment_batch
+
+
+
+
+
+
+ Payment batch
+ opendons_payment_batch
+ tree,form
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/views/returnmail.xml b/views/returnmail.xml
new file mode 100644
index 0000000..1432d73
--- /dev/null
+++ b/views/returnmail.xml
@@ -0,0 +1,63 @@
+
+
+
+
+ opendons_returnmail list
+ opendons_returnmail
+
+
+
+
+
+
+
+
+
+
+
+
+ opendons_returnmail Form
+ opendons_returnmail
+
+
+
+
+
+
+
+
+ return mail
+ opendons_returnmail
+ tree,form
+
+
+
+
+
+
\ No newline at end of file