diff --git a/addons/account/account.py b/addons/account/account.py
index 45d3cb4377c..9aadf24b7dd 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -2572,12 +2572,10 @@ class wizard_multi_charts_accounts(osv.osv_memory):
data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view')])
data = data_pool.browse(cr, uid, data_id[0])
view_id_cash = data.res_id
- #view_id_cash = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal View')])[0] #TOFIX: why put fix name
-
+
data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view_multi')])
data = data_pool.browse(cr, uid, data_id[0])
ref_acc_bank = data.res_id
- #ref_acc_bank = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal (Multi-Currency) View')])[0] #TOFIX: why put fix name
ref_acc_bank = obj_multi.chart_template_id.bank_account_view_id
current_num = 1
@@ -2604,8 +2602,8 @@ class wizard_multi_charts_accounts(osv.osv_memory):
if obj_multi.seq_journal:
vals_seq={
- 'name': _('Bank Journal ') + vals['name'],
- 'code': 'account.journal',
+ 'name': _('Bank Journal ') + vals['name'],
+ 'code': 'account.journal',
}
seq_id = obj_sequence.create(cr,uid,vals_seq)
@@ -2661,9 +2659,9 @@ class wizard_multi_charts_accounts(osv.osv_memory):
for position in obj_fiscal_position_template.browse(cr, uid, fp_ids):
vals_fp = {
- 'company_id' : company_id,
- 'name' : position.name,
- }
+ 'company_id' : company_id,
+ 'name' : position.name,
+ }
new_fp = obj_fiscal_position.create(cr, uid, vals_fp)
obj_tax_fp = self.pool.get('account.fiscal.position.tax')
@@ -2671,18 +2669,18 @@ class wizard_multi_charts_accounts(osv.osv_memory):
for tax in position.tax_ids:
vals_tax = {
- 'tax_src_id' : tax_template_ref[tax.tax_src_id.id],
- 'tax_dest_id' : tax.tax_dest_id and tax_template_ref[tax.tax_dest_id.id] or False,
- 'position_id' : new_fp,
- }
+ 'tax_src_id' : tax_template_ref[tax.tax_src_id.id],
+ 'tax_dest_id' : tax.tax_dest_id and tax_template_ref[tax.tax_dest_id.id] or False,
+ 'position_id' : new_fp,
+ }
obj_tax_fp.create(cr, uid, vals_tax)
for acc in position.account_ids:
vals_acc = {
- 'account_src_id' : acc_template_ref[acc.account_src_id.id],
- 'account_dest_id' : acc_template_ref[acc.account_dest_id.id],
- 'position_id' : new_fp,
- }
+ 'account_src_id' : acc_template_ref[acc.account_src_id.id],
+ 'account_dest_id' : acc_template_ref[acc.account_dest_id.id],
+ 'position_id' : new_fp,
+ }
obj_ac_fp.create(cr, uid, vals_acc)
#fially inactive the demo chart of accounts
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 90ef039e550..7572ae2aa59 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -5,7 +5,6 @@
-
account.invoice.calendar
account.invoice
@@ -17,6 +16,7 @@
+
account.invoice.graph
account.invoice
@@ -28,6 +28,7 @@
+
account.invoice.line.tree
account.invoice.line
@@ -44,6 +45,7 @@
+
account.invoice.line.form
account.invoice.line
@@ -74,6 +76,7 @@
+
account.invoice.tax.tree
account.invoice.tax
@@ -89,6 +92,7 @@
+
account.invoice.tax.form
account.invoice.tax
@@ -149,7 +153,7 @@
-
+
@@ -212,7 +216,7 @@
-
+
@@ -245,7 +249,6 @@
-
account.invoice.form
account.invoice
@@ -259,7 +262,7 @@
-
+
@@ -312,7 +315,7 @@
-
tree
+
form
@@ -421,11 +425,13 @@
{'type':'out_invoice'}
+
tree
+
form
@@ -469,7 +475,6 @@
-
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index 3ccfdb160c9..55ec3ab43f1 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -299,7 +299,7 @@ class account_invoice(osv.osv):
'account.move.line': (_get_invoice_from_line, None, 50),
'account.move.reconcile': (_get_invoice_from_reconcile, None, 50),
}, help="The Ledger Postings of the invoice have been reconciled with Ledger Postings of the payment(s)."),
- 'partner_bank': fields.many2one('res.partner.bank', 'Bank Account',
+ 'partner_bank_id': fields.many2one('res.partner.bank', 'Bank Account',
help='Bank Account Number, Company bank account if Invoice is customer or supplier refund, otherwise Parner bank account number.', readonly=True, states={'draft':[('readonly',False)]}),
'move_lines':fields.function(_get_lines , method=True, type='many2many', relation='account.move.line', string='Entry Lines'),
'residual': fields.function(_amount_residual, method=True, digits_compute=dp.get_precision('Account'), string='Residual',
@@ -373,7 +373,7 @@ class account_invoice(osv.osv):
# def get_invoice_address(self, cr, uid, ids):
# res = self.pool.get('res.partner').address_get(cr, uid, [part], ['invoice'])
# return [{}]
- def onchange_partner_id(self, cr, uid, ids, type, partner_id,
+ def onchange_partner_id(self, cr, uid, ids, type, partner_id,\
date_invoice=False, payment_term=False, partner_bank=False, company_id=False):
invoice_addr_id = False
contact_addr_id = False
@@ -429,7 +429,7 @@ class account_invoice(osv.osv):
}
if type in ('in_invoice', 'in_refund'):
- result['value']['partner_bank'] = bank_id
+ result['value']['partner_bank_id'] = bank_id
if payment_term != partner_payment_term:
if partner_payment_term:
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py
index a06c59da06a..825fdeaa44f 100644
--- a/addons/account/report/account_invoice_report.py
+++ b/addons/account/report/account_invoice_report.py
@@ -68,7 +68,7 @@ class account_invoice_report(osv.osv):
'address_contact_id': fields.many2one('res.partner.address', 'Contact Address Name', readonly=True),
'address_invoice_id': fields.many2one('res.partner.address', 'Invoice Address Name', readonly=True),
'account_id': fields.many2one('account.account', 'Account',readonly=True),
- 'partner_bank': fields.many2one('res.partner.bank', 'Bank Account',readonly=True),
+ 'partner_bank_id': fields.many2one('res.partner.bank', 'Bank Account',readonly=True),
'residual':fields.float('Total Residual', readonly=True),
'delay_to_pay':fields.float('Avg. Delay To Pay', readonly=True, group_operator="avg"),
}
@@ -101,7 +101,7 @@ class account_invoice_report(osv.osv):
ai.address_contact_id as address_contact_id,
ai.address_invoice_id as address_invoice_id,
ai.account_id as account_id,
- ai.partner_bank as partner_bank,
+ ai.partner_bank_id as partner_bank_id,
sum(case when ai.type in ('out_refund','in_invoice') then
ail.quantity * u.factor * -1
else
@@ -152,7 +152,7 @@ class account_invoice_report(osv.osv):
ai.address_contact_id,
ai.address_invoice_id,
ai.account_id,
- ai.partner_bank,
+ ai.partner_bank_id,
ai.residual
)
""")
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index d03e977336b..3ea50b8925c 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -25,7 +25,7 @@
-
+
diff --git a/addons/account_payment/account_move_line.py b/addons/account_payment/account_move_line.py
index 27455183afd..ca583188a63 100644
--- a/addons/account_payment/account_move_line.py
+++ b/addons/account_payment/account_move_line.py
@@ -93,8 +93,8 @@ class account_move_line(osv.osv):
context=context)
for line in self.browse(cr, uid, ids, context=context):
line2bank[line.id] = False
- if line.invoice and line.invoice.partner_bank:
- line2bank[line.id] = line.invoice.partner_bank.id
+ if line.invoice and line.invoice.partner_bank_id:
+ line2bank[line.id] = line.invoice.partner_bank_id.id
elif line.partner_id:
if not line.partner_id.bank_ids:
#raise osv.except_osv(_('Error !'), _('Partner '+ line.partner_id.name+ ' has no bank account defined'))
diff --git a/addons/l10n_ch/account_invoice.xml b/addons/l10n_ch/account_invoice.xml
index e6602e686f8..e66f2b0f888 100644
--- a/addons/l10n_ch/account_invoice.xml
+++ b/addons/l10n_ch/account_invoice.xml
@@ -22,10 +22,10 @@
-
-
+
+ on_change="onchange_partner_bank(partner_bank_id)"/>
@@ -35,8 +35,8 @@
form
-
-
+
diff --git a/addons/l10n_ch/account_move_line.py b/addons/l10n_ch/account_move_line.py
index 006b79d24f8..d326a98b611 100644
--- a/addons/l10n_ch/account_move_line.py
+++ b/addons/l10n_ch/account_move_line.py
@@ -57,8 +57,8 @@ class AccountMoveLine(osv.osv):
bank_type = payment_mode_obj.suitable_bank_types(cr, uid, payment_type,
context=context)
for line in self.browse(cr, uid, ids, context=context):
- if line.invoice and line.invoice.partner_bank:
- line2bank[line.id] = line.invoice.partner_bank.id
+ if line.invoice and line.invoice.partner_bank_id:
+ line2bank[line.id] = line.invoice.partner_bank_id.id
elif line.partner_id:
for bank in line.partner_id.bank_ids:
if bank.state in bank_type:
diff --git a/addons/l10n_ch/invoice.py b/addons/l10n_ch/invoice.py
index 3d707b3b39e..fc0ec3dd762 100644
--- a/addons/l10n_ch/invoice.py
+++ b/addons/l10n_ch/invoice.py
@@ -82,7 +82,7 @@ class account_invoice(osv.osv):
'reference_type': fields.selection(_get_reference_type,
'Reference Type', required=True),
### Partner bank link between bank and partner id
- 'partner_bank': fields.many2one('res.partner.bank', 'Bank Account',
+ 'partner_bank_id': fields.many2one('res.partner.bank', 'Bank Account',
help='The partner bank account to pay\nKeep empty to use the default'
),
### Amount to pay
@@ -129,8 +129,8 @@ class account_invoice(osv.osv):
on the BVR reference type and the invoice partner bank type"""
for invoice in self.browse(cursor, user, ids):
if invoice.type in 'in_invoice':
- if invoice.partner_bank and \
- invoice.partner_bank.state in \
+ if invoice.partner_bank_id and \
+ invoice.partner_bank_id.state in \
('bvrbank', 'bvrpost') and \
invoice.reference_type != 'bvr':
return False
@@ -173,7 +173,7 @@ class account_invoice(osv.osv):
bank_id = p.bank_ids[0].id
if type in ('in_invoice', 'in_refund'):
- res['value']['partner_bank'] = bank_id
+ res['value']['partner_bank_id'] = bank_id
if partner_bank != bank_id:
to_update = self.onchange_partner_bank(cr, uid, ids, bank_id)
diff --git a/addons/l10n_ch/wizard/wizard_bvr.py b/addons/l10n_ch/wizard/wizard_bvr.py
index 15bdb85b356..10258a4b8bd 100644
--- a/addons/l10n_ch/wizard/wizard_bvr.py
+++ b/addons/l10n_ch/wizard/wizard_bvr.py
@@ -39,22 +39,22 @@ def _check(self, cr, uid, data, context):
pool = pooler.get_pool(cr.dbname)
invoice_obj = pool.get('account.invoice')
for invoice in invoice_obj.browse(cr, uid, data['ids'], context):
- if not invoice.partner_bank:
+ if not invoice.partner_bank_is:
raise wizard.except_wizard(_('UserError'),
_('No bank specified on invoice:\n%s') % \
invoice_obj.name_get(cr, uid, [invoice.id], context=context)[0][1])
if not re.compile('[0-9][0-9]-[0-9]{3,6}-[0-9]').match(
- invoice.partner_bank.bvr_number or ''):
+ invoice.partner_bank_id.bvr_number or ''):
raise wizard.except_wizard(_('UserError'),
_('Your bank BVR number should be of the form 0X-XXX-X!\n' \
'Please check your company ' \
'information for the invoice:\n%s') % \
invoice_obj.name_get(cr, uid, [invoice.id], context=context)[0][1])
- if invoice.partner_bank.bvr_adherent_num \
+ if invoice.partner_bank_id.bvr_adherent_num \
and not re.compile('[0-9]*$').match(
- invoice.partner_bank.bvr_adherent_num):
+ invoice.partner_bank_id.bvr_adherent_num):
raise wizard.except_wizard(_('UserError'),
_('Your bank BVR adherent number must contain exactly seven' \
'digits!\nPlease check your company ' \