From 47b61670808204d41e8163d75b88a82006b6f411 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 22 Jun 2022 16:35:18 +0000 Subject: [PATCH] operation batch export --- __manifest__.py | 4 +- controllers/portal.py | 5 +- models/__init__.py | 4 +- models/donation.py | 26 +----- models/donation_lines.py | 0 models/donation_print_email_history.py | 2 +- models/donation_recurring_template_letter.py | 1 + models/donation_tax_receipt.py | 22 +---- models/duplicate.py | 10 +-- models/email.py | 56 ------------- models/operation.py | 39 +++------ models/operation_batch_export.py | 40 +++++++++ models/partner.py | 33 +------- models/phone.py | 56 ------------- models/res_partner_bank.py | 49 +---------- models/returnmail.py | 2 +- models/template_rf.py | 9 +- security/ir.model.access.csv | 5 +- views/address.xml | 88 -------------------- views/operation_batch_export.xml | 25 ++++++ views/partner.xml | 20 +---- views/phone.xml | 64 -------------- views/recurring_donation.xml | 18 ---- 23 files changed, 100 insertions(+), 478 deletions(-) delete mode 100644 models/donation_lines.py delete mode 100644 models/email.py create mode 100644 models/operation_batch_export.py delete mode 100644 models/phone.py delete mode 100644 views/address.xml create mode 100644 views/operation_batch_export.xml delete mode 100644 views/phone.xml diff --git a/__manifest__.py b/__manifest__.py index b2132ae..b2ba3eb 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -27,15 +27,13 @@ 'security/security.xml', 'views/settings.xml', 'views/qualifier.xml', - 'views/address.xml', - 'views/email.xml', - 'views/phone.xml', 'views/donation.xml', 'views/product.xml', 'views/recurring_donation.xml', 'data/recurring_donation_configuration.xml', 'views/relationship.xml', 'views/operation.xml', + 'views/operation_batch_export.xml', 'views/templates.xml', 'views/returnmail.xml', 'views/bank_deposit.xml', diff --git a/controllers/portal.py b/controllers/portal.py index 03e590c..a53d090 100644 --- a/controllers/portal.py +++ b/controllers/portal.py @@ -121,10 +121,7 @@ class PortalOpendons(CustomerPortal): def print_id(self, **kw): tr=request.env['donation.tax.receipt'].sudo().search([('id','=',int(kw['id']))]) if tr: - - #mise à jour du champ htl à imprimer - #tr.update_print_pdf() - + pdf = request.env.ref('opendons.report_donation_tax_receipt').sudo()._render_qweb_pdf([tr.id])[0] pdfhttpheaders = [('Content-Type', 'application/pdf'), ('Content-Length', len(pdf))] return request.make_response(pdf, headers=pdfhttpheaders) diff --git a/models/__init__.py b/models/__init__.py index 161f444..0512fd1 100644 --- a/models/__init__.py +++ b/models/__init__.py @@ -3,10 +3,8 @@ from . import qualifier from . import partner from . import donation -from . import address -from . import email -from . import phone from . import operation +from . import operation_batch_export from . import operation_segment from . import operation_ensemble from . import operation_request diff --git a/models/donation.py b/models/donation.py index eb9b0b8..05247cf 100644 --- a/models/donation.py +++ b/models/donation.py @@ -123,7 +123,7 @@ class DonationDonation(models.Model): rec.payment_state=rec.payment_batch_id.state if rec.source_recurring_id: rec.payment_state='deposited_in_bank' - #accounting_deposit_date=fields.Datetime(related='payment_batch_id.accounting_deposit_date') + year_donation_date=fields.Integer('Year donation date',compute='_compute_year_donation_date',store=True) print_email_history_ids=fields.One2many( @@ -245,19 +245,6 @@ class DonationDonation(models.Model): return res - - # def write(self, vals): - - # res = super(DonationDonation, self).write(vals) - # #si don hors lot de paiement, création auto du lot de paiement - # if not self.payment_batch_id and self.state!='draft' : - # vals={} - # vals['payment_mode_id']=int(self.payment_mode_id) - # batch=self.env['opendons_payment_batch'].create(vals) - # batch.write({'donation_ids':[(4,int(self.id))]}) - - - @api.onchange("partner_id") def donation_partner_direct_debit_change(self): @@ -662,17 +649,9 @@ class DonationDonation(models.Model): def payment_order_action(self): - #payorder=self.env['account.payment.order'].search([('state','=','draft')],order='create_date desc', limit=2) action = self.env.ref("account_payment_order.account_payment_order_inbound_action").sudo().read([])[0] - # action.update( - # { - # "view_mode": "tree", - # "view_type":"list", - # #"res_id": payorder[0].id if payorder[0].id else False - # } - # ) return action @@ -729,9 +708,6 @@ class DonationDonation(models.Model): } - - # self.write({"recurring_template": "stopped"}) - # self.write({"stopped_date": fields.Date.context_today(self)}) @api.depends("state", "partner_id", "move_id", "recurring_template") def name_get(self): diff --git a/models/donation_lines.py b/models/donation_lines.py deleted file mode 100644 index e69de29..0000000 diff --git a/models/donation_print_email_history.py b/models/donation_print_email_history.py index f5b9d04..72f4cf8 100644 --- a/models/donation_print_email_history.py +++ b/models/donation_print_email_history.py @@ -3,7 +3,7 @@ from odoo.exceptions import UserError,Warning class opendons_donation_print_email_history(models.Model): _name = 'opendons.donation.print_email_history' - _description = 'history of print or email sent to partner' + _description = 'history of print or email sent to partner from recurring donation screen after rejected payment' chanel=fields.Char('chanel') date_action=fields.Date('date action') diff --git a/models/donation_recurring_template_letter.py b/models/donation_recurring_template_letter.py index bff9ba1..f91d4df 100644 --- a/models/donation_recurring_template_letter.py +++ b/models/donation_recurring_template_letter.py @@ -4,6 +4,7 @@ from odoo.exceptions import UserError,Warning class DonationRecurringTemplateLetter(models.Model): _inherit = "donation.donation" + _description = 'manage recurring templates letters' template_pa_id=fields.Many2one('opendons.template_pa_letter', '(e)mail to send') html_content=fields.Html('html content',compute='pa_html_content') diff --git a/models/donation_tax_receipt.py b/models/donation_tax_receipt.py index 05b4257..8625c08 100644 --- a/models/donation_tax_receipt.py +++ b/models/donation_tax_receipt.py @@ -5,7 +5,7 @@ class DonationTaxReceipt(models.Model): _inherit = "donation.tax.receipt" template_rf_id=fields.Many2one('opendons.template_rf', 'RF template') - #html_content=fields.Html('html content',) + html_content_print=fields.Html('html content print') pdf_file=fields.Binary("PDF") @@ -14,7 +14,7 @@ class DonationTaxReceipt(models.Model): def create(self, values): res = super(DonationTaxReceipt, self).create(values) - #génération du RF au format HTML pour impression pdf + #generate the taxreceipt in HTMl format for PDF print template_rf=self.env['opendons.template_rf'].search([('type_rf','=','generic'),('active','=',True)],limit=1) html_content_print=template_rf.html_content @@ -40,15 +40,6 @@ class DonationTaxReceipt(models.Model): def _html_content_rf(self): self.html_content=self.template_rf_id.html_content - #affichage du RF depuis l'espace donateur - def update_print_pdf(self): - html_content_print=self.html_content - html_content_print=html_content_print.replace('{{partner_id.name}}',self.partner_id.name) - html_content_print=html_content_print.replace('{{partner_id.firstname}}',self.partner_id.firstname) - html_content_print=html_content_print.replace('{{donor_id}}',self.partner_id.donor_id) - html_content_print=html_content_print.replace('{{adresse}}',self.update_adresse()) - - self.html_content_print=html_content_print def update_adresse(self): p=self.env['res.partner'].search([('id','=',int(self.partner_id))]) @@ -79,7 +70,7 @@ class DonationTaxReceipt(models.Model): result='

'+title+' '+name+' '+firstname+'
'+street+street2+locality+'
'+zip+' '+city+'
'+country+'

' - #result="

Monsieur Dupont Marcel
7 avenue de la Marne

75016 Paris

" + #result="

Monsieur Dupont Marcel
7 avenue de la Marne

75016 Paris

" return result class DonationTaxReceiptPrint(models.TransientModel): @@ -91,12 +82,7 @@ class DonationTaxReceiptPrint(models.TransientModel): if not self.receipt_ids: raise UserError(_("There are no tax receipts to print.")) today = fields.Date.context_today(self) - #self.receipt_ids.write({"print_date": today}) - - #update htm to print in receipts - for receipt_id in self.receipt_ids: - - receipt_id.update_print_pdf() + return self.env.ref("opendons.report_donation_tax_receipt").report_action(self.receipt_ids) \ No newline at end of file diff --git a/models/duplicate.py b/models/duplicate.py index 25fd6b6..1a9d0e2 100644 --- a/models/duplicate.py +++ b/models/duplicate.py @@ -65,7 +65,7 @@ class opendons_duplicate_partner(models.Model): p=self.env.cr.dictfetchall() except: raise Warning(sql) - #raise Warning(json.dumps(p)) + for pp in p: @@ -116,9 +116,7 @@ class opendons_duplicate_partner(models.Model): { "domain": [("id", "in", dbl_partner_ids)], "limit": 5000, - #'view_mode': 'tree', - #'view_type': 'list' - #"context":{'view_mode':'tree,form'} + } ) return action @@ -168,7 +166,7 @@ class opendons_duplicate_rule_line(models.Model): @api.model def field_selection(self): field_list=self.env['res.partner'].fields_get() - #raise Warning(json.dumps(field_list)) + result=[] for key in field_list: result.append((key,key)) @@ -178,7 +176,7 @@ class opendons_duplicate_rule_line(models.Model): def field_selection2(self): field_list=self.env['res.partner'].fields_get() - #raise Warning(json.dumps(field_list)) + result=[] for key in field_list: result.append((key,key)) diff --git a/models/email.py b/models/email.py deleted file mode 100644 index bf4c558..0000000 --- a/models/email.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- - -from odoo import models, fields, api -from odoo.exceptions import UserError, ValidationError -from psycopg2 import sql, DatabaseError -from odoo.tools.safe_eval import safe_eval, datetime - -from werkzeug import utils - - - -class opendons_partneremail(models.Model): - _name = 'opendons.partneremail' - _description = 'emails du contact' - _inherit = ['mail.thread'] - - email = fields.Char() - - active=fields.Boolean(string='active',default=True,track_visibility='always') - date_active=fields.Date(readonly=True,string='Date active',track_visibility='always') - date_inactive=fields.Date(readonly=True,string='Date inactive',track_visibility='always') - - partner_id = fields.Many2one( - 'res.partner', - string='partner', - required=True, - index=True, - readonly=True, - track_visibility='onchange', - ondelete='restrict' - ) - - def write(self,vals): - date_active=False - date_inactive=False - for val in vals: - if val=='active' and not vals['active']: - date_inactive=fields.Date.context_today(self) - if val=='active' and vals['active']: - date_inactive=False - date_active=fields.Date.context_today(self) - - - vals['date_inactive']=date_inactive - vals['date_active']=date_active - - - res = super(opendons_partneremail, self).write(vals) - - #Your code goes here - return res - - - - - diff --git a/models/operation.py b/models/operation.py index 444e9d8..efec8c3 100644 --- a/models/operation.py +++ b/models/operation.py @@ -132,6 +132,7 @@ class opendons_operation(models.Model): def csv_export_operation(self): + tmstp=secrets.token_hex(16) csv_filename='/tmp/export_'+tmstp+'.csv' with open(csv_filename, mode='w') as file: @@ -143,8 +144,6 @@ class opendons_operation(models.Model): writer.writerow(['id','key','name','firstname','title','street','street2','city','cp','country_name','operation','segment']) #sélections des contacts - res=self.select_partner_operation() - segments=self.env['opendons.segment'].search(['&',('operation_id','=',self.id),('exclusion','=',False)]) #extraction des contacts sélectionnés sur chaque segment @@ -171,7 +170,7 @@ class opendons_operation(models.Model): writer.writerow([id,key,name,firstname,title,street,street2,city,cp,country_name,operation,segment]) with open(csv_filename, 'r', encoding="utf-8") as f2: - # file encode and store in a variable ‘data’ + data = str.encode(f2.read(), 'utf-8') @@ -179,9 +178,9 @@ class opendons_operation(models.Model): self.document_fname='operation'+str(self.id)+'.csv' self.exported_date=fields.Date.context_today(self) os.unlink(csv_filename) - #raise Warning('Traitement terminé') + - return + return True def select_partner_operation(self): @@ -204,19 +203,16 @@ class opendons_operation(models.Model): mailing_domain='["&","!",'+segexcl.mailing_domain[1:-1]+','+ sg.mailing_domain[1:-1]+']' - #["&","!",["id","=",1],["id","=",2]] - #["&","!",[["id","=",1]],[["id","=",1]]] - #raise UserError(str(mailing_domain)) - #try: + partners=self.env['res.partner'].search(eval(mailing_domain)) - #except: - # raise UserError(mailing_domain) + + #ajouts des contact à l'opération self.partner_ids=partners #ajouts des contacts au segment sg.partner_ids=partners - #sg_1=sg + else: #on doit exclure tous les contacts qui pourraient être dans les segments précédent sg_up=self.env['opendons.segment'].search(['&',('operation_id','=',self.id),('sequence','<',int(sg.sequence))]) @@ -244,7 +240,10 @@ class opendons_operation(models.Model): sg_1=sg i=i+1 + self.exported_date=fields.Date.context_today(self, readonly=True) + + return True @@ -353,18 +352,4 @@ class opendons_operation(models.Model): return dup_operation -class opendons_operation_batch_export(models.Model): - _name = 'opendons.operation.batch_export' - _description = 'lot export' - - name=fields.Char(string='Name',required=True,track_visibility='always') - operation_id = fields.Many2one( - 'opendons.operation', - String='Operation', - index=True, - readonly=True, - track_visibility='onchange', - ondelete='cascade' - ) - - \ No newline at end of file + \ No newline at end of file diff --git a/models/operation_batch_export.py b/models/operation_batch_export.py new file mode 100644 index 0000000..02769df --- /dev/null +++ b/models/operation_batch_export.py @@ -0,0 +1,40 @@ +from odoo import models, fields, api,_ +from odoo.exceptions import UserError, ValidationError,Warning +from psycopg2 import sql, DatabaseError + +from werkzeug import utils +import json +import logging +import xlwt +from io import BytesIO +import base64 +import csv +import os,secrets + + + + +class opendons_operation_batch_export(models.Model): + _name = 'opendons.operation.batch_export' + _description = 'lot export' + + name=fields.Char(string='Name',required=True,track_visibility='always') + operation_id = fields.Many2one( + 'opendons.operation', + String='Operation', + index=True, + readonly=True, + track_visibility='onchange', + ondelete='cascade' + ) + partner_ids = fields.Many2many('res.partner', 'partner_batch_export_rel', 'partner_id', 'batch_export__id', string='partners') + csv_export = fields.Binary('csv export', filters='.csv', readonly=True) + document_fname=fields.Char() + exported_date=fields.Date(string='Exported Date',track_visibility='always', readonly=True) + + def csv_export_batch(self): + + segments=self.env['opendons.segment'].search([('operation_id','=',int(self.operation_id)),('batch_export_id','=',int(self.id))]) + #récupération des contacts sélectionnées et lié au segments du batch + + return True \ No newline at end of file diff --git a/models/partner.py b/models/partner.py index 6c6726f..6fabdf0 100644 --- a/models/partner.py +++ b/models/partner.py @@ -76,19 +76,14 @@ class partner(models.Model): ) - address_ids = fields.One2many( - 'opendons.partneraddress', - 'partner_id', - string='Address', - readonly=True - ) + request_ids = fields.Many2many('opendons.request', 'request_partner_rel', 'partner_id', 'request_id', string='requests',ondelete='cascade') operation_ids = fields.Many2many('opendons.operation', 'operation_partner_rel', 'partner_id', 'operation_id', string='operations',ondelete='cascade' ) operation_excl_ids = fields.Many2many('opendons.operation', 'operation_excl_partner_rel', 'partner_id', 'operation_id', string='excluded operations',ondelete='cascade') segment_ids = fields.Many2many('opendons.segment', 'segment_partner_rel', 'partner_id', 'segment_id', string='segments',ondelete='cascade') - + export_batch_ids=fields.Many2many('opendons.batch', 'export_batch_partner_rel', 'partner_id', 'export_batch_id', string='export batchs',ondelete='cascade') address_count = fields.Integer( compute='_compute_address_count', @@ -106,28 +101,8 @@ class partner(models.Model): string="# of Relationship", readonly=True ) - email_ids = fields.One2many( - 'opendons.partneremail', - 'partner_id', - string='Email', - readonly=True - ) - email_count = fields.Integer( - compute='_compute_email_count', - string="# of email", - readonly=True - ) - phone_ids = fields.One2many( - 'opendons.partnerphone', - 'partner_id', - string='Phone', - readonly=True - ) - phone_count = fields.Integer( - compute='_compute_phone_count', - string="# of phone", - readonly=True - ) + + recurring_donation_count = fields.Integer( compute='_compute_recurring_donation_count', string="# of recurring donation", diff --git a/models/phone.py b/models/phone.py deleted file mode 100644 index 1de95ee..0000000 --- a/models/phone.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- - -from odoo import models, fields, api -from odoo.exceptions import UserError, ValidationError -from psycopg2 import sql, DatabaseError -from odoo.tools.safe_eval import safe_eval, datetime - -from werkzeug import utils - - - -class opendons_partnerphone(models.Model): - _name = 'opendons.partnerphone' - _description = 'telephones du contact' - _inherit = ['mail.thread'] - - phone = fields.Char() - - active=fields.Boolean(string='active',default=True,track_visibility='always') - date_active=fields.Date(readonly=True,string='Date active',track_visibility='always') - date_inactive=fields.Date(readonly=True,string='Date inactive',track_visibility='always') - - partner_id = fields.Many2one( - 'res.partner', - string='partner', - required=True, - index=True, - readonly=True, - track_visibility='onchange', - ondelete='restrict' - ) - - def write(self,vals): - date_active=False - date_inactive=False - for val in vals: - if val=='active' and not vals['active']: - date_inactive=fields.Date.context_today(self) - if val=='active' and vals['active']: - date_inactive=False - date_active=fields.Date.context_today(self) - - - vals['date_inactive']=date_inactive - vals['date_active']=date_active - - - res = super(opendons_partnerphone, self).write(vals) - - #Your code goes here - return res - - - - - diff --git a/models/res_partner_bank.py b/models/res_partner_bank.py index c31ca79..052f556 100644 --- a/models/res_partner_bank.py +++ b/models/res_partner_bank.py @@ -21,51 +21,4 @@ class ResPartnerBank(models.Model): - # class ResPartnerBank(models.Model): - # _inherit = 'res.partner.bank' - - # @api.onchange('acc_number') - # def _onchange_acc_number(self): - # #validation IBAN - # #https://www.regextester.com/115565 - # if self.acc_number: - - # regex = re.compile(r'(^(?:(?:IT|SM)\d{2}[A-Z]\d{22}|CY\d{2}[A-Z]\d{23}|NL\d{2}[A-Z]{4}\d{10}|LV\d{2}[A-Z]{4}\d{13}|(?:BG|BH|GB|IE)\d{2}[A-Z]{4}\d{14}|GI\d{2}[A-Z]{4}\d{15}|RO\d{2}[A-Z]{4}\d{16}|KW\d{2}[A-Z]{4}\d{22}|MT\d{2}[A-Z]{4}\d{23}|NO\d{13}|(?:DK|FI|GL|FO)\d{16}|MK\d{17}|(?:AT|EE|KZ|LU|XK)\d{18}|(?:BA|HR|LI|CH|CR)\d{19}|(?:GE|DE|LT|ME|RS)\d{20}|IL\d{21}|(?:AD|CZ|ES|MD|SA)\d{22}|PT\d{23}|(?:BE|IS)\d{24}|(?:FR|MR|MC)\d{25}|(?:AL|DO|LB|PL)\d{26}|(?:AZ|HU)\d{27}|(?:GR|MU)\d{28})$)+') - - # if not re.fullmatch(regex, self.acc_number): - # raise Warning('Invalid IBAN') - - # @api.constrains('acc_number') - # def _onchange_acc_number(self): - # #validation IBAN - # #https://www.regextester.com/115565 - # if self.acc_number: - - # regex = re.compile(r'(^(?:(?:IT|SM)\d{2}[A-Z]\d{22}|CY\d{2}[A-Z]\d{23}|NL\d{2}[A-Z]{4}\d{10}|LV\d{2}[A-Z]{4}\d{13}|(?:BG|BH|GB|IE)\d{2}[A-Z]{4}\d{14}|GI\d{2}[A-Z]{4}\d{15}|RO\d{2}[A-Z]{4}\d{16}|KW\d{2}[A-Z]{4}\d{22}|MT\d{2}[A-Z]{4}\d{23}|NO\d{13}|(?:DK|FI|GL|FO)\d{16}|MK\d{17}|(?:AT|EE|KZ|LU|XK)\d{18}|(?:BA|HR|LI|CH|CR)\d{19}|(?:GE|DE|LT|ME|RS)\d{20}|IL\d{21}|(?:AD|CZ|ES|MD|SA)\d{22}|PT\d{23}|(?:BE|IS)\d{24}|(?:FR|MR|MC)\d{25}|(?:AL|DO|LB|PL)\d{26}|(?:AZ|HU)\d{27}|(?:GR|MU)\d{28})$)+') - - # if not re.fullmatch(regex, self.acc_number): - - # raise Warning('Invalid IBAN') - - # @api.onchange('acc_number') - # def _onchange_acc_number(self): - # #validation IBAN - # #https://www.regextester.com/115565 - # if self.acc_number: - - # regex = re.compile(r'(^(?:(?:IT|SM)\d{2}[A-Z]\d{22}|CY\d{2}[A-Z]\d{23}|NL\d{2}[A-Z]{4}\d{10}|LV\d{2}[A-Z]{4}\d{13}|(?:BG|BH|GB|IE)\d{2}[A-Z]{4}\d{14}|GI\d{2}[A-Z]{4}\d{15}|RO\d{2}[A-Z]{4}\d{16}|KW\d{2}[A-Z]{4}\d{22}|MT\d{2}[A-Z]{4}\d{23}|NO\d{13}|(?:DK|FI|GL|FO)\d{16}|MK\d{17}|(?:AT|EE|KZ|LU|XK)\d{18}|(?:BA|HR|LI|CH|CR)\d{19}|(?:GE|DE|LT|ME|RS)\d{20}|IL\d{21}|(?:AD|CZ|ES|MD|SA)\d{22}|PT\d{23}|(?:BE|IS)\d{24}|(?:FR|MR|MC)\d{25}|(?:AL|DO|LB|PL)\d{26}|(?:AZ|HU)\d{27}|(?:GR|MU)\d{28})$)+') - - # if not re.fullmatch(regex, self.acc_number): - # raise Warning('Invalid IBAN') - - # @api.constrains('acc_number') - # def _onchange_acc_number(self): - # #validation IBAN - # #https://www.regextester.com/115565 - # if self.acc_number: - - # regex = re.compile(r'(^(?:(?:IT|SM)\d{2}[A-Z]\d{22}|CY\d{2}[A-Z]\d{23}|NL\d{2}[A-Z]{4}\d{10}|LV\d{2}[A-Z]{4}\d{13}|(?:BG|BH|GB|IE)\d{2}[A-Z]{4}\d{14}|GI\d{2}[A-Z]{4}\d{15}|RO\d{2}[A-Z]{4}\d{16}|KW\d{2}[A-Z]{4}\d{22}|MT\d{2}[A-Z]{4}\d{23}|NO\d{13}|(?:DK|FI|GL|FO)\d{16}|MK\d{17}|(?:AT|EE|KZ|LU|XK)\d{18}|(?:BA|HR|LI|CH|CR)\d{19}|(?:GE|DE|LT|ME|RS)\d{20}|IL\d{21}|(?:AD|CZ|ES|MD|SA)\d{22}|PT\d{23}|(?:BE|IS)\d{24}|(?:FR|MR|MC)\d{25}|(?:AL|DO|LB|PL)\d{26}|(?:AZ|HU)\d{27}|(?:GR|MU)\d{28})$)+') - - # if not re.fullmatch(regex, self.acc_number): - - # raise Warning('Invalid IBAN') \ No newline at end of file + \ No newline at end of file diff --git a/models/returnmail.py b/models/returnmail.py index bca1d3e..611e31a 100644 --- a/models/returnmail.py +++ b/models/returnmail.py @@ -25,7 +25,7 @@ class opendons_returnmail(models.Model): 'returnmail_id', string='NPAI', track_visibility='onchange') - #related_npai_partner_id = fields.Many2one(related='returnmailnpai_ids.partner_id') + company_id = fields.Many2one( "res.company", string="Company", diff --git a/models/template_rf.py b/models/template_rf.py index dcefce2..4d6258e 100644 --- a/models/template_rf.py +++ b/models/template_rf.py @@ -19,11 +19,4 @@ class opendons_template_rf(models.Model): html_content=fields.Html('Html content') type_rf=fields.Selection(string='type',selection=[('generic','Generic'),('affectation','Affectation'),('high amount','High amount')]) - - -# class opendons_type_template_rf(models.Model): -# _name = 'opendons.type_template_rf' -# _description = 'manage type rf template' - -# name=fields.Char('name') -# type_rf=fields.Selection(string='type',selection=[('generic','Generic'),('affectation','Affectation'),('high amount','High amount')]) \ No newline at end of file + \ No newline at end of file diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv index deb08fa..ad1a4ae 100644 --- a/security/ir.model.access.csv +++ b/security/ir.model.access.csv @@ -2,11 +2,9 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_opendons_qualifier_qualifier,opendons_qualifier.qualifier,model_opendons_qualifier_qualifier,donation.group_donation_manager,1,1,1,1 access_opendons_qualifier_category,opendons_qualifier.category,model_opendons_qualifier_category,donation.group_donation_manager,1,1,1,1 access_opendons_qualifier_partnerqualifier,opendons_qualifier.partnerqualifier,model_opendons_qualifier_partnerqualifier,donation.group_donation_manager,1,1,1,1 -access_opendons_partneraddress,opendons.partneraddress,model_opendons_partneraddress,donation.group_donation_manager,1,1,1,1 access_opendons_operations,opendons.operations,model_opendons_operation,donation.group_donation_manager,1,1,1,1 access_opendons_operation_batch_export,opendons.operation_batch_export,model_opendons_operation_batch_export,donation.group_donation_manager,1,1,1,1 - access_opendons_segments,opendons.segments,model_opendons_segment,donation.group_donation_manager,1,1,1,1 access_opendons_ensembles,opendons.ensembles,model_opendons_ensemble,donation.group_donation_manager,1,1,1,1 access_opendons_requests,opendons.requests,model_opendons_request,donation.group_donation_manager,1,1,1,1 @@ -14,8 +12,7 @@ access_opendons_requests,opendons.requests,model_opendons_request,donation.group access_opendons_relationship_partner,opendons_relationship.partner,model_opendons_relationship_partner,donation.group_donation_manager,1,1,1,1 access_opendons_relationship_nature,opendons_relationship.nature,model_opendons_relationship_nature,donation.group_donation_manager,1,1,1,1 access_opendons_relationship_type,opendons_relationship.type,model_opendons_relationship_type,donation.group_donation_manager,1,1,1,1 -access_opendons_partneremail,opendons_partneremail,model_opendons_partneremail,donation.group_donation_manager,1,1,1,1 -access_opendons_partnerphone,opendons_partnerphone,model_opendons_partnerphone,donation.group_donation_manager,1,1,1,1 + access_opendons_returnmail,opendons_returnmail,model_opendons_returnmail,donation.group_donation_manager,1,1,1,1 access_opendons_returnmailnpai,opendons_returnmailnpai,model_opendons_returnmail_npai,donation.group_donation_manager,1,1,1,1 diff --git a/views/address.xml b/views/address.xml deleted file mode 100644 index 5902442..0000000 --- a/views/address.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - opendons_partneraddress list - opendons.partneraddress - - - - - - - - - - - - - - - - opendons_partneraddress.search - opendons.partneraddress - - - - - - - - - opendons_partneraddress Form - opendons.partneraddress - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-
-
-
- - - - - - - partneraddresses - opendons.partneraddress - tree,form - - -
-
\ No newline at end of file diff --git a/views/operation_batch_export.xml b/views/operation_batch_export.xml new file mode 100644 index 0000000..d62256c --- /dev/null +++ b/views/operation_batch_export.xml @@ -0,0 +1,25 @@ + + + opendons_batch_export Form + opendons.operation.batch_export + + +
+ +
+
+ + + + + + %b-%d-%Y + +
+ + + +
+
+
\ No newline at end of file diff --git a/views/partner.xml b/views/partner.xml index 23576cb..59e3469 100644 --- a/views/partner.xml +++ b/views/partner.xml @@ -28,26 +28,8 @@ [('value_type','=', 'boolean'),('actif','=',True)] - - Addresses - opendons.partneraddress - tree,form,graph - {'search_default_partner_id': active_id} - - - Emails - opendons.partneremail - tree,form,graph - {'search_default_partner_id': active_id} - - - - phones - opendons.partnerphone - tree,form,graph - {'search_default_partner_id': active_id} - + diff --git a/views/phone.xml b/views/phone.xml deleted file mode 100644 index eb2b1b8..0000000 --- a/views/phone.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - opendons_partnerphone list - opendons.partnerphone - - - - - - - - - - - opendons_partnerphone.search - opendons.partnerphone - - - - - - - - - opendons_partnerphone Form - opendons.partnerphone - -
- - - - - - - - - - - - -
- - -
-
-
-
- - - - - - - partnerphones - opendons.partnerphone - tree,form - - -
-
\ No newline at end of file diff --git a/views/recurring_donation.xml b/views/recurring_donation.xml index 7c8b7cf..279475f 100644 --- a/views/recurring_donation.xml +++ b/views/recurring_donation.xml @@ -25,10 +25,6 @@ - - @@ -142,15 +138,6 @@ - - - - -
@@ -198,9 +185,6 @@ Recurring Donations donation.donation tree,form,pivot,graph - [('recurring_template', '!=', False)] @@ -255,6 +239,4 @@ sequence="30"/> - - \ No newline at end of file