[FIX] Wizard should not have ACL

[FIX] Undefined reference to orm.except_orm
This commit is contained in:
unknown
2013-10-28 15:51:41 +01:00
committed by Holger Brunn
5 changed files with 16 additions and 15 deletions

View File

@@ -4,4 +4,3 @@
"access_account_banking_import","account.bankimport","model_account_banking_imported_file","account.group_account_user",1,1,1,1
"access_payment_mode_type","payment.mode.type","model_payment_mode_type","account_payment.group_account_payment",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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
4 access_account_banking_import account.bankimport model_account_banking_imported_file account.group_account_user 1 1 1 1
5 access_payment_mode_type payment.mode.type model_payment_mode_type account_payment.group_account_payment 1 1 1 1
6 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

View File

@@ -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',

View File

@@ -14,7 +14,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" />
@@ -26,7 +26,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"/>
@@ -59,7 +59,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>
@@ -73,7 +73,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"

View File

@@ -107,7 +107,7 @@ class banking_export_sepa_wizard(osv.osv_memory):
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
@@ -260,7 +260,7 @@ class banking_export_sepa_wizard(osv.osv_memory):
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')
@@ -280,7 +280,8 @@ class banking_export_sepa_wizard(osv.osv_memory):
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)

View File

@@ -336,20 +336,20 @@ class payment_line(osv.osv):
payment_line_id = payment_line_id[0]
reconcile_obj = self.pool.get('account.move.reconcile')
move_line_obj = self.pool.get('account.move.line')
payment_line = self.browse(cr, uid, payment_line_id, context=context)
payment_line_record = self.browse(cr, uid, payment_line_id, context=context)
debit_move_line = payment_line.debit_move_line_id
torec_move_line = payment_line.move_line_id
debit_move_line = payment_line_record.debit_move_line_id
torec_move_line = payment_line_record.move_line_id
if payment_line.storno:
if payment_line_record.storno:
raise osv.except_osv(
_('Can not reconcile'),
_('Cancelation of payment line \'%s\' has already been ' +
'processed') % payment_line.name)
'processed') % payment_line_record.name)
if (not debit_move_line or not torec_move_line):
raise osv.except_osv(
_('Can not reconcile'),
_('No move line for line %s') % payment_line.name)
_('No move line for line %s') % payment_line_record.name)
if torec_move_line.reconcile_id: # torec_move_line.reconcile_partial_id:
raise osv.except_osv(
_('Error'),
@@ -370,7 +370,7 @@ class payment_line(osv.osv):
line_ids = [debit_move_line.id, torec_move_line.id]
if torec_move_line.reconcile_partial_id:
line_ids = [
x.id for x in debit_move_line.reconcile_partial_id.line_partial_ids] + [torec_move_line_id]
x.id for x in torec_move_line.reconcile_partial_id.line_partial_ids] + [debit_move_line.id]
total = move_line_obj.get_balance(cr, uid, line_ids)
vals = {