From a4c9d28e8d67e9187e257c891d4726cd7d2755ad Mon Sep 17 00:00:00 2001 From: root Date: Sun, 23 Jul 2023 18:32:13 +0200 Subject: [PATCH] account export+fix account.move --- models/account_move.py | 22 +++- views/account.xml | 3 + wizard/accounting_file_wizard.py | 189 +++++++++++++++++++----------- wizard/accounting_file_wizard.xml | 1 + 4 files changed, 145 insertions(+), 70 deletions(-) diff --git a/models/account_move.py b/models/account_move.py index a3bb1e4..a6f57b0 100755 --- a/models/account_move.py +++ b/models/account_move.py @@ -15,13 +15,15 @@ class AccountMove(models.Model): transaction_amount=fields.Float(compute='_compute_transaction_amount') systempay_ref=fields.Text(compute='_compute_systempay_ref') date_compta=fields.Datetime('date import',default=False) + date_compta_end_of_stay=fields.Datetime('date import',default=False) date_compta_out_refund=fields.Datetime('date import',default=False) out_invoice_id=fields.Many2one('account.move' ,ondelete="cascade",domain="[('partner_id','=',partner_id),('move_type','=','out_invoice'),('state','!=','paid')]") def _compute_description(self): for a in self: - description='' + + a.description='' for line in a.line_ids: a.description=line.product_id.name break @@ -55,5 +57,23 @@ class AccountMove(models.Model): if r_s[0]==" 'vads_order_id'": a.systempay_ref=r_s[1].replace("'","") break + def button_event_registration(self): + reg=self.env['event.registration'].search(['|','|','|',('invoice_id','=',self.id),\ + ('down_payment_invoice_id','=',self.id),\ + ('balance_invoice_id','=',self.id),\ + ('end_of_stay_invoice_id','=',self.id)]) + + if reg : + event_id=reg.event_id + action=self.env.ref('event.action_registration').read()[0] + action.update({ + 'view_mode': 'form', + 'res_id': reg.id, + 'view_type':'form', + "views": [[False, "form"]], + + + }) + return action diff --git a/views/account.xml b/views/account.xml index a772215..44dfd45 100644 --- a/views/account.xml +++ b/views/account.xml @@ -36,6 +36,9 @@ + +