diff --git a/__manifest__.py b/__manifest__.py index 129bd86..0dedff4 100755 --- a/__manifest__.py +++ b/__manifest__.py @@ -68,7 +68,8 @@ 'views/asset.xml', 'views/payment_transaction.xml', 'views/donation.xml', - 'views/mediatheque.xml' + 'views/mediatheque.xml', + 'views/account.xml' #'views/payment_views.xml' diff --git a/models/__init__.py b/models/__init__.py index d4bd4e8..093aae0 100755 --- a/models/__init__.py +++ b/models/__init__.py @@ -19,7 +19,7 @@ from . import booking_donation #from . import booking_sale_order from . import event_media_link from . import mailing_list -#from . import account_move +from . import account_move from . import res_users from . import membership_import from . import online_payment diff --git a/models/account_move.py b/models/account_move.py index 4e734f0..53c187b 100755 --- a/models/account_move.py +++ b/models/account_move.py @@ -5,24 +5,55 @@ import logging from werkzeug import utils import re _logger = logging.getLogger(__name__) +import json class AccountMove(models.Model): _inherit = 'account.move' - def write(self,vals): - res=super(AccountMove, self).write(vals) - - m=self.env['kalachakra.membership'].sudo().search([('invoice_id','=',int(self.id))]) - - if m: - if self.payment_state == 'not_paid': - m.payment_state='not paid' - m.state='draft' - else: - m.payment_state='paid' - m.state='done' - _logger.error("errK2"+str(m.payment_state)) - - return res - + description=fields.Char(compute='_compute_description') + transaction_date=fields.Datetime(compute='_compute_transaction_date') + transaction_amount=fields.Float(compute='_compute_transaction_amount') + systempay_ref=fields.Text(compute='_compute_systempay_ref') + + + def _compute_description(self): + + for a in self: + description='' + for line in a.line_ids: + a.description=line.product_id.name + break + + def _compute_transaction_date(self): + + for a in self: + a.transaction_date=False + for t in a.transaction_ids: + a.transaction_date=t.date + break + + def _compute_transaction_amount(self): + + for a in self: + a.transaction_amount=False + for t in a.transaction_ids: + a.transaction_amount=t.amount + break + + def _compute_systempay_ref(self): + + for a in self: + a.systempay_ref=False + for t in a.transaction_ids: + if t.systempay_raw_data: + raw1=t.systempay_raw_data.split(",") + vads_order_id_s=raw1[21].split(":") + # raw1=raw1.replace("\r", "") + # raw1=raw1.replace("'","\"") + # raise Warning(raw1) + # raw=json.loads(raw1) + + a.systempay_ref=vads_order_id_s[1].replace("'","") + break + diff --git a/models/donation.py b/models/donation.py index 41fe5aa..189e208 100755 --- a/models/donation.py +++ b/models/donation.py @@ -39,7 +39,7 @@ class DonationDonation(models.Model): invoice_id=fields.Many2one('account.move','invoice') transaction_id=fields.Many2one('payment.transaction','payment transaction') state_done=fields.Boolean(compute='_compute_donation_state',store=True) - + affectation=fields.Char(compute='_compute_affectation') # @api.depends('transaction_id.state') # def transaction_state(self): # _logger.error("onchange_transaction_state") @@ -55,6 +55,19 @@ class DonationDonation(models.Model): # membership=request.env['kalachakra.membership'].sudo().search([('id','=',int(membership_id))]) # if membership:membership.state='done' + def _compute_affectation(self): + + i=1 + for d in self: + affectation='' + for line in d.line_ids: + if i==1: + affectation=line.product_id.name + else: + affectation=affectation+ ' ' +line.product_id.name + i=i+1 + d.affectation=affectation + @api.depends('invoice_id.payment_state','transaction_id.state') def _compute_donation_state(self): for d in self: diff --git a/views/account.xml b/views/account.xml new file mode 100644 index 0000000..7df4f81 --- /dev/null +++ b/views/account.xml @@ -0,0 +1,20 @@ + + + + kala.account.tree + account.move + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/views/donation.xml b/views/donation.xml index 2088876..d34b5ca 100755 --- a/views/donation.xml +++ b/views/donation.xml @@ -18,4 +18,22 @@ + + + opendons.donation.tree + donation.donation + + + + + + + + + + + + + + \ No newline at end of file diff --git a/views/event.xml b/views/event.xml index 164aaac..afb6cb5 100755 --- a/views/event.xml +++ b/views/event.xml @@ -1,6 +1,24 @@ + + Events + ir.actions.act_window + event.event + tree,form,pivot,graph,kanban,calendar + + {'search_default_upcoming': 1} + [('individual_booking_event', '=', False)] + + + Add a new event + + Schedule and organize your events efficiently: + track registrations and participations, automate the confirmation emails, sell tickets, etc. + + + + event_tag_category_view_form_inherit_kalachakra event.tag.category
+ Add a new event +
+ Schedule and organize your events efficiently: + track registrations and participations, automate the confirmation emails, sell tickets, etc. +