diff --git a/account_statement_base_completion/statement.py b/account_statement_base_completion/statement.py index ef43001c..b45f5d8c 100644 --- a/account_statement_base_completion/statement.py +++ b/account_statement_base_completion/statement.py @@ -39,11 +39,11 @@ class ErrorTooManyPartner(Exception): class AccountStatementProfil(Model): """ - Extend the class to add rules per profil that will match at least the partner, + Extend the class to add rules per profile that will match at least the partner, but it could also be used to match other values as well. """ - _inherit = "account.statement.profil" + _inherit = "account.statement.profile" _columns={ # @Akretion : For now, we don't implement this features, but this would probably be there: @@ -115,7 +115,7 @@ class AccountStatementCompletionRule(Model): _columns={ 'sequence': fields.integer('Sequence', help="Lower means paresed first."), 'name': fields.char('Name', size=128), - 'profile_ids': fields.many2many('account.statement.profil', + 'profile_ids': fields.many2many('account.statement.profile', rel='as_rul_st_prof_rel', string='Related statement profiles'), 'function_to_call': fields.selection(_get_functions, 'Method'), @@ -296,7 +296,7 @@ class AccountStatementLine(Model): the statement line or {}. The first dict has statement line ID as a key: {117009: {'partner_id': 100997, 'account_id': 489L}} """ - profile_obj = self.pool.get('account.statement.profil') + profile_obj = self.pool.get('account.statement.profile') st_obj = self.pool.get('account.bank.statement.line') res={} errors_stack = [] diff --git a/account_statement_base_completion/statement_view.xml b/account_statement_base_completion/statement_view.xml index 5153a40b..4d3e2ee8 100644 --- a/account_statement_base_completion/statement_view.xml +++ b/account_statement_base_completion/statement_view.xml @@ -48,8 +48,8 @@ - account.statement.profil.view - account.statement.profil + account.statement.profile.view + account.statement.profile form diff --git a/account_statement_base_import/__openerp__.py b/account_statement_base_import/__openerp__.py index 912bee06..16bf4658 100644 --- a/account_statement_base_import/__openerp__.py +++ b/account_statement_base_import/__openerp__.py @@ -41,7 +41,7 @@ * ref : the SO number, INV number or any matching ref found. It'll be used as reference in the generated entries and will be useful for reconciliation process * date : date of the payment - * amount : amount paid in the currency of the journal used in the importation profil + * amount : amount paid in the currency of the journal used in the importation profile * commission_amount : amount of the comission for each line * label : the comunication given by the payment office, used as communication in the generated entries. diff --git a/account_statement_base_import/statement.py b/account_statement_base_import/statement.py index abaceb2a..2c1dcc86 100644 --- a/account_statement_base_import/statement.py +++ b/account_statement_base_import/statement.py @@ -31,7 +31,7 @@ import sys import traceback class AccountStatementProfil(Model): - _inherit = "account.statement.profil" + _inherit = "account.statement.profile" def get_import_type_selection(self, cr, uid, context=None): @@ -48,7 +48,7 @@ class AccountStatementProfil(Model): 'last_import_date': fields.datetime("Last Import Date"), 'rec_log': fields.text('log', readonly=True), 'import_type': fields.selection(get_import_type_selection, 'Type of import', required=True, - help = "Choose here the method by which you want to import bank statement for this profil."), + help = "Choose here the method by which you want to import bank statement for this profile."), } @@ -152,7 +152,7 @@ class AccountStatementProfil(Model): statement_obj = self.pool.get('account.bank.statement') statement_line_obj = self.pool.get('account.bank.statement.line') attachment_obj = self.pool.get('ir.attachment') - prof_obj = self.pool.get("account.statement.profil") + prof_obj = self.pool.get("account.statement.profile") if not profile_id: raise osv.except_osv( _("No Profile !"), diff --git a/account_statement_base_import/statement_view.xml b/account_statement_base_import/statement_view.xml index b3ced577..884ed868 100644 --- a/account_statement_base_import/statement_view.xml +++ b/account_statement_base_import/statement_view.xml @@ -4,8 +4,8 @@ - account.statement.profil.view - account.statement.profil + account.statement.profile.view + account.statement.profile form diff --git a/account_statement_base_import/wizard/import_statement.py b/account_statement_base_import/wizard/import_statement.py index 574a8979..23bb6c3b 100644 --- a/account_statement_base_import/wizard/import_statement.py +++ b/account_statement_base_import/wizard/import_statement.py @@ -33,7 +33,7 @@ class CreditPartnerStatementImporter(osv.osv_memory): def default_get(self, cr, uid, fields, context=None): if context is None: context = {} res = {} - if (context.get('active_model', False) == 'account.statement.profil' and + if (context.get('active_model', False) == 'account.statement.profile' and context.get('active_ids', False)): ids = context['active_ids'] assert len(ids) == 1, 'You cannot use this on more than one profile !' @@ -43,7 +43,7 @@ class CreditPartnerStatementImporter(osv.osv_memory): return res _columns = { - 'profile_id': fields.many2one('account.statement.profil', + 'profile_id': fields.many2one('account.statement.profile', 'Import configuration parameter', required=True), 'input_statement': fields.binary('Statement file', required=True), @@ -76,7 +76,7 @@ class CreditPartnerStatementImporter(osv.osv_memory): def onchange_profile_id(self, cr, uid, ids, profile_id, context=None): res={} if profile_id: - c = self.pool.get("account.statement.profil").browse(cr,uid,profile_id) + c = self.pool.get("account.statement.profile").browse(cr,uid,profile_id) res = {'value': {'partner_id': c.partner_id and c.partner_id.id or False, 'journal_id': c.journal_id and c.journal_id.id or False, 'commission_account_id': \ c.commission_account_id and c.commission_account_id.id or False, @@ -101,7 +101,7 @@ class CreditPartnerStatementImporter(osv.osv_memory): importer = self.browse(cursor, uid, req_id, context) ftype = self._check_extension(importer.file_name) sid = self.pool.get( - 'account.statement.profil').statement_import( + 'account.statement.profile').statement_import( cursor, uid, False, diff --git a/account_statement_ext/statement.py b/account_statement_ext/statement.py index b35ebc95..b5b783ff 100644 --- a/account_statement_ext/statement.py +++ b/account_statement_ext/statement.py @@ -32,7 +32,7 @@ class AccountStatementProfil(Model): bank statement, and related generated entries. It defines the journal to use, the partner and commision account and so on. """ - _name = "account.statement.profil" + _name = "account.statement.profile" _description = "Statement Profil" _columns = { @@ -85,9 +85,9 @@ class AccountBankSatement(Model): """ We improve the bank statement class mostly for : - Removing the period and compute it from the date of each line. - - Allow to remove the balance check depending on the chosen profil + - Allow to remove the balance check depending on the chosen profile - Report errors on confirmation all at once instead of crashing onr by one - - Add a profil notion that can change the generated entries on statement + - Add a profile notion that can change the generated entries on statement confirmation. For this, we had to override quite some long method and we'll need to maintain them up to date. Changes are point up by '#Chg' comment. @@ -96,7 +96,7 @@ class AccountBankSatement(Model): _inherit = "account.bank.statement" _columns = { - 'profile_id': fields.many2one('account.statement.profil', + 'profile_id': fields.many2one('account.statement.profile', 'Profil', required=True, readonly=True, states={'draft': [('readonly', False)]}), 'credit_partner_id': fields.related( 'profile_id', @@ -129,8 +129,8 @@ class AccountBankSatement(Model): """Need to pass the journal_id in vals anytime because of account.cash.statement need it.""" if 'profile_id' in vals: - profil_obj = self.pool.get('account.statement.profil') - profile = profil_obj.browse(cr,uid,vals['profile_id'],context) + profile_obj = self.pool.get('account.statement.profile') + profile = profile_obj.browse(cr,uid,vals['profile_id'],context) vals['journal_id'] = profile.journal_id.id return super(AccountBankSatement, self).create(cr, uid, vals, context=context) @@ -185,7 +185,7 @@ class AccountBankSatement(Model): Override a large portion of the code to compute the periode for each line instead of taking the period of the whole statement. Remove the entry posting on generated account moves. - We change the move line generated from the lines depending on the profil: + We change the move line generated from the lines depending on the profile: - If receivable_account_id is set, we'll use it instead of the "partner" one - If partner_id is set, we'll us it for the commission (when imported throufh the wizard) - If partner_id is set and force_partner_on_bank is ticked, we'll let the partner of each line @@ -310,19 +310,19 @@ class AccountBankSatement(Model): account_move_obj.post(cr, uid, [move_id], context=context) return move_id - def _get_st_number_period_profil(self, cr, uid, date, profile_id): + def _get_st_number_period_profile(self, cr, uid, date, profile_id): """ Retrieve the name of bank statement from sequence, according to the period - corresponding to the date passed in args. Add a prefix if set in the profil. + corresponding to the date passed in args. Add a prefix if set in the profile. :param: date: date of the statement used to compute the right period - :param: int/long: profile_id: the account.statement.profil ID from which to take the + :param: int/long: profile_id: the account.statement.profile ID from which to take the bank_statement_prefix for the name :return: char: name of the bank statement (st_number) """ year = self.pool.get('account.period').browse(cr, uid, self._get_period(cr, uid, date)).fiscalyear_id.id - profile = self.pool.get('account.statement.profil').browse(cr,uid, profile_id) + profile = self.pool.get('account.statement.profile').browse(cr,uid, profile_id) c = {'fiscalyear_id': year} obj_seq = self.pool.get('ir.sequence') journal_sequence_id = profile.journal_id.sequence_id and profile.journal_id.sequence_id.id or False @@ -364,7 +364,7 @@ class AccountBankSatement(Model): st_number = st.name else: # Begin Changes - st_number = self._get_st_number_period_profil(cr, uid, st.date, st.profile_id.id) + st_number = self._get_st_number_period_profile(cr, uid, st.date, st.profile_id.id) # End Changes for line in st.move_line_ids: if line.state <> 'valid': @@ -466,7 +466,7 @@ class AccountBankSatement(Model): def balance_check(self, cr, uid, st_id, journal_type='bank', context=None): """ - Balance check depends on the profil. If no check for this profil is required, + Balance check depends on the profile. If no check for this profile is required, return True and do nothing, otherwise call super. :param int/long st_id: ID of the concerned account.bank.statement @@ -488,7 +488,7 @@ class AccountBankSatement(Model): """ if not profile_id: return {} - import_config = self.pool.get("account.statement.profil").browse(cr,uid,profile_id) + import_config = self.pool.get("account.statement.profile").browse(cr,uid,profile_id) journal_id = import_config.journal_id.id account_id = import_config.journal_id.default_debit_account_id.id credit_partner_id = import_config.partner_id and import_config.partner_id.id or False @@ -531,7 +531,7 @@ class AccountBankSatementLine(Model): def get_values_for_line(self, cr, uid, profile_id = False, partner_id = False, line_type = False, amount = False, context = None): """ Return the account_id to be used in the line of a bank statement. It'll base the result as follow: - - If a receivable_account_id is set in the profil, return this value and type = general + - If a receivable_account_id is set in the profile, return this value and type = general - Elif line_type is given, take the partner receivable/payable property (payable if type= supplier, receivable otherwise) - Elif amount is given, take the partner receivable/payable property (receivable if amount >= 0.0, @@ -558,9 +558,9 @@ class AccountBankSatementLine(Model): obj_partner = self.pool.get('res.partner') obj_stat = self.pool.get('account.bank.statement') receiv_account = pay_account = account_id = False - # If profil has a receivable_account_id, we return it in any case + # If profile has a receivable_account_id, we return it in any case if profile_id: - profile = self.pool.get("account.statement.profil").browse(cr,uid,profile_id) + profile = self.pool.get("account.statement.profile").browse(cr,uid,profile_id) if profile.receivable_account_id: res['account_id'] = profile.receivable_account_id.id res['type'] = 'general' diff --git a/account_statement_ext/statement_view.xml b/account_statement_ext/statement_view.xml index 62a51b89..fdca3ddd 100644 --- a/account_statement_ext/statement_view.xml +++ b/account_statement_ext/statement_view.xml @@ -28,8 +28,8 @@ - account.statement.profil.view - account.statement.profil + account.statement.profile.view + account.statement.profile form
@@ -48,8 +48,8 @@ - account.statement.profil.view - account.statement.profil + account.statement.profile.view + account.statement.profile tree @@ -64,14 +64,14 @@ - + Bank Statements Profile - account.statement.profil + account.statement.profile form tree,form - + account.bank.statement.line.inherit @@ -136,7 +136,7 @@ - + @@ -145,7 +145,7 @@ - + @@ -199,7 +199,7 @@ diff --git a/account_statement_transactionid_import/statement.py b/account_statement_transactionid_import/statement.py index 5cfef3ca..1163ae6d 100644 --- a/account_statement_transactionid_import/statement.py +++ b/account_statement_transactionid_import/statement.py @@ -23,7 +23,7 @@ from openerp.osv.orm import Model, fields from openerp.osv import fields, osv class AccountStatementProfil(Model): - _inherit = "account.statement.profil" + _inherit = "account.statement.profile" def get_import_type_selection(self, cr, uid, context=None): @@ -37,7 +37,7 @@ class AccountStatementProfil(Model): _columns = { 'import_type': fields.selection(get_import_type_selection, 'Type of import', required=True, - help = "Choose here the method by which you want to import bank statement for this profil."), + help = "Choose here the method by which you want to import bank statement for this profile."), }