diff --git a/models/donation.py b/models/donation.py index 4fd1956..8b6af90 100755 --- a/models/donation.py +++ b/models/donation.py @@ -48,6 +48,7 @@ class DonationDonation(models.Model): source_import=fields.Char('source import') date_import=fields.Date('date import',default=False) date_compta=fields.Datetime('date import',default=False) + name2=fields.Char('name2',compute='_compute_name2', store=True) # @api.depends('transaction_id.state') # def transaction_state(self): # _logger.error("onchange_transaction_state") @@ -63,6 +64,10 @@ class DonationDonation(models.Model): # membership=request.env['kalachakra.membership'].sudo().search([('id','=',int(membership_id))]) # if membership:membership.state='done' + def _compute_name2(self): + for d in self: + d.name2=d.partner_id.name+ ' ' + str(d.partner_id.firstname) + def _compute_affectation(self): i=1 @@ -318,4 +323,8 @@ class DonationDonation(models.Model): def fix_donation(self): #tax_receipt_total=0 for Donation pour favoriser le séjour des personnes à revenu modeste donation=self.env['donation.donation'].search([('tax_receipt_total','=',0),('state','=','done')]) - raise UserError(donation) \ No newline at end of file + raise UserError(donation) + + def update_donation_tax_receipt_option(self): + donation=self.env['donation.donation'].search([('tax_receipt_option','=','each')]) + donation.tax_receipt_option='annual' \ No newline at end of file diff --git a/models/event.py b/models/event.py index 28c3a8b..e20596d 100755 --- a/models/event.py +++ b/models/event.py @@ -112,7 +112,20 @@ class KalachakraEvent(models.Model): default['stage_id'] = stage_new.id return super(KalachakraEvent, self).copy(default) - + + def action_mass_mailing_attendees(self): + return { + 'name': 'Mass Mail Attendees', + 'type': 'ir.actions.act_window', + 'res_model': 'mailing.mailing', + 'view_mode': 'form', + 'target': 'current', + 'context': { + 'default_mailing_model_id': self.env.ref('event.model_event_registration').id, + 'default_mailing_domain': repr([('event_id', 'in', self.ids),('state','=','open')]) + }, + } + # def write(self,vals): # res = super(KalachakraEvent, self).write(vals) # #mise à jour du calendrier google si diff --git a/views/donation.xml b/views/donation.xml index 2da18c7..6f1c4c0 100755 --- a/views/donation.xml +++ b/views/donation.xml @@ -47,7 +47,13 @@ - + + + + + + + diff --git a/views/portal_templates.xml b/views/portal_templates.xml index d15a61f..4d36c35 100755 --- a/views/portal_templates.xml +++ b/views/portal_templates.xml @@ -95,4 +95,16 @@ + + \ No newline at end of file diff --git a/views/website_templates.xml b/views/website_templates.xml index f52ca8f..c52006b 100755 --- a/views/website_templates.xml +++ b/views/website_templates.xml @@ -7,6 +7,20 @@ + + \ No newline at end of file diff --git a/wizard/accounting_file_wizard.py b/wizard/accounting_file_wizard.py index 70dcf28..6b80415 100644 --- a/wizard/accounting_file_wizard.py +++ b/wizard/accounting_file_wizard.py @@ -187,7 +187,7 @@ class AccountingFileWizard(models.TransientModel): name=d.partner_id.name if not name : name='N/A' if not firstname: firstname=' ' - lib1=firstname[0]+' '+name + lib1=name+' '+firstname[0] lib1=self._file_format(lib1,12) #lib1=lib1[11] @@ -262,7 +262,7 @@ class AccountingFileWizard(models.TransientModel): name=m.partner_id.name if not name : name='N/A' if not firstname: firstname=' ' - lib1=firstname[0]+' '+name + lib1=name+' '+firstname[0] lib1=self._file_format(lib1,12) date_line=self._date_format(m.start_date) amount=m.amount @@ -331,7 +331,7 @@ class AccountingFileWizard(models.TransientModel): name=reg.partner_id.name if not name : name='N/A' if not firstname: firstname=' ' - lib1=firstname[0]+' '+name + lib1=name+' '+firstname[0] lib1=self._file_format(lib1,12) #date du paiement @@ -409,7 +409,7 @@ class AccountingFileWizard(models.TransientModel): name=reg.partner_id.name if not name : name='N/A' if not firstname: firstname=' ' - lib1=firstname[0]+' '+name + lib1=name+' '+firstname[0] lib1=self._file_format(lib1,12) lib2=self._file_format(reg.event_id.booking_product_id.name,13) lib=lib1+' '+lib2 @@ -534,7 +534,7 @@ class AccountingFileWizard(models.TransientModel): name=reg.partner_id.name if not name : name='N/A' if not firstname: firstname=' ' - lib1=firstname[0]+' '+name + lib1=name+' '+firstname[0] lib1=self._file_format(lib1,12) lib2=self._file_format(reg.event_id.booking_product_id.name,13) lib=lib1+' '+lib2 @@ -637,7 +637,7 @@ class AccountingFileWizard(models.TransientModel): name=reg.partner_id.name if not name : name='N/A' if not firstname: firstname=' ' - lib1=firstname[0]+' '+name + lib1=name+' '+firstname[0] lib1=self._file_format(lib1,12) lib2=self._file_format(reg.event_id.booking_product_id.name,13) lib=lib1+' '+lib2 @@ -711,7 +711,7 @@ class AccountingFileWizard(models.TransientModel): name=reg.partner_id.name if not name : name='N/A' if not firstname: firstname=' ' - lib1=firstname[0]+' '+name + lib1=name+' '+firstname[0] lib1=self._file_format(lib1,12) lib2=self._file_format(reg.event_id.booking_product_id.name,13) lib=lib1+' '+lib2 @@ -818,7 +818,7 @@ class AccountingFileWizard(models.TransientModel): name=invoice.partner_id.name if not name : name='N/A' if not firstname: firstname=' ' - lib1=firstname[0]+' '+name + lib1=name+' '+firstname[0] lib1=self._file_format(lib1,12) lines=self.env['account.move.line'].search([('move_id','=',int(invoice.id))],limit=1) @@ -866,7 +866,7 @@ class AccountingFileWizard(models.TransientModel): #_logger.error(name) if not name : name='N/A' if not firstname: firstname=' ' - lib1=firstname[0]+' '+name + lib1=name+' '+firstname[0] lib1=self._file_format(lib1,12) lib2='' diff --git a/wizard/accounting_file_wizard_cdr.py b/wizard/accounting_file_wizard_cdr.py index 2d35b04..56dfeb2 100644 --- a/wizard/accounting_file_wizard_cdr.py +++ b/wizard/accounting_file_wizard_cdr.py @@ -139,7 +139,7 @@ class CdrAccountingFileWizard(models.TransientModel): name=d.partner_id.name if not name : name='N/A' if not firstname: firstname=' ' - lib1=firstname[0]+' '+name + lib1=name+' '+firstname[0] lib1=self._file_format(lib1,12) #lib1=lib1[11] @@ -207,7 +207,7 @@ class CdrAccountingFileWizard(models.TransientModel): name=reg.partner_id.name if not name : name='N/A' if not firstname: firstname=' ' - lib1=firstname[0]+' '+name + lib1=name+' '+firstname[0] lib1=self._file_format(lib1,12) lib2=self._file_format(reg.event_id.booking_product_id.name,13) lib=lib1+' '+lib2 @@ -271,6 +271,10 @@ class CdrAccountingFileWizard(models.TransientModel): for reg in registration: + + tag_ids=reg.event_id.tag_ids + for tag in tag_ids: + if tag.name=='VOYAGES': continue if reg.event_id.booking_event: if reg.event_id.individual_booking_event: account_credit_number=self._file_format('754799',6) @@ -324,7 +328,7 @@ class CdrAccountingFileWizard(models.TransientModel): name=reg.partner_id.name if not name : name='N/A' if not firstname: firstname=' ' - lib1=firstname[0]+' '+name + lib1=name+' '+firstname[0] lib1=self._file_format(lib1,12) lib2=self._file_format(reg.event_id.booking_product_id.name,13) lib=lib1+' '+lib2 @@ -429,7 +433,7 @@ class CdrAccountingFileWizard(models.TransientModel): name=reg.partner_id.name if not name : name='N/A' if not firstname: firstname=' ' - lib1=firstname[0]+' '+name + lib1=name+' '+firstname[0] lib1=self._file_format(lib1,12) lib2=self._file_format(reg.event_id.booking_product_id.name,13) lib=lib1+' '+lib2 @@ -445,8 +449,8 @@ class CdrAccountingFileWizard(models.TransientModel): account_debit_number=self._file_format('170000',6) trans=self.env['payment.transaction'].search([('invoice_ids','in',reg.down_payment_invoice_id.id),('state','=','done')],limit=1) - if trans and trans.acquirer_id.name=='Paypal': account_debit_number=self._file_format(str(self.env['account.payment.mode'].search([('name','=','Paypal')]).fixed_journal_id.default_account_id.code),6) - if trans and trans.acquirer_id.name=='Paiement par carte bancaire': account_debit_number=self._file_format(str(self.env['account.payment.mode'].search([('name','=','CB')]).fixed_journal_id.default_account_id.code),6) + #if trans and trans.acquirer_id.name=='Paypal': account_debit_number=self._file_format(str(self.env['account.payment.mode'].search([('name','=','Paypal')]).fixed_journal_id.default_account_id.code),6) + #if trans and trans.acquirer_id.name=='Paiement par carte bancaire': account_debit_number=self._file_format(str(self.env['account.payment.mode'].search([('name','=','CB')]).fixed_journal_id.default_account_id.code),6) amount=reg.down_payment_invoice_id.amount_total date_line=self._date_format(reg.date_payment_down_payment) @@ -510,7 +514,7 @@ class CdrAccountingFileWizard(models.TransientModel): name=reg.partner_id.name if not name : name='N/A' if not firstname: firstname=' ' - lib1=firstname[0]+' '+name + lib1=name+' '+firstname[0] lib1=self._file_format(lib1,12) lib2=self._file_format(reg.event_id.booking_product_id.name,13) lib=lib1+' '+lib2 @@ -619,7 +623,7 @@ class CdrAccountingFileWizard(models.TransientModel): name=invoice.partner_id.name if not name : name='N/A' if not firstname: firstname=' ' - lib1=firstname[0]+' '+name + lib1=name+' '+firstname[0] lib1=self._file_format(lib1,12) lines=self.env['account.move.line'].search([('move_id','=',int(invoice.id))],limit=1) @@ -667,7 +671,7 @@ class CdrAccountingFileWizard(models.TransientModel): #_logger.error(name) if not name : name='N/A' if not firstname: firstname=' ' - lib1=firstname[0]+' '+name + lib1=name+' '+firstname[0] lib1=self._file_format(lib1,12) lib2=''