From a4836b6f8960a49d2224cf85ad9ec587261ecce5 Mon Sep 17 00:00:00 2001 From: Joel Grand-Guillaume Date: Tue, 18 Dec 2012 20:51:26 +0100 Subject: [PATCH] [MIGR] Adapt views, fix import and depedencies --- account_statement_ext/__openerp__.py | 2 +- account_statement_ext/statement.py | 18 ++- account_statement_ext/statement_view.xml | 144 ++++++++++------------- 3 files changed, 69 insertions(+), 95 deletions(-) diff --git a/account_statement_ext/__openerp__.py b/account_statement_ext/__openerp__.py index 4b169e61..e002962f 100644 --- a/account_statement_ext/__openerp__.py +++ b/account_statement_ext/__openerp__.py @@ -25,7 +25,7 @@ 'maintainer': 'Camptocamp', 'category': 'Finance', 'complexity': 'normal', #easy, normal, expert - 'depends': ['account'], + 'depends': ['account','report_webkit'], 'description': """ Improve the basic bank statement, by adding various new features, and help dealing with huge volume of reconciliation through payment offices such as Paypal, Lazer, diff --git a/account_statement_ext/statement.py b/account_statement_ext/statement.py index 4e84f1bc..b3c7c19f 100644 --- a/account_statement_ext/statement.py +++ b/account_statement_ext/statement.py @@ -19,12 +19,11 @@ # ############################################################################## -from tools.translate import _ -import datetime -import netsvc -logger = netsvc.Logger() +import time + from openerp.osv.orm import Model, fields -from openerp.osv import fields, osv +from openerp.tools.translate import _ +import openerp.addons.decimal_precision as dp class AccountStatementProfil(Model): """ @@ -216,7 +215,7 @@ class AccountBankSatement(Model): """ if context is None: context = {} - res = super(AccountBankSatement, self)._prepare_move_line_vals(self, cr, uid, st_line, move_id, debit, + res = super(AccountBankSatement, self)._prepare_move_line_vals(cr, uid, st_line, move_id, debit, credit, currency_id = currency_id, amount_currency = amount_currency, account_id = account_id, analytic_id = analytic_id, partner_id = partner_id, context = context) ctx = context.copy() @@ -225,7 +224,7 @@ class AccountBankSatement(Model): res.update({'period_id': period_id}) return res - def _get_counter_part_partner(sefl, cr, uid, st_line, context=None): + def _get_counter_part_partner(self, cr, uid, st_line, context=None): """ We change the move line generated from the lines depending on the profile: - If partner_id is set and force_partner_on_bank is ticked, we'll let the partner of each line @@ -236,11 +235,10 @@ class AccountBankSatement(Model): create the move from. :return: int/long of the res.partner to use as counterpart """ + bank_partner_id = super(AccountBankSatement, self)._get_counter_part_partner(cr, uid, st_line, context=context) # GET THE RIGHT PARTNER ACCORDING TO THE CHOSEN PROFIL if st_line.statement_id.profile_id.force_partner_on_bank: bank_partner_id = st_line.statement_id.profile_id.partner_id.id - else: - bank_partner_id = ((st_line.partner_id) and st_line.partner_id.id) or False return bank_partner_id def _get_st_number_period_profile(self, cr, uid, date, profile_id): @@ -329,7 +327,7 @@ class AccountBankSatement(Model): 'name': st_number, 'balance_end_real': st.balance_end }, context=context) - self.log(cr, uid, st.id, _('Statement %s is confirmed, journal items are created.') % (st_number,)) + self.message_post(cr, uid, [st.id], body=_('Statement %s confirmed, journal items were created.') % (st_number,), context=context) return self.write(cr, uid, ids, {'state':'confirm'}, context=context) def get_account_for_counterpart(self, cursor, uid, diff --git a/account_statement_ext/statement_view.xml b/account_statement_ext/statement_view.xml index fdca3ddd..8892ee5d 100644 --- a/account_statement_ext/statement_view.xml +++ b/account_statement_ext/statement_view.xml @@ -73,32 +73,20 @@ - - account.bank.statement.line.inherit - account.bank.statement - - - - - - - - account.bank.statement.search account.bank.statement - search - + - + @@ -124,76 +112,64 @@ - - - account.bank.statement.form - account.bank.statement - - form - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + account.bank.statement.form + account.bank.statement + + form + + + + + + + + + + + + + + + + + + # Make balance visible or not depending on profile + + {'invisible':[('balance_check','=',False)]} + + + {'invisible':[('balance_check','=',False)]} + + + + + + + + + + + + + # Adapt onchange signature + + + + + + + + + + + + + + + +