[ADD] Account_voucher: import invoice from bank statements moved from account module
bzr revid: mra@mra-laptop-20100922062308-859tbohs0ne09hj0
This commit is contained in:
parent
8154302472
commit
23f99c1681
|
@ -49,7 +49,6 @@ module named account_voucher.
|
|||
'security/ir.model.access.csv',
|
||||
'account_menuitem.xml',
|
||||
'account_wizard.xml',
|
||||
'wizard/account_statement_from_invoice_view.xml',
|
||||
'wizard/account_move_bank_reconcile_view.xml',
|
||||
'wizard/account_use_model_view.xml',
|
||||
'account_installer.xml',
|
||||
|
|
|
@ -222,10 +222,10 @@ class account_bank_statement(osv.osv):
|
|||
account_move_line_obj = self.pool.get('account.move.line')
|
||||
account_analytic_line_obj = self.pool.get('account.analytic.line')
|
||||
account_bank_statement_line_obj = self.pool.get('account.bank.statement.line')
|
||||
|
||||
st_line = account_bank_statement_line_obj.browse(cr, uid, st_line_id, context)
|
||||
|
||||
st_line = account_bank_statement_line_obj.browse(cr, uid, st_line_id.id, context)
|
||||
st = st_line.statement_id
|
||||
|
||||
|
||||
context.update({'date': st_line.date})
|
||||
move_id = account_move_obj.create(cr, uid, {
|
||||
'journal_id': st.journal_id.id,
|
||||
|
@ -284,7 +284,7 @@ class account_bank_statement(osv.osv):
|
|||
|
||||
move_line_id = account_move_line_obj.create(cr, uid, val , context=context)
|
||||
torec.append(move_line_id)
|
||||
|
||||
|
||||
# Fill the secondary amount/currency
|
||||
# if currency is not the same than the company
|
||||
amount_currency = False
|
||||
|
|
|
@ -516,9 +516,6 @@
|
|||
<field name="balance_start"/>
|
||||
<field name="balance_end_real"/>
|
||||
<field name="currency" invisible="1"/>
|
||||
<button name="%(action_view_account_statement_from_invoice_lines)d"
|
||||
string="Import Invoices" type="action" icon="gtk-execute"
|
||||
attrs="{'invisible':[('state','=','confirm')]}"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Transaction" name="statement_line_ids">
|
||||
|
@ -579,9 +576,6 @@
|
|||
<field name="balance_start"/>
|
||||
<field name="balance_end_real"/>
|
||||
<field name="currency" invisible="1"/>
|
||||
<button name="%(action_view_account_statement_from_invoice_lines)d"
|
||||
string="Import Invoices" type="action" icon="gtk-execute"
|
||||
attrs="{'invisible':[('state','=','confirm')]}"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Journal Entries">
|
||||
|
|
|
@ -56,8 +56,6 @@ import account_use_model
|
|||
|
||||
import account_state_open
|
||||
|
||||
import account_statement_from_invoice
|
||||
|
||||
import account_report_print_journal
|
||||
import account_report_central_journal
|
||||
import account_report_general_journal
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,10 +15,12 @@
|
|||
# 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 <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import voucher
|
||||
import report
|
||||
import wizard
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -42,6 +42,7 @@
|
|||
"voucher_workflow.xml",
|
||||
"voucher_report.xml",
|
||||
"wizard/account_voucher_unreconcile_view.xml",
|
||||
"wizard/account_statement_from_invoice_view.xml",
|
||||
"voucher_view.xml",
|
||||
"voucher_payment_receipt_view.xml",
|
||||
"voucher_sales_purchase_view.xml",
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_voucher_form">
|
||||
<field name="name">account.voucher.form</field>
|
||||
<field name="model">account.voucher</field>
|
||||
|
@ -180,6 +180,35 @@
|
|||
</record>
|
||||
|
||||
|
||||
<record id="view_bank_statement_form_invoice_periodic" model="ir.ui.view">
|
||||
<field name="name">account.bank.statement.invoice.form.inherit</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="account.view_bank_statement_periodic_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="currency" invisible="1" position="after">
|
||||
<button name="%(action_view_account_statement_from_invoice_lines)d"
|
||||
string="Import Invoices" type="action" icon="gtk-execute"
|
||||
attrs="{'invisible':[('state','=','confirm')]}"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_bank_statement_form_invoice" model="ir.ui.view">
|
||||
<field name="name">account.bank.statement.invoice.form.inherit</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="account.view_bank_statement_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="currency" invisible="1" position="after">
|
||||
<button name="%(action_view_account_statement_from_invoice_lines)d"
|
||||
string="Import Invoices" type="action" icon="gtk-execute"
|
||||
attrs="{'invisible':[('state','=','confirm')]}"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_bank_statement_form_voucher" model="ir.ui.view">
|
||||
<field name="name">account.bank.statement.voucher.form.inherit</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
|
|
|
@ -20,3 +20,6 @@
|
|||
##############################################################################
|
||||
|
||||
import account_voucher_unreconcile
|
||||
import account_statement_from_invoice
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -47,7 +47,7 @@ class account_statement_from_invoice_lines(osv.osv_memory):
|
|||
statement_obj = self.pool.get('account.bank.statement')
|
||||
statement_line_obj = self.pool.get('account.bank.statement.line')
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
statement_reconcile_obj = self.pool.get('account.bank.statement.reconcile')
|
||||
# statement_reconcile_obj = self.pool.get('account.bank.statement.reconcile')
|
||||
line_date = time.strftime('%Y-%m-%d')
|
||||
statement = statement_obj.browse(cr, uid, statement_id, context=context)
|
||||
|
||||
|
@ -70,9 +70,9 @@ class account_statement_from_invoice_lines(osv.osv_memory):
|
|||
amount = currency_obj.compute(cr, uid, line.invoice.currency_id.id,
|
||||
statement.currency.id, amount, context=ctx)
|
||||
|
||||
reconcile_id = statement_reconcile_obj.create(cr, uid, {
|
||||
'line_ids': [(6, 0, [line.id])]
|
||||
}, context=context)
|
||||
# reconcile_id = statement_reconcile_obj.create(cr, uid, {
|
||||
# 'line_ids': [(6, 0, [line.id])]
|
||||
# }, context=context)
|
||||
if line.journal_id.type == 'sale':
|
||||
type = 'customer'
|
||||
elif line.journal_id.type == 'purchase':
|
||||
|
@ -87,7 +87,7 @@ class account_statement_from_invoice_lines(osv.osv_memory):
|
|||
'account_id': line.account_id.id,
|
||||
'statement_id': statement_id,
|
||||
'ref': line.ref,
|
||||
'reconcile_id': reconcile_id,
|
||||
# 'reconcile_id': reconcile_id,
|
||||
'date': time.strftime('%Y-%m-%d'), #time.strftime('%Y-%m-%d'), #line.date_maturity or,
|
||||
}, context=context)
|
||||
return {}
|
Loading…
Reference in New Issue