diff --git a/account_bank_statement_tax/i18n/hu.po b/account_bank_statement_tax/i18n/hu.po index 22b532144..4a55763cc 100644 --- a/account_bank_statement_tax/i18n/hu.po +++ b/account_bank_statement_tax/i18n/hu.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:01+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_bank_statement_tax #: model:ir.model,name:account_bank_statement_tax.model_account_bank_statement_line diff --git a/account_bank_statement_tax/i18n/nl.po b/account_bank_statement_tax/i18n/nl.po index d2a02e73c..63dbb956a 100644 --- a/account_bank_statement_tax/i18n/nl.po +++ b/account_bank_statement_tax/i18n/nl.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:01+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_bank_statement_tax #: model:ir.model,name:account_bank_statement_tax.model_account_bank_statement_line diff --git a/account_bank_statement_tax/i18n/pt_BR.po b/account_bank_statement_tax/i18n/pt_BR.po index f54e27b00..50e01e1f5 100644 --- a/account_bank_statement_tax/i18n/pt_BR.po +++ b/account_bank_statement_tax/i18n/pt_BR.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:01+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_bank_statement_tax #: model:ir.model,name:account_bank_statement_tax.model_account_bank_statement_line diff --git a/account_banking/__openerp__.py b/account_banking/__openerp__.py index ae6f66bc1..bb2385407 100644 --- a/account_banking/__openerp__.py +++ b/account_banking/__openerp__.py @@ -4,7 +4,7 @@ # Copyright (C) 2009 EduSense BV (). # (C) 2011 Therp BV (). # (C) 2011 Smile (). -# +# # All other contributions are (C) by their respective contributors # # All Rights Reserved @@ -26,7 +26,7 @@ { 'name': 'Account Banking', - 'version': '0.2', + 'version': '0.4', 'license': 'AGPL-3', 'author': 'Banking addons community', 'website': 'https://launchpad.net/banking-addons', diff --git a/account_banking/account_banking.py b/account_banking/account_banking.py index e0384aea3..971df55ee 100644 --- a/account_banking/account_banking.py +++ b/account_banking/account_banking.py @@ -298,17 +298,24 @@ class account_bank_statement(orm.Model): def _check_company_id(self, cr, uid, ids, context=None): """ Adapt this constraint method from the account module to reflect the - move of period_id to the statement line + move of period_id to the statement line: also check the periods of the + lines. Update the statement period if it does not have one yet. + Don't call super, because its check is integrated below and + it will break if a statement does not have any lines yet and + therefore may not have a period. """ for statement in self.browse(cr, uid, ids, context=context): + if (statement.period_id and + statement.company_id != statement.period_id.company_id): + return False for line in statement.line_ids: if (line.period_id and - statement.company_id.id != line.period_id.company_id.id): + statement.company_id != line.period_id.company_id): return False if not statement.period_id: statement.write({'period_id': line.period_id.id}) - return super(account_bank_statement, self)._check_company_id( - cr, uid, ids, context=context) + statement.refresh() + return True # Redefine the constraint, or it still refer to the original method _constraints = [ @@ -317,13 +324,24 @@ class account_bank_statement(orm.Model): ['journal_id','period_id']), ] - def _get_period(self, cr, uid, date, context=None): - ''' - Find matching period for date, not meant for _defaults. - ''' - period_obj = self.pool.get('account.period') - periods = period_obj.find(cr, uid, dt=date, context=context) - return periods and periods[0] or False + def _get_period(self, cr, uid, date=False, context=None): + """ + Used in statement line's _defaults, so it is always triggered + on installation or module upgrade even if there are no records + without a value. For that reason, we need + to be tolerant and allow for the situation in which no period + exists for the current date (i.e. when no date is specified). + + Cannot be used directly as a defaults method due to lp:1296229 + """ + local_ctx = dict(context or {}, account_period_prefer_normal=True) + try: + return self.pool.get('account.period').find( + cr, uid, dt=date, context=local_ctx)[0] + except except_osv: + if date: + raise + return False def _prepare_move( self, cr, uid, st_line, st_line_number, context=None): @@ -368,7 +386,7 @@ class account_bank_statement(orm.Model): # Take period from statement line and write to context # this will be picked up by the _prepare_move* methods period_id = self._get_period( - cr, uid, st_line.date, context=context) + cr, uid, date=st_line.date, context=context) localctx = context.copy() localctx['period_id'] = period_id @@ -424,7 +442,8 @@ class account_bank_statement(orm.Model): context=context) for st in self.browse(cr, uid, noname_ids, context=context): if st.journal_id.sequence_id: - period_id = self._get_period(cr, uid, st.date) + period_id = self._get_period( + cr, uid, date=st.date, context=context) year = self.pool.get('account.period').browse( cr, uid, period_id, context=context).fiscalyear_id.id c = {'fiscalyear_id': year} @@ -436,8 +455,6 @@ class account_bank_statement(orm.Model): return super(account_bank_statement, self).button_confirm_bank( cr, uid, ids, context) -account_bank_statement() - class account_voucher(orm.Model): _inherit = 'account.voucher' @@ -446,12 +463,11 @@ class account_voucher(orm.Model): if context is None: context = {} if not context.get('period_id') and context.get('move_line_ids'): - return self.pool.get('account.move.line').browse( - cr, uid , context.get('move_line_ids'), context=context)[0].period_id.id + move_line = self.pool.get('account.move.line').browse( + cr, uid , context.get('move_line_ids')[0], context=context) + return move_line.period_id.id return super(account_voucher, self)._get_period(cr, uid, context) -account_voucher() - class account_bank_statement_line(orm.Model): ''' @@ -464,28 +480,15 @@ class account_bank_statement_line(orm.Model): _inherit = 'account.bank.statement.line' _description = 'Bank Transaction' - def _get_period(self, cr, uid, context=None): - """ - Get a non-opening period for today or a date specified in - the context. + def _get_period(self, cr, uid, date=False, context=None): + return self.pool['account.bank.statement']._get_period( + cr, uid, date=date, context=context) - Used in this model's _defaults, so it is always triggered - on installation or module upgrade. For that reason, we need - to be tolerant and allow for the situation in which no period - exists for the current date (i.e. when no date is specified). + def _get_period_context(self, cr, uid, context=None): """ - if context is None: - context = {} - date = context.get('date', False) - local_ctx = dict(context) - local_ctx['account_period_prefer_normal'] = True - try: - return self.pool.get('account.period').find( - cr, uid, dt=date, context=local_ctx)[0] - except except_osv: - if date: - raise - return False + Workaround for lp:1296229, context is passed positionally + """ + return self._get_period(cr, uid, context=context) def _get_currency(self, cr, uid, context=None): ''' @@ -549,7 +552,7 @@ class account_bank_statement_line(orm.Model): } _defaults = { - 'period_id': _get_period, + 'period_id': _get_period_context, 'currency': _get_currency, } diff --git a/account_banking/account_banking_view.xml b/account_banking/account_banking_view.xml index ee1888578..e56f2e62e 100644 --- a/account_banking/account_banking_view.xml +++ b/account_banking/account_banking_view.xml @@ -250,7 +250,7 @@ - {'readonly': ['|', ('state', '!=', 'draft'), ('match_type', '!=', '')]} + {'readonly': ['|', ('state', '!=', 'draft'), ('match_type', '!=', False)]} diff --git a/account_banking/banking_import_transaction.py b/account_banking/banking_import_transaction.py index a9b9ac132..6ac4abfd4 100644 --- a/account_banking/banking_import_transaction.py +++ b/account_banking/banking_import_transaction.py @@ -74,7 +74,7 @@ class banking_import_transaction(orm.Model): ('type', '=', 'in_invoice'), ('partner_id', 'child_of', account_info.bank_partner_id.id), ('company_id', '=', account_info.company_id.id), - ('date_invoice', '=', trans.effective_date), + ('date_invoice', '=', trans.execution_date), ('reference', '=', reference), ('amount_total', '=', amount), ] @@ -101,7 +101,7 @@ class banking_import_transaction(orm.Model): period_id = period_id, journal_id = account_info.invoice_journal_id.id, account_id = account_info.bank_partner_id.property_account_payable.id, - date_invoice = trans.effective_date, + date_invoice = trans.execution_date, reference_type = 'none', reference = reference, name = trans.reference or trans.message, @@ -943,7 +943,7 @@ class banking_import_transaction(orm.Model): # Link accounting period period_id = banktools.get_period( - self.pool, cr, uid, transaction.effective_date, + self.pool, cr, uid, transaction.execution_date, company, results['log']) if not period_id: results['trans_skipped_cnt'] += 1 @@ -959,7 +959,7 @@ class banking_import_transaction(orm.Model): else: values = { 'name': '%s.%s' % (transaction.statement, transaction.transaction), - 'date': transaction.effective_date, + 'date': transaction.execution_date, 'amount': transaction.transferred_amount, 'statement_id': transaction.statement_id.id, 'note': transaction.message, @@ -1290,8 +1290,8 @@ class banking_import_transaction(orm.Model): 'reference': fields.char('reference', size=1024), 'local_account': fields.char('local_account', size=24), 'local_currency': fields.char('local_currency', size=16), - 'execution_date': fields.date('execution_date'), - 'effective_date': fields.date('effective_date'), + 'execution_date': fields.date('Posted date'), + 'value_date': fields.date('Value date'), 'remote_account': fields.char('remote_account', size=24), 'remote_currency': fields.char('remote_currency', size=16), 'exchange_rate': fields.float('exchange_rate'), @@ -1576,7 +1576,7 @@ class account_bank_statement_line(orm.Model): self.write( cr, uid, [st_line.id], { 'period_id': self._get_period( - cr, uid, {'date': st_line.date}) + cr, uid, date=st_line.date, context=context) }) st_line.refresh() # Generate the statement number, if it is not already done diff --git a/account_banking/i18n/account_banking.pot b/account_banking/i18n/account_banking.pot index 70aace93e..b1e913fd5 100644 --- a/account_banking/i18n/account_banking.pot +++ b/account_banking/i18n/account_banking.pot @@ -288,7 +288,7 @@ msgstr "" #. module: account_banking #: field:banking.import.transaction,execution_date:0 -msgid "execution_date" +msgid "Posted date" msgstr "" #. module: account_banking @@ -785,8 +785,8 @@ msgid "Payment Difference" msgstr "" #. module: account_banking -#: field:banking.import.transaction,effective_date:0 -msgid "effective_date" +#: field:banking.import.transaction,value_date:0 +msgid "Value date" msgstr "" #. module: account_banking diff --git a/account_banking/i18n/da.po b/account_banking/i18n/da.po index aa6d68319..86fcb7065 100644 --- a/account_banking/i18n/da.po +++ b/account_banking/i18n/da.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:01+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking #: field:account.bank.statement.line,reconcile_id:0 @@ -293,7 +293,7 @@ msgstr "" #. module: account_banking #: field:banking.import.transaction,execution_date:0 -msgid "execution_date" +msgid "Posted date" msgstr "" #. module: account_banking @@ -801,8 +801,8 @@ msgid "Payment Difference" msgstr "" #. module: account_banking -#: field:banking.import.transaction,effective_date:0 -msgid "effective_date" +#: field:banking.import.transaction,value_date:0 +msgid "Value date" msgstr "" #. module: account_banking diff --git a/account_banking/i18n/en.po b/account_banking/i18n/en.po index 5515eb7a5..602433e9d 100644 --- a/account_banking/i18n/en.po +++ b/account_banking/i18n/en.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:01+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking #: field:account.bank.statement.line,reconcile_id:0 @@ -292,7 +292,7 @@ msgstr "" #. module: account_banking #: field:banking.import.transaction,execution_date:0 -msgid "execution_date" +msgid "Posted date" msgstr "" #. module: account_banking @@ -807,8 +807,8 @@ msgid "Payment Difference" msgstr "" #. module: account_banking -#: field:banking.import.transaction,effective_date:0 -msgid "effective_date" +#: field:banking.import.transaction,value_date:0 +msgid "Value date" msgstr "" #. module: account_banking diff --git a/account_banking/i18n/es_ES.po b/account_banking/i18n/es_ES.po index 7e430e057..09ae7dfd0 100644 --- a/account_banking/i18n/es_ES.po +++ b/account_banking/i18n/es_ES.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking #: field:account.bank.statement.line,reconcile_id:0 @@ -293,7 +293,7 @@ msgstr "" #. module: account_banking #: field:banking.import.transaction,execution_date:0 -msgid "execution_date" +msgid "Posted date" msgstr "" #. module: account_banking @@ -801,8 +801,8 @@ msgid "Payment Difference" msgstr "" #. module: account_banking -#: field:banking.import.transaction,effective_date:0 -msgid "effective_date" +#: field:banking.import.transaction,value_date:0 +msgid "Value date" msgstr "" #. module: account_banking diff --git a/account_banking/i18n/hr.po b/account_banking/i18n/hr.po index bc32fed99..519348445 100644 --- a/account_banking/i18n/hr.po +++ b/account_banking/i18n/hr.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:01+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking #: field:account.bank.statement.line,reconcile_id:0 @@ -293,7 +293,7 @@ msgstr "" #. module: account_banking #: field:banking.import.transaction,execution_date:0 -msgid "execution_date" +msgid "Posted date" msgstr "" #. module: account_banking @@ -807,8 +807,8 @@ msgid "Payment Difference" msgstr "" #. module: account_banking -#: field:banking.import.transaction,effective_date:0 -msgid "effective_date" +#: field:banking.import.transaction,value_date:0 +msgid "Value date" msgstr "" #. module: account_banking diff --git a/account_banking/i18n/hu.po b/account_banking/i18n/hu.po index caaf530ab..c64267f6f 100644 --- a/account_banking/i18n/hu.po +++ b/account_banking/i18n/hu.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: banking-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2013-10-25 15:52+0000\n" -"PO-Revision-Date: 2014-01-26 14:44+0000\n" -"Last-Translator: krnkris \n" +"PO-Revision-Date: 2014-04-01 01:32+0000\n" +"Last-Translator: Stefan Rijnhart (Therp) \n" "Language-Team: Hungarian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:01+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking #: field:account.bank.statement.line,reconcile_id:0 @@ -303,7 +303,7 @@ msgstr "Tranzakciós adat" #. module: account_banking #: field:banking.import.transaction,execution_date:0 -msgid "execution_date" +msgid "Posted date" msgstr "execution_date" #. module: account_banking @@ -814,8 +814,8 @@ msgid "Payment Difference" msgstr "" #. module: account_banking -#: field:banking.import.transaction,effective_date:0 -msgid "effective_date" +#: field:banking.import.transaction,value_date:0 +msgid "Value date" msgstr "" #. module: account_banking @@ -1688,3 +1688,6 @@ msgstr "" #: field:banking.import.transaction,remote_bank_chips_uid:0 msgid "remote_bank_chips_uid" msgstr "" + +#~ msgid "execution_date" +#~ msgstr "execution_date" diff --git a/account_banking/i18n/nb.po b/account_banking/i18n/nb.po index 785fd134f..3e32a567d 100644 --- a/account_banking/i18n/nb.po +++ b/account_banking/i18n/nb.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:01+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking #: field:account.bank.statement.line,reconcile_id:0 @@ -293,7 +293,7 @@ msgstr "" #. module: account_banking #: field:banking.import.transaction,execution_date:0 -msgid "execution_date" +msgid "Posted date" msgstr "" #. module: account_banking @@ -801,8 +801,8 @@ msgid "Payment Difference" msgstr "" #. module: account_banking -#: field:banking.import.transaction,effective_date:0 -msgid "effective_date" +#: field:banking.import.transaction,value_date:0 +msgid "Value date" msgstr "" #. module: account_banking diff --git a/account_banking/i18n/nl.po b/account_banking/i18n/nl.po index b715cbad4..f224e8dc3 100644 --- a/account_banking/i18n/nl.po +++ b/account_banking/i18n/nl.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-10-25 15:52+0000\n" -"PO-Revision-Date: 2013-12-03 11:06+0000\n" +"PO-Revision-Date: 2014-06-18 13:58+0000\n" "Last-Translator: Erwin van der Ploeg (BAS Solutions) \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-06-19 06:39+0000\n" +"X-Generator: Launchpad (build 17048)\n" #. module: account_banking #: field:account.bank.statement.line,reconcile_id:0 @@ -301,8 +301,8 @@ msgstr "Transactie gegevens" #. module: account_banking #: field:banking.import.transaction,execution_date:0 -msgid "execution_date" -msgstr "execution_date" +msgid "Posted date" +msgstr "Boekdatum" #. module: account_banking #: field:banking.import.line,account_id:0 @@ -822,9 +822,9 @@ msgid "Payment Difference" msgstr "Betaalverschil" #. module: account_banking -#: field:banking.import.transaction,effective_date:0 -msgid "effective_date" -msgstr "effective_date" +#: field:banking.import.transaction,value_date:0 +msgid "Value date" +msgstr "Valutadatum" #. module: account_banking #: view:account.bank.statement.line:0 @@ -970,7 +970,7 @@ msgstr "Herzien" #: selection:banking.import.transaction,payment_option:0 #: selection:banking.transaction.wizard,payment_option:0 msgid "Reconcile Payment Balance" -msgstr "Afletteren betaal saldo" +msgstr "Afschrijven" #. module: account_banking #: code:addons/account_banking/account_banking.py:845 @@ -1135,7 +1135,7 @@ msgstr "duplicaat" #. module: account_banking #: field:banking.link_partner,name:0 msgid "Create partner with name" -msgstr "Create partner with name" +msgstr "Aanmaken relatie met de naam" #. module: account_banking #: selection:banking.import.line,transaction_type:0 @@ -1305,8 +1305,8 @@ msgid "" "matches or select a match manually below." msgstr "" "Meerdere overeenkomende boekingen zijn gevonden voor deze mutatie. U moet " -"één van deze boekingen uitkiezen, of de mutatie handmatig matchen verderop " -"in dit formulier." +"één van deze boekingen uitkiezen, of de mutatie handmatig handmatig te " +"matchen door te kiezen voor handmatige match." #. module: account_banking #: field:banking.transaction.wizard,writeoff_analytic_id:0 @@ -1742,3 +1742,9 @@ msgstr " (splits)" #: field:banking.import.transaction,remote_bank_chips_uid:0 msgid "remote_bank_chips_uid" msgstr "remote_bank_chips_uid" + +#~ msgid "execution_date" +#~ msgstr "execution_date" + +#~ msgid "effective_date" +#~ msgstr "effective_date" diff --git a/account_banking/i18n/pt_BR.po b/account_banking/i18n/pt_BR.po index 8589d7769..fc70be793 100644 --- a/account_banking/i18n/pt_BR.po +++ b/account_banking/i18n/pt_BR.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:01+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking #: field:account.bank.statement.line,reconcile_id:0 @@ -293,7 +293,7 @@ msgstr "" #. module: account_banking #: field:banking.import.transaction,execution_date:0 -msgid "execution_date" +msgid "Posted date" msgstr "" #. module: account_banking @@ -801,8 +801,8 @@ msgid "Payment Difference" msgstr "" #. module: account_banking -#: field:banking.import.transaction,effective_date:0 -msgid "effective_date" +#: field:banking.import.transaction,value_date:0 +msgid "Value date" msgstr "" #. module: account_banking diff --git a/account_banking/i18n/ro.po b/account_banking/i18n/ro.po index be1f65318..fb6e132a9 100644 --- a/account_banking/i18n/ro.po +++ b/account_banking/i18n/ro.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:01+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking #: field:account.bank.statement.line,reconcile_id:0 @@ -293,7 +293,7 @@ msgstr "" #. module: account_banking #: field:banking.import.transaction,execution_date:0 -msgid "execution_date" +msgid "Posted date" msgstr "" #. module: account_banking @@ -801,8 +801,8 @@ msgid "Payment Difference" msgstr "" #. module: account_banking -#: field:banking.import.transaction,effective_date:0 -msgid "effective_date" +#: field:banking.import.transaction,value_date:0 +msgid "Value date" msgstr "" #. module: account_banking diff --git a/account_banking/i18n/tr.po b/account_banking/i18n/tr.po index 219457cac..25a08b2a8 100644 --- a/account_banking/i18n/tr.po +++ b/account_banking/i18n/tr.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:01+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking #: field:account.bank.statement.line,reconcile_id:0 @@ -293,7 +293,7 @@ msgstr "" #. module: account_banking #: field:banking.import.transaction,execution_date:0 -msgid "execution_date" +msgid "Posted date" msgstr "" #. module: account_banking @@ -801,8 +801,8 @@ msgid "Payment Difference" msgstr "" #. module: account_banking -#: field:banking.import.transaction,effective_date:0 -msgid "effective_date" +#: field:banking.import.transaction,value_date:0 +msgid "Value date" msgstr "" #. module: account_banking diff --git a/account_banking/migrations/7.0.0.3/pre-migration.py b/account_banking/migrations/7.0.0.3/pre-migration.py new file mode 100644 index 000000000..0a1c80c6c --- /dev/null +++ b/account_banking/migrations/7.0.0.3/pre-migration.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2014 Therp BV (). +# All Rights Reserved +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +def migrate(cr, version): + if not version: + return + + # Rename value date column + cr.execute( + """ + ALTER TABLE banking_import_transaction + RENAME COLUMN effective_date TO value_date + """) diff --git a/account_banking/migrations/7.0.0.4/pre-migration.py b/account_banking/migrations/7.0.0.4/pre-migration.py new file mode 100644 index 000000000..dfec20809 --- /dev/null +++ b/account_banking/migrations/7.0.0.4/pre-migration.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2014 Akretion (http://www.akretion.com/) +# @author: Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +def table_exists(cr, table): + """ Check whether a certain table or view exists """ + cr.execute( + 'SELECT count(relname) FROM pg_class WHERE relname = %s', + (table,)) + return cr.fetchone()[0] == 1 + +def migrate(cr, version): + """ + Migration script for semantic changes in account_banking_payment_export. + Putting the same script in this module for users migrating from 6.1, + before the export module was refactored out. + """ + if not version or not table_exists(cr, 'payment_line'): + return + cr.execute( + "UPDATE payment_line SET communication = communication2, " + "communication2 = null " + "FROM payment_order " + "WHERE payment_line.order_id = payment_order.id " + "AND payment_order.state in ('draft', 'open') " + "AND payment_line.state = 'normal' " + "AND communication2 is not null") diff --git a/account_banking/parsers/models.py b/account_banking/parsers/models.py index b33231ff2..4e88ea66e 100644 --- a/account_banking/parsers/models.py +++ b/account_banking/parsers/models.py @@ -86,10 +86,10 @@ class mem_bank_transaction(object): # The currency the bank used to process the transferred amount 'execution_date', - # The requested execution date of the action - order date if you like + # The posted date of the action - 'effective_date', - # The real execution date of the action + 'value_date', + # The value date of the action 'remote_account', # The account of the other party diff --git a/account_banking_camt/camt.py b/account_banking_camt/camt.py index c925cb86f..b649c5f59 100644 --- a/account_banking_camt/camt.py +++ b/account_banking_camt/camt.py @@ -182,7 +182,7 @@ CAMT Format parser """ entry_details = { 'execution_date': self.xpath(node, './ns:BookgDt/ns:Dt')[0].text, - 'effective_date': self.xpath(node, './ns:ValDt/ns:Dt')[0].text, + 'value_date': self.xpath(node, './ns:ValDt/ns:Dt')[0].text, 'transfer_type': self.get_transfer_type(node), 'transferred_amount': self.parse_amount(node) } @@ -253,12 +253,14 @@ CAMT Format parser """ Sanity check the document's namespace """ - if not self.ns.startswith('{urn:iso:std:iso:20022:tech:xsd:camt.'): + if not self.ns.startswith('{urn:iso:std:iso:20022:tech:xsd:camt.')\ + and not self.ns.startswith('{ISO:camt.'): raise except_orm( "Error", "This does not seem to be a CAMT format bank statement.") - if not self.ns.startswith('{urn:iso:std:iso:20022:tech:xsd:camt.053.'): + if not self.ns.startswith('{urn:iso:std:iso:20022:tech:xsd:camt.053.')\ + and not self.ns.startswith('{ISO:camt.053'): raise except_orm( "Error", "Only CAMT.053 is supported at the moment.") @@ -274,5 +276,7 @@ CAMT Format parser self.assert_tag(root[0][0], 'GrpHdr') statements = [] for node in root[0][1:]: - statements.append(self.parse_Stmt(cr, node)) + statement = self.parse_Stmt(cr, node) + if len(statement.transactions): + statements.append(statement) return statements diff --git a/account_banking_fi_patu/i18n/nl.po b/account_banking_fi_patu/i18n/nl.po index b1171adf6..0c44f7137 100644 --- a/account_banking_fi_patu/i18n/nl.po +++ b/account_banking_fi_patu/i18n/nl.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_fi_patu #: code:addons/account_banking_fi_patu/patu.py:115 diff --git a/account_banking_fi_patu/i18n/pt_BR.po b/account_banking_fi_patu/i18n/pt_BR.po index 7b1ac5073..f7c90db28 100644 --- a/account_banking_fi_patu/i18n/pt_BR.po +++ b/account_banking_fi_patu/i18n/pt_BR.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_fi_patu #: code:addons/account_banking_fi_patu/patu.py:115 diff --git a/account_banking_fi_patu/patu.py b/account_banking_fi_patu/patu.py index a1e12e879..329f8c7a3 100644 --- a/account_banking_fi_patu/patu.py +++ b/account_banking_fi_patu/patu.py @@ -39,7 +39,7 @@ class transaction(models.mem_bank_transaction): "remote_currency": "currency", "transferred_amount": "amount", "execution_date": "recorddate", - "effective_date": "paymentdate", + "value_date": "paymentdate", "transfer_type": "eventtype", "reference": "refnr", "eventcode": "eventcode", diff --git a/account_banking_fr_lcr/__init__.py b/account_banking_fr_lcr/__init__.py new file mode 100644 index 000000000..119fec429 --- /dev/null +++ b/account_banking_fr_lcr/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# French Letter of Change module for OpenERP +# Copyright (C) 2014 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from . import account_banking_lcr +from . import wizard diff --git a/account_banking_fr_lcr/__openerp__.py b/account_banking_fr_lcr/__openerp__.py new file mode 100644 index 000000000..631d1882e --- /dev/null +++ b/account_banking_fr_lcr/__openerp__.py @@ -0,0 +1,53 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# French Letter of Change module for OpenERP +# Copyright (C) 2014 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'French Letter of Change', + 'summary': 'Create French LCR CFONB files', + 'version': '0.1', + 'license': 'AGPL-3', + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'category': 'Banking addons', + 'depends': ['account_direct_debit'], + 'external_dependencies': { + 'python': ['unidecode'], + }, + 'data': [ + 'account_banking_lcr_view.xml', + 'wizard/export_lcr_view.xml', + 'data/payment_type_lcr.xml', + 'security/ir.model.access.csv', + ], + 'demo': ['lcr_demo.xml'], + 'description': ''' +French Letter of Change +======================= + +This module adds support for French Letters of Change (in French : Lettre de Change Relevé aka LCR). This payment type is still in use in France and it is *not* replaced by SEPA one-off Direct Debits. With this module, you can generate a CFONB file to send to your bank. + +This module uses the framework provided by the banking addons, cf https://launchpad.net/banking-addons + +Please contact Alexis de Lattre from Akretion for any help or question about this module. + ''', + 'active': False, +} diff --git a/account_banking_fr_lcr/account_banking_lcr.py b/account_banking_fr_lcr/account_banking_lcr.py new file mode 100644 index 000000000..7c4b3add8 --- /dev/null +++ b/account_banking_fr_lcr/account_banking_lcr.py @@ -0,0 +1,70 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# French Letter of Change module for OpenERP +# Copyright (C) 2014 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp.osv import orm, fields +from openerp.addons.decimal_precision import decimal_precision as dp +from unidecode import unidecode + + +class banking_export_lcr(orm.Model): + '''French LCR''' + _name = 'banking.export.lcr' + _description = __doc__ + _rec_name = 'filename' + + def _generate_filename(self, cr, uid, ids, name, arg, context=None): + res = {} + for lcr_file in self.browse(cr, uid, ids, context=context): + ref = lcr_file.payment_order_ids[0].reference + if ref: + label = unidecode(ref.replace('/', '-')) + else: + label = 'error' + res[lcr_file.id] = 'lcr_%s.txt' % label + return res + + _columns = { + 'payment_order_ids': fields.many2many( + 'payment.order', + 'account_payment_order_lcr_rel', + 'banking_export_lcr_id', 'payment_order_id', + 'Payment Orders', + readonly=True), + 'nb_transactions': fields.integer( + 'Number of Transactions', readonly=True), + 'total_amount': fields.float( + 'Total Amount', digits_compute=dp.get_precision('Account'), + readonly=True), + 'create_date': fields.datetime('Generation Date', readonly=True), + 'file': fields.binary('CFONB File', readonly=True), + 'filename': fields.function( + _generate_filename, type='char', size=256, + string='Filename', readonly=True, store=True), + 'state': fields.selection([ + ('draft', 'Draft'), + ('sent', 'Sent'), + ], 'State', readonly=True), + } + + _defaults = { + 'state': 'draft', + } diff --git a/account_banking_fr_lcr/account_banking_lcr_view.xml b/account_banking_fr_lcr/account_banking_lcr_view.xml new file mode 100644 index 000000000..06d13a373 --- /dev/null +++ b/account_banking_fr_lcr/account_banking_lcr_view.xml @@ -0,0 +1,74 @@ + + + + + + + + + banking.export.lcr.form + banking.export.lcr + +
+
+ +
+ + + + + + + + + + + + + + +
+
+
+ + + banking.export.lcr.tree + banking.export.lcr + + + + + + + + + + + + LCR Files + banking.export.lcr + form + tree,form + + + + + + +
+
diff --git a/account_banking_fr_lcr/data/payment_type_lcr.xml b/account_banking_fr_lcr/data/payment_type_lcr.xml new file mode 100644 index 000000000..aaf01a4d0 --- /dev/null +++ b/account_banking_fr_lcr/data/payment_type_lcr.xml @@ -0,0 +1,15 @@ + + + + + + Lettre de Change Relevé + LCR + + + debit + + + + diff --git a/account_banking_fr_lcr/i18n/account_banking_fr_lcr.pot b/account_banking_fr_lcr/i18n/account_banking_fr_lcr.pot new file mode 100644 index 000000000..ea5786160 --- /dev/null +++ b/account_banking_fr_lcr/i18n/account_banking_fr_lcr.pot @@ -0,0 +1,187 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_banking_fr_lcr +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-03-20 23:15+0000\n" +"PO-Revision-Date: 2014-03-20 23:15+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_banking_fr_lcr +#: selection:banking.export.lcr.wizard,state:0 +msgid "Create" +msgstr "" + +#. module: account_banking_fr_lcr +#: field:banking.export.lcr,nb_transactions:0 +#: field:banking.export.lcr.wizard,nb_transactions:0 +msgid "Number of Transactions" +msgstr "" + +#. module: account_banking_fr_lcr +#: field:banking.export.lcr,filename:0 +#: field:banking.export.lcr.wizard,filename:0 +msgid "Filename" +msgstr "" + +#. module: account_banking_fr_lcr +#: field:banking.export.lcr,state:0 +#: field:banking.export.lcr.wizard,state:0 +msgid "State" +msgstr "" + +#. module: account_banking_fr_lcr +#: view:banking.export.lcr:0 +msgid "LCR File" +msgstr "" + +#. module: account_banking_fr_lcr +#: selection:banking.export.lcr,state:0 +msgid "Draft" +msgstr "" + +#. module: account_banking_fr_lcr +#: selection:banking.export.lcr,state:0 +msgid "Sent" +msgstr "" + +#. module: account_banking_fr_lcr +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:91 +#, python-format +msgid "The field '%s' is empty or 0. It should have a non-null value." +msgstr "" + +#. module: account_banking_fr_lcr +#: selection:banking.export.lcr.wizard,state:0 +msgid "Finish" +msgstr "" + +#. module: account_banking_fr_lcr +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:124 +#, python-format +msgid "For the bank account '%s' of partner '%s', the bank account type is 'RIB and optional IBAN' and the IBAN field is empty, but, starting from 2014, we consider that the IBAN is required. Please write the IBAN on this bank account." +msgstr "" + +#. module: account_banking_fr_lcr +#: view:banking.export.lcr.wizard:0 +msgid "LCR File Generation" +msgstr "" + +#. module: account_banking_fr_lcr +#: field:banking.export.lcr,total_amount:0 +#: field:banking.export.lcr.wizard,total_amount:0 +msgid "Total Amount" +msgstr "" + +#. module: account_banking_fr_lcr +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:296 +#, python-format +msgid "The currency of payment line '%s' is '%s'. To be included in a French LCR, the currency must be EUR." +msgstr "" + +#. module: account_banking_fr_lcr +#: model:ir.model,name:account_banking_fr_lcr.model_banking_export_lcr_wizard +msgid "Export French LCR File" +msgstr "" + +#. module: account_banking_fr_lcr +#: model:ir.model,name:account_banking_fr_lcr.model_banking_export_lcr +msgid "French LCR" +msgstr "" + +#. module: account_banking_fr_lcr +#: view:banking.export.lcr.wizard:0 +msgid "Validate" +msgstr "" + +#. module: account_banking_fr_lcr +#: view:banking.export.lcr.wizard:0 +msgid "Generate" +msgstr "" + +#. module: account_banking_fr_lcr +#: model:ir.actions.act_window,name:account_banking_fr_lcr.act_banking_export_lcr_payment_order +msgid "Generated LCR Files" +msgstr "" + +#. module: account_banking_fr_lcr +#: field:banking.export.lcr.wizard,file_id:0 +msgid "LCR CFONB File" +msgstr "" + +#. module: account_banking_fr_lcr +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:144 +#, python-format +msgid "LCR are only for French bank accounts. The IBAN '%s' of partner '%s' is not a French IBAN." +msgstr "" + +#. module: account_banking_fr_lcr +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:90 +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:104 +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:123 +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:134 +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:143 +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:295 +#, python-format +msgid "Error:" +msgstr "" + +#. module: account_banking_fr_lcr +#: view:banking.export.lcr:0 +#: model:ir.actions.act_window,name:account_banking_fr_lcr.banking_export_lcr_action +#: model:ir.ui.menu,name:account_banking_fr_lcr.banking_export_lcr_menu +msgid "LCR Files" +msgstr "" + +#. module: account_banking_fr_lcr +#: field:banking.export.lcr,file:0 +msgid "CFONB File" +msgstr "" + +#. module: account_banking_fr_lcr +#: view:banking.export.lcr:0 +#: field:banking.export.lcr,payment_order_ids:0 +#: field:banking.export.lcr.wizard,payment_order_ids:0 +msgid "Payment Orders" +msgstr "" + +#. module: account_banking_fr_lcr +#: view:banking.export.lcr:0 +msgid "General Information" +msgstr "" + +#. module: account_banking_fr_lcr +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:135 +#, python-format +msgid "For the bank account '%s' of partner '%s', the Bank Account Type should be 'IBAN'." +msgstr "" + +#. module: account_banking_fr_lcr +#: field:banking.export.lcr.wizard,file:0 +msgid "File" +msgstr "" + +#. module: account_banking_fr_lcr +#: view:banking.export.lcr.wizard:0 +msgid "Cancel" +msgstr "" + +#. module: account_banking_fr_lcr +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:105 +#, python-format +msgid "Cannot convert the field '%s' to ASCII" +msgstr "" + +#. module: account_banking_fr_lcr +#: field:banking.export.lcr,create_date:0 +msgid "Generation Date" +msgstr "" + diff --git a/account_banking_fr_lcr/i18n/fr.po b/account_banking_fr_lcr/i18n/fr.po new file mode 100644 index 000000000..8e17d2606 --- /dev/null +++ b/account_banking_fr_lcr/i18n/fr.po @@ -0,0 +1,204 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_banking_fr_lcr +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-03-20 23:15+0000\n" +"PO-Revision-Date: 2014-03-27 08:45+0000\n" +"Last-Translator: Alexis de Lattre \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" + +#. module: account_banking_fr_lcr +#: selection:banking.export.lcr.wizard,state:0 +msgid "Create" +msgstr "Créer" + +#. module: account_banking_fr_lcr +#: field:banking.export.lcr,nb_transactions:0 +#: field:banking.export.lcr.wizard,nb_transactions:0 +msgid "Number of Transactions" +msgstr "Nombre de transactions" + +#. module: account_banking_fr_lcr +#: field:banking.export.lcr,filename:0 +#: field:banking.export.lcr.wizard,filename:0 +msgid "Filename" +msgstr "Nom du fichier" + +#. module: account_banking_fr_lcr +#: field:banking.export.lcr,state:0 +#: field:banking.export.lcr.wizard,state:0 +msgid "State" +msgstr "État" + +#. module: account_banking_fr_lcr +#: view:banking.export.lcr:0 +msgid "LCR File" +msgstr "Fichier LCR" + +#. module: account_banking_fr_lcr +#: selection:banking.export.lcr,state:0 +msgid "Draft" +msgstr "Brouillon" + +#. module: account_banking_fr_lcr +#: selection:banking.export.lcr,state:0 +msgid "Sent" +msgstr "Envoyé" + +#. module: account_banking_fr_lcr +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:91 +#, python-format +msgid "The field '%s' is empty or 0. It should have a non-null value." +msgstr "" +"Le champ '%s' est vide ou égal à 0. Il devrait avoir une valeur non nulle." + +#. module: account_banking_fr_lcr +#: selection:banking.export.lcr.wizard,state:0 +msgid "Finish" +msgstr "Finir" + +#. module: account_banking_fr_lcr +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:124 +#, python-format +msgid "" +"For the bank account '%s' of partner '%s', the bank account type is 'RIB and " +"optional IBAN' and the IBAN field is empty, but, starting from 2014, we " +"consider that the IBAN is required. Please write the IBAN on this bank " +"account." +msgstr "" + +#. module: account_banking_fr_lcr +#: view:banking.export.lcr.wizard:0 +msgid "LCR File Generation" +msgstr "Génération du fichier LCR" + +#. module: account_banking_fr_lcr +#: field:banking.export.lcr,total_amount:0 +#: field:banking.export.lcr.wizard,total_amount:0 +msgid "Total Amount" +msgstr "Montant total" + +#. module: account_banking_fr_lcr +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:296 +#, python-format +msgid "" +"The currency of payment line '%s' is '%s'. To be included in a French LCR, " +"the currency must be EUR." +msgstr "" +"La monnaie de la ligne de paiement '%s' est '%s'. Pour être intégrée dans " +"une LCR, la monnaie doit être EUR." + +#. module: account_banking_fr_lcr +#: model:ir.model,name:account_banking_fr_lcr.model_banking_export_lcr_wizard +msgid "Export French LCR File" +msgstr "Export du fichier LCR" + +#. module: account_banking_fr_lcr +#: model:ir.model,name:account_banking_fr_lcr.model_banking_export_lcr +msgid "French LCR" +msgstr "LCR" + +#. module: account_banking_fr_lcr +#: view:banking.export.lcr.wizard:0 +msgid "Validate" +msgstr "Valider" + +#. module: account_banking_fr_lcr +#: view:banking.export.lcr.wizard:0 +msgid "Generate" +msgstr "Générer" + +#. module: account_banking_fr_lcr +#: model:ir.actions.act_window,name:account_banking_fr_lcr.act_banking_export_lcr_payment_order +msgid "Generated LCR Files" +msgstr "Fichiers LCR générés" + +#. module: account_banking_fr_lcr +#: field:banking.export.lcr.wizard,file_id:0 +msgid "LCR CFONB File" +msgstr "Fichier CFONB LCR" + +#. module: account_banking_fr_lcr +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:144 +#, python-format +msgid "" +"LCR are only for French bank accounts. The IBAN '%s' of partner '%s' is not " +"a French IBAN." +msgstr "" +"Les LCR ne fonctionnent qu'avec des comptes bancaires français. L'IBAN '%s' " +"du partenaire '%s' n'est pas un IBAN français." + +#. module: account_banking_fr_lcr +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:90 +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:104 +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:123 +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:134 +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:143 +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:295 +#, python-format +msgid "Error:" +msgstr "Erreur :" + +#. module: account_banking_fr_lcr +#: view:banking.export.lcr:0 +#: model:ir.actions.act_window,name:account_banking_fr_lcr.banking_export_lcr_action +#: model:ir.ui.menu,name:account_banking_fr_lcr.banking_export_lcr_menu +msgid "LCR Files" +msgstr "Fichiers LCR" + +#. module: account_banking_fr_lcr +#: field:banking.export.lcr,file:0 +msgid "CFONB File" +msgstr "Fichier CFONB" + +#. module: account_banking_fr_lcr +#: view:banking.export.lcr:0 +#: field:banking.export.lcr,payment_order_ids:0 +#: field:banking.export.lcr.wizard,payment_order_ids:0 +msgid "Payment Orders" +msgstr "Ordre de paiement" + +#. module: account_banking_fr_lcr +#: view:banking.export.lcr:0 +msgid "General Information" +msgstr "Informations générales" + +#. module: account_banking_fr_lcr +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:135 +#, python-format +msgid "" +"For the bank account '%s' of partner '%s', the Bank Account Type should be " +"'IBAN'." +msgstr "" +"Pour le compte bancaire '%s' du partenaire '%s', le type de compte bancaire " +"devrait être 'IBAN'." + +#. module: account_banking_fr_lcr +#: field:banking.export.lcr.wizard,file:0 +msgid "File" +msgstr "Fichier" + +#. module: account_banking_fr_lcr +#: view:banking.export.lcr.wizard:0 +msgid "Cancel" +msgstr "Annuler" + +#. module: account_banking_fr_lcr +#: code:addons/account_banking_fr_lcr/wizard/export_lcr.py:105 +#, python-format +msgid "Cannot convert the field '%s' to ASCII" +msgstr "Impossible de convertir le champ '%s' en ASCII" + +#. module: account_banking_fr_lcr +#: field:banking.export.lcr,create_date:0 +msgid "Generation Date" +msgstr "Date de génération" diff --git a/account_banking_fr_lcr/lcr_demo.xml b/account_banking_fr_lcr/lcr_demo.xml new file mode 100644 index 000000000..27535c86a --- /dev/null +++ b/account_banking_fr_lcr/lcr_demo.xml @@ -0,0 +1,15 @@ + + + + + + + LCR La Banque Postale + + + + + + + + diff --git a/account_banking_fr_lcr/security/ir.model.access.csv b/account_banking_fr_lcr/security/ir.model.access.csv new file mode 100644 index 000000000..41d051828 --- /dev/null +++ b/account_banking_fr_lcr/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_banking_export_lcr,Full access on banking.export.lcr to Account Payment grp,model_banking_export_lcr,account_payment.group_account_payment,1,1,1,1 diff --git a/account_banking_fr_lcr/wizard/__init__.py b/account_banking_fr_lcr/wizard/__init__.py new file mode 100644 index 000000000..5cd45758a --- /dev/null +++ b/account_banking_fr_lcr/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# French Letter of Change module for OpenERP +# Copyright (C) 2014 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from . import export_lcr diff --git a/account_banking_fr_lcr/wizard/export_lcr.py b/account_banking_fr_lcr/wizard/export_lcr.py new file mode 100644 index 000000000..def19d3cf --- /dev/null +++ b/account_banking_fr_lcr/wizard/export_lcr.py @@ -0,0 +1,355 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# French Letter of Change module for OpenERP +# Copyright (C) 2014 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp.osv import orm, fields +from openerp.tools.translate import _ +from openerp import netsvc +from datetime import datetime +from openerp.tools import DEFAULT_SERVER_DATE_FORMAT +from unidecode import unidecode +import base64 + +LCR_DATE_FORMAT = '%d%m%y' + + +class banking_export_lcr_wizard(orm.TransientModel): + _name = 'banking.export.lcr.wizard' + _description = 'Export French LCR File' + + _columns = { + 'state': fields.selection([ + ('create', 'Create'), + ('finish', 'Finish'), + ], 'State', readonly=True), + 'nb_transactions': fields.related( + 'file_id', 'nb_transactions', type='integer', + string='Number of Transactions', readonly=True), + 'total_amount': fields.related( + 'file_id', 'total_amount', type='float', string='Total Amount', + readonly=True), + 'file_id': fields.many2one( + 'banking.export.lcr', 'LCR CFONB File', readonly=True), + 'file': fields.related( + 'file_id', 'file', string="File", type='binary', readonly=True), + 'filename': fields.related( + 'file_id', 'filename', string="Filename", type='char', size=256, + readonly=True), + 'payment_order_ids': fields.many2many( + 'payment.order', 'wiz_lcr_payorders_rel', 'wizard_id', + 'payment_order_id', 'Payment Orders', readonly=True), + } + + _defaults = { + 'state': 'create', + } + + def create(self, cr, uid, vals, context=None): + payment_order_ids = context.get('active_ids', []) + vals.update({ + 'payment_order_ids': [[6, 0, payment_order_ids]], + }) + return super(banking_export_lcr_wizard, self).create( + cr, uid, vals, context=context) + + def _prepare_export_lcr( + self, cr, uid, lcr_export, total_amount, transactions_count, + cfonb_string, context=None): + return { + 'total_amount': total_amount, + 'nb_transactions': transactions_count, + 'file': base64.encodestring(cfonb_string), + 'payment_order_ids': [( + 6, 0, [x.id for x in lcr_export.payment_order_ids] + )], + } + + def _prepare_field( + self, cr, uid, field_name, field_value, size, context=None): + '''This function is designed to be inherited.''' + if not field_value: + raise orm.except_orm( + _('Error:'), + _("The field '%s' is empty or 0. It should have a non-null " + "value.") + % field_name) + try: + value = unidecode(field_value) + unallowed_ascii_chars = [ + '"', '#', '$', '%', '&', ';', '<', '>', '=', '@', + '[', ']', '^', '_', '`', '{', '}', '|', '~', '\\', '!', + ] + for unallowed_ascii_char in unallowed_ascii_chars: + value = value.replace(unallowed_ascii_char, '-') + except: + raise orm.except_orm( + _('Error:'), + _("Cannot convert the field '%s' to ASCII") + % field_name) + value = value.upper() + # Cut if too long + value = value[0:size] + # enlarge if too small + if len(value) < size: + value = value.ljust(size, ' ') + assert len(value) == size, 'The length of the field is wrong' + return value + + def _get_rib_from_iban(self, cr, uid, partner_bank, context=None): + # I do NOT want to add a dependancy on l10n_fr_rib, because + # we plan to remove the module in the near future + # So I consider that IBAN MUST be given in the res.partner.bank + # of type 'rib' + if partner_bank.state == 'rib' and not partner_bank.acc_number: + raise orm.except_orm( + _('Error:'), + _("For the bank account '%s' of partner '%s', the bank " + "account type is 'RIB and optional IBAN' and the IBAN " + "field is empty, but, starting from 2014, we consider " + "that the IBAN is required. Please write the IBAN on " + "this bank account.") + % (self.pool['res.partner.bank'].name_get( + cr, uid, [partner_bank.id], context=context)[0][1], + partner_bank.partner_id.name)) + elif partner_bank.state != 'iban': + raise orm.except_orm( + _('Error:'), + _("For the bank account '%s' of partner '%s', the Bank " + "Account Type should be 'IBAN'.") + % (self.pool['res.partner.bank'].name_get( + cr, uid, [partner_bank.id], context=context)[0][1], + partner_bank.partner_id.name)) + iban = partner_bank.acc_number.replace(' ', '') + if iban[0:2] != 'FR': + raise orm.except_orm( + _('Error:'), + _("LCR are only for French bank accounts. The IBAN '%s' " + "of partner '%s' is not a French IBAN.") + % (partner_bank.acc_number, partner_bank.partner_id.name)) + assert len(iban) == 27, 'French IBANs must have 27 caracters' + return { + 'code_banque': iban[4:9], + 'code_guichet': iban[9:14], + 'numero_compte': iban[14:25], + 'cle_rib': iban[25:27], + } + + def _prepare_first_cfonb_line( + self, cr, uid, lcr_export, context=None): + '''Generate the header line of the CFONB file''' + code_enregistrement = '03' + code_operation = '60' + numero_enregistrement = '00000001' + numero_emetteur = '000000' # It is not needed for LCR + # this number is only required for old national direct debits + today_str = fields.date.context_today(self, cr, uid, context=context) + today_dt = datetime.strptime(today_str, DEFAULT_SERVER_DATE_FORMAT) + date_remise = today_dt.strftime(LCR_DATE_FORMAT) + raison_sociale_cedant = self._prepare_field( + cr, uid, u'Raison sociale du cédant', + lcr_export.payment_order_ids[0].company_id.name, 24, + context=context) + domiciliation_bancaire_cedant = self._prepare_field( + cr, uid, u'Domiciliation bancaire du cédant', + lcr_export.payment_order_ids[0].mode.bank_id.bank.name, 24, + context=context) + code_entree = '3' + code_dailly = ' ' + code_monnaie = 'E' + rib = self._get_rib_from_iban( + cr, uid, lcr_export.payment_order_ids[0].mode.bank_id, + context=context) + ref_remise = self._prepare_field( + cr, uid, u'Référence de la remise', + lcr_export.payment_order_ids[0].reference, 11, context=context) + cfonb_line = ''.join([ + code_enregistrement, + code_operation, + numero_enregistrement, + numero_emetteur, + ' ' * 6, + date_remise, + raison_sociale_cedant, + domiciliation_bancaire_cedant, + code_entree, + code_dailly, + code_monnaie, + rib['code_banque'], + rib['code_guichet'], + rib['numero_compte'], + ' ' * (16 + 6 + 10 + 15), + # Date de valeur is left empty because it is only for + # "remise à l'escompte" and we do + # "Encaissement, crédit forfaitaire après l’échéance" + ref_remise, + ]) + assert len(cfonb_line) == 160, 'LCR CFONB line must have 160 chars' + cfonb_line += '\r\n' + return cfonb_line + + def _prepare_cfonb_line( + self, cr, uid, line, requested_date, transactions_count, + context=None): + '''Generate each debit line of the CFONB file''' + # I use French variable names because the specs are in French + code_enregistrement = '06' + code_operation = '60' + numero_enregistrement = '%08d' % (transactions_count + 1) + reference_tire = self._prepare_field( + cr, uid, u'Référence tiré', line.communication, 10, + context=context) + rib = self._get_rib_from_iban(cr, uid, line.bank_id, context=context) + + nom_tire = self._prepare_field( + cr, uid, u'Nom tiré', line.partner_id.name, 24, context=context) + nom_banque = self._prepare_field( + cr, uid, u'Nom banque', line.bank_id.bank.name, 24, + context=context) + code_acceptation = '0' + montant_centimes = int(line.amount_currency * 100) + zero_montant_centimes = ('%012d' % montant_centimes) + today_str = fields.date.context_today(self, cr, uid, context=context) + today_dt = datetime.strptime(today_str, DEFAULT_SERVER_DATE_FORMAT) + date_creation = today_dt.strftime(LCR_DATE_FORMAT) + requested_date_dt = datetime.strptime( + requested_date, DEFAULT_SERVER_DATE_FORMAT) + date_echeance = requested_date_dt.strftime(LCR_DATE_FORMAT) + reference_tireur = reference_tire + + cfonb_line = ''.join([ + code_enregistrement, + code_operation, + numero_enregistrement, + ' ' * (6 + 2), + reference_tire, + nom_tire, + nom_banque, + code_acceptation, + ' ' * 2, + rib['code_banque'], + rib['code_guichet'], + rib['numero_compte'], + zero_montant_centimes, + ' ' * 4, + date_echeance, + date_creation, + ' ' * (4 + 1 + 3 + 3 + 9), + reference_tireur, + ]) + assert len(cfonb_line) == 160, 'LCR CFONB line must have 160 chars' + cfonb_line += '\r\n' + return cfonb_line + + def _prepare_final_cfonb_line( + self, cr, uid, total_amount, transactions_count, context=None): + '''Generate the last line of the CFONB file''' + code_enregistrement = '08' + code_operation = '60' + numero_enregistrement = '%08d' % (transactions_count + 2) + montant_total_centimes = int(total_amount * 100) + zero_montant_total_centimes = ('%012d' % montant_total_centimes) + cfonb_line = ''.join([ + code_enregistrement, + code_operation, + numero_enregistrement, + ' ' * (6 + 12 + 24 + 24 + 1 + 2 + 5 + 5 + 11), + zero_montant_total_centimes, + ' ' * (4 + 6 + 10 + 15 + 5 + 6), + ]) + assert len(cfonb_line) == 160, 'LCR CFONB line must have 160 chars' + return cfonb_line + + def create_lcr(self, cr, uid, ids, context=None): + '''Creates the LCR CFONB file.''' + lcr_export = self.browse(cr, uid, ids[0], context=context) + today = fields.date.context_today(self, cr, uid, context=context) + + cfonb_string = self._prepare_first_cfonb_line( + cr, uid, lcr_export, context=context) + transactions_count = 0 + total_amount = 0.0 + for payment_order in lcr_export.payment_order_ids: + total_amount = total_amount + payment_order.total + # Iterate each payment lines + for line in payment_order.line_ids: + if line.currency.name != 'EUR': + raise orm.except_orm( + _('Error:'), + _("The currency of payment line '%s' is '%s'. " + "To be included in a French LCR, the currency " + "must be EUR.") + % (line.name, line.currency.name)) + transactions_count += 1 + if payment_order.date_prefered == 'due': + requested_date = line.ml_maturity_date or today + elif payment_order.date_prefered == 'fixed': + requested_date = payment_order.date_scheduled or today + else: + requested_date = today + cfonb_string += self._prepare_cfonb_line( + cr, uid, line, requested_date, transactions_count, + context=context) + + cfonb_string += self._prepare_final_cfonb_line( + cr, uid, total_amount, transactions_count, + context=context) + + file_id = self.pool['banking.export.lcr'].create( + cr, uid, self._prepare_export_lcr( + cr, uid, lcr_export, total_amount, transactions_count, + cfonb_string, context=context), + context=context) + + self.write( + cr, uid, ids, { + 'file_id': file_id, + 'state': 'finish', + }, context=context) + + action = { + 'name': 'LCR File', + 'type': 'ir.actions.act_window', + 'view_type': 'form', + 'view_mode': 'form,tree', + 'res_model': self._name, + 'res_id': ids[0], + 'target': 'new', + } + + return action + + def cancel_lcr(self, cr, uid, ids, context=None): + '''Cancel the CFONB file: just drop the file''' + lcr_export = self.browse(cr, uid, ids[0], context=context) + self.pool['banking.export.lcr'].unlink( + cr, uid, lcr_export.file_id.id, context=context) + return {'type': 'ir.actions.act_window_close'} + + def save_lcr(self, cr, uid, ids, context=None): + '''Mark the LCR file as 'sent' and the payment order as 'done'.''' + lcr_export = self.browse(cr, uid, ids[0], context=context) + self.pool['banking.export.lcr'].write( + cr, uid, lcr_export.file_id.id, {'state': 'sent'}, + context=context) + wf_service = netsvc.LocalService('workflow') + for order in lcr_export.payment_order_ids: + wf_service.trg_validate(uid, 'payment.order', order.id, 'done', cr) + return {'type': 'ir.actions.act_window_close'} diff --git a/account_banking_fr_lcr/wizard/export_lcr_view.xml b/account_banking_fr_lcr/wizard/export_lcr_view.xml new file mode 100644 index 000000000..7f6540838 --- /dev/null +++ b/account_banking_fr_lcr/wizard/export_lcr_view.xml @@ -0,0 +1,39 @@ + + + + + + + + + banking.export.lcr.wizard.form + banking.export.lcr.wizard + +
+ + + + + + + +
+
+ +
+
+ +
+
diff --git a/account_banking_mt940/static/src/img/icon.png b/account_banking_mt940/static/src/img/icon.png deleted file mode 100644 index 4c7ab3029..000000000 Binary files a/account_banking_mt940/static/src/img/icon.png and /dev/null differ diff --git a/account_banking_nl_abnamro/abnamro.py b/account_banking_nl_abnamro/abnamro.py index 977383e00..809f776f9 100644 --- a/account_banking_nl_abnamro/abnamro.py +++ b/account_banking_nl_abnamro/abnamro.py @@ -67,9 +67,9 @@ class transaction_message(object): self.transferred_amount = float( self.transferred_amount.replace(',', '.')) self.execution_date = str2date(self.date, '%Y%m%d') - self.effective_date = str2date(self.date, '%Y%m%d') + self.value_date = str2date(self.date, '%Y%m%d') # Set statement_id based on week number - self.statement_id = self.effective_date.strftime('%Yw%W') + self.statement_id = self.execution_date.strftime('%Yw%W') self.id = str(subno).zfill(4) class transaction(models.mem_bank_transaction): @@ -77,7 +77,7 @@ class transaction(models.mem_bank_transaction): Implementation of transaction communication class for account_banking. ''' attrnames = ['local_account', 'local_currency', 'transferred_amount', - 'blob', 'execution_date', 'effective_date', 'id', + 'blob', 'execution_date', 'value_date', 'id', ] type_map = { @@ -91,6 +91,7 @@ class transaction(models.mem_bank_transaction): 'UNKN': bt.ORDER, # everything else 'SEPA': bt.ORDER, 'PAYB': bt.PAYMENT_BATCH, + 'RETR': bt.STORNO, } def __init__(self, line, *args, **kwargs): @@ -257,8 +258,11 @@ class transaction(models.mem_bank_transaction): if self.transfer_type == 'SEPA': sepa_dict = get_sepa_dict(''.join(fields)) sepa_type = sepa_dict.get('TRTP') or '' - if sepa_type.upper() != 'SEPA OVERBOEKING': - raise ValueError, _('Sepa transaction type %s not handled yet') % sepa_type + self.transfer_type = { + 'SEPA BATCH': 'PAYB', + 'SEPA BATCH SALARIS': 'PAYB', + 'SEPA TERUGBOEKING': 'RETR', + }.get(sepa_type.upper(), 'SEPA') self.remote_account = sepa_dict.get('IBAN',False) self.remote_bank_bic = sepa_dict.get('BIC', False) self.remote_owner = sepa_dict.get('NAME', False) @@ -369,7 +373,7 @@ each file covers a period of two weeks. msg = transaction_message(line, subno) if not statement_id: statement_id = self.get_unique_statement_id( - cr, msg.effective_date.strftime('%Yw%W')) + cr, msg.execution_date.strftime('%Yw%W')) msg.statement_id = statement_id if stmnt: stmnt.import_transaction(msg) diff --git a/account_banking_nl_abnamro/i18n/en.po b/account_banking_nl_abnamro/i18n/en.po index ee37c02cd..bf032a625 100644 --- a/account_banking_nl_abnamro/i18n/en.po +++ b/account_banking_nl_abnamro/i18n/en.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_nl_abnamro #: code:addons/account_banking_nl_abnamro/abnamro.py:122 diff --git a/account_banking_nl_abnamro/i18n/nl.po b/account_banking_nl_abnamro/i18n/nl.po index facd4c624..071792ee2 100644 --- a/account_banking_nl_abnamro/i18n/nl.po +++ b/account_banking_nl_abnamro/i18n/nl.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_nl_abnamro #: code:addons/account_banking_nl_abnamro/abnamro.py:122 diff --git a/account_banking_nl_clieop/i18n/da.po b/account_banking_nl_clieop/i18n/da.po index 799140899..c1542f9b3 100644 --- a/account_banking_nl_clieop/i18n/da.po +++ b/account_banking_nl_clieop/i18n/da.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" diff --git a/account_banking_nl_clieop/i18n/en.po b/account_banking_nl_clieop/i18n/en.po index edf96042c..0a8d90376 100644 --- a/account_banking_nl_clieop/i18n/en.po +++ b/account_banking_nl_clieop/i18n/en.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" diff --git a/account_banking_nl_clieop/i18n/nl.po b/account_banking_nl_clieop/i18n/nl.po index 154e4d20d..c0cedd490 100644 --- a/account_banking_nl_clieop/i18n/nl.po +++ b/account_banking_nl_clieop/i18n/nl.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" diff --git a/account_banking_nl_clieop/i18n/tr.po b/account_banking_nl_clieop/i18n/tr.po index 089529cfa..650050e15 100644 --- a/account_banking_nl_clieop/i18n/tr.po +++ b/account_banking_nl_clieop/i18n/tr.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" diff --git a/account_banking_nl_girotel/girotel.py b/account_banking_nl_girotel/girotel.py index 5fe48c49f..1b111b214 100644 --- a/account_banking_nl_girotel/girotel.py +++ b/account_banking_nl_girotel/girotel.py @@ -106,6 +106,7 @@ class transaction_message(object): self.date = str2date(self.date, '%Y%m%d') if self.direction == 'A': self.transferred_amount = -float(self.transferred_amount) + #payment batch done via clieop if (self.transfer_type == 'VZ' and (not self.remote_account or self.remote_account == '0') and (not self.message or re.match('^\s*$', self.message)) @@ -113,6 +114,14 @@ class transaction_message(object): self.transfer_type = 'PB' self.message = self.remote_owner self.remove_owner = False + #payment batch done via sepa + if self.transfer_type == 'VZ'\ + and not self.remote_account\ + and not self.remote_owner\ + and re.match( + '^Verzamel Eurobetaling .* TOTAAL \d+ POSTEN\s*$', + self.message): + self.transfer_type = 'PB' else: self.transferred_amount = float(self.transferred_amount) self.local_account = self.local_account.zfill(10) @@ -120,7 +129,7 @@ class transaction_message(object): self.remote_account = self.remote_account.zfill(10) else: self.remote_account = False - self.execution_date = self.effective_date = self.date + self.execution_date = self.value_date = self.date self.remote_owner = self.remote_owner.rstrip() self.message = self.message.rstrip() self.genid() @@ -137,7 +146,7 @@ class transaction(models.mem_bank_transaction): ''' attrnames = [ 'statement_id', 'remote_account', 'remote_owner', 'remote_currency', 'transferred_amount', 'execution_date', - 'effective_date', 'transfer_type', 'message', + 'value_date', 'transfer_type', 'message', ] type_map = { diff --git a/account_banking_nl_girotel/i18n/en.po b/account_banking_nl_girotel/i18n/en.po index d6cd6ce2f..e769a7896 100644 --- a/account_banking_nl_girotel/i18n/en.po +++ b/account_banking_nl_girotel/i18n/en.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_nl_girotel #: code:addons/account_banking_nl_girotel/girotel.py:325 diff --git a/account_banking_nl_girotel/i18n/nl.po b/account_banking_nl_girotel/i18n/nl.po index a383f817a..66fa6c51b 100644 --- a/account_banking_nl_girotel/i18n/nl.po +++ b/account_banking_nl_girotel/i18n/nl.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_nl_girotel #: code:addons/account_banking_nl_girotel/girotel.py:325 diff --git a/account_banking_nl_girotel/i18n/pt_BR.po b/account_banking_nl_girotel/i18n/pt_BR.po index 816332e19..e26a343f8 100644 --- a/account_banking_nl_girotel/i18n/pt_BR.po +++ b/account_banking_nl_girotel/i18n/pt_BR.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_nl_girotel #: code:addons/account_banking_nl_girotel/girotel.py:325 diff --git a/account_banking_nl_ing/i18n/nl.po b/account_banking_nl_ing/i18n/nl.po index a9292649e..eda299bd0 100644 --- a/account_banking_nl_ing/i18n/nl.po +++ b/account_banking_nl_ing/i18n/nl.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_nl_ing #: code:addons/account_banking_nl_ing/ing.py:257 diff --git a/account_banking_nl_ing/i18n/pt_BR.po b/account_banking_nl_ing/i18n/pt_BR.po index a9a963b58..77c6f75b9 100644 --- a/account_banking_nl_ing/i18n/pt_BR.po +++ b/account_banking_nl_ing/i18n/pt_BR.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_nl_ing #: code:addons/account_banking_nl_ing/ing.py:257 diff --git a/account_banking_nl_ing/ing.py b/account_banking_nl_ing/ing.py index 929384c6a..6384f1314 100644 --- a/account_banking_nl_ing/ing.py +++ b/account_banking_nl_ing/ing.py @@ -68,10 +68,10 @@ class transaction_message(object): if self.debcred == 'Af': self.transferred_amount = -self.transferred_amount try: - self.execution_date = self.effective_date = str2date(self.date, '%Y%m%d') + self.execution_date = self.value_date = str2date(self.date, '%Y%m%d') except ValueError: - self.execution_date = self.effective_date = str2date(self.date, '%d-%m-%Y') - self.statement_id = '' #self.effective_date.strftime('%Yw%W') + self.execution_date = self.value_date = str2date(self.date, '%d-%m-%Y') + self.statement_id = '' #self.value_date.strftime('%Yw%W') self.id = str(subno).zfill(4) self.reference = '' # Normalize basic account numbers @@ -85,7 +85,7 @@ class transaction(models.mem_bank_transaction): ''' attrnames = ['local_account', 'remote_account', 'remote_owner', 'transferred_amount', - 'execution_date', 'effective_date', 'transfer_type', + 'execution_date', 'value_date', 'transfer_type', 'id', 'reference', 'statement_id', 'message', ] @@ -279,7 +279,7 @@ Statements. msg = transaction_message(line, subno) if not statement_id: statement_id = self.get_unique_statement_id( - cr, msg.effective_date.strftime('%Yw%W')) + cr, msg.execution_date.strftime('%Yw%W')) msg.statement_id = statement_id if stmnt: stmnt.import_transaction(msg) diff --git a/account_banking_nl_ing_mt940/__openerp__.py b/account_banking_nl_ing_mt940/__openerp__.py index 8eae5c53c..112721951 100644 --- a/account_banking_nl_ing_mt940/__openerp__.py +++ b/account_banking_nl_ing_mt940/__openerp__.py @@ -20,7 +20,7 @@ ############################################################################## { "name" : "MT940 import for Dutch ING", - "version" : "1.0", + "version" : "1.1", "author" : "Therp BV", "complexity": "normal", "description": """ diff --git a/account_banking_nl_ing_mt940/account_banking_nl_ing_mt940.py b/account_banking_nl_ing_mt940/account_banking_nl_ing_mt940.py index a85ce2ff0..5c877c890 100644 --- a/account_banking_nl_ing_mt940/account_banking_nl_ing_mt940.py +++ b/account_banking_nl_ing_mt940/account_banking_nl_ing_mt940.py @@ -36,7 +36,7 @@ class IngMT940Parser(MT940, parser): code = 'INT_MT940_STRUC' tag_61_regex = re.compile( - '^(?P\d{6})(?P[CD])(?P\d+,\d{2})N(?P\d{3})' + '^(?P\d{6})(?P[CD])(?P\d+,\d{2})N(?P.{3})' '(?P\w{1,16})') def create_transaction(self, cr): @@ -62,7 +62,8 @@ class IngMT940Parser(MT940, parser): return super(IngMT940Parser, self).handle_tag_86(cr, data) codewords = ['RTRN', 'BENM', 'ORDP', 'CSID', 'BUSP', 'MARF', 'EREF', - 'PREF', 'REMI', 'ID', 'PURP', 'ULTB', 'ULTD'] + 'PREF', 'REMI', 'ID', 'PURP', 'ULTB', 'ULTD', + 'CREF', 'IREF', 'CNTP', 'ULTC', 'EXCH', 'CHGS'] subfields = {} current_codeword = None for word in data.split('/'): @@ -72,7 +73,14 @@ class IngMT940Parser(MT940, parser): current_codeword = word subfields[current_codeword] = [] continue - subfields[current_codeword].append(word) + if current_codeword in subfields: + subfields[current_codeword].append(word) + + if 'CNTP' in subfields: + self.current_transaction.remote_account = subfields['CNTP'][0] + self.current_transaction.remote_bank_bic = subfields['CNTP'][1] + self.current_transaction.remote_owner = subfields['CNTP'][2] + self.current_transaction.remote_owner_city = subfields['CNTP'][3] if 'BENM' in subfields: self.current_transaction.remote_account = subfields['BENM'][0] diff --git a/account_banking_nl_ing_mt940/static/src/img/icon.png b/account_banking_nl_ing_mt940/static/src/img/icon.png deleted file mode 100644 index 4c7ab3029..000000000 Binary files a/account_banking_nl_ing_mt940/static/src/img/icon.png and /dev/null differ diff --git a/account_banking_nl_multibank/i18n/en.po b/account_banking_nl_multibank/i18n/en.po index be047aa17..6bd23d1b0 100644 --- a/account_banking_nl_multibank/i18n/en.po +++ b/account_banking_nl_multibank/i18n/en.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_nl_multibank #: code:addons/account_banking_nl_multibank/multibank.py:292 diff --git a/account_banking_nl_multibank/i18n/nl.po b/account_banking_nl_multibank/i18n/nl.po index 7e6a106a1..db1281eca 100644 --- a/account_banking_nl_multibank/i18n/nl.po +++ b/account_banking_nl_multibank/i18n/nl.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_nl_multibank #: code:addons/account_banking_nl_multibank/multibank.py:292 diff --git a/account_banking_nl_multibank/i18n/pt_BR.po b/account_banking_nl_multibank/i18n/pt_BR.po index 215da959d..df3de74ec 100644 --- a/account_banking_nl_multibank/i18n/pt_BR.po +++ b/account_banking_nl_multibank/i18n/pt_BR.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_nl_multibank #: code:addons/account_banking_nl_multibank/multibank.py:292 diff --git a/account_banking_nl_multibank/multibank.py b/account_banking_nl_multibank/multibank.py index 885479a46..5eee004df 100644 --- a/account_banking_nl_multibank/multibank.py +++ b/account_banking_nl_multibank/multibank.py @@ -44,7 +44,7 @@ class transaction_message(object): attrnames = [ 'date', 'local_account', 'remote_account', 'remote_owner', 'u1', 'u2', 'u3', 'local_currency', 'start_balance', 'remote_currency', - 'transferred_amount', 'execution_date', 'effective_date', 'nr1', + 'transferred_amount', 'execution_date', 'value_date', 'nr1', 'transfer_type', 'nr2', 'reference', 'message', 'statement_id' ] @@ -82,7 +82,7 @@ class transaction_message(object): self.start_balance = float(self.start_balance) self.transferred_amount = float(self.transferred_amount) self.execution_date = str2date(self.execution_date, '%d-%m-%Y') - self.effective_date = str2date(self.effective_date, '%d-%m-%Y') + self.value_date = str2date(self.value_date, '%d-%m-%Y') self.id = str(subno).zfill(4) class transaction(models.mem_bank_transaction): @@ -91,7 +91,7 @@ class transaction(models.mem_bank_transaction): ''' attrnames = ['local_account', 'local_currency', 'remote_account', 'remote_owner', 'remote_currency', 'transferred_amount', - 'execution_date', 'effective_date', 'transfer_type', + 'execution_date', 'value_date', 'transfer_type', 'reference', 'message', 'statement_id', 'id', ] @@ -152,7 +152,7 @@ class transaction(models.mem_bank_transaction): have their transfer_type set to 'OPN'. ''' return (self.transferred_amount and self.execution_date and - self.effective_date) and ( + self.value_date) and ( self.remote_account or self.transfer_type in [ 'KST', 'PRV', 'BTL', 'BEA', 'OPN', 'KNT', 'DIV', diff --git a/account_banking_nl_triodos/i18n/en.po b/account_banking_nl_triodos/i18n/en.po index 2b270a8a1..da665a915 100644 --- a/account_banking_nl_triodos/i18n/en.po +++ b/account_banking_nl_triodos/i18n/en.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_nl_triodos #: code:addons/account_banking_nl_triodos/triodos.py:183 diff --git a/account_banking_nl_triodos/i18n/nl.po b/account_banking_nl_triodos/i18n/nl.po index ed09259c9..63ee706d7 100644 --- a/account_banking_nl_triodos/i18n/nl.po +++ b/account_banking_nl_triodos/i18n/nl.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_nl_triodos #: code:addons/account_banking_nl_triodos/triodos.py:183 diff --git a/account_banking_nl_triodos/i18n/pt_BR.po b/account_banking_nl_triodos/i18n/pt_BR.po index 9c56949fd..20b36e69a 100644 --- a/account_banking_nl_triodos/i18n/pt_BR.po +++ b/account_banking_nl_triodos/i18n/pt_BR.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_nl_triodos #: code:addons/account_banking_nl_triodos/triodos.py:183 diff --git a/account_banking_nl_triodos/triodos.py b/account_banking_nl_triodos/triodos.py index dea453d2d..deca77764 100644 --- a/account_banking_nl_triodos/triodos.py +++ b/account_banking_nl_triodos/triodos.py @@ -65,8 +65,8 @@ class transaction_message(object): if self.debcred == 'Debet': self.transferred_amount = -self.transferred_amount self.execution_date = str2date(self.date, '%d-%m-%Y') - self.effective_date = str2date(self.date, '%d-%m-%Y') - self.statement_id = '' # self.effective_date.strftime('%Yw%W') # Set statement_id based on week number + self.value_date = str2date(self.date, '%d-%m-%Y') + self.statement_id = '' self.id = str(subno).zfill(4) # Normalize basic account numbers self.remote_account = self.remote_account.replace('.', '').zfill(10) @@ -78,7 +78,7 @@ class transaction(models.mem_bank_transaction): ''' attrnames = ['local_account', 'remote_account', 'remote_owner', 'transferred_amount', - 'execution_date', 'effective_date', 'transfer_type', + 'execution_date', 'value_date', 'transfer_type', 'reference', 'id', ] @@ -212,7 +212,7 @@ Statements. msg = transaction_message(line, subno) if not statement_id: statement_id = self.get_unique_statement_id( - cr, msg.effective_date.strftime('%Yw%W')) + cr, msg.execution_date.strftime('%Yw%W')) msg.statement_id = statement_id if stmnt: stmnt.import_transaction(msg) diff --git a/account_banking_pain_base/i18n/fr.po b/account_banking_pain_base/i18n/fr.po index 5aee0611a..e58b8ece0 100644 --- a/account_banking_pain_base/i18n/fr.po +++ b/account_banking_pain_base/i18n/fr.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_pain_base #: field:res.company,initiating_party_issuer:0 diff --git a/account_banking_pain_base/i18n/nl.po b/account_banking_pain_base/i18n/nl.po index c33db28e8..721d24f68 100644 --- a/account_banking_pain_base/i18n/nl.po +++ b/account_banking_pain_base/i18n/nl.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_pain_base #: field:res.company,initiating_party_issuer:0 diff --git a/account_banking_partner_journal_account/i18n/nl.po b/account_banking_partner_journal_account/i18n/nl.po index a479fcaf0..ec27c63ed 100644 --- a/account_banking_partner_journal_account/i18n/nl.po +++ b/account_banking_partner_journal_account/i18n/nl.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_partner_journal_account #: model:ir.model,name:account_banking_partner_journal_account.model_res_partner diff --git a/account_banking_payment/i18n/nl.po b/account_banking_payment/i18n/nl.po index aaa8b7ba2..0dbdee7ca 100644 --- a/account_banking_payment/i18n/nl.po +++ b/account_banking_payment/i18n/nl.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-10-25 15:58+0000\n" -"PO-Revision-Date: 2013-12-03 11:50+0000\n" -"Last-Translator: Jan Jurkus (GCE CAD-Service) \n" +"PO-Revision-Date: 2014-03-26 14:48+0000\n" +"Last-Translator: Erwin van der Ploeg (BAS Solutions) \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_payment #: model:ir.model,name:account_banking_payment.model_payment_order_create @@ -269,7 +269,7 @@ msgstr "Fout" #. module: account_banking_payment #: field:payment.mode,transfer_account_id:0 msgid "Transfer account" -msgstr "Overschrijf bedrag" +msgstr "Overschrijf rekening" #. module: account_banking_payment #: code:addons/account_banking_payment/model/banking_import_transaction.py:225 diff --git a/account_banking_payment/model/payment_line.py b/account_banking_payment/model/payment_line.py index 7b5345ecf..1cf14c614 100644 --- a/account_banking_payment/model/payment_line.py +++ b/account_banking_payment/model/payment_line.py @@ -36,23 +36,9 @@ class payment_line(orm.Model): ''' _inherit = 'payment.line' _columns = { - # New fields 'msg': fields.char('Message', size=255, required=False, readonly=True), 'date_done': fields.date( 'Date Confirmed', select=True, readonly=True), - # Communication: required is dependend on the mode - 'communication': fields.char( - 'Communication', size=64, required=False, - help=("Used as the message between ordering customer and current " - "company. Depicts 'What do you want to say to the recipient" - " about this order ?'" - ), - ), - # Communication2: enlarge to 128 - 'communication2': fields.char( - 'Communication 2', size=128, - help='The successor message of Communication.', - ), 'transit_move_line_id': fields.many2one( # this line is part of the credit side of move 2a # from the documentation diff --git a/account_banking_payment/view/account_payment.xml b/account_banking_payment/view/account_payment.xml index c26847abf..fb29c8716 100644 --- a/account_banking_payment/view/account_payment.xml +++ b/account_banking_payment/view/account_payment.xml @@ -17,13 +17,6 @@ 'invisible':[('state','!=','draft')] }
- - - { - 'readonly': [('state', '=', 'normal')] - } - diff --git a/account_banking_payment_export/__openerp__.py b/account_banking_payment_export/__openerp__.py index 11835c973..424be1620 100644 --- a/account_banking_payment_export/__openerp__.py +++ b/account_banking_payment_export/__openerp__.py @@ -26,7 +26,7 @@ { 'name': 'Account Banking - Payments Export Infrastructure', - 'version': '0.1.164', + 'version': '0.1.165', 'license': 'AGPL-3', 'author': 'Banking addons community', 'website': 'https://launchpad.net/banking-addons', diff --git a/account_banking_payment_export/i18n/nl.po b/account_banking_payment_export/i18n/nl.po index 02cd48ac9..dea08f97f 100644 --- a/account_banking_payment_export/i18n/nl.po +++ b/account_banking_payment_export/i18n/nl.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_payment_export #: help:payment.mode.type,name:0 diff --git a/account_banking_payment_export/migrations/7.0.0.1.165/pre-migration.py b/account_banking_payment_export/migrations/7.0.0.1.165/pre-migration.py new file mode 100644 index 000000000..a420f05fd --- /dev/null +++ b/account_banking_payment_export/migrations/7.0.0.1.165/pre-migration.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2014 Akretion (http://www.akretion.com/) +# @author: Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +def migrate(cr, version): + if not version: + return + cr.execute( + "UPDATE payment_line SET communication = communication2, " + "communication2 = null " + "FROM payment_order " + "WHERE payment_line.order_id = payment_order.id " + "AND payment_order.state in ('draft', 'open') " + "AND payment_line.state = 'normal' " + "AND communication2 is not null") diff --git a/account_banking_payment_export/model/payment_order_create.py b/account_banking_payment_export/model/payment_order_create.py index 5dffe24e1..20d8c3ac1 100644 --- a/account_banking_payment_export/model/payment_order_create.py +++ b/account_banking_payment_export/model/payment_order_create.py @@ -88,6 +88,82 @@ class payment_order_create(orm.TransientModel): 'target': 'new', } + def _prepare_payment_line(self, cr, uid, payment, line, context=None): + '''This function is designed to be inherited + The resulting dict is passed to the create method of payment.line''' + _today = fields.date.context_today(self, cr, uid, context=context) + if payment.date_prefered == "now": + #no payment date => immediate payment + date_to_pay = False + elif payment.date_prefered == 'due': + ### account_banking + # date_to_pay = line.date_maturity + date_to_pay = ( + line.date_maturity + if line.date_maturity and line.date_maturity > _today + else False) + ### end account banking + elif payment.date_prefered == 'fixed': + ### account_banking + # date_to_pay = payment.date_scheduled + date_to_pay = ( + payment.date_scheduled + if payment.date_scheduled and payment.date_scheduled > _today + else False) + ### end account banking + + ### account_banking + state = 'normal' + communication = line.ref or '-' + if line.invoice: + if line.invoice.type in ('in_invoice', 'in_refund'): + if line.invoice.reference_type == 'structured': + state = 'structured' + communication = line.invoice.reference + else: + if line.invoice.reference: + communication = line.invoice.reference + elif line.invoice.supplier_invoice_number: + communication = line.invoice.supplier_invoice_number + else: + # Make sure that the communication includes the + # customer invoice number (in the case of debit order) + communication = line.invoice.number.replace('/', '') + state = 'structured' + + # support debit orders when enabled + if (payment.payment_order_type == 'debit' and + 'amount_to_receive' in line): + amount_currency = line.amount_to_receive + else: + amount_currency = line.amount_to_pay + ### end account_banking + + ### account banking + # t = None + # line2bank = line_obj.line2bank(cr, uid, line_ids, t, context) + line2bank = self.pool['account.move.line'].line2bank( + cr, uid, [line.id], payment.mode.id, context) + ### end account banking + + res = { + 'move_line_id': line.id, + 'amount_currency': amount_currency, + 'bank_id': line2bank.get(line.id), + 'order_id': payment.id, + 'partner_id': line.partner_id and line.partner_id.id or False, + ### account banking + # 'communication': line.ref or '/' + 'communication': communication, + 'state': state, + ### end account banking + 'date': date_to_pay, + 'currency': (line.invoice and line.invoice.currency_id.id + or line.journal_id.currency.id + or line.journal_id.company_id.currency_id.id), + } + return res + def create_payment(self, cr, uid, ids, context=None): ''' This method is a slightly modified version of the existing method on this @@ -97,10 +173,6 @@ class payment_order_create(orm.TransientModel): references are allowed, but others as well - check date_to_pay is not in the past. ''' - - order_obj = self.pool.get('payment.order') - line_obj = self.pool.get('account.move.line') - payment_obj = self.pool.get('payment.line') if context is None: context = {} data = self.read(cr, uid, ids, [], context=context)[0] @@ -108,85 +180,14 @@ class payment_order_create(orm.TransientModel): if not line_ids: return {'type': 'ir.actions.act_window_close'} - payment = order_obj.browse( + payment = self.pool['payment.order'].browse( cr, uid, context['active_id'], context=context) - ### account banking - # t = None - # line2bank = line_obj.line2bank(cr, uid, line_ids, t, context) - line2bank = line_obj.line2bank( - cr, uid, line_ids, payment.mode.id, context) - _today = fields.date.context_today(self, cr, uid, context=context) - ### end account banking - - ## Finally populate the current payment with new lines: - for line in line_obj.browse(cr, uid, line_ids, context=context): - if payment.date_prefered == "now": - #no payment date => immediate payment - date_to_pay = False - elif payment.date_prefered == 'due': - ### account_banking - # date_to_pay = line.date_maturity - date_to_pay = ( - line.date_maturity - if line.date_maturity and line.date_maturity > _today - else False) - ### end account banking - elif payment.date_prefered == 'fixed': - ### account_banking - # date_to_pay = payment.date_scheduled - date_to_pay = ( - payment.date_scheduled - if payment.date_scheduled and payment.date_scheduled > _today - else False) - ### end account banking - - ### account_banking - state = communication2 = False - communication = line.ref or '/' - if line.invoice: - if line.invoice.type in ('in_invoice', 'in_refund'): - if line.invoice.reference_type == 'structured': - state = 'structured' - communication = line.invoice.reference - else: - state = 'normal' - communication2 = line.invoice.reference - else: - # Make sure that the communication includes the - # customer invoice number (in the case of debit order) - communication = line.invoice.number.replace('/', '') - state = 'structured' - if line.invoice.number != line.ref: - communication2 = line.ref - else: - state = 'normal' - communication2 = line.ref - - # support debit orders when enabled - if (payment.payment_order_type == 'debit' and - 'amount_to_receive' in line): - amount_currency = line.amount_to_receive - else: - amount_currency = line.amount_to_pay - ### end account_banking - - payment_obj.create(cr, uid, { - 'move_line_id': line.id, - 'amount_currency': amount_currency, - 'bank_id': line2bank.get(line.id), - 'order_id': payment.id, - 'partner_id': line.partner_id and line.partner_id.id or False, - ### account banking - # 'communication': line.ref or '/' - 'communication': communication, - 'communication2': communication2, - 'state': state, - ### end account banking - 'date': date_to_pay, - 'currency': (line.invoice and line.invoice.currency_id.id - or line.journal_id.currency.id - or line.journal_id.company_id.currency_id.id), - }, context=context) + ## Populate the current payment with new lines: + for line in self.pool['account.move.line'].browse( + cr, uid, line_ids, context=context): + vals = self._prepare_payment_line( + cr, uid, payment, line, context=context) + self.pool['payment.line'].create(cr, uid, vals, context=context) # Force reload of payment order view as a workaround for lp:1155525 return {'name': _('Payment Orders'), 'context': context, diff --git a/account_banking_sepa_credit_transfer/i18n/fr.po b/account_banking_sepa_credit_transfer/i18n/fr.po index af66bc9eb..b4bb7235f 100644 --- a/account_banking_sepa_credit_transfer/i18n/fr.po +++ b/account_banking_sepa_credit_transfer/i18n/fr.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_sepa_credit_transfer #: selection:banking.export.sepa.wizard,state:0 diff --git a/account_banking_sepa_credit_transfer/i18n/nl.po b/account_banking_sepa_credit_transfer/i18n/nl.po index 6ed80f0df..541366292 100644 --- a/account_banking_sepa_credit_transfer/i18n/nl.po +++ b/account_banking_sepa_credit_transfer/i18n/nl.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-12-23 22:49+0000\n" -"PO-Revision-Date: 2014-02-01 07:47+0000\n" +"PO-Revision-Date: 2014-04-24 10:34+0000\n" "Last-Translator: Erwin van der Ploeg (BAS Solutions) \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_sepa_credit_transfer #: selection:banking.export.sepa.wizard,state:0 @@ -59,9 +59,9 @@ msgstr "" "afgesproken regels in het service level en/of schema (Voor SEPA berichten " "deze gebruiken). Gedeeld : De transactiekosten aan de debiteur zijde zijn " "voor de schuldeiser, transactiekosten aan de crediteur kant zijn voor de " -"schuldenaar. Rekening van de schuldenaar: Alle transactie kosten zijn voor " -"rekening van de schuldenaar. Rekening van de schuldeiser: Alle transactie " -"kosten zijn voor rekening van de schuldeiser." +"schuldenaar. Op rekening van de schuldenaar: Alle transactie kosten zijn " +"voor rekening van de schuldenaar. Op rekening van de schuldeiser: Alle " +"transactie kosten zijn voor rekening van de schuldeiser." #. module: account_banking_sepa_credit_transfer #: selection:banking.export.sepa,charge_bearer:0 @@ -110,7 +110,7 @@ msgstr "Volg service level" #: selection:banking.export.sepa,charge_bearer:0 #: selection:banking.export.sepa.wizard,charge_bearer:0 msgid "Borne by Creditor" -msgstr "Rekening van schuldeiser" +msgstr "Op rekening van schuldeiser" #. module: account_banking_sepa_credit_transfer #: view:banking.export.sepa.wizard:0 @@ -126,7 +126,7 @@ msgstr "Genereer" #: selection:banking.export.sepa,charge_bearer:0 #: selection:banking.export.sepa.wizard,charge_bearer:0 msgid "Borne by Debtor" -msgstr "Rekening van schuldenaar" +msgstr "Op rekening van schuldenaar" #. module: account_banking_sepa_credit_transfer #: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:128 @@ -186,9 +186,9 @@ msgstr "" "afgesproken regels in het service level en/of schema (Voor SEPA berichten " "deze gebruiken). Gedeeld : De transactiekosten aan de crediteur zijde zijn " "voor de schuldenaar, transactiekosten aan de debiteur kant zijn voor de " -"schuldeiser. Rekening van de schuldenaar: Alle transactie kosten zijn voor " -"rekening van de schuldenaar. Rekening van de schuldeiser: Alle transactie " -"kosten zijn voor rekening van de schuldeiser." +"schuldeiser. Op rekening van de schuldenaar: Alle transactie kosten zijn " +"voor rekening van de schuldenaar. Op rekening van de schuldeiser: Alle " +"transactie kosten zijn voor rekening van de schuldeiser." #. module: account_banking_sepa_credit_transfer #: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:129 diff --git a/account_banking_sepa_direct_debit/account_banking_sdd.py b/account_banking_sepa_direct_debit/account_banking_sdd.py index cbf0d0d10..87e50111b 100644 --- a/account_banking_sepa_direct_debit/account_banking_sdd.py +++ b/account_banking_sepa_direct_debit/account_banking_sdd.py @@ -191,8 +191,7 @@ class sdd_mandate(orm.Model): 'company_id': lambda self, cr, uid, context: self.pool['res.company']._company_default_get( cr, uid, 'sdd.mandate', context=context), - 'unique_mandate_reference': lambda self, cr, uid, ctx: - self.pool['ir.sequence'].get(cr, uid, 'sdd.mandate.reference'), + 'unique_mandate_reference': '/', 'state': 'draft', 'sepa_migrated': True, } @@ -203,6 +202,13 @@ class sdd_mandate(orm.Model): 'A Mandate with the same reference already exists for this company !' )] + def create(self, cr, uid, vals, context=None): + if vals.get('unique_mandate_reference', '/') == '/': + vals['unique_mandate_reference'] = \ + self.pool['ir.sequence'].next_by_code( + cr, uid, 'sdd.mandate.reference', context=context) + return super(sdd_mandate, self).create(cr, uid, vals, context=context) + def _check_sdd_mandate(self, cr, uid, ids): for mandate in self.browse(cr, uid, ids): if (mandate.signature_date and @@ -314,6 +320,16 @@ class sdd_mandate(orm.Model): cr, uid, to_cancel_ids, {'state': 'cancel'}, context=context) return True + def back2draft(self, cr, uid, ids, context=None): + to_draft_ids = [] + for mandate in self.browse(cr, uid, ids, context=context): + assert mandate.state == 'cancel',\ + 'Mandate should be in cancel state' + to_draft_ids.append(mandate.id) + self.write( + cr, uid, to_draft_ids, {'state': 'draft'}, context=context) + return True + def _sdd_mandate_set_state_to_expired(self, cr, uid, context=None): logger.info('Searching for SDD Mandates that must be set to Expired') expire_limit_date = datetime.today() + \ diff --git a/account_banking_sepa_direct_debit/i18n/fr.po b/account_banking_sepa_direct_debit/i18n/fr.po index a8a0a1d21..3744da850 100644 --- a/account_banking_sepa_direct_debit/i18n/fr.po +++ b/account_banking_sepa_direct_debit/i18n/fr.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_sepa_direct_debit #: model:mail.message.subtype,description:account_banking_sepa_direct_debit.mandate_valid diff --git a/account_banking_sepa_direct_debit/i18n/nl.po b/account_banking_sepa_direct_debit/i18n/nl.po index 2db04467f..2c2ccc12f 100644 --- a/account_banking_sepa_direct_debit/i18n/nl.po +++ b/account_banking_sepa_direct_debit/i18n/nl.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: banking-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2013-12-23 22:24+0000\n" -"PO-Revision-Date: 2014-02-11 09:47+0000\n" +"PO-Revision-Date: 2014-04-24 10:38+0000\n" "Last-Translator: Erwin van der Ploeg (BAS Solutions) \n" "Language-Team: Dutch \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_banking_sepa_direct_debit #: model:mail.message.subtype,description:account_banking_sepa_direct_debit.mandate_valid @@ -81,7 +81,7 @@ msgstr "Reeks soort voor volgende incasso" #: selection:banking.export.sdd,charge_bearer:0 #: selection:banking.export.sdd.wizard,charge_bearer:0 msgid "Borne by Creditor" -msgstr "Rekening van schuldeiser" +msgstr "Op rekening van schuldeiser" #. module: account_banking_sepa_direct_debit #: model:ir.actions.act_window,name:account_banking_sepa_direct_debit.sdd_mandate_action @@ -205,9 +205,9 @@ msgstr "" "afgesproken regels in het service level en/of schema (Voor SEPA berichten " "deze gebruiken). Gedeeld : De transactiekosten aan de crediteur zijde zijn " "voor de schuldenaar, transactiekosten aan de debiteur kant zijn voor de " -"schuldeiser. Rekening van de schuldenaar: Alle transactie kosten zijn voor " -"rekening van de schuldenaar. Rekening van de schuldeiser: Alle transactie " -"kosten zijn voor rekening van de schuldeiser." +"schuldeiser. Op rekening van de schuldenaar: Alle transactie kosten zijn " +"voor rekening van de schuldenaar. Op rekening van de schuldeiser: Alle " +"transactie kosten zijn voor rekening van de schuldeiser." #. module: account_banking_sepa_direct_debit #: view:sdd.mandate:0 diff --git a/account_banking_sepa_direct_debit/sdd_mandate_view.xml b/account_banking_sepa_direct_debit/sdd_mandate_view.xml index 409919dc5..bd1dd6e79 100644 --- a/account_banking_sepa_direct_debit/sdd_mandate_view.xml +++ b/account_banking_sepa_direct_debit/sdd_mandate_view.xml @@ -13,8 +13,11 @@
-
diff --git a/account_banking_tests/__openerp__.py b/account_banking_tests/__openerp__.py index 04e3fdd70..47194935a 100644 --- a/account_banking_tests/__openerp__.py +++ b/account_banking_tests/__openerp__.py @@ -27,7 +27,7 @@ 'category': 'Banking addons', 'depends': [ 'account_accountant', - 'account_banking', + 'account_banking_payment', 'account_banking_sepa_credit_transfer', ], 'description': ''' diff --git a/account_banking_tests/tests/test_payment_roundtrip.py b/account_banking_tests/tests/test_payment_roundtrip.py index 8962df1c4..a3c8223f4 100644 --- a/account_banking_tests/tests/test_payment_roundtrip.py +++ b/account_banking_tests/tests/test_payment_roundtrip.py @@ -163,6 +163,8 @@ class TestPaymentRoundtrip(SingleTransactionCase): 'price_unit': 100.0, 'quantity': 1, 'account_id': expense_id,})], + 'reference_type': 'none', + 'supplier_invoice_number': 'INV1', } self.invoice_ids = [ invoice_model.create( @@ -171,7 +173,11 @@ class TestPaymentRoundtrip(SingleTransactionCase): })] values.update({ 'partner_id': supplier2, - 'name': 'Purchase 2'}) + 'name': 'Purchase 2', + 'reference_type': 'structured', + 'supplier_invoice_number': 'INV2', + 'reference': 'STR2', + }) self.invoice_ids.append( invoice_model.create( cr, uid, values, context={ @@ -247,6 +253,27 @@ class TestPaymentRoundtrip(SingleTransactionCase): }, context=context) reg('payment.order.create').create_payment( cr, uid, [self.payment_order_create_id], context=context) + + # Check if payment lines are created with the correct reference + self.assertTrue( + reg('payment.line').search( + cr, uid, [ + ('move_line_id.invoice', '=', self.invoice_ids[0]), + ('communication', '=', 'INV1'), + ('state', '=', 'normal'), + ], context=context), + 'No payment line created from invoice 1 or with the wrong ' + 'communication') + self.assertTrue( + reg('payment.line').search( + cr, uid, [ + ('move_line_id.invoice', '=', self.invoice_ids[1]), + ('communication', '=', 'STR2'), + ('state', '=', 'structured'), + ], context=context), + 'No payment line created from invoice 2 or with the wrong ' + 'communication') + wf_service = netsvc.LocalService('workflow') wf_service.trg_validate( uid, 'payment.order', self.payment_order_id, 'open', cr) diff --git a/account_banking_uk_hsbc/hsbc_mt940.py b/account_banking_uk_hsbc/hsbc_mt940.py index fc3dd65fd..5016ba1e2 100644 --- a/account_banking_uk_hsbc/hsbc_mt940.py +++ b/account_banking_uk_hsbc/hsbc_mt940.py @@ -40,7 +40,7 @@ class transaction(models.mem_bank_transaction): mapping = { 'execution_date' : 'valuedate', - 'effective_date' : 'valuedate', + 'value_date' : 'valuedate', 'local_currency' : 'currency', 'transfer_type' : 'bookingcode', 'reference' : 'custrefno', diff --git a/account_direct_debit/i18n/nl.po b/account_direct_debit/i18n/nl.po index 94a63bb44..659a5e48e 100644 --- a/account_direct_debit/i18n/nl.po +++ b/account_direct_debit/i18n/nl.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_direct_debit #: model:account.payment.term,note:account_direct_debit.payment_term_direct_debit diff --git a/account_iban_preserve_domestic/i18n/nl.po b/account_iban_preserve_domestic/i18n/nl.po index 485b9ac6e..ba3a493c1 100644 --- a/account_iban_preserve_domestic/i18n/nl.po +++ b/account_iban_preserve_domestic/i18n/nl.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_iban_preserve_domestic #: field:res.partner.bank,acc_number_domestic:0 diff --git a/account_iban_preserve_domestic/i18n/pt_BR.po b/account_iban_preserve_domestic/i18n/pt_BR.po index 483bc95ee..6d16d26fa 100644 --- a/account_iban_preserve_domestic/i18n/pt_BR.po +++ b/account_iban_preserve_domestic/i18n/pt_BR.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: account_iban_preserve_domestic #: field:res.partner.bank,acc_number_domestic:0 diff --git a/base_iban_bic_not_required/i18n/nl.po b/base_iban_bic_not_required/i18n/nl.po index 3ace4ddc1..9b1313012 100644 --- a/base_iban_bic_not_required/i18n/nl.po +++ b/base_iban_bic_not_required/i18n/nl.po @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: base_iban_bic_not_required #: constraint:res.partner.bank:0 diff --git a/base_iban_bic_not_required/i18n/pt_BR.po b/base_iban_bic_not_required/i18n/pt_BR.po index 99f18af68..2720edba5 100644 --- a/base_iban_bic_not_required/i18n/pt_BR.po +++ b/base_iban_bic_not_required/i18n/pt_BR.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-21 06:57+0000\n" -"X-Generator: Launchpad (build 16967)\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" #. module: base_iban_bic_not_required #: constraint:res.partner.bank:0