From 5f0f36bde161a5fa6f90c703de94217635a30c60 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 11 Apr 2022 18:27:27 +0000 Subject: [PATCH] Recu fisval PDF --- __manifest__.py | 7 ++-- models/__init__.py | 1 - models/operation.py | 20 ++++----- models/partner.py | 12 +++--- report/report_donationtax.xml | 79 +++++++++++++++++++++++++++++++++++ views/partner.xml | 1 + 6 files changed, 100 insertions(+), 20 deletions(-) create mode 100644 report/report_donationtax.xml diff --git a/__manifest__.py b/__manifest__.py index 6d0a92c..a151eb2 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -20,7 +20,7 @@ 'version': '0.1', # any module necessary for this one to work correctly - 'depends': ['base','mail','mass_mailing','donation_recurring','website_sale'], + 'depends': ['base','donation_recurring','website_sale'], # always loaded 'data': [ @@ -34,12 +34,13 @@ 'views/relationship.xml', 'views/operation.xml', 'views/templates.xml', - 'views/mail_mail.xml', + #'views/mail_mail.xml', 'views/returnmail.xml', 'views/payment_batch.xml', 'views/website_sale.xml', 'views/aggregate.xml', - 'wizard/operation_duplicate_wizard.xml' + 'wizard/operation_duplicate_wizard.xml', + 'report/report_donationtax.xml' #'views/website_donation.xml' diff --git a/models/__init__.py b/models/__init__.py index 8c307a7..e690b10 100644 --- a/models/__init__.py +++ b/models/__init__.py @@ -7,7 +7,6 @@ from . import address from . import email from . import phone from . import operation -from . import mailing_mailing from . import relationship from . import returnmail from . import payment_batch diff --git a/models/operation.py b/models/operation.py index 7fc35fd..37576f1 100644 --- a/models/operation.py +++ b/models/operation.py @@ -13,16 +13,16 @@ import os,secrets _logger = logging.getLogger(__name__) -MASS_MAILING_BUSINESS_MODELS = [ - 'crm.lead', - 'event.registration', - 'hr.applicant', - 'res.partner', - 'event.track', - 'sale.order', - 'mailing.list', - 'mailing.contact' -] +# MASS_MAILING_BUSINESS_MODELS = [ +# 'crm.lead', +# 'event.registration', +# 'hr.applicant', +# 'res.partner', +# 'event.track', +# 'sale.order', +# 'mailing.list', +# 'mailing.contact' +# ] class opendons_operation(models.Model): _name = 'opendons.operation' diff --git a/models/partner.py b/models/partner.py index 84600b2..b1d2a6a 100644 --- a/models/partner.py +++ b/models/partner.py @@ -157,9 +157,9 @@ class partner(models.Model): ) key=fields.Integer( - #compute='_compute_key', + compute='_compute_key', string="Key", - #store=True, + store=True, readonly=True ) @@ -216,7 +216,7 @@ class partner(models.Model): @api.constrains('phone') def _onchange_phone(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 @@ -267,7 +267,7 @@ class partner(models.Model): #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): @@ -279,8 +279,8 @@ class partner(models.Model): #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})$)+') + + 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): diff --git a/report/report_donationtax.xml b/report/report_donationtax.xml new file mode 100644 index 0000000..9e5518e --- /dev/null +++ b/report/report_donationtax.xml @@ -0,0 +1,79 @@ + + + + + + + \ No newline at end of file diff --git a/views/partner.xml b/views/partner.xml index 590839a..1efe78e 100644 --- a/views/partner.xml +++ b/views/partner.xml @@ -79,6 +79,7 @@ +