banking-addons-team team mailing list archive
-
banking-addons-team team
-
Mailing list archive
-
Message #00788
lp:~acsone-openerp/banking-addons/ba-70-missing-transfer-account into lp:banking-addons/banking-addons-70
Stéphane Bidoul (Acsone) has proposed merging lp:~acsone-openerp/banking-addons/ba-70-missing-transfer-account into lp:banking-addons/banking-addons-70.
Requested reviews:
Banking Addons Core Editors (banking-addons-team)
For more details, see:
https://code.launchpad.net/~acsone-openerp/banking-addons/ba-70-missing-transfer-account/+merge/178560
Transfer account and transfer journal are optional in payment modes. This patch attempts to handle such situations.
--
https://code.launchpad.net/~acsone-openerp/banking-addons/ba-70-missing-transfer-account/+merge/178560
Your team Banking Addons Core Editors is requested to review the proposed merge of lp:~acsone-openerp/banking-addons/ba-70-missing-transfer-account into lp:banking-addons/banking-addons-70.
=== modified file 'account_banking/security/ir.model.access.csv'
--- account_banking/security/ir.model.access.csv 2013-03-16 16:44:19 +0000
+++ account_banking/security/ir.model.access.csv 2013-08-05 13:21:34 +0000
@@ -3,4 +3,3 @@
"access_account_banking_settings_user","account.banking.account.settings user","model_account_banking_account_settings","account.group_account_user",1,0,0,0
"access_account_banking_import","account.bankimport","model_account_banking_imported_file","account.group_account_user",1,1,1,1
"access_banking_import_transaction","Banking addons - Bank import transaction","model_banking_import_transaction","account.group_account_user",1,1,1,1
-"access_banking_transaction_wizard","Banking addons - Transaction wizard","model_banking_transaction_wizard","account.group_account_user",1,1,1,1
=== modified file 'account_banking_payment/model/account_payment.py'
--- account_banking_payment/model/account_payment.py 2013-07-15 13:31:34 +0000
+++ account_banking_payment/model/account_payment.py 2013-08-05 13:21:34 +0000
@@ -284,6 +284,8 @@
'debit': _('Direct debit order'),
}
for order in self.browse(cr, uid, ids, context=context):
+ if not order.mode.transfer_journal_id or not order.mode.transfer_account_id:
+ continue
for line in order.line_ids:
# basic checks
if not line.move_line_id:
=== modified file 'account_banking_payment/view/banking_transaction_wizard.xml'
--- account_banking_payment/view/banking_transaction_wizard.xml 2013-05-29 22:26:36 +0000
+++ account_banking_payment/view/banking_transaction_wizard.xml 2013-08-05 13:21:34 +0000
@@ -26,7 +26,7 @@
domain="[('id', 'in', payment_order_ids[0][2])]"
/>
</field>
- <field name="manual_move_line_id" position="after">
+ <field name="manual_move_line_ids" position="after">
<field name="manual_payment_line_id"/>
<field name="manual_payment_order_id"/>
</field>
=== modified file 'account_banking_sepa_credit_transfer/__openerp__.py'
--- account_banking_sepa_credit_transfer/__openerp__.py 2013-06-28 19:39:37 +0000
+++ account_banking_sepa_credit_transfer/__openerp__.py 2013-08-05 13:21:34 +0000
@@ -20,6 +20,7 @@
##############################################################################
{
'name': 'Account Banking SEPA Credit Transfer',
+ 'summary': 'Create SEPA XML files for Credit Transfers',
'version': '0.1',
'license': 'AGPL-3',
'author': 'Akretion',
=== modified file 'account_banking_sepa_credit_transfer/account_banking_sepa_view.xml'
--- account_banking_sepa_credit_transfer/account_banking_sepa_view.xml 2013-06-28 19:39:37 +0000
+++ account_banking_sepa_credit_transfer/account_banking_sepa_view.xml 2013-08-05 13:21:34 +0000
@@ -13,7 +13,7 @@
<field name="arch" type="xml">
<form string="SEPA Credit Transfer">
<notebook>
- <page string="General information">
+ <page string="General Information">
<field name="msg_identification" select="1" />
<field name="total_amount" />
<field name="nb_transactions" />
@@ -25,7 +25,7 @@
<field name="file" filename="filename"/>
<field name="filename" invisible="True"/>
</page>
- <page string="Payment orders">
+ <page string="Payment Orders">
<field name="payment_order_ids" colspan="4" nolabel="1">
<tree colors="blue:state in ('draft');gray:state in ('cancel','done');black:state in ('open')" string="Payment order">
<field name="reference"/>
@@ -57,7 +57,7 @@
<record id="action_account_banking_sepa" model="ir.actions.act_window">
- <field name="name">Generated SEPA XML files</field>
+ <field name="name">Generated SEPA Credit Transfer XML files</field>
<field name="res_model">banking.export.sepa</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
@@ -71,7 +71,7 @@
/>
<act_window id="act_banking_export_sepa_payment_order"
- name="Generated SEPA files"
+ name="Generated SEPA Credit Transfer files"
domain="[('payment_order_ids', '=', active_id)]"
res_model="banking.export.sepa"
src_model="payment.order"
=== modified file 'account_banking_sepa_credit_transfer/wizard/export_sepa.py'
--- account_banking_sepa_credit_transfer/wizard/export_sepa.py 2013-06-28 19:39:37 +0000
+++ account_banking_sepa_credit_transfer/wizard/export_sepa.py 2013-08-05 13:21:34 +0000
@@ -106,7 +106,7 @@
sepa_export = self.browse(cr, uid, ids[0], context=context)
my_company_name = sepa_export.payment_order_ids[0].mode.bank_id.partner_id.name
- my_company_iban = self._validate_iban(cr, uid, sepa_export.payment_order_ids[0].mode.bank_id.iban, context=context)
+ my_company_iban = self._validate_iban(cr, uid, sepa_export.payment_order_ids[0].mode.bank_id.acc_number, context=context)
my_company_bic = sepa_export.payment_order_ids[0].mode.bank_id.bank.bic
#my_company_country_code = sepa_export.payment_order_ids[0].mode.bank_id.partner_id.address[0].country_id.code
#my_company_city = sepa_export.payment_order_ids[0].mode.bank_id.partner_id.address[0].city
@@ -239,6 +239,8 @@
creditor_agent = etree.SubElement(credit_transfer_transaction_info, 'CdtrAgt')
creditor_agent_institution = etree.SubElement(creditor_agent, 'FinInstnId')
creditor_agent_bic = etree.SubElement(creditor_agent_institution, bic_xml_tag)
+ if not line.bank_id:
+ raise orm.except_orm(_('Error :'), _("Missing Bank Account on invoice '%s' (payment order line reference '%s').") %(line.ml_inv_ref.number, line.name))
creditor_agent_bic.text = line.bank_id.bank.bic
creditor = etree.SubElement(credit_transfer_transaction_info, 'Cdtr')
creditor_name = etree.SubElement(creditor, 'Nm')
@@ -255,7 +257,7 @@
creditor_account = etree.SubElement(credit_transfer_transaction_info, 'CdtrAcct')
creditor_account_id = etree.SubElement(creditor_account, 'Id')
creditor_account_iban = etree.SubElement(creditor_account_id, 'IBAN')
- creditor_account_iban.text = self._validate_iban(cr, uid, line.bank_id.iban, context=context)
+ creditor_account_iban.text = self._validate_iban(cr, uid, line.bank_id.acc_number, context=context)
remittance_info = etree.SubElement(credit_transfer_transaction_info, 'RmtInf')
# switch to Structured (Strdr) ? If we do it, beware that the format is not the same between pain 02 and pain 03
remittance_info_unstructured = etree.SubElement(remittance_info, 'Ustrd')
@@ -275,7 +277,8 @@
official_pain_schema = etree.XMLSchema(etree.parse(tools.file_open('account_banking_sepa_credit_transfer/data/%s.xsd' % pain_flavor)))
try:
- official_pain_schema.validate(root)
+ root_to_validate = etree.fromstring(xml_string)
+ official_pain_schema.assertValid(root_to_validate)
except Exception, e:
_logger.warning("The XML file is invalid against the XML Schema Definition")
_logger.warning(xml_string)
=== modified file 'account_banking_sepa_credit_transfer/wizard/export_sepa_view.xml'
--- account_banking_sepa_credit_transfer/wizard/export_sepa_view.xml 2013-06-28 19:39:37 +0000
+++ account_banking_sepa_credit_transfer/wizard/export_sepa_view.xml 2013-08-05 13:21:34 +0000
@@ -11,7 +11,7 @@
<field name="name">banking.export.sepa.wizard.view</field>
<field name="model">banking.export.sepa.wizard</field>
<field name="arch" type="xml">
- <form string="SEPA XML file generation">
+ <form string="SEPA XML file generation" version="7.0">
<field name="state" invisible="True"/>
<group states="create">
<separator colspan="4" string="Processing details" />
@@ -20,9 +20,6 @@
<field name="charge_bearer" />
<separator colspan="4" string="Reference for further communication" />
<field name="msg_identification" required="True" />
- <newline />
- <button icon="gtk-close" special="cancel" string="Cancel" colspan="2"/>
- <button icon="gtk-ok" string="Generate" name="create_sepa" type="object" colspan="2"/>
</group>
<group states="finish">
<field name="total_amount" />
@@ -31,14 +28,16 @@
Bug desc : in the Gtk client, you have to clic twice on the
"Create" button.
<field name="nb_transactions" /> -->
- <newline />
- <field name="file_id" />
+ <!-- <field name="file_id" /> -->
<field name="file" filename="filename" />
<field name="filename" invisible="True"/>
- <newline />
- <button icon="gtk-cancel" string="Cancel" name="cancel_sepa" type="object" colspan="2"/>
- <button icon="gtk-ok" string="Validate" name="save_sepa" type="object" colspan="2"/>
</group>
+ <footer>
+ <button string="Generate" name="create_sepa" type="object" class="oe_highlight" states="create"/>
+ <button string="Cancel" special="cancel" class="oe_link" states="create"/>
+ <button string="Validate" name="save_sepa" type="object" class="oe_highlight" states="finish"/>
+ <button string="Cancel" name="cancel_sepa" type="object" class="oe_link" states="finish"/>
+ </footer>
</form>
</field>
</record>
=== modified file 'account_direct_debit/model/payment_line.py'
--- account_direct_debit/model/payment_line.py 2013-05-28 14:17:56 +0000
+++ account_direct_debit/model/payment_line.py 2013-08-05 13:21:34 +0000
@@ -133,14 +133,14 @@
"""
if isinstance(payment_line_id, (list, tuple)):
payment_line_id = payment_line_id[0]
- payment_line = self.read(
+ payment_line_vals = self.read(
cr, uid, payment_line_id, ['storno', 'name'], context=context)
- if payment_line['storno']:
+ if payment_line_vals['storno']:
raise orm.except_orm(
_('Can not reconcile'),
_('Cancelation of payment line \'%s\' has already been '
- 'processed') % payment_line['name'])
- return super(self, payment_line).debit_reconcile(
+ 'processed') % payment_line_vals['name'])
+ return super(payment_line, self).debit_reconcile(
cr, uid, payment_line_id, context=context)
_columns = {
Follow ups