From 9cbccd3f0e94788bba2467597a0d6691632b5816 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 13 Jul 2011 16:05:24 +0200 Subject: [PATCH 01/39] [IMP] account_voucher: added property fields on res.company for auto exchange rate account bzr revid: qdp-launchpad@openerp.com-20110713140524-j1uylbsryd1j0go0 --- addons/account_voucher/__init__.py | 3 +- addons/account_voucher/__openerp__.py | 1 + addons/account_voucher/company.py | 45 +++++++++++++++++++++++++ addons/account_voucher/company_view.xml | 18 ++++++++++ 4 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 addons/account_voucher/company.py create mode 100644 addons/account_voucher/company_view.xml diff --git a/addons/account_voucher/__init__.py b/addons/account_voucher/__init__.py index 9796f81d5e5..098d82ea361 100644 --- a/addons/account_voucher/__init__.py +++ b/addons/account_voucher/__init__.py @@ -20,8 +20,9 @@ ############################################################################## import account_voucher +import company import invoice import report import wizard -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py index ef93be397a0..039d3e067af 100644 --- a/addons/account_voucher/__openerp__.py +++ b/addons/account_voucher/__openerp__.py @@ -47,6 +47,7 @@ Account Voucher module includes all the basic requirements of Voucher Entries fo "wizard/account_voucher_unreconcile_view.xml", "wizard/account_statement_from_invoice_view.xml", "account_voucher_view.xml", + "company_view.xml", "voucher_payment_receipt_view.xml", "voucher_sales_purchase_view.xml", "account_voucher_wizard.xml", diff --git a/addons/account_voucher/company.py b/addons/account_voucher/company.py new file mode 100644 index 00000000000..d8f0409a710 --- /dev/null +++ b/addons/account_voucher/company.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 osv import fields, osv + +class res_company(osv.osv): + _inherit = "res.company" + _columns = { + 'property_income_currency_exchange': fields.property( + 'account.account', + type='many2one', + relation='account.account', + string="Income Currency Exchange", + view_load=True, + domain="[('type', '=', 'other')]", + 'property_expense_currency_exchange': fields.property( + 'account.account', + type='many2one', + relation='account.account', + string="Expense Currency Exchange", + view_load=True, + domain="[('type', '=', 'other')]", + } + +res_company() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_voucher/company_view.xml b/addons/account_voucher/company_view.xml new file mode 100644 index 00000000000..97d6edc31b7 --- /dev/null +++ b/addons/account_voucher/company_view.xml @@ -0,0 +1,18 @@ + + + + + res.company.form.inherit + + res.company + form + + + + + + + + + + From bbee50ce0164e36fc0ef46723320efbf4bf7cf93 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 13 Jul 2011 16:06:18 +0200 Subject: [PATCH 02/39] [IMP] account_voucher: imp in customer payment form view bzr revid: qdp-launchpad@openerp.com-20110713140618-kcd3vii57bibsk4g --- .../voucher_payment_receipt_view.xml | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index 7be6022c474..88d84a7c7f0 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -288,27 +288,29 @@ form
- - - + + - - - - - + + + + + + + - - + + @@ -356,7 +358,6 @@ - From 7039769b08fe90d70fd0c1b091a3e00bf135dd5d Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 13 Jul 2011 16:59:29 +0200 Subject: [PATCH 03/39] [FIX] account_voucher: syntax error fixed bzr revid: qdp-launchpad@openerp.com-20110713145929-4eheevdmmijncrc4 --- addons/account_voucher/company.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_voucher/company.py b/addons/account_voucher/company.py index d8f0409a710..8c877c8b635 100644 --- a/addons/account_voucher/company.py +++ b/addons/account_voucher/company.py @@ -30,14 +30,14 @@ class res_company(osv.osv): relation='account.account', string="Income Currency Exchange", view_load=True, - domain="[('type', '=', 'other')]", + domain="[('type', '=', 'other')]",), 'property_expense_currency_exchange': fields.property( 'account.account', type='many2one', relation='account.account', string="Expense Currency Exchange", view_load=True, - domain="[('type', '=', 'other')]", + domain="[('type', '=', 'other')]",), } res_company() From f2fc1fcd179ec1158490c4e59dd7e8cc5be34c7e Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 14 Jul 2011 15:44:21 +0200 Subject: [PATCH 04/39] [IMP] account_voucher: lots of improvements (part 1) bzr revid: qdp-launchpad@openerp.com-20110714134421-q453j1z6upq03ter --- addons/account_voucher/account_voucher.py | 252 +++++++++++------- .../voucher_payment_receipt_view.xml | 10 +- 2 files changed, 162 insertions(+), 100 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 0e85904dcd7..5b8be1d8a8b 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -142,33 +142,56 @@ class account_voucher(osv.osv): res['arch'] = etree.tostring(doc) return res - def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount): - debit = credit = 0.0 + def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount, context=None): + if context is None: + context = {} + ctx = context.copy() + debit = credit = currency_rate_diff = 0.0 + #import pdb;pdb.set_trace() for l in line_dr_ids: + ctx.update({'date': l['date_original']}) + currency_rate_diff += 'amount_in_company_currency' in l and l['amount_in_company_currency'] or self.pool.get('res.currency').compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount_original'], context=ctx) debit += l['amount'] for l in line_cr_ids: + ctx.update({'date': l['date_original']}) + currency_rate_diff -= 'amount_in_company_currency' in l and l['amount_in_company_currency'] or self.pool.get('res.currency').compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount_original'], context=ctx) credit += l['amount'] - return abs(amount - abs(credit - debit)) + return abs(amount - abs(credit - debit)), currency_rate_diff def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, context=None): - context = context or {} if not line_dr_ids and not line_cr_ids: return {'value':{}} line_osv = self.pool.get("account.voucher.line") line_dr_ids = resolve_o2m_operations(cr, uid, line_osv, line_dr_ids, ['amount'], context) line_cr_ids = resolve_o2m_operations(cr, uid, line_osv, line_cr_ids, ['amount'], context) - return {'value': {'writeoff_amount': self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount)}} + currency_pool = self.pool.get('res.currency') + writeoff_amount, currency_rate_diff = self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount, context=context) + return {'value': {'writeoff_amount': writeoff_amount,}}# 'currency_rate_difference': currency_rate_diff}} def _get_writeoff_amount(self, cr, uid, ids, name, args, context=None): if not ids: return {} - res = {} - debit = credit = 0.0 + if context is None: + context = {} + res = {}.fromkeys(ids,{}) + counter_for_writeoff = counter_for_currency_diff = real_amount = expected_amount = 0.0 + currency_pool = self.pool.get('res.currency') for voucher in self.browse(cr, uid, ids, context=context): + ctx = context.copy() for l in voucher.line_dr_ids: - debit += l.amount + real_amount -= l.amount_in_company_currency + ctx.update({'date': l.date_original}) + counter_for_writeoff -= currency_pool.compute(cr, uid, voucher.company_id.currency_id.id, voucher.currency_id.id, l.amount_in_company_currency, context=ctx) + ctx.update({'date': voucher.date}) + counter_for_currency_diff -= currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) for l in voucher.line_cr_ids: - credit += l.amount - res[voucher.id] = abs(voucher.amount - abs(credit - debit)) + real_amount += l.amount_in_company_currency + ctx.update({'date': l.date_original}) + counter_for_writeoff += currency_pool.compute(cr, uid, voucher.company_id.currency_id.id, voucher.currency_id.id, l.amount_in_company_currency, context=ctx) + ctx.update({'date': voucher.date}) + counter_for_currency_diff += l.amount and currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) + writeoff_amount = voucher.amount - counter_for_writeoff + res[voucher.id]['writeoff_amount'] = writeoff_amount + res[voucher.id]['currency_rate_difference'] = real_amount - counter_for_currency_diff return res _name = 'account.voucher' @@ -193,8 +216,8 @@ class account_voucher(osv.osv): domain=[('type','=','dr')], context={'default_type':'dr'}, readonly=True, states={'draft':[('readonly',False)]}), 'period_id': fields.many2one('account.period', 'Period', required=True, readonly=True, states={'draft':[('readonly',False)]}), 'narration':fields.text('Notes', readonly=True, states={'draft':[('readonly',False)]}), - 'currency_id':fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}), -# 'currency_id': fields.related('journal_id','currency', type='many2one', relation='res.currency', string='Currency', store=True, readonly=True, states={'draft':[('readonly',False)]}), + #'currency_id':fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}), + 'currency_id': fields.related('journal_id','currency', type='many2one', relation='res.currency', string='Currency', store=True, readonly=True), 'company_id': fields.many2one('res.company', 'Company', required=True, readonly=True, states={'draft':[('readonly',False)]}), 'state':fields.selection( [('draft','Draft'), @@ -228,7 +251,8 @@ class account_voucher(osv.osv): 'writeoff_acc_id': fields.many2one('account.account', 'Write-Off account', readonly=True, states={'draft': [('readonly', False)]}), 'comment': fields.char('Write-Off Comment', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}), 'analytic_id': fields.many2one('account.analytic.account','Write-Off Analytic Account', readonly=True, states={'draft': [('readonly', False)]}), - 'writeoff_amount': fields.function(_get_writeoff_amount, string='Write-Off Amount', type='float', readonly=True), + 'writeoff_amount': fields.function(_get_writeoff_amount, string='Write-Off Amount', type='float', readonly=True, multi="writeoff"), + 'currency_rate_difference': fields.function(_get_writeoff_amount, string="Currency Rate Difference", type='float', multi="writeoff"), } _defaults = { 'period_id': _get_period, @@ -491,27 +515,30 @@ class account_voucher(osv.osv): if line.debit and line.reconcile_partial_id and ttype == 'payment': continue original_amount = line.credit or line.debit or 0.0 - amount_unreconciled = currency_pool.compute(cr, uid, line.currency_id and line.currency_id.id or company_currency, currency_id, abs(line.amount_residual_currency), context=context_multi_currency) + amount_original, amount_unreconciled = line_pool._get_amounts(cr, uid, line, context=context) + currency_id = line.currency_id and line.currency_id.id or line.company_id.currency_id.id rs = { 'name':line.move_id.name, 'type': line.credit and 'dr' or 'cr', 'move_line_id':line.id, 'account_id':line.account_id.id, - 'amount_original': currency_pool.compute(cr, uid, line.currency_id and line.currency_id.id or company_currency, currency_id, line.currency_id and abs(line.amount_currency) or original_amount, context=context_multi_currency), + 'amount_original': amount_original, + 'amount': 0.0, + 'currency_id': currency_id, 'date_original':line.date, + 'company_currency_id': line.company_id.currency_id.id, 'date_due':line.date_maturity, 'amount_unreconciled': amount_unreconciled, - } - if line.credit: - amount = min(amount_unreconciled, currency_pool.compute(cr, uid, company_currency, currency_id, abs(total_debit), context=context_multi_currency)) - rs['amount'] = amount - total_debit -= amount - else: - amount = min(amount_unreconciled, currency_pool.compute(cr, uid, company_currency, currency_id, abs(total_credit), context=context_multi_currency)) - rs['amount'] = amount - total_credit -= amount + #if line.credit: + # amount = min(amount_unreconciled, currency_pool.compute(cr, uid, company_currency, currency_id, abs(total_debit), context=context_multi_currency)) + # rs['amount'] = amount + # total_debit -= amount + #else: + # amount = min(amount_unreconciled, currency_pool.compute(cr, uid, company_currency, currency_id, abs(total_credit), context=context_multi_currency)) + # rs['amount'] = amount + # total_credit -= amount default['value']['line_ids'].append(rs) if rs['type'] == 'cr': @@ -523,7 +550,7 @@ class account_voucher(osv.osv): default['value']['pre_line'] = 1 elif ttype == 'receipt' and len(default['value']['line_dr_ids']) > 0: default['value']['pre_line'] = 1 - default['value']['writeoff_amount'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price) + default['value']['writeoff_amount'], default['value']['currency_rate_difference'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price, context=context) return default def onchange_date(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None): @@ -636,44 +663,42 @@ class account_voucher(osv.osv): currency_pool = self.pool.get('res.currency') tax_obj = self.pool.get('account.tax') seq_obj = self.pool.get('ir.sequence') - for inv in self.browse(cr, uid, ids, context=context): - if inv.move_id: + for voucher in self.browse(cr, uid, ids, context=context): + if voucher.move_id: continue context_multi_currency = context.copy() - context_multi_currency.update({'date': inv.date}) + context_multi_currency.update({'date': voucher.date}) - if inv.number: - name = inv.number - elif inv.journal_id.sequence_id: - name = seq_obj.get_id(cr, uid, inv.journal_id.sequence_id.id) + if voucher.number: + name = voucher.number else: - raise osv.except_osv(_('Error !'), _('Please define a sequence on the journal !')) - if not inv.reference: + name = seq_obj.get_id(cr, uid, voucher.journal_id.sequence_id.id) + if not voucher.reference: ref = name.replace('/','') else: - ref = inv.reference + ref = voucher.reference move = { 'name': name, - 'journal_id': inv.journal_id.id, - 'narration': inv.narration, - 'date': inv.date, + 'journal_id': voucher.journal_id.id, + 'narration': voucher.narration, + 'date': voucher.date, 'ref': ref, - 'period_id': inv.period_id and inv.period_id.id or False + 'period_id': voucher.period_id and voucher.period_id.id or False } move_id = move_pool.create(cr, uid, move) #create the first line manually - company_currency = inv.journal_id.company_id.currency_id.id - current_currency = inv.currency_id.id + company_currency = voucher.journal_id.company_id.currency_id.id + current_currency = voucher.currency_id.id debit = 0.0 credit = 0.0 # TODO: is there any other alternative then the voucher type ?? # -for sale, purchase we have but for the payment and receipt we do not have as based on the bank/cash journal we can not know its payment or receipt - if inv.type in ('purchase', 'payment'): - credit = currency_pool.compute(cr, uid, current_currency, company_currency, inv.amount, context=context_multi_currency) - elif inv.type in ('sale', 'receipt'): - debit = currency_pool.compute(cr, uid, current_currency, company_currency, inv.amount, context=context_multi_currency) + if voucher.type in ('purchase', 'payment'): + credit = currency_pool.compute(cr, uid, current_currency, company_currency, voucher.amount, context=context_multi_currency) + elif voucher.type in ('sale', 'receipt'): + debit = currency_pool.compute(cr, uid, current_currency, company_currency, voucher.amount, context=context_multi_currency) if debit < 0: credit = -debit debit = 0.0 @@ -683,28 +708,28 @@ class account_voucher(osv.osv): sign = debit - credit < 0 and -1 or 1 #create the first line of the voucher move_line = { - 'name': inv.name or '/', + 'name': voucher.name or '/', 'debit': debit, 'credit': credit, - 'account_id': inv.account_id.id, + 'account_id': voucher.account_id.id, 'move_id': move_id, - 'journal_id': inv.journal_id.id, - 'period_id': inv.period_id.id, - 'partner_id': inv.partner_id.id, + 'journal_id': voucher.journal_id.id, + 'period_id': voucher.period_id.id, + 'partner_id': voucher.partner_id.id, 'currency_id': company_currency <> current_currency and current_currency or False, - 'amount_currency': company_currency <> current_currency and sign * inv.amount or 0.0, - 'date': inv.date, - 'date_maturity': inv.date_due + 'amount_currency': company_currency <> current_currency and sign * voucher.amount or 0.0, + 'date': voucher.date, + 'date_maturity': voucher.date_due } move_line_pool.create(cr, uid, move_line) rec_list_ids = [] line_total = debit - credit - if inv.type == 'sale': - line_total = line_total - currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, inv.tax_amount, context=context_multi_currency) - elif inv.type == 'purchase': - line_total = line_total + currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, inv.tax_amount, context=context_multi_currency) + if voucher.type == 'sale': + line_total = line_total - currency_pool.compute(cr, uid, voucher.currency_id.id, company_currency, voucher.tax_amount, context=context_multi_currency) + elif voucher.type == 'purchase': + line_total = line_total + currency_pool.compute(cr, uid, voucher.currency_id.id, company_currency, voucher.tax_amount, context=context_multi_currency) - for line in inv.line_ids: + for line in voucher.line_ids: #create one move line per voucher line where amount is not 0.0 if not line.amount: continue @@ -712,21 +737,26 @@ class account_voucher(osv.osv): if line.amount == line.amount_unreconciled: amount = line.move_line_id.amount_residual #residual amount in company currency else: - amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=context_multi_currency) + ctx = context_multi_currency.copy() + ctx.update({'date': line.date_original}) + amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=ctx) move_line = { - 'journal_id': inv.journal_id.id, - 'period_id': inv.period_id.id, + 'journal_id': voucher.journal_id.id, + 'period_id': voucher.period_id.id, 'name': line.name or '/', 'account_id': line.account_id.id, 'move_id': move_id, - 'partner_id': inv.partner_id.id, + 'partner_id': voucher.partner_id.id, 'currency_id': company_currency <> current_currency and current_currency or False, 'analytic_account_id': line.account_analytic_id and line.account_analytic_id.id or False, 'quantity': 1, 'credit': 0.0, 'debit': 0.0, - 'date': inv.date + 'date': voucher.date } + #TODO: assigner le montant de la diff de change sur le bon compte et pas debtor + #TODO: mettre le montant de company currency en onchange + readonly + computed + #TODO: mettre un champ difference de change sur le voucher if amount < 0: amount = -amount if line.type == 'dr': @@ -740,9 +770,9 @@ class account_voucher(osv.osv): line_total -= amount move_line['credit'] = amount - if inv.tax_id and inv.type in ('sale', 'purchase'): + if voucher.tax_id and voucher.type in ('sale', 'purchase'): move_line.update({ - 'account_tax_id': inv.tax_id.id, + 'account_tax_id': voucher.tax_id.id, }) if move_line.get('account_tax_id', False): tax_data = tax_obj.browse(cr, uid, [move_line['account_tax_id']], context=context)[0] @@ -755,35 +785,35 @@ class account_voucher(osv.osv): rec_ids = [voucher_line, line.move_line_id.id] rec_list_ids.append(rec_ids) - if not currency_pool.is_zero(cr, uid, inv.currency_id, line_total): + if not currency_pool.is_zero(cr, uid, voucher.currency_id, line_total): diff = line_total account_id = False write_off_name = '' - if inv.payment_option == 'with_writeoff': - account_id = inv.writeoff_acc_id.id - write_off_name = inv.comment - elif inv.type in ('sale', 'receipt'): - account_id = inv.partner_id.property_account_receivable.id + if voucher.payment_option == 'with_writeoff': + account_id = voucher.writeoff_acc_id.id + write_off_name = voucher.comment + elif voucher.type in ('sale', 'receipt'): + account_id = voucher.partner_id.property_account_receivable.id else: - account_id = inv.partner_id.property_account_payable.id + account_id = voucher.partner_id.property_account_payable.id move_line = { 'name': write_off_name or name, 'account_id': account_id, 'move_id': move_id, - 'partner_id': inv.partner_id.id, - 'date': inv.date, + 'partner_id': voucher.partner_id.id, + 'date': voucher.date, 'credit': diff > 0 and diff or 0.0, 'debit': diff < 0 and -diff or 0.0, #'amount_currency': company_currency <> current_currency and currency_pool.compute(cr, uid, company_currency, current_currency, diff * -1, context=context_multi_currency) or 0.0, #'currency_id': company_currency <> current_currency and current_currency or False, } move_line_pool.create(cr, uid, move_line) - self.write(cr, uid, [inv.id], { + self.write(cr, uid, [voucher.id], { 'move_id': move_id, 'state': 'posted', 'number': name, }) - if inv.journal_id.entry_posted: + if voucher.journal_id.entry_posted: move_pool.post(cr, uid, [move_id], context={}) for rec_ids in rec_list_ids: if len(rec_ids) >= 2: @@ -810,43 +840,71 @@ class account_voucher_line(osv.osv): _description = 'Voucher Lines' _order = "move_line_id" + def _currency_id(self, cr, uid, ids, name, args, context=None): + res = {} + for line in self.browse(cr, uid, ids, context=context): + move_line = line.move_line_id + res[line.id] = move_line.currency_id and move_line.currency_id.id or move_line.company_id.currency_id.id + return res + + def _get_amounts(self, cr, uid, line_browse_rec, context=None): + if line_browse_rec.currency_id: + amount_original = line_browse_rec.amount_currency or 0.0 + amount_unreconciled = line_browse_rec.amount_residual_currency + elif line_browse_rec.credit > 0: + amount_original = line_browse_rec.credit or 0.0 + amount_unreconciled = line_browse_rec.amount_residual + else: + amount_original = line_browse_rec.debit or 0.0 + amount_unreconciled = line_browse_rec.amount_residual + return amount_original, amount_unreconciled + def _compute_balance(self, cr, uid, ids, name, args, context=None): currency_pool = self.pool.get('res.currency') - rs_data = {} + res = {} for line in self.browse(cr, uid, ids, context=context): - ctx = context.copy() - ctx.update({'date': line.voucher_id.date}) - res = {} - company_currency = line.voucher_id.journal_id.company_id.currency_id.id - voucher_currency = line.voucher_id.currency_id.id - move_line = line.move_line_id or False + amount_original, amount_unreconciled = self._get_amounts(cr, uid, line.move_line_id, context) + res[line.id] = { + 'amount_original': amount_original, + 'amount_unreconciled': amount_unreconciled, + } - if not move_line: - res['amount_original'] = 0.0 - res['amount_unreconciled'] = 0.0 + return res - elif move_line.currency_id: - res['amount_original'] = currency_pool.compute(cr, uid, move_line.currency_id.id, voucher_currency, move_line.amount_currency, context=ctx) - elif move_line and move_line.credit > 0: - res['amount_original'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, move_line.credit, context=ctx) - else: - res['amount_original'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, move_line.debit, context=ctx) + def __company_currency_amount(self, cr, uid, line, amount, context=None): + if context is None: + context = {} + ctx = context.copy() + ctx.update({'date': line.date_original}) + currency_pool = self.pool.get('res.currency') + return currency_pool.compute(cr, uid, line.currency_id.id, line.company_currency_id.id, amount, context=ctx) - if move_line: - res['amount_unreconciled'] = currency_pool.compute(cr, uid, move_line.currency_id and move_line.currency_id.id or company_currency, voucher_currency, abs(move_line.amount_residual_currency), context=ctx) - rs_data[line.id] = res - return rs_data + def onchange_amount(self, cr, uid, ids, amount, context=None): + if not amount: + return {'value':{'amount_in_company_currency': 0.0}} + for line in self.browse(cr, uid, ids, context=context): + amount = self.__company_currency_amount(cr, uid, line, amount, context=context) + return {'value': {'amount_in_company_currency': amount}} + + def _get_amount_in_company_currency(self, cr, uid, ids, name, args, context=None): + res = {} + for line in self.browse(cr, uid, ids, context=context): + res[line.id] = self.__company_currency_amount(cr, uid, line, line.amount, context=context) + return res _columns = { 'voucher_id':fields.many2one('account.voucher', 'Voucher', required=1, ondelete='cascade'), 'name':fields.char('Description', size=256), 'account_id':fields.many2one('account.account','Account', required=True), 'partner_id':fields.related('voucher_id', 'partner_id', type='many2one', relation='res.partner', string='Partner'), + 'currency_id': fields.function(_currency_id, string='Currency', type='many2one', relation='res.currency'), 'untax_amount':fields.float('Untax Amount'), 'amount':fields.float('Amount', digits_compute=dp.get_precision('Account')), 'type':fields.selection([('dr','Debit'),('cr','Credit')], 'Dr/Cr'), 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'), - 'move_line_id': fields.many2one('account.move.line', 'Journal Item'), + 'move_line_id': fields.many2one('account.move.line', 'Journal Item', required=True), + 'company_currency_id': fields.related('move_line_id','company_id','currency_id', type='many2one', relation='res.currency', string="Company Currency"), + 'amount_in_company_currency': fields.function(_get_amount_in_company_currency, string='Amount in Company Currency', type='float', digits_compute=dp.get_precision('Account')), 'date_original': fields.related('move_line_id','date', type='date', relation='account.move.line', string='Date', readonly=1), 'date_due': fields.related('move_line_id','date_maturity', type='date', relation='account.move.line', string='Due Date', readonly=1), 'amount_original': fields.function(_compute_balance, multi='dc', type='float', string='Original Amount', store=True), diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index 88d84a7c7f0..85dfc8f12c0 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -283,7 +283,7 @@ id="menu_action_vendor_payment" parent="account.menu_finance_payables"/> - account.voucher.receipt.form + voucher.form.customer.payment account.voucher form @@ -320,12 +320,15 @@ on_change="onchange_move_line_id(move_line_id)" domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]" /> - + - + + + + @@ -359,6 +362,7 @@ + From bb605efd941ff6aa4cad9a445a8c9074e5fec408 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 14 Jul 2011 17:48:22 +0200 Subject: [PATCH 05/39] [IMP] account_voucher: multi currency and usability changes (part 2) bzr revid: qdp-launchpad@openerp.com-20110714154822-s5mbl0et1jdw7jty --- addons/account_voucher/account_voucher.py | 77 ++++++++++++------- addons/account_voucher/company.py | 4 +- .../voucher_payment_receipt_view.xml | 4 +- 3 files changed, 53 insertions(+), 32 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 5b8be1d8a8b..b3eaa36db21 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -142,30 +142,35 @@ class account_voucher(osv.osv): res['arch'] = etree.tostring(doc) return res - def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount, context=None): + def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount, voucher_date, voucher_currency_id, context=None): if context is None: context = {} + currency_pool = self.pool.get('res.currency') ctx = context.copy() - debit = credit = currency_rate_diff = 0.0 - #import pdb;pdb.set_trace() + counter_for_writeoff = counter_for_currency_diff = real_amount = 0.0 for l in line_dr_ids: + real_amount -= l.get('amount_in_company_currency', 0.0) ctx.update({'date': l['date_original']}) - currency_rate_diff += 'amount_in_company_currency' in l and l['amount_in_company_currency'] or self.pool.get('res.currency').compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount_original'], context=ctx) - debit += l['amount'] + counter_for_writeoff -= currency_pool.compute(cr, uid, l['company_currency_id'], voucher_currency_id, l.get('amount_in_company_currency',0.0), context=ctx) + ctx.update({'date': voucher_date}) + counter_for_currency_diff -= currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) for l in line_cr_ids: + real_amount += l.get('amount_in_company_currency', 0.0) ctx.update({'date': l['date_original']}) - currency_rate_diff -= 'amount_in_company_currency' in l and l['amount_in_company_currency'] or self.pool.get('res.currency').compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount_original'], context=ctx) - credit += l['amount'] - return abs(amount - abs(credit - debit)), currency_rate_diff + counter_for_writeoff += currency_pool.compute(cr, uid, l['company_currency_id'], voucher_currency_id, l.get('amount_in_company_currency',0.0), context=ctx) + ctx.update({'date': voucher_date}) + counter_for_currency_diff += currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) + writeoff_amount = amount - counter_for_writeoff + currency_rate_difference = real_amount - counter_for_currency_diff + return writeoff_amount, currency_rate_difference - def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, context=None): + def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, voucher_date, voucher_currency_id, context=None): if not line_dr_ids and not line_cr_ids: return {'value':{}} line_osv = self.pool.get("account.voucher.line") line_dr_ids = resolve_o2m_operations(cr, uid, line_osv, line_dr_ids, ['amount'], context) line_cr_ids = resolve_o2m_operations(cr, uid, line_osv, line_cr_ids, ['amount'], context) - currency_pool = self.pool.get('res.currency') - writeoff_amount, currency_rate_diff = self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount, context=context) + writeoff_amount, currency_rate_diff = self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount, voucher_date, voucher_currency_id, context=context) return {'value': {'writeoff_amount': writeoff_amount,}}# 'currency_rate_difference': currency_rate_diff}} def _get_writeoff_amount(self, cr, uid, ids, name, args, context=None): @@ -173,7 +178,7 @@ class account_voucher(osv.osv): if context is None: context = {} res = {}.fromkeys(ids,{}) - counter_for_writeoff = counter_for_currency_diff = real_amount = expected_amount = 0.0 + counter_for_writeoff = counter_for_currency_diff = real_amount = 0.0 currency_pool = self.pool.get('res.currency') for voucher in self.browse(cr, uid, ids, context=context): ctx = context.copy() @@ -188,7 +193,7 @@ class account_voucher(osv.osv): ctx.update({'date': l.date_original}) counter_for_writeoff += currency_pool.compute(cr, uid, voucher.company_id.currency_id.id, voucher.currency_id.id, l.amount_in_company_currency, context=ctx) ctx.update({'date': voucher.date}) - counter_for_currency_diff += l.amount and currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) + counter_for_currency_diff += currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) writeoff_amount = voucher.amount - counter_for_writeoff res[voucher.id]['writeoff_amount'] = writeoff_amount res[voucher.id]['currency_rate_difference'] = real_amount - counter_for_currency_diff @@ -550,7 +555,7 @@ class account_voucher(osv.osv): default['value']['pre_line'] = 1 elif ttype == 'receipt' and len(default['value']['line_dr_ids']) > 0: default['value']['pre_line'] = 1 - default['value']['writeoff_amount'], default['value']['currency_rate_difference'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price, context=context) + default['value']['writeoff_amount'], default['value']['currency_rate_difference'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price, date, currency_id, context=context) return default def onchange_date(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None): @@ -722,12 +727,33 @@ class account_voucher(osv.osv): 'date_maturity': voucher.date_due } move_line_pool.create(cr, uid, move_line) + + #create the move line for the currency difference + if voucher.currency_rate_difference: + if voucher.currency_rate_difference > 0: + account_id = voucher.company_id.property_income_currency_exchange + if not account_id: + raise osv.except_osv(_('Warning'),_("Unable to create accounting entry for currency rate difference. You have to configure the field 'Income Currency Rate' on the company! ")) + else: + account_id = voucher.company_id.property_expense_currency_exchange + if not account_id: + raise osv.except_osv(_('Warning'),_("Unable to create accounting entry for currency rate difference. You have to configure the field 'Expense Currency Rate' on the company! ")) + + currency_diff_line = { + 'name': _('Currency Difference'), + 'debit': voucher.currency_rate_difference > 0 and voucher.currency_rate_difference or 0.0, + 'credit': voucher.currency_rate_difference < 0 and -voucher.currency_rate_difference or 0.0, + 'account_id': account_id.id, + 'move_id': move_id, + 'journal_id': voucher.journal_id.id, + 'period_id': voucher.period_id.id, + 'partner_id': voucher.partner_id.id, + 'date': voucher.date, + 'date_maturity': voucher.date_due + } + + move_line_pool.create(cr, uid, currency_diff_line, context=context) rec_list_ids = [] - line_total = debit - credit - if voucher.type == 'sale': - line_total = line_total - currency_pool.compute(cr, uid, voucher.currency_id.id, company_currency, voucher.tax_amount, context=context_multi_currency) - elif voucher.type == 'purchase': - line_total = line_total + currency_pool.compute(cr, uid, voucher.currency_id.id, company_currency, voucher.tax_amount, context=context_multi_currency) for line in voucher.line_ids: #create one move line per voucher line where amount is not 0.0 @@ -754,9 +780,6 @@ class account_voucher(osv.osv): 'debit': 0.0, 'date': voucher.date } - #TODO: assigner le montant de la diff de change sur le bon compte et pas debtor - #TODO: mettre le montant de company currency en onchange + readonly + computed - #TODO: mettre un champ difference de change sur le voucher if amount < 0: amount = -amount if line.type == 'dr': @@ -764,10 +787,8 @@ class account_voucher(osv.osv): else: line.type = 'dr' if (line.type=='dr'): - line_total += amount move_line['debit'] = amount else: - line_total -= amount move_line['credit'] = amount if voucher.tax_id and voucher.type in ('sale', 'purchase'): @@ -785,8 +806,8 @@ class account_voucher(osv.osv): rec_ids = [voucher_line, line.move_line_id.id] rec_list_ids.append(rec_ids) - if not currency_pool.is_zero(cr, uid, voucher.currency_id, line_total): - diff = line_total + if not currency_pool.is_zero(cr, uid, voucher.currency_id, voucher.writeoff_amount): + diff = currency_pool.compute(cr, uid, current_currency, company_currency, voucher.writeoff_amount, context=context_multi_currency) account_id = False write_off_name = '' if voucher.payment_option == 'with_writeoff': @@ -804,8 +825,8 @@ class account_voucher(osv.osv): 'date': voucher.date, 'credit': diff > 0 and diff or 0.0, 'debit': diff < 0 and -diff or 0.0, - #'amount_currency': company_currency <> current_currency and currency_pool.compute(cr, uid, company_currency, current_currency, diff * -1, context=context_multi_currency) or 0.0, - #'currency_id': company_currency <> current_currency and current_currency or False, + 'amount_currency': voucher.writeoff_amount, + 'currency_id': company_currency <> current_currency and current_currency or False, } move_line_pool.create(cr, uid, move_line) self.write(cr, uid, [voucher.id], { diff --git a/addons/account_voucher/company.py b/addons/account_voucher/company.py index 8c877c8b635..5a5b5d040d7 100644 --- a/addons/account_voucher/company.py +++ b/addons/account_voucher/company.py @@ -28,14 +28,14 @@ class res_company(osv.osv): 'account.account', type='many2one', relation='account.account', - string="Income Currency Exchange", + string="Income Currency Rate", view_load=True, domain="[('type', '=', 'other')]",), 'property_expense_currency_exchange': fields.property( 'account.account', type='many2one', relation='account.account', - string="Expense Currency Exchange", + string="Expense Currency Rate", view_load=True, domain="[('type', '=', 'other')]",), } diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index 85dfc8f12c0..1d6e2f19ddc 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -314,7 +314,7 @@ - + - + From 9aa1760fcfa9c03dd48b4a45ae3b0536e352eece Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 15 Jul 2011 10:26:43 +0200 Subject: [PATCH 06/39] [IMP] account_voucher: multi-currency improvements (part 3) bzr revid: qdp-launchpad@openerp.com-20110715082643-0bxv6u0z80wkqozi --- addons/account_voucher/account_voucher.py | 124 ++++++++++-------- .../voucher_payment_receipt_view.xml | 31 +++-- 2 files changed, 92 insertions(+), 63 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index b3eaa36db21..dd3af1139f4 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -142,35 +142,32 @@ class account_voucher(osv.osv): res['arch'] = etree.tostring(doc) return res - def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount, voucher_date, voucher_currency_id, context=None): + def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount, voucher_date, context=None): if context is None: context = {} currency_pool = self.pool.get('res.currency') ctx = context.copy() counter_for_writeoff = counter_for_currency_diff = real_amount = 0.0 + ctx.update({'date': voucher_date}) for l in line_dr_ids: real_amount -= l.get('amount_in_company_currency', 0.0) - ctx.update({'date': l['date_original']}) - counter_for_writeoff -= currency_pool.compute(cr, uid, l['company_currency_id'], voucher_currency_id, l.get('amount_in_company_currency',0.0), context=ctx) - ctx.update({'date': voucher_date}) + counter_for_writeoff -= currency_pool.compute(cr, uid, l['company_currency_id'], l['voucher_currency_id'], l.get('amount_in_company_currency',0.0), context=ctx) counter_for_currency_diff -= currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) for l in line_cr_ids: real_amount += l.get('amount_in_company_currency', 0.0) - ctx.update({'date': l['date_original']}) - counter_for_writeoff += currency_pool.compute(cr, uid, l['company_currency_id'], voucher_currency_id, l.get('amount_in_company_currency',0.0), context=ctx) - ctx.update({'date': voucher_date}) + counter_for_writeoff += currency_pool.compute(cr, uid, l['company_currency_id'], l['voucher_currency_id'], l.get('amount_in_company_currency',0.0), context=ctx) counter_for_currency_diff += currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) writeoff_amount = amount - counter_for_writeoff currency_rate_difference = real_amount - counter_for_currency_diff return writeoff_amount, currency_rate_difference - def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, voucher_date, voucher_currency_id, context=None): + def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, voucher_date, context=None): if not line_dr_ids and not line_cr_ids: return {'value':{}} line_osv = self.pool.get("account.voucher.line") line_dr_ids = resolve_o2m_operations(cr, uid, line_osv, line_dr_ids, ['amount'], context) line_cr_ids = resolve_o2m_operations(cr, uid, line_osv, line_cr_ids, ['amount'], context) - writeoff_amount, currency_rate_diff = self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount, voucher_date, voucher_currency_id, context=context) + writeoff_amount, currency_rate_diff = self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount, voucher_date, context=context) return {'value': {'writeoff_amount': writeoff_amount,}}# 'currency_rate_difference': currency_rate_diff}} def _get_writeoff_amount(self, cr, uid, ids, name, args, context=None): @@ -182,27 +179,34 @@ class account_voucher(osv.osv): currency_pool = self.pool.get('res.currency') for voucher in self.browse(cr, uid, ids, context=context): ctx = context.copy() + ctx.update({'date': voucher.date}) for l in voucher.line_dr_ids: real_amount -= l.amount_in_company_currency - ctx.update({'date': l.date_original}) - counter_for_writeoff -= currency_pool.compute(cr, uid, voucher.company_id.currency_id.id, voucher.currency_id.id, l.amount_in_company_currency, context=ctx) - ctx.update({'date': voucher.date}) + counter_for_writeoff -= l.amount_in_voucher_currency + #ctx.update({'date': l.date_original}) + #counter_for_writeoff -= currency_pool.compute(cr, uid, voucher.company_id.currency_id.id, voucher.currency_id.id, l.amount_in_company_currency, context=ctx) counter_for_currency_diff -= currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) for l in voucher.line_cr_ids: real_amount += l.amount_in_company_currency - ctx.update({'date': l.date_original}) - counter_for_writeoff += currency_pool.compute(cr, uid, voucher.company_id.currency_id.id, voucher.currency_id.id, l.amount_in_company_currency, context=ctx) - ctx.update({'date': voucher.date}) + counter_for_writeoff += l.amount_in_voucher_currency + #ctx.update({'date': l.date_original}) + #counter_for_writeoff += currency_pool.compute(cr, uid, voucher.company_id.currency_id.id, voucher.currency_id.id, l.amount_in_company_currency, context=ctx) counter_for_currency_diff += currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) writeoff_amount = voucher.amount - counter_for_writeoff res[voucher.id]['writeoff_amount'] = writeoff_amount res[voucher.id]['currency_rate_difference'] = real_amount - counter_for_currency_diff return res + def _currency_id(self, cr, uid, ids, name, args, context=None): + res = {} + for voucher in self.browse(cr, uid, ids, context=context): + currency = voucher.journal_id.currency and voucher.journal_id.currency.id or voucher.company_id.currency_id.id + res[voucher.id] = {'currency_id': currency, 'currency_id2': currency} + return res + _name = 'account.voucher' _description = 'Accounting Voucher' _order = "date desc, id desc" -# _rec_name = 'number' _columns = { 'type':fields.selection([ ('sale','Sale'), @@ -221,8 +225,9 @@ class account_voucher(osv.osv): domain=[('type','=','dr')], context={'default_type':'dr'}, readonly=True, states={'draft':[('readonly',False)]}), 'period_id': fields.many2one('account.period', 'Period', required=True, readonly=True, states={'draft':[('readonly',False)]}), 'narration':fields.text('Notes', readonly=True, states={'draft':[('readonly',False)]}), - #'currency_id':fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}), - 'currency_id': fields.related('journal_id','currency', type='many2one', relation='res.currency', string='Currency', store=True, readonly=True), + 'currency_id': fields.function(_currency_id, type='many2one', relation='res.currency', string='Currency', store=True, readonly=True, multi="currency"), + #duplicated field for display purposes + 'currency_id2': fields.function(_currency_id, type='many2one', relation='res.currency', string='Currency', store=True, readonly=True, multi="currency"), 'company_id': fields.many2one('res.company', 'Company', required=True, readonly=True, states={'draft':[('readonly',False)]}), 'state':fields.selection( [('draft','Draft'), @@ -425,7 +430,7 @@ class account_voucher(osv.osv): return default - def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None): + def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id, price, voucher_currency_id, ttype, date, context=None): """price Returns a dict that contains new values and context @@ -455,9 +460,9 @@ class account_voucher(osv.osv): vals = self.onchange_journal(cr, uid, ids, journal_id, [], False, partner_id, context) vals = vals.get('value') - currency_id = vals.get('currency_id', currency_id) + voucher_currency_id = vals.get('currency_id', voucher_currency_id) default = { - 'value':{'line_ids':[], 'line_dr_ids':[], 'line_cr_ids':[], 'pre_line': False, 'currency_id':currency_id}, + 'value':{'line_ids':[], 'line_dr_ids':[], 'line_cr_ids':[], 'pre_line': False, 'currency_id': voucher_currency_id}, } if not partner_id: @@ -502,10 +507,10 @@ class account_voucher(osv.osv): moves = move_line_pool.browse(cr, uid, ids, context=context) company_currency = journal.company_id.currency_id.id - if company_currency != currency_id and ttype == 'payment': - total_debit = currency_pool.compute(cr, uid, currency_id, company_currency, total_debit, context=context_multi_currency) - elif company_currency != currency_id and ttype == 'receipt': - total_credit = currency_pool.compute(cr, uid, currency_id, company_currency, total_credit, context=context_multi_currency) + if company_currency != voucher_currency_id and ttype == 'payment': + total_debit = currency_pool.compute(cr, uid, voucher_currency_id, company_currency, total_debit, context=context_multi_currency) + elif company_currency != voucher_currency_id and ttype == 'receipt': + total_credit = currency_pool.compute(cr, uid, voucher_currency_id, company_currency, total_credit, context=context_multi_currency) for line in moves: if line.credit and line.reconcile_partial_id and ttype == 'receipt': @@ -530,10 +535,12 @@ class account_voucher(osv.osv): 'amount_original': amount_original, 'amount': 0.0, 'currency_id': currency_id, + 'voucher_currency_id': voucher_currency_id, 'date_original':line.date, 'company_currency_id': line.company_id.currency_id.id, 'date_due':line.date_maturity, 'amount_unreconciled': amount_unreconciled, + 'amount_in_company_currency': 0.0, } #if line.credit: @@ -555,7 +562,7 @@ class account_voucher(osv.osv): default['value']['pre_line'] = 1 elif ttype == 'receipt' and len(default['value']['line_dr_ids']) > 0: default['value']['pre_line'] = 1 - default['value']['writeoff_amount'], default['value']['currency_rate_difference'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price, date, currency_id, context=context) + default['value']['writeoff_amount'], default['value']['currency_rate_difference'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price, date, context=context) return default def onchange_date(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None): @@ -695,15 +702,15 @@ class account_voucher(osv.osv): #create the first line manually company_currency = voucher.journal_id.company_id.currency_id.id - current_currency = voucher.currency_id.id + voucher_currency = voucher.currency_id.id debit = 0.0 credit = 0.0 # TODO: is there any other alternative then the voucher type ?? # -for sale, purchase we have but for the payment and receipt we do not have as based on the bank/cash journal we can not know its payment or receipt if voucher.type in ('purchase', 'payment'): - credit = currency_pool.compute(cr, uid, current_currency, company_currency, voucher.amount, context=context_multi_currency) + credit = currency_pool.compute(cr, uid, voucher_currency, company_currency, voucher.amount, context=context_multi_currency) elif voucher.type in ('sale', 'receipt'): - debit = currency_pool.compute(cr, uid, current_currency, company_currency, voucher.amount, context=context_multi_currency) + debit = currency_pool.compute(cr, uid, voucher_currency, company_currency, voucher.amount, context=context_multi_currency) if debit < 0: credit = -debit debit = 0.0 @@ -721,8 +728,8 @@ class account_voucher(osv.osv): 'journal_id': voucher.journal_id.id, 'period_id': voucher.period_id.id, 'partner_id': voucher.partner_id.id, - 'currency_id': company_currency <> current_currency and current_currency or False, - 'amount_currency': company_currency <> current_currency and sign * voucher.amount or 0.0, + 'currency_id': company_currency <> voucher_currency and voucher_currency or False, + 'amount_currency': company_currency <> voucher_currency and sign * voucher.amount or 0.0, 'date': voucher.date, 'date_maturity': voucher.date_due } @@ -763,9 +770,10 @@ class account_voucher(osv.osv): if line.amount == line.amount_unreconciled: amount = line.move_line_id.amount_residual #residual amount in company currency else: - ctx = context_multi_currency.copy() - ctx.update({'date': line.date_original}) - amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=ctx) + #ctx = context_multi_currency.copy() + #ctx.update({'date': line.date_original}) + #amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=ctx) + amount = line.amount_in_company_currency move_line = { 'journal_id': voucher.journal_id.id, 'period_id': voucher.period_id.id, @@ -773,7 +781,7 @@ class account_voucher(osv.osv): 'account_id': line.account_id.id, 'move_id': move_id, 'partner_id': voucher.partner_id.id, - 'currency_id': company_currency <> current_currency and current_currency or False, + 'currency_id': company_currency <> line.currency_id.id and line.currency_id.id or False, 'analytic_account_id': line.account_analytic_id and line.account_analytic_id.id or False, 'quantity': 1, 'credit': 0.0, @@ -800,14 +808,14 @@ class account_voucher(osv.osv): if not (tax_data.base_code_id and tax_data.tax_code_id): raise osv.except_osv(_('No Account Base Code and Account Tax Code!'),_("You have to configure account base code and account tax code on the '%s' tax!") % (tax_data.name)) sign = (move_line['debit'] - move_line['credit']) < 0 and -1 or 1 - move_line['amount_currency'] = company_currency <> current_currency and sign * line.amount or 0.0 + move_line['amount_currency'] = company_currency <> line.currency_id.id and sign * line.amount or 0.0 voucher_line = move_line_pool.create(cr, uid, move_line) if line.move_line_id.id: rec_ids = [voucher_line, line.move_line_id.id] rec_list_ids.append(rec_ids) if not currency_pool.is_zero(cr, uid, voucher.currency_id, voucher.writeoff_amount): - diff = currency_pool.compute(cr, uid, current_currency, company_currency, voucher.writeoff_amount, context=context_multi_currency) + diff = currency_pool.compute(cr, uid, voucher_currency, company_currency, voucher.writeoff_amount, context=context_multi_currency) account_id = False write_off_name = '' if voucher.payment_option == 'with_writeoff': @@ -825,8 +833,8 @@ class account_voucher(osv.osv): 'date': voucher.date, 'credit': diff > 0 and diff or 0.0, 'debit': diff < 0 and -diff or 0.0, - 'amount_currency': voucher.writeoff_amount, - 'currency_id': company_currency <> current_currency and current_currency or False, + 'amount_currency': company_currency <> voucher_currency and voucher.writeoff_amount or 0.0, + 'currency_id': company_currency <> voucher_currency and voucher_currency or False, } move_line_pool.create(cr, uid, move_line) self.write(cr, uid, [voucher.id], { @@ -898,34 +906,46 @@ class account_voucher_line(osv.osv): ctx = context.copy() ctx.update({'date': line.date_original}) currency_pool = self.pool.get('res.currency') - return currency_pool.compute(cr, uid, line.currency_id.id, line.company_currency_id.id, amount, context=ctx) + amount_company_cur = currency_pool.compute(cr, uid, line.currency_id.id, line.company_currency_id.id, amount, context=ctx) + ctx.update({'date': line.voucher_id.date}) + amount_voucher_cur = currency_pool.compute(cr, uid, line.currency_id.id, line.voucher_currency_id.id, amount, context=ctx) + return amount_company_cur, amount_voucher_cur def onchange_amount(self, cr, uid, ids, amount, context=None): - if not amount: - return {'value':{'amount_in_company_currency': 0.0}} + if not amount or not ids: + return {'value':{'amount_in_company_currency': 0.0, 'amount_in_voucher_currency': 0.0}} for line in self.browse(cr, uid, ids, context=context): - amount = self.__company_currency_amount(cr, uid, line, amount, context=context) - return {'value': {'amount_in_company_currency': amount}} + amount_company_cur, amount_voucher_cur = self.__company_currency_amount(cr, uid, line, amount, context=context) + return {'value': {'amount_in_company_currency': amount_company_cur, 'amount_in_voucher_currency': amount_voucher_cur}} def _get_amount_in_company_currency(self, cr, uid, ids, name, args, context=None): res = {} for line in self.browse(cr, uid, ids, context=context): - res[line.id] = self.__company_currency_amount(cr, uid, line, line.amount, context=context) + amount_in_company_currency, amount_in_voucher_currency = self.__company_currency_amount(cr, uid, line, line.amount, context=context) + res[line.id] = { + 'amount_in_company_currency': amount_in_company_currency, + 'amount_in_voucher_currency': amount_in_voucher_currency, + } return res _columns = { 'voucher_id':fields.many2one('account.voucher', 'Voucher', required=1, ondelete='cascade'), + 'move_line_id': fields.many2one('account.move.line', 'Journal Item', required=True), + 'type':fields.selection([('dr','Debit'),('cr','Credit')], 'Dr/Cr'), 'name':fields.char('Description', size=256), 'account_id':fields.many2one('account.account','Account', required=True), - 'partner_id':fields.related('voucher_id', 'partner_id', type='many2one', relation='res.partner', string='Partner'), - 'currency_id': fields.function(_currency_id, string='Currency', type='many2one', relation='res.currency'), - 'untax_amount':fields.float('Untax Amount'), - 'amount':fields.float('Amount', digits_compute=dp.get_precision('Account')), - 'type':fields.selection([('dr','Debit'),('cr','Credit')], 'Dr/Cr'), 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'), - 'move_line_id': fields.many2one('account.move.line', 'Journal Item', required=True), + 'partner_id':fields.related('voucher_id', 'partner_id', type='many2one', relation='res.partner', string='Partner'), + 'untax_amount':fields.float('Untax Amount'), + + 'currency_id': fields.function(_currency_id, string='Currency', type='many2one', relation='res.currency'), 'company_currency_id': fields.related('move_line_id','company_id','currency_id', type='many2one', relation='res.currency', string="Company Currency"), - 'amount_in_company_currency': fields.function(_get_amount_in_company_currency, string='Amount in Company Currency', type='float', digits_compute=dp.get_precision('Account')), + 'voucher_currency_id': fields.related('voucher_id', 'currency_id', type='many2one', relation='res.currency', string="Voucher Currency"), + + 'amount':fields.float('Amount', digits_compute=dp.get_precision('Account')), + 'amount_in_company_currency': fields.function(_get_amount_in_company_currency, string='Amount in Company Currency', type='float', digits_compute=dp.get_precision('Account'), multi="voucher_line_amount"), + 'amount_in_voucher_currency': fields.function(_get_amount_in_company_currency, string='Amount in Voucher Currency', type='float', digits_compute=dp.get_precision('Account'), multi="voucher_line_amount"), + 'date_original': fields.related('move_line_id','date', type='date', relation='account.move.line', string='Date', readonly=1), 'date_due': fields.related('move_line_id','date_maturity', type='date', relation='account.move.line', string='Due Date', readonly=1), 'amount_original': fields.function(_compute_balance, multi='dc', type='float', string='Original Amount', store=True), diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index 1d6e2f19ddc..b4e249a0d33 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -301,7 +301,7 @@ invisible="context.get('line_type', False)" string="Paid Amount" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/> - + @@ -314,7 +314,7 @@ - + - + + + - + - + + + + + + + @@ -345,19 +353,20 @@ - - - + + + + + domain="[('type','=','other')]" colspan="4"/> + attrs="{'invisible':[('payment_option','!=','with_writeoff')]}" colspan="4"/> + groups="analytic.group_analytic_accounting" colspan="4"/> From 69e5946d0f285e23735ac82f2088c006177533c2 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 15 Jul 2011 14:44:33 +0200 Subject: [PATCH 07/39] [IMP] account: display currency in name get of journals also for the ones in company currency bzr revid: qdp-launchpad@openerp.com-20110715124433-f61h47m09l83c07d --- addons/account/account.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/account.py b/addons/account/account.py index 03a9b628922..ad7b60ada4d 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -711,6 +711,8 @@ class account_journal(osv.osv): name = rs.name if rs.currency: name = "%s (%s)" % (rs.name, rs.currency.name) + else: + name = "%s (%s)" % (rs.name, rs.company_id.currency_id.name) res += [(rs.id, name)] return res From 3ff98eff3648564be8cbf6a5479498e524dc7a21 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 15 Jul 2011 14:47:12 +0200 Subject: [PATCH 08/39] [IMP] account: added move_id in tree view of payment in invoices form view, to allow the 'click and relate' feature to see the move line bzr revid: qdp-launchpad@openerp.com-20110715124712-8nnptyr3yy30nlse --- addons/account/account_invoice_view.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index be431c9b2e7..99a82e38485 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -238,6 +238,7 @@ + @@ -336,6 +337,7 @@ + From 930def9cfc58d3b8b5ad775fa642e4905df55b89 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 15 Jul 2011 14:47:38 +0200 Subject: [PATCH 09/39] [IMP] account_voucher: multi currency improvements (part 4) bzr revid: qdp-launchpad@openerp.com-20110715124738-q64m7ev5yk0denge --- addons/account_voucher/account_voucher.py | 56 ++++++++----------- .../voucher_payment_receipt_view.xml | 47 +++++++++------- 2 files changed, 49 insertions(+), 54 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index dd3af1139f4..a409092ed16 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -182,13 +182,13 @@ class account_voucher(osv.osv): ctx.update({'date': voucher.date}) for l in voucher.line_dr_ids: real_amount -= l.amount_in_company_currency - counter_for_writeoff -= l.amount_in_voucher_currency + counter_for_writeoff -= (l.voucher_currency_id.id == l.company_currency_id.id) and l.amount_in_company_currency or l.amount_in_voucher_currency #ctx.update({'date': l.date_original}) #counter_for_writeoff -= currency_pool.compute(cr, uid, voucher.company_id.currency_id.id, voucher.currency_id.id, l.amount_in_company_currency, context=ctx) counter_for_currency_diff -= currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) for l in voucher.line_cr_ids: real_amount += l.amount_in_company_currency - counter_for_writeoff += l.amount_in_voucher_currency + counter_for_writeoff += (l.voucher_currency_id.id == l.company_currency_id.id) and l.amount_in_company_currency or l.amount_in_voucher_currency #ctx.update({'date': l.date_original}) #counter_for_writeoff += currency_pool.compute(cr, uid, voucher.company_id.currency_id.id, voucher.currency_id.id, l.amount_in_company_currency, context=ctx) counter_for_currency_diff += currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) @@ -216,7 +216,7 @@ class account_voucher(osv.osv): ],'Default Type', readonly=True, states={'draft':[('readonly',False)]}), 'name':fields.char('Memo', size=256, readonly=True, states={'draft':[('readonly',False)]}), 'date':fields.date('Date', readonly=True, select=True, states={'draft':[('readonly',False)]}, help="Effective date for accounting entries"), - 'journal_id':fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}), + 'journal_id':fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}, change_default=1), 'account_id':fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}), 'line_ids':fields.one2many('account.voucher.line','voucher_id','Voucher Lines', readonly=True, states={'draft':[('readonly',False)]}), 'line_cr_ids':fields.one2many('account.voucher.line','voucher_id','Credits', @@ -229,6 +229,7 @@ class account_voucher(osv.osv): #duplicated field for display purposes 'currency_id2': fields.function(_currency_id, type='many2one', relation='res.currency', string='Currency', store=True, readonly=True, multi="currency"), 'company_id': fields.many2one('res.company', 'Company', required=True, readonly=True, states={'draft':[('readonly',False)]}), + 'company_currency': fields.related('company_id','currency_id', type='many2one', relation='res.currency', string='Currency', readonly=True), 'state':fields.selection( [('draft','Draft'), ('proforma','Pro-forma'), @@ -256,7 +257,7 @@ class account_voucher(osv.osv): 'date_due': fields.date('Due Date', readonly=True, select=True, states={'draft':[('readonly',False)]}), 'payment_option':fields.selection([ ('without_writeoff', 'Keep Open'), - ('with_writeoff', 'Reconcile with Write-Off'), + ('with_writeoff', 'Reconcile'), ], 'Payment Difference', required=True, readonly=True, states={'draft': [('readonly', False)]}), 'writeoff_acc_id': fields.many2one('account.account', 'Write-Off account', readonly=True, states={'draft': [('readonly', False)]}), 'comment': fields.char('Write-Off Comment', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}), @@ -440,38 +441,33 @@ class account_voucher(osv.osv): @return: Returns a dict which contains new values, and context """ - if context is None: - context = {} if not journal_id: return {} + if context is None: + context = {} context_multi_currency = context.copy() if date: context_multi_currency.update({'date': date}) - line_pool = self.pool.get('account.voucher.line') - line_ids = ids and line_pool.search(cr, uid, [('voucher_id', '=', ids[0])]) or False - if line_ids: - line_pool.unlink(cr, uid, line_ids) - currency_pool = self.pool.get('res.currency') move_line_pool = self.pool.get('account.move.line') partner_pool = self.pool.get('res.partner') journal_pool = self.pool.get('account.journal') - - vals = self.onchange_journal(cr, uid, ids, journal_id, [], False, partner_id, context) - vals = vals.get('value') + line_pool = self.pool.get('account.voucher.line') + #get default values + vals = self.onchange_journal(cr, uid, ids, journal_id, [], False, partner_id, context=context) + vals = vals.get('value',{}) voucher_currency_id = vals.get('currency_id', voucher_currency_id) default = { 'value':{'line_ids':[], 'line_dr_ids':[], 'line_cr_ids':[], 'pre_line': False, 'currency_id': voucher_currency_id}, } - if not partner_id: - return default + #drop existing lines + line_ids = ids and line_pool.search(cr, uid, [('voucher_id', 'in', ids)]) or [] + if line_ids: + line_pool.unlink(cr, uid, line_ids, context=context) - if not partner_id and ids: - line_ids = line_pool.search(cr, uid, [('voucher_id', '=', ids[0])]) - if line_ids: - line_pool.unlink(cr, uid, line_ids) + if not partner_id: return default journal = journal_pool.browse(cr, uid, journal_id, context=context) @@ -583,7 +579,7 @@ class account_voucher(osv.osv): def onchange_journal(self, cr, uid, ids, journal_id, line_ids, tax_id, partner_id, context=None): if not journal_id: - return False + return {} journal_pool = self.pool.get('account.journal') journal = journal_pool.browse(cr, uid, journal_id, context=context) account_id = journal.default_credit_account_id or journal.default_debit_account_id @@ -640,7 +636,6 @@ class account_voucher(osv.osv): raise osv.except_osv(_('Invalid action !'), _('Cannot delete Voucher(s) which are already opened or paid !')) return super(account_voucher, self).unlink(cr, uid, ids, context=context) - # TODO: may be we can remove this method if not used anyware def onchange_payment(self, cr, uid, ids, pay_now, journal_id, partner_id, ttype='sale'): res = {} if not partner_id: @@ -705,8 +700,6 @@ class account_voucher(osv.osv): voucher_currency = voucher.currency_id.id debit = 0.0 credit = 0.0 - # TODO: is there any other alternative then the voucher type ?? - # -for sale, purchase we have but for the payment and receipt we do not have as based on the bank/cash journal we can not know its payment or receipt if voucher.type in ('purchase', 'payment'): credit = currency_pool.compute(cr, uid, voucher_currency, company_currency, voucher.amount, context=context_multi_currency) elif voucher.type in ('sale', 'receipt'): @@ -738,11 +731,11 @@ class account_voucher(osv.osv): #create the move line for the currency difference if voucher.currency_rate_difference: if voucher.currency_rate_difference > 0: - account_id = voucher.company_id.property_income_currency_exchange + account_id = voucher.company_id.property_expense_currency_exchange if not account_id: raise osv.except_osv(_('Warning'),_("Unable to create accounting entry for currency rate difference. You have to configure the field 'Income Currency Rate' on the company! ")) else: - account_id = voucher.company_id.property_expense_currency_exchange + account_id = voucher.company_id.property_income_currency_exchange if not account_id: raise osv.except_osv(_('Warning'),_("Unable to create accounting entry for currency rate difference. You have to configure the field 'Expense Currency Rate' on the company! ")) @@ -758,10 +751,9 @@ class account_voucher(osv.osv): 'date': voucher.date, 'date_maturity': voucher.date_due } - move_line_pool.create(cr, uid, currency_diff_line, context=context) - rec_list_ids = [] + rec_list_ids = [] for line in voucher.line_ids: #create one move line per voucher line where amount is not 0.0 if not line.amount: @@ -770,9 +762,6 @@ class account_voucher(osv.osv): if line.amount == line.amount_unreconciled: amount = line.move_line_id.amount_residual #residual amount in company currency else: - #ctx = context_multi_currency.copy() - #ctx.update({'date': line.date_original}) - #amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=ctx) amount = line.amount_in_company_currency move_line = { 'journal_id': voucher.journal_id.id, @@ -815,6 +804,7 @@ class account_voucher(osv.osv): rec_list_ids.append(rec_ids) if not currency_pool.is_zero(cr, uid, voucher.currency_id, voucher.writeoff_amount): + #create one line for the write off if needed diff = currency_pool.compute(cr, uid, voucher_currency, company_currency, voucher.writeoff_amount, context=context_multi_currency) account_id = False write_off_name = '' @@ -831,9 +821,9 @@ class account_voucher(osv.osv): 'move_id': move_id, 'partner_id': voucher.partner_id.id, 'date': voucher.date, - 'credit': diff > 0 and diff or 0.0, 'debit': diff < 0 and -diff or 0.0, - 'amount_currency': company_currency <> voucher_currency and voucher.writeoff_amount or 0.0, + 'credit': diff > 0 and diff or 0.0, + 'amount_currency': company_currency <> voucher_currency and -voucher.writeoff_amount or 0.0, 'currency_id': company_currency <> voucher_currency and voucher_currency or False, } move_line_pool.create(cr, uid, move_line) diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index b4e249a0d33..c2344d681c1 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -301,7 +301,7 @@ invisible="context.get('line_type', False)" string="Paid Amount" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/> - + @@ -320,32 +320,36 @@ on_change="onchange_move_line_id(move_line_id)" domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]" /> - + - - - - - - - + + + + + + + - - - - - - + + + + - - - - + + + + + + + @@ -356,9 +360,11 @@ + + - + @@ -371,7 +377,6 @@ - From db61756ea7069646b61cd83d854284978c4ad816 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 15 Jul 2011 16:41:26 +0200 Subject: [PATCH 10/39] [IMP] account_voucher: onchange of the amount must assign it correctly if the same amount is found in move line list. If not, it must split it only on the lines with the same curerncy (not working yet). (improvements part 5) bzr revid: qdp-launchpad@openerp.com-20110715144126-6mq2dhkchwcxh51j --- addons/account_voucher/account_voucher.py | 52 +++++++++++++++++------ 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index a409092ed16..17940aa6f25 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -499,22 +499,38 @@ class account_voucher(osv.osv): ids = move_line_pool.search(cr, uid, [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id)], context=context) else: ids = context['move_line_ids'] + #order the lines by most old first ids.reverse() - moves = move_line_pool.browse(cr, uid, ids, context=context) + moves = move_line_pool.browse(cr, uid, ids, context=context) company_currency = journal.company_id.currency_id.id if company_currency != voucher_currency_id and ttype == 'payment': total_debit = currency_pool.compute(cr, uid, voucher_currency_id, company_currency, total_debit, context=context_multi_currency) elif company_currency != voucher_currency_id and ttype == 'receipt': total_credit = currency_pool.compute(cr, uid, voucher_currency_id, company_currency, total_credit, context=context_multi_currency) + invoice_id = context.get('invoice_id', False) + move_line_found = False for line in moves: if line.credit and line.reconcile_partial_id and ttype == 'receipt': continue if line.debit and line.reconcile_partial_id and ttype == 'payment': continue - total_credit += line.credit or 0.0 - total_debit += line.debit or 0.0 + if invoice_id and line.move_id.invoice_id.id == invoice_id: + move_line_found = line.id + break + if voucher_currency_id == company_currency: + if line.amount_residual == price: + move_line_found = line.id + break + total_credit += line.credit or 0.0 + total_debit += line.debit or 0.0 + elif voucher_currency_id == line.currency_id.id: + if line.amount_residual_currency == price: + move_line_found = line.id + break + total_credit += line.amount_currency or 0.0 + total_debit += line.amount_currency or 0.0 for line in moves: if line.credit and line.reconcile_partial_id and ttype == 'receipt': continue @@ -529,7 +545,7 @@ class account_voucher(osv.osv): 'move_line_id':line.id, 'account_id':line.account_id.id, 'amount_original': amount_original, - 'amount': 0.0, + 'amount': (move_line_found == line.id) and min(price, amount_unreconciled) or 0.0, 'currency_id': currency_id, 'voucher_currency_id': voucher_currency_id, 'date_original':line.date, @@ -539,14 +555,26 @@ class account_voucher(osv.osv): 'amount_in_company_currency': 0.0, } - #if line.credit: - # amount = min(amount_unreconciled, currency_pool.compute(cr, uid, company_currency, currency_id, abs(total_debit), context=context_multi_currency)) - # rs['amount'] = amount - # total_debit -= amount - #else: - # amount = min(amount_unreconciled, currency_pool.compute(cr, uid, company_currency, currency_id, abs(total_credit), context=context_multi_currency)) - # rs['amount'] = amount - # total_credit -= amount + if not move_line_found: + #TODO: this part isn't working really: we should assign the voucher amount on only lines that are or the same currency + if company_currency == voucher_currency_id: + if line.credit: + amount = min(amount_unreconciled, abs(total_debit)) + rs['amount'] = amount + total_debit -= amount + else: + amount = min(amount_unreconciled, abs(total_credit)) + rs['amount'] = amount + total_credit -= amount + elif voucher_currency_id == line.currency_id.id: + if line.credit: + amount = min(amount_unreconciled, abs(total_debit)) + rs['amount'] = amount + total_debit -= amount + else: + amount = min(amount_unreconciled, abs(total_credit)) + rs['amount'] = amount + total_credit -= amount default['value']['line_ids'].append(rs) if rs['type'] == 'cr': From 0e614785f9d10c65e2b9cc8479d8a5fe4762f0bb Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Thu, 21 Jul 2011 14:31:17 +0530 Subject: [PATCH 11/39] [FIX] Account voucher: payment date refused when check date not in the period is checked lp bug: https://launchpad.net/bugs/808751 fixed bzr revid: mra@mra-laptop-20110721090117-n3uhdgxvyrkmii7d --- addons/account_voucher/account_voucher.py | 30 +++++++++---------- .../wizard/account_statement_from_invoice.py | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 17940aa6f25..56f1c719624 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -152,11 +152,11 @@ class account_voucher(osv.osv): for l in line_dr_ids: real_amount -= l.get('amount_in_company_currency', 0.0) counter_for_writeoff -= currency_pool.compute(cr, uid, l['company_currency_id'], l['voucher_currency_id'], l.get('amount_in_company_currency',0.0), context=ctx) - counter_for_currency_diff -= currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) + counter_for_currency_diff -= currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) for l in line_cr_ids: real_amount += l.get('amount_in_company_currency', 0.0) counter_for_writeoff += currency_pool.compute(cr, uid, l['company_currency_id'], l['voucher_currency_id'], l.get('amount_in_company_currency',0.0), context=ctx) - counter_for_currency_diff += currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) + counter_for_currency_diff += currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) writeoff_amount = amount - counter_for_writeoff currency_rate_difference = real_amount - counter_for_currency_diff return writeoff_amount, currency_rate_difference @@ -167,7 +167,7 @@ class account_voucher(osv.osv): line_osv = self.pool.get("account.voucher.line") line_dr_ids = resolve_o2m_operations(cr, uid, line_osv, line_dr_ids, ['amount'], context) line_cr_ids = resolve_o2m_operations(cr, uid, line_osv, line_cr_ids, ['amount'], context) - writeoff_amount, currency_rate_diff = self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount, voucher_date, context=context) + writeoff_amount, currency_rate_diff = self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount, voucher_date, context=context) return {'value': {'writeoff_amount': writeoff_amount,}}# 'currency_rate_difference': currency_rate_diff}} def _get_writeoff_amount(self, cr, uid, ids, name, args, context=None): @@ -185,15 +185,15 @@ class account_voucher(osv.osv): counter_for_writeoff -= (l.voucher_currency_id.id == l.company_currency_id.id) and l.amount_in_company_currency or l.amount_in_voucher_currency #ctx.update({'date': l.date_original}) #counter_for_writeoff -= currency_pool.compute(cr, uid, voucher.company_id.currency_id.id, voucher.currency_id.id, l.amount_in_company_currency, context=ctx) - counter_for_currency_diff -= currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) + counter_for_currency_diff -= currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) for l in voucher.line_cr_ids: real_amount += l.amount_in_company_currency counter_for_writeoff += (l.voucher_currency_id.id == l.company_currency_id.id) and l.amount_in_company_currency or l.amount_in_voucher_currency #ctx.update({'date': l.date_original}) #counter_for_writeoff += currency_pool.compute(cr, uid, voucher.company_id.currency_id.id, voucher.currency_id.id, l.amount_in_company_currency, context=ctx) - counter_for_currency_diff += currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) + counter_for_currency_diff += currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) writeoff_amount = voucher.amount - counter_for_writeoff - res[voucher.id]['writeoff_amount'] = writeoff_amount + res[voucher.id]['writeoff_amount'] = writeoff_amount res[voucher.id]['currency_rate_difference'] = real_amount - counter_for_currency_diff return res @@ -545,9 +545,9 @@ class account_voucher(osv.osv): 'move_line_id':line.id, 'account_id':line.account_id.id, 'amount_original': amount_original, - 'amount': (move_line_found == line.id) and min(price, amount_unreconciled) or 0.0, + 'amount': (move_line_found == line.id) and min(price, amount_unreconciled) or 0.0, 'currency_id': currency_id, - 'voucher_currency_id': voucher_currency_id, + 'voucher_currency_id': voucher_currency_id, 'date_original':line.date, 'company_currency_id': line.company_id.currency_id.id, 'date_due':line.date_maturity, @@ -766,7 +766,7 @@ class account_voucher(osv.osv): account_id = voucher.company_id.property_income_currency_exchange if not account_id: raise osv.except_osv(_('Warning'),_("Unable to create accounting entry for currency rate difference. You have to configure the field 'Expense Currency Rate' on the company! ")) - + currency_diff_line = { 'name': _('Currency Difference'), 'debit': voucher.currency_rate_difference > 0 and voucher.currency_rate_difference or 0.0, @@ -833,7 +833,7 @@ class account_voucher(osv.osv): if not currency_pool.is_zero(cr, uid, voucher.currency_id, voucher.writeoff_amount): #create one line for the write off if needed - diff = currency_pool.compute(cr, uid, voucher_currency, company_currency, voucher.writeoff_amount, context=context_multi_currency) + diff = currency_pool.compute(cr, uid, voucher_currency, company_currency, voucher.writeoff_amount, context=context_multi_currency) account_id = False write_off_name = '' if voucher.payment_option == 'with_writeoff': @@ -939,7 +939,7 @@ class account_voucher_line(osv.osv): def _get_amount_in_company_currency(self, cr, uid, ids, name, args, context=None): res = {} for line in self.browse(cr, uid, ids, context=context): - amount_in_company_currency, amount_in_voucher_currency = self.__company_currency_amount(cr, uid, line, line.amount, context=context) + amount_in_company_currency, amount_in_voucher_currency = self.__company_currency_amount(cr, uid, line, line.amount, context=context) res[line.id] = { 'amount_in_company_currency': amount_in_company_currency, 'amount_in_voucher_currency': amount_in_voucher_currency, @@ -961,8 +961,8 @@ class account_voucher_line(osv.osv): 'voucher_currency_id': fields.related('voucher_id', 'currency_id', type='many2one', relation='res.currency', string="Voucher Currency"), 'amount':fields.float('Amount', digits_compute=dp.get_precision('Account')), - 'amount_in_company_currency': fields.function(_get_amount_in_company_currency, string='Amount in Company Currency', type='float', digits_compute=dp.get_precision('Account'), multi="voucher_line_amount"), - 'amount_in_voucher_currency': fields.function(_get_amount_in_company_currency, string='Amount in Voucher Currency', type='float', digits_compute=dp.get_precision('Account'), multi="voucher_line_amount"), + 'amount_in_company_currency': fields.function(_get_amount_in_company_currency, string='Amount in Company Currency', type='float', digits_compute=dp.get_precision('Account'), multi="voucher_line_amount"), + 'amount_in_voucher_currency': fields.function(_get_amount_in_company_currency, string='Amount in Voucher Currency', type='float', digits_compute=dp.get_precision('Account'), multi="voucher_line_amount"), 'date_original': fields.related('move_line_id','date', type='date', relation='account.move.line', string='Date', readonly=1), 'date_due': fields.related('move_line_id','date_maturity', type='date', relation='account.move.line', string='Due Date', readonly=1), @@ -1062,7 +1062,7 @@ class account_bank_statement(osv.osv): bank_st_line_obj = self.pool.get('account.bank.statement.line') st_line = bank_st_line_obj.browse(cr, uid, st_line_id, context=context) if st_line.voucher_id: - voucher_obj.write(cr, uid, [st_line.voucher_id.id], {'number': next_number}, context=context) + voucher_obj.write(cr, uid, [st_line.voucher_id.id], {'number': next_number, 'date': st_line.date}, context=context) if st_line.voucher_id.state == 'cancel': voucher_obj.action_cancel_draft(cr, uid, [st_line.voucher_id.id], context=context) wf_service.trg_validate(uid, 'account.voucher', st_line.voucher_id.id, 'proforma_voucher', cr) @@ -1072,7 +1072,7 @@ class account_bank_statement(osv.osv): 'move_ids': [(4, v.move_id.id, False)] }) - return move_line_obj.write(cr, uid, [x.id for x in v.move_ids], {'statement_id': st_line.statement_id.id}, context=context) + return move_line_obj.write(cr, uid, [x.id for x in v.move_ids], {'statement_id': st_line.statement_id.id, 'date': st_line.date}, update_check=False, context=context) return super(account_bank_statement, self).create_move_from_st_line(cr, uid, st_line.id, company_currency_id, next_number, context=context) account_bank_statement() diff --git a/addons/account_voucher/wizard/account_statement_from_invoice.py b/addons/account_voucher/wizard/account_statement_from_invoice.py index e4d728c8867..3509ac846b5 100644 --- a/addons/account_voucher/wizard/account_statement_from_invoice.py +++ b/addons/account_voucher/wizard/account_statement_from_invoice.py @@ -75,7 +75,7 @@ class account_statement_from_invoice_lines(osv.osv_memory): statement.currency.id, amount, context=ctx) context.update({'move_line_ids': [line.id]}) - result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype=(amount < 0 and 'payment' or 'receipt'), date=line_date, context=context) + result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), voucher_currency_id= statement.currency.id, ttype=(amount < 0 and 'payment' or 'receipt'), date=line_date, context=context) voucher_res = { 'type':(amount < 0 and 'payment' or 'receipt'), 'name': line.name, 'partner_id': line.partner_id.id, From 0465909c92d248e0a434dd85f8d78e7ff0be2c7a Mon Sep 17 00:00:00 2001 From: mtr Date: Mon, 1 Aug 2011 18:31:43 +0530 Subject: [PATCH 12/39] [ADD] account_voucher: added yaml for multicurrency i.e. USD-EUR, EUR-EUR, CAD-CHF bzr revid: mtr@mtr-20110801130143-wygzy83cztuqw3ub --- addons/account_voucher/__openerp__.py | 5 +- addons/account_voucher/test/case2_usd_eur.yml | 360 ++++++++++++++++++ addons/account_voucher/test/case3_eur_eur.yml | 331 ++++++++++++++++ addons/account_voucher/test/case4_cad_chf.yml | 181 +++++++++ 4 files changed, 876 insertions(+), 1 deletion(-) create mode 100644 addons/account_voucher/test/case2_usd_eur.yml create mode 100644 addons/account_voucher/test/case3_eur_eur.yml create mode 100644 addons/account_voucher/test/case4_cad_chf.yml diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py index 039d3e067af..d4331a81923 100644 --- a/addons/account_voucher/__openerp__.py +++ b/addons/account_voucher/__openerp__.py @@ -59,7 +59,10 @@ Account Voucher module includes all the basic requirements of Voucher Entries fo "test/account_voucher.yml", "test/sales_receipt.yml", "test/sales_payment.yml", - "test/account_voucher_report.yml" + "test/account_voucher_report.yml", + "test/case2_usd_eur.yml", + "test/case3_eur_eur.yml", + "test/case4_cad_chf.yml", ], 'certificate': '0037580727101', "active": False, diff --git a/addons/account_voucher/test/case2_usd_eur.yml b/addons/account_voucher/test/case2_usd_eur.yml new file mode 100644 index 00000000000..39b0eb0edbb --- /dev/null +++ b/addons/account_voucher/test/case2_usd_eur.yml @@ -0,0 +1,360 @@ +- + I create a currency rate for USD for january of 1.333333 +- + !record {model: res.currency.rate, id: janu_usd}: + currency_id: base.USD + name: !eval "'%s-01-01' %(datetime.now().year)" + rate: 1.333333 +- + I create a currency rate for USD for february of 1.250000 +- + !record {model: res.currency.rate, id: febr_usd}: + currency_id: base.USD + name: !eval "'%s-02-01' %(datetime.now().year)" + rate: 1.250000 +- + I create a currency rate for USD for march of 1.111111 +- + !record {model: res.currency.rate, id: marc_usd}: + currency_id: base.USD + name: !eval "'%s-03-01' %(datetime.now().year)" + rate: 1.111111 +- + I create a currency rate for USD for april of 1.052632 +- + !record {model: res.currency.rate, id: apri_usd}: + currency_id: base.USD + name: !eval "'%s-04-01' %(datetime.now().year)" + rate: 1.052632 +- + I create a bank journal with EUR as currency +- + !record {model: account.journal, id: bank_journal_EUR}: + name: Bank Journal(EUR) + code: BEUR + type: bank + analytic_journal_id: account.sit + sequence_id: account.sequence_bank_journal + default_debit_account_id: account.cash + default_credit_account_id: account.cash + currency: base.EUR + company_id: base.main_company + view_id: account.account_journal_bank_view +- + I create a bank journal with USD as currency +- + !record {model: account.journal, id: bank_journal_USD}: + name: Bank Journal(USD) + code: BUSD + type: bank + analytic_journal_id: account.sit + sequence_id: account.sequence_bank_journal + default_debit_account_id: account.cash + default_credit_account_id: account.cash + currency: base.USD + company_id: base.main_company + view_id: account.account_journal_bank_view +- + I assign accounts for 'Income Curreny Rate' and 'Expense Currency Rate' +- + !record {model: res.company, id: base.main_company}: + property_expense_currency_exchange: account.o_expense + property_income_currency_exchange: account.o_income +- + I create a new partner Michael Geller +- + !record {model: res.partner, id: res_partner_michael0}: + address: + - city: paris + country_id: base.fr + name: Michael + street: 1 rue Rockfeller + type: invoice + zip: '75016' + name: Mr.Michael Geller +- + I create the first invoice on 1st January for 200 USD +- + !record {model: account.invoice, id: account_first_invoice_jan}: + account_id: account.a_recv + address_contact_id: base.res_partner_address_3000 + address_invoice_id: base.res_partner_address_3000 + company_id: base.main_company + currency_id: base.USD + date_invoice: !eval "'%s-01-01' %(datetime.now().year)" + period_id: account.period_1 + invoice_line: + - account_id: account.a_sale + name: '[PC1] Basic PC' + price_unit: 200.0 + quantity: 1.0 + product_id: product.product_product_pc1 + uos_id: product.product_uom_unit + journal_id: account.sales_journal + partner_id: res_partner_michael0 + reference_type: none +- + I Validate invoice by clicking on Validate button +- + !workflow {model: account.invoice, action: invoice_open, ref: account_first_invoice_jan} +- + I check that first invoice move is correct +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan")) + assert invoice_id.move_id, "Move not created for open invoice" + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + assert (move_line.debit - move_line.credit == 150.00), "Invoice move is incorrect for debtors account" +- + I create the second invoice on 1st February for 100 USD +- + !record {model: account.invoice, id: account_second_invoice_feb}: + account_id: account.a_recv + address_contact_id: base.res_partner_address_3000 + address_invoice_id: base.res_partner_address_3000 + company_id: base.main_company + currency_id: base.USD + date_invoice: !eval "'%s-02-01' %(datetime.now().year)" + period_id: account.period_2 + invoice_line: + - account_id: account.a_sale + name: '[PC1] Basic PC' + price_unit: 100.0 + quantity: 1.0 + product_id: product.product_product_pc1 + uos_id: product.product_uom_unit + journal_id: account.sales_journal + partner_id: res_partner_michael0 + reference_type: none +- + I Validate invoice by clicking on Validate button +- + !workflow {model: account.invoice, action: invoice_open, ref: account_second_invoice_feb} +- + I check that second invoice move is correct for debtor account (debit - credit == 80) +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb")) + assert invoice_id.move_id, "Move not created for open invoice" + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + assert (move_line.debit - move_line.credit == 80), "Invoice move is incorrect for debtors account" +- + I create the first voucher of payment with values 240 EUR, journal EUR, and fill amount 180 for the invoice of 200$ and 70 for the 100$ invoice. +- + !python {model: account.voucher}: | + import netsvc, time + vals = {} + res = self.onchange_partner_id(cr, uid, [], ref("res_partner_michael0"), ref('bank_journal_EUR'), 240.0, 2, ttype='receipt', date=False) + vals = { + 'account_id': ref('account.cash'), + 'amount': 240.0, + 'company_id': ref('base.main_company'), + 'currency_id': ref('base.EUR'), + 'journal_id': ref('bank_journal_EUR'), + 'partner_id': ref('res_partner_michael0'), + 'period_id': ref('account.period_3'), + 'type': 'receipt', + 'date': time.strftime("%Y-03-01"), + 'payment_option': 'with_writeoff', + 'writeoff_acc_id': ref('account.a_expense'), + 'comment': 'Write Off', + 'name': 'First payment', + } + if not res['value']['line_cr_ids']: + res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}] + for item in res['value']['line_cr_ids']: + if item['amount_unreconciled'] == 200: + item['amount'] = 180 + else: + item['amount'] = 70 + vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']] + id = self.create(cr, uid, vals) + voucher_id = self.browse(cr, uid, id) + assert (voucher_id.state=='draft'), "Voucher is not in draft state" +- + I check that writeoff amount computed is 15 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michael0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert (voucher_id.writeoff_amount == 15), "writeoff amount is not 15" +- + I check that currency rate difference is -34 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michael0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert (voucher_id.currency_rate_difference == -34), "currency rate difference is not -34" +- + I confirm the voucher +- + !python {model: account.voucher}: | + import netsvc + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michael0'))]) + wf_service = netsvc.LocalService("workflow") + wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) +- + I check that my voucher state is posted +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michael0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert voucher_id.state == 'posted', "Voucher state is not posted" +- + I check that my debtor account is correct +- + I check that the debtor account has 2 new lines with -180 and -70 as amount_currency columns and their credit columns are respectively 135 and 56 and currency is USD($). +- + I check that my Currency Difference entry is created with a credit of 34, amount currency as 0.0 +- + I check that my write-off entry is created with a credit of 15.00 and amount currency as 0.0 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment')]) + voucher_id = self.browse(cr, uid, voucher[0]) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) + for move_line in move_line_obj.browse(cr, uid, move_lines): + if move_line.amount_currency == -180: + assert move_line.credit == 135, "Debtor account has wrong entry." + if move_line.amount_currency == -70: + assert move_line.credit == 56.00, "Debtor account has wrong entry." + if move_line.credit == 34: + assert move_line.amount_currency == 0.00, "Incorrect Currency Difference." + if move_line.credit == 15.00: + assert move_line.credit == 0.00, "Writeoff amount is wrong." +- + I check the residual amount of Invoice1, should be 20 in residual currency and 15 in amount_residual +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan")) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + residual_curr = move_line.amount_residual_currency + residual = move_line.amount_residual + assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for first Invoice" +- + I check the residual amuont of Invoice2, should be 30 in residual currency and 24 in amount_residual +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb")) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + residual_curr = move_line.amount_residual_currency + residual = move_line.amount_residual + assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for second Invoice" +- + I create the second voucher of payment with values, 45 USD, journal USD, and fill amounts 20 for the invoice of 200$ and 30 for the invoice of 100$ +- + !python {model: account.voucher}: | + import netsvc, time + vals = {} + res = self.onchange_partner_id(cr, uid, [], ref("res_partner_michael0"), ref('bank_journal_EUR'), 45.0, 2, ttype='receipt', date=False) + vals = { + 'account_id': ref('account.cash'), + 'amount': 45.0, + 'company_id': ref('base.main_company'), + 'currency_id': ref('base.USD'), + 'journal_id': ref('bank_journal_USD'), + 'partner_id': ref('res_partner_michael0'), + 'period_id': ref('account.period_3'), + 'type': 'receipt', + 'date': time.strftime("%Y-04-01"), + 'payment_option': 'with_writeoff', + 'writeoff_acc_id': ref('account.a_expense'), + 'comment': 'Write Off', + 'name': 'Second payment', + } + if not res['value']['line_cr_ids']: + res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}] + for item in res['value']['line_cr_ids']: + if item['amount_unreconciled'] == 20: + item['amount'] = 20 + else: + item['amount'] = 30 + vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']] + id = self.create(cr, uid, vals) + voucher_id = self.browse(cr, uid, id) + assert (voucher_id.state=='draft'), "Voucher is not in draft state" +- + I check that writeoff amount computed is -5 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert (voucher_id.writeoff_amount == -5), "writeoff amount is not -5" +- + I check that currency rate difference is -8.50 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + curr_diff = voucher_id.currency_rate_difference + assert (voucher_id.currency_rate_difference == curr_diff), "currency rate difference is not -8.50" +- + I confirm the voucher +- + !python {model: account.voucher}: | + import netsvc + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))]) + wf_service = netsvc.LocalService("workflow") + wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) +- + I check that my voucher state is posted +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert voucher_id.state == 'posted', "Voucher state is not posted" +- + I check that my debtor account is correct +- + I check that the debtor account has 2 new lines with -20 and -30 as amount_currency columns and their credit columns are respectively 15 and 24 and currency is USD($). +- + I check that my Currency Difference entry is created with a credit of 8.5 +- + I check that my write-off entry is created with a debit of 4.75 and amount currency as 0.0 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) + for move_line in move_line_obj.browse(cr, uid, move_lines): + d + if move_line.amount_currency == -20: + assert move_line.credit == 15, "Debtor account has wrong entry." + if move_line.amount_currency == -30: + assert move_line.credit == 24, "Debtor account has wrong entry." + if move_line.credit == 8.5: + assert move_line.amount_currency == 0.00, "Incorrect Currency Difference." + if move_line.credit == 5: + assert move_line.credit == 4.75, "Writeoff amount is wrong." +- + I check the residual amount of invoice 1, should be 0 in residual currency and 0 in amount_residual +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan")) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + residual_curr = move_line.amount_residual_currency + residual = move_line.amount_residual + assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for first Invoice" +- + I check the residual amuont of invoice 2, should be 0 in residual currency and 0 in amount_residual +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb")) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + residual_curr = move_line.amount_residual_currency + residual = move_line.amount_residual + assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for second Invoice" \ No newline at end of file diff --git a/addons/account_voucher/test/case3_eur_eur.yml b/addons/account_voucher/test/case3_eur_eur.yml new file mode 100644 index 00000000000..bce4feb5a3d --- /dev/null +++ b/addons/account_voucher/test/case3_eur_eur.yml @@ -0,0 +1,331 @@ +- + I create a currency rate for EUR for january of 1.000000 +- + !record {model: res.currency.rate, id: jan_eur}: + currency_id: base.EUR + name: !eval "'%s-01-01' %(datetime.now().year)" + rate: 1.000000 +- + I create a currency rate for EUR for february of 1.000000 +- + !record {model: res.currency.rate, id: feb_eur}: + currency_id: base.EUR + name: !eval "'%s-02-01' %(datetime.now().year)" + rate: 1.000000 +- + I create a currency rate for EUR for march of 1.000000 +- + !record {model: res.currency.rate, id: mar_eur}: + currency_id: base.EUR + name: !eval "'%s-03-01' %(datetime.now().year)" + rate: 1.000000 +- + I create a currency rate for EUR for april of 1.000000 +- + !record {model: res.currency.rate, id: apr_eur}: + currency_id: base.EUR + name: !eval "'%s-04-01' %(datetime.now().year)" + rate: 1.000000 +- + I create a bank journal with EUR as currency +- + !record {model: account.journal, id: bank_journal_EUR}: + name: Bank Journal(EUR) + code: BEUR + type: bank + analytic_journal_id: account.sit + sequence_id: account.sequence_bank_journal + default_debit_account_id: account.cash + default_credit_account_id: account.cash + currency: base.EUR + company_id: base.main_company + view_id: account.account_journal_bank_view +- + I assign accounts for 'Income Curreny Rate' and 'Expense Currency Rate' +- + !record {model: res.company, id: base.main_company}: + property_expense_currency_exchange: account.o_expense + property_income_currency_exchange: account.o_income +- + I create a new partner Peter Lawson. +- + !record {model: res.partner, id: res_partner_peter0}: + address: + - city: paris + country_id: base.fr + name: Peter + street: 1 rue Rockfeller + type: invoice + zip: '75016' + name: Mr.Peter Lawson +- + I create the first invoice on 1st January for 150 EUR +- + !record {model: account.invoice, id: account_first_invoice_jan_eur}: + account_id: account.a_recv + address_contact_id: base.res_partner_address_3000 + address_invoice_id: base.res_partner_address_3000 + company_id: base.main_company + currency_id: base.EUR + date_invoice: !eval "'%s-01-01' %(datetime.now().year)" + period_id: account.period_1 + invoice_line: + - account_id: account.a_sale + name: '[PC1] Basic PC' + price_unit: 150.0 + quantity: 1.0 + product_id: product.product_product_pc1 + uos_id: product.product_uom_unit + journal_id: account.sales_journal + partner_id: res_partner_peter0 + reference_type: none +- + I Validate invoice by clicking on Validate button +- + !workflow {model: account.invoice, action: invoice_open, ref: account_first_invoice_jan_eur} +- + I check that first invoice move is correct +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_eur")) + assert invoice_id.move_id, "Move not created for open invoice" + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + assert (move_line.debit - move_line.credit == 150.00), "Invoice move is incorrect for debtors account" +- + I create the first invoice on 1st February for 80 EUR +- + !record {model: account.invoice, id: account_second_invoice_feb_eur}: + account_id: account.a_recv + address_contact_id: base.res_partner_address_3000 + address_invoice_id: base.res_partner_address_3000 + company_id: base.main_company + currency_id: base.EUR + date_invoice: !eval "'%s-02-01' %(datetime.now().year)" + period_id: account.period_1 + invoice_line: + - account_id: account.a_sale + name: '[PC1] Basic PC' + price_unit: 80.0 + quantity: 1.0 + product_id: product.product_product_pc1 + uos_id: product.product_uom_unit + journal_id: account.sales_journal + partner_id: res_partner_peter0 + reference_type: none +- + I Validate invoice by clicking on Validate button +- + !workflow {model: account.invoice, action: invoice_open, ref: account_second_invoice_feb_eur} +- + I check that second invoice move is correct +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb_eur")) + assert invoice_id.move_id, "Move not created for open invoice" + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + assert (move_line.debit - move_line.credit == 80.00), "Invoice move is incorrect for debtors account" +- + I create the first voucher of payment with values 120 EUR, journal EUR, and fill amounts 100 for the invoice of 150 and 20 for the 80 EUR invoice. +- + !python {model: account.voucher}: | + import netsvc, time + vals = {} + res = self.onchange_partner_id(cr, uid, [], ref("res_partner_peter0"), ref('bank_journal_EUR'), 120.00, 2, ttype='receipt', date=False) + vals = { + 'account_id': ref('account.cash'), + 'amount': 120.0, + 'company_id': ref('base.main_company'), + 'currency_id': ref('base.EUR'), + 'journal_id': ref('bank_journal_EUR'), + 'partner_id': ref('res_partner_peter0'), + 'period_id': ref('account.period_3'), + 'type': 'receipt', + 'date': time.strftime("%Y-03-01"), + 'payment_option': 'with_writeoff', + 'writeoff_acc_id': ref('account.a_expense'), + 'comment': 'Write Off', + 'name': 'First payment', + } + if not res['value']['line_cr_ids']: + res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}] + for item in res['value']['line_cr_ids']: + if item['amount_unreconciled'] == 150: + item['amount'] = 100 + else: + item['amount'] = 20 + vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']] + id = self.create(cr, uid, vals) + voucher_id = self.browse(cr, uid, id) + assert (voucher_id.state=='draft'), "Voucher is not in draft state" +- + I check that writeoff amount computed is 0 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert (voucher_id.writeoff_amount == 0), "writeoff amount is not 0" +- + I check that currency rate difference is 0.00 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert (voucher_id.currency_rate_difference == 0.00), "currency rate difference is not 0.00" +- + I confirm the voucher +- + !python {model: account.voucher}: | + import netsvc + voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))]) + wf_service = netsvc.LocalService("workflow") + wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) +- + I check that my voucher state is posted +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert voucher_id.state == 'posted', "Voucher state is not posted" +- + I check that my debtor account is correct +- + I check that the debtor account has 2 new lines with 0.00 and 0.00 as amount_currency columns and their credit are 20 and 100 respectively +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) + for move_line in move_line_obj.browse(cr, uid, move_lines): + if move_line.credit == 20: + assert move_line.amount_currency == 0.00, "Debtor account has wrong entry." + if move_line.credit == 100: + assert move_line.amount_currency == 0.00, "Debtor account has wrong entry." +- + I check the residual amount of Invoice1 is 50 +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_eur")) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + residual_curr = move_line.amount_residual_currency + residual = move_line.amount_residual + assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for first Invoice" +- + I check the residual amuont of Invoice2 is 60 +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb_eur")) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + residual_curr = move_line.amount_residual_currency + residual = move_line.amount_residual + assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for second Invoice" +- + I create the second voucher of payment and check to let open the debtor overpaid amount. +- + I create the second voucher of payment with Paid Amount as 120, journal EUR, and fill amount 50 for the residual amount 50 for the invoice of 150 and 70 for the residual amount 60 for the invoice of 80 +- + !python {model: account.voucher}: | + import netsvc, time + vals = {} + res = self.onchange_partner_id(cr, uid, [], ref("res_partner_peter0"), ref('bank_journal_EUR'), 120.0, 2, ttype='receipt', date=False) + vals = { + 'account_id': ref('account.cash'), + 'amount': 120.0, + 'company_id': ref('base.main_company'), + 'currency_id': ref('base.EUR'), + 'journal_id': ref('bank_journal_EUR'), + 'partner_id': ref('res_partner_peter0'), + 'period_id': ref('account.period_3'), + 'type': 'receipt', + 'date': time.strftime("%Y-04-01"), + 'payment_option': 'with_writeoff', + 'writeoff_acc_id': ref('account.a_expense'), + 'comment': 'Write Off', + 'name': 'Second payment', + } + if not res['value']['line_cr_ids']: + res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}] + for item in res['value']['line_cr_ids']: + if item['amount_unreconciled'] == 50.00: + item['amount'] = 50.00 + elif item['amount_unreconciled'] == 60.00: + item['amount'] = 70.00 + vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']] + id = self.create(cr, uid, vals) + voucher_id = self.browse(cr, uid, id) + assert (voucher_id.state=='draft'), "Voucher is not in draft state" +- + I check that writeoff amount computed is 0.00 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'Second payment'),('partner_id', '=', ref('res_partner_peter0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert (voucher_id.writeoff_amount == 0.00), "writeoff amount is not 0" +- + I check that currency rate difference is 0.00 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_peter0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + curr_diff = voucher_id.currency_rate_difference + assert (voucher_id.currency_rate_difference == curr_diff), "currency rate difference is not 0" +- + I confirm the voucher +- + !python {model: account.voucher}: | + import netsvc + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_peter0'))]) + wf_service = netsvc.LocalService("workflow") + wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) +- + I check that my voucher state is posted +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_peter0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert voucher_id.state == 'posted', "Voucher state is not posted" +- + I check that my debtor account is correct +- + I check that the debtor account has 2 new lines with 0.00 and 0.00 as amount_currency columns and their credit are 70 and 50 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_peter0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) + for move_line in move_line_obj.browse(cr, uid, move_lines): + if move_line.credit == 70.00: + assert move_line.amount_currency == 0.00, "Debtor account has wrong entry." + if move_line.credit == 50.00: + assert move_line.amount_currency == 0.00, "Debtor account has wrong entry." +- + I check the residual amount of Invoice1 is 0 +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_eur")) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + residual_curr = move_line.amount_residual_currency + residual = move_line.amount_residual + assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for first Invoice" +- + I check the residual amuont of Invoice2 is -10 +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb_eur")) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + residual_curr = move_line.amount_residual_currency + residual = move_line.amount_residual + assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for second Invoice" \ No newline at end of file diff --git a/addons/account_voucher/test/case4_cad_chf.yml b/addons/account_voucher/test/case4_cad_chf.yml new file mode 100644 index 00000000000..2156ec813ff --- /dev/null +++ b/addons/account_voucher/test/case4_cad_chf.yml @@ -0,0 +1,181 @@ +- + I create a currency rate for CAD for january of 1.338800 +- + !record {model: res.currency.rate, id: jan_cad}: + currency_id: base.CAD + name: !eval "'%s-01-01' %(datetime.now().year)" + rate: 1.338800 +- + I create a currency rate for CAD for march of 0.500000 +- + !record {model: res.currency.rate, id: mar_cad}: + currency_id: base.CAD + name: !eval "'%s-03-01' %(datetime.now().year)" + rate: 0.500000 +- + I create a currency rate for CHF for january of 1.308600 +- + !record {model: res.currency.rate, id: jan_chf}: + currency_id: base.CHF + name: !eval "'%s-01-01' %(datetime.now().year)" + rate: 1.308600 +- + I create a bank journal with CHF as currency +- + !record {model: account.journal, id: bank_journal_CHF}: + name: Bank Journal(CHF) + code: BCHF + type: bank + analytic_journal_id: account.sit + sequence_id: account.sequence_bank_journal + default_debit_account_id: account.cash + default_credit_account_id: account.cash + currency: base.CHF + company_id: base.main_company + view_id: account.account_journal_bank_view +- + I assign accounts for 'Income Curreny Rate' and 'Expense Currency Rate' +- + !record {model: res.company, id: base.main_company}: + property_expense_currency_exchange: account.o_expense + property_income_currency_exchange: account.o_income +- + I create a new partner John Armani. +- + !record {model: res.partner, id: res_partner_john0}: + address: + - city: paris + country_id: base.fr + name: John + street: 1 rue Rockfeller + type: invoice + zip: '75016' + name: Mr.John Armani +- + I create the first invoice on 1st January for 200 CAD +- + !record {model: account.invoice, id: account_first_invoice_jan_cad}: + account_id: account.a_recv + address_contact_id: base.res_partner_address_3000 + address_invoice_id: base.res_partner_address_3000 + company_id: base.main_company + currency_id: base.CAD + date_invoice: !eval "'%s-01-01' %(datetime.now().year)" + period_id: account.period_1 + invoice_line: + - account_id: account.a_sale + name: '[PC1] Basic PC' + price_unit: 200.0 + quantity: 1.0 + product_id: product.product_product_pc1 + uos_id: product.product_uom_unit + journal_id: account.sales_journal + partner_id: res_partner_john0 + reference_type: none +- + I Validate invoice by clicking on Validate button +- + !workflow {model: account.invoice, action: invoice_open, ref: account_first_invoice_jan_cad} +- + I check that accounting move for first invoice is correct +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_cad")) + assert invoice_id.move_id, "Move not created for open invoice" + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + assert (move_line.debit - move_line.credit == 149.39), "Invoice move is incorrect for debtors account" +- + I create the first voucher of payment with Paid amount as 300, journal CHF, and fill amounts 200 for the invoice of 200. +- + !python {model: account.voucher}: | + import netsvc, time + vals = {} + res = self.onchange_partner_id(cr, uid, [], ref("res_partner_john0"), ref('bank_journal_CHF'), 300.0, 2, ttype='receipt', date=False) + vals = { + 'account_id': ref('account.cash'), + 'amount': 120.0, + 'company_id': ref('base.main_company'), + 'currency_id': ref('base.CHF'), + 'journal_id': ref('bank_journal_CHF'), + 'partner_id': ref('res_partner_john0'), + 'period_id': ref('account.period_3'), + 'type': 'receipt', + 'date': time.strftime("%Y-03-01"), + 'payment_option': 'with_writeoff', + 'writeoff_acc_id': ref('account.a_expense'), + 'comment': 'Write Off', + 'name': 'First payment', + } + if not res['value']['line_cr_ids']: + res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}] + for item in res['value']['line_cr_ids']: + if item['amount_unreconciled'] == 200: + item['amount'] = 200 + vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']] + id = self.create(cr, uid, vals) + voucher_id = self.browse(cr, uid, id) + assert (voucher_id.state=='draft'), "Voucher is not in draft state" +- + I check that writeoff amount computed is 175 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment')]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert (voucher_id.writeoff_amount == 175), "writeoff amount is not 175" +- + I check that currency rate difference is 49.39 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment')]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert (voucher_id.currency_rate_difference == 49.39), "currency rate difference is not 0.00" +- + I confirm the voucher +- + !python {model: account.voucher}: | + import netsvc + voucher = self.search(cr, uid, [('name', '=', 'First payment')]) + wf_service = netsvc.LocalService("workflow") + wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) +- + I check that my voucher state is posted +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment')]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert voucher_id.state == 'posted', "Voucher state is not posted" +- + I check that my debtor account is correct +- + I check that the debtor account has 2 new lines with -20 and -30 as amount_currency columns and their credit columns are respectively 15 and 24 and currency is USD($). +- + I check that my Currency Difference entry is created with a credit of 8.5 +- + I check that my write-off entry is created with a debit of 4.75 and amount currency as 0.0 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'Second payment')]) + voucher_id = self.browse(cr, uid, voucher[0]) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) + for move_line in move_line_obj.browse(cr, uid, move_lines): + if move_line.amount_currency == -200: + assert move_line.credit == 149.39, "Debtor account has wrong entry." + if move_line.credit == 49.39: + assert move_line.amount_currency == 0.00, "Incorrect Currency Difference." + if move_line.credit == -140.00: + assert move_line.credit == -175, "Writeoff amount is wrong." +- + I check the residual amount of invoice 1, should be 0 in residual currency and 0 in amount_residual +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan")) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + residual_curr = move_line.amount_residual_currency + residual = move_line.amount_residual + assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for first Invoice" +- \ No newline at end of file From 97e4c6efb0457103ba9495890eca6ffcdbebe945 Mon Sep 17 00:00:00 2001 From: "psi(OpenERP),mtr(OpenERP)" <> Date: Tue, 2 Aug 2011 11:49:50 +0530 Subject: [PATCH 13/39] [ADD] account_voucher: added yaml for multi-currency i.e. USD-USD bzr revid: mtr@mtr-20110802061950-t0eah4pcj1vs1yp6 --- addons/account_voucher/__openerp__.py | 1 + addons/account_voucher/test/case1_usd_usd.yml | 345 ++++++++++++++++++ 2 files changed, 346 insertions(+) create mode 100755 addons/account_voucher/test/case1_usd_usd.yml diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py index d4331a81923..dc7747fb593 100644 --- a/addons/account_voucher/__openerp__.py +++ b/addons/account_voucher/__openerp__.py @@ -60,6 +60,7 @@ Account Voucher module includes all the basic requirements of Voucher Entries fo "test/sales_receipt.yml", "test/sales_payment.yml", "test/account_voucher_report.yml", + "test/case1_usd_usd.yml", "test/case2_usd_eur.yml", "test/case3_eur_eur.yml", "test/case4_cad_chf.yml", diff --git a/addons/account_voucher/test/case1_usd_usd.yml b/addons/account_voucher/test/case1_usd_usd.yml new file mode 100755 index 00000000000..7751849120e --- /dev/null +++ b/addons/account_voucher/test/case1_usd_usd.yml @@ -0,0 +1,345 @@ +- + I create a currency rate for USD for january of 1.333333 +- + !record {model: res.currency.rate, id: jan_usd}: + currency_id: base.USD + name: !eval "'%s-01-01' %(datetime.now().year)" + rate: 1.333333 + +- + I create a currency rate for USD for february of 1.250000 +- + !record {model: res.currency.rate, id: feb_usd}: + currency_id: base.USD + name: !eval "'%s-02-01' %(datetime.now().year)" + rate: 1.250000 + +- + I create a currency rate for USD for march of 1.111111 +- + !record {model: res.currency.rate, id: mar_usd}: + currency_id: base.USD + name: !eval "'%s-03-01' %(datetime.now().year)" + rate: 1.111111 + +- + I create a currency rate for USD for april of 1.052632 +- + !record {model: res.currency.rate, id: apr_usd}: + currency_id: base.USD + name: !eval "'%s-04-01' %(datetime.now().year)" + rate: 1.052632 + +- + I create a bank journal with USD as currency +- + !record {model: account.journal, id: bank_journal_USD}: + name: Bank Journal(USD) + code: BUSD + type: bank + analytic_journal_id: account.sit + sequence_id: account.sequence_bank_journal + default_debit_account_id: account.cash + default_credit_account_id: account.cash + currency: base.USD + company_id: base.main_company + view_id: account.account_journal_bank_view + +- + I set up some accounts for currency rate expense/income in my company +- + !record {model: res.company, id: base.main_company}: + property_expense_currency_exchange: account.o_expense + property_income_currency_exchange: account.o_income +- + I'm creating new partner "Mr. strauss". +- + !record {model: res.partner, id: res_partner_strauss0}: + address: + - city: paris + country_id: base.fr + name: Mark Strauss + street: 1 rue Rockfeller + type: invoice + zip: '75016' + name: Mr. Mark Strauss +- + I create the first invoice on 1st January for 200 USD +- + !record {model: account.invoice, id: account_invoice_jan}: + account_id: account.a_recv + address_contact_id: base.res_partner_address_3000 + address_invoice_id: base.res_partner_address_3000 + company_id: base.main_company + currency_id: base.USD + date_invoice: !eval "'%s-01-01' %(datetime.now().year)" + period_id: account.period_1 + invoice_line: + - account_id: account.a_sale + name: '[PC1] Basic PC' + price_unit: 200.0 + quantity: 1.0 + product_id: product.product_product_pc1 + uos_id: product.product_uom_unit + journal_id: account.sales_journal + partner_id: res_partner_strauss0 + reference_type: none +- + I Validate invoice by clicking on Validate button +- + !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_jan} +- + I check that first invoice move is correct for debtor account (debit - credit == 150.0) +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_invoice_jan")) + assert invoice_id.move_id, "Move not created for open invoice" + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + assert (move_line.debit - move_line.credit == 150.0), "Invoice move is correct for debtors account" +- + I create the second invoice on 1st February for 100 USD +- + !record {model: account.invoice, id: account_invoice_feb}: + account_id: account.a_recv + address_contact_id: base.res_partner_address_3000 + address_invoice_id: base.res_partner_address_3000 + company_id: base.main_company + currency_id: base.USD + date_invoice: !eval "'%s-02-01' %(datetime.now().year)" + period_id: account.period_2 + invoice_line: + - account_id: account.a_sale + name: '[PC1] Basic PC' + price_unit: 100.0 + quantity: 1.0 + product_id: product.product_product_pc1 + uos_id: product.product_uom_unit + journal_id: account.sales_journal + partner_id: res_partner_strauss0 + reference_type: none +- + I Validate invoice by clicking on Validate button +- + !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_feb} +- + I check that second invoice move is correct for debtor account (debit - credit == 80) +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_invoice_feb")) + assert invoice_id.move_id, "Move not created for open invoice" + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + assert (move_line.debit - move_line.credit == 80), "Invoice move is correct for debtors account" + +- + I create the first voucher of payment + +- + !python {model: account.voucher}: | + import netsvc, time + vals = {} + res = self.onchange_partner_id(cr, uid, [], ref("res_partner_strauss0"), ref('bank_journal_USD'), 240.0, 2, ttype='receipt', date=False) + vals = { + 'account_id': ref('account.cash'), + 'amount': 240.0, + 'company_id': ref('base.main_company'), + 'currency_id': ref('base.USD'), + 'journal_id': ref('bank_journal_USD'), + 'partner_id': ref('res_partner_strauss0'), + 'period_id': ref('account.period_3'), + 'type': 'receipt', + 'date': time.strftime("%Y-03-01"), + 'payment_option': 'with_writeoff', + 'writeoff_acc_id': ref('account.a_expense'), + 'comment': 'Write Off', + 'name': 'First payment', + } + if not res['value']['line_cr_ids']: + res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}] + for item in res['value']['line_cr_ids']: + if item['amount_unreconciled'] == 200: + item['amount'] = 180 + else: + item['amount'] = 70 + vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']] + id = self.create(cr, uid, vals) + voucher_id = self.browse(cr, uid, id) + assert (voucher_id.state=='draft'), "Voucher is not in draft state" +- + I check that writeoff amount computed is -10 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert (voucher_id.writeoff_amount == -10), "writeoff amount is not -10" +- + I check that currency rate difference is -34 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert (voucher_id.currency_rate_difference == -34), "currency rate difference is not -34" +- + I confirm the voucher +- + !python {model: account.voucher}: | + import netsvc + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))]) + wf_service = netsvc.LocalService("workflow") + wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) +- + I check that my voucher is valid +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment')]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert voucher_id.state == 'posted', "Voucher is not balanced" + +- + I check that my debtor account is correct +- + I check that the debtor account has 2 new lines with -180 and -70 as amount_currency columns and that their credit columns are respectively 135 and 56 +- + I check that my currency rate difference is correct. 34 in credit with no amount_currency +- + I check that my write-off is correct. 9 debit and 10 amount_currency +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) + for move_line in move_line_obj.browse(cr, uid, move_lines): + if move_line.amount_currency == -180: + assert move_line.credit == 135.00, "Debtor account has wrong entry." + if move_line.amount_currency == -70: + assert move_line.credit == 56.00, "Debtor account has wrong entry." + if move_line.credit == 34.00: + assert move_line.amount_currency == 0, "Incorrect currency rate difference." + if move_line.amount_currency == 10: + assert move_line.debit == 9.0, "Writeoff amount is wrong." +- + I check the residual amount of Invoice1, should be 20 in amount_currency and 15 in company currency +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_invoice_jan")) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + assert (move_line.amount_residual_currency == 20.0 and move_line.amount_residual == 15.0) , "Residual amount is not correct for first Invoice" +- + I check the residual amuont of Invoice2, should be 30 in residual currency and 24 in amount_residual +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_invoice_feb")) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + assert (move_line.amount_residual_currency == 30.0 and move_line.amount_residual == 24.0) , "Residual amount is not correct for first Invoice" +- + I create the second voucher of payment with Paid Amount as 45 USD, journal USD, and fill amounts 20 for the invoice of 200$ and 30 for the invoice of 100$ +- + !python {model: account.voucher}: | + import netsvc, time + vals = {} + res = self.onchange_partner_id(cr, uid, [], ref("res_partner_strauss0"), ref('bank_journal_USD'), 45.0, 2, ttype='receipt', date=False) + vals = { + 'account_id': ref('account.cash'), + 'amount': 45.0, + 'company_id': ref('base.main_company'), + 'currency_id': ref('base.USD'), + 'journal_id': ref('bank_journal_USD'), + 'partner_id': ref('res_partner_strauss0'), + 'period_id': ref('account.period_3'), + 'type': 'receipt', + 'date': time.strftime("%Y-04-01"), + 'payment_option': 'with_writeoff', + 'writeoff_acc_id': ref('account.a_expense'), + 'comment': 'Write Off', + 'name': 'Second payment', + } + if not res['value']['line_cr_ids']: + res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}] + for item in res['value']['line_cr_ids']: + if item['amount_unreconciled'] == 20: + item['amount'] = 20 + else: + item['amount'] = 30 + vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']] + id = self.create(cr, uid, vals) + voucher_id = self.browse(cr, uid, id) + assert (voucher_id.state=='draft'), "Voucher is not in draft state" +- + I check that writeoff amount computed is -5 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert (voucher_id.writeoff_amount == -5), "writeoff amount is not -5" +- + I check that currency rate difference is -8.50 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + curr_diff = voucher_id.currency_rate_difference + assert (voucher_id.currency_rate_difference == curr_diff), "currency rate difference is not -8.50" +- + I confirm the voucher +- + !python {model: account.voucher}: | + import netsvc + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))]) + wf_service = netsvc.LocalService("workflow") + wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) +- + I check that my voucher state is posted +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert voucher_id.state == 'posted', "Voucher state is not posted" +- + I check that my debtor account is correct +- + I check that the debtor account has 2 new lines with -20 and -30 as amount_currency columns and their credit columns are respectively 15 and 24 and currency is USD($). +- + I check that my Currency Difference entry is created with a credit of 8.5 +- + I check that my write-off entry is created with a debit of 4.75 and amount currency as 0.0 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) + for move_line in move_line_obj.browse(cr, uid, move_lines): + if move_line.amount_currency == -20: + assert move_line.credit == 15, "Debtor account has wrong entry." + if move_line.amount_currency == -30: + assert move_line.credit == 24, "Debtor account has wrong entry." + if move_line.credit == 8.5: + assert move_line.amount_currency == 0.00, "Incorrect Currency Difference." + if move_line.credit == 5: + assert move_line.credit == 4.75, "Writeoff amount is wrong." +- + I check the residual amount of Invoice1, should be 0 in residual currency and 0 in amount_residual +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_invoice_jan")) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0) , "Residual amount is not correct for first Invoice" +- + I check the residual amuont of Invoice2, should be 0 in residual currency and 0 in amount_residual +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_invoice_feb")) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0) , "Residual amount is not correct for second Invoice" \ No newline at end of file From 437c84191e4b16681177f62cb6f5ac1c47ca1ece Mon Sep 17 00:00:00 2001 From: mtr Date: Tue, 2 Aug 2011 12:23:44 +0530 Subject: [PATCH 14/39] [IMP] account_voucher: minor changes in yaml bzr revid: mtr@mtr-20110802065344-ewaqf3etl687gjlg --- addons/account_voucher/test/case2_usd_eur.yml | 18 +++++------------- addons/account_voucher/test/case3_eur_eur.yml | 16 ++++------------ addons/account_voucher/test/case4_cad_chf.yml | 6 ++---- 3 files changed, 11 insertions(+), 29 deletions(-) diff --git a/addons/account_voucher/test/case2_usd_eur.yml b/addons/account_voucher/test/case2_usd_eur.yml index 39b0eb0edbb..25d69a95bb1 100644 --- a/addons/account_voucher/test/case2_usd_eur.yml +++ b/addons/account_voucher/test/case2_usd_eur.yml @@ -214,7 +214,7 @@ I check that my write-off entry is created with a credit of 15.00 and amount currency as 0.0 - !python {model: account.voucher}: | - voucher = self.search(cr, uid, [('name', '=', 'First payment')]) + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michael0'))]) voucher_id = self.browse(cr, uid, voucher[0]) move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) @@ -235,9 +235,7 @@ move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) move_line = move_line_obj.browse(cr, uid, move_lines[0]) - residual_curr = move_line.amount_residual_currency - residual = move_line.amount_residual - assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for first Invoice" + assert (move_line.amount_residual_currency == 20.0 and move_line.amount_residual == 15) , "Residual amount is not correct for first Invoice" - I check the residual amuont of Invoice2, should be 30 in residual currency and 24 in amount_residual - @@ -246,9 +244,7 @@ move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) move_line = move_line_obj.browse(cr, uid, move_lines[0]) - residual_curr = move_line.amount_residual_currency - residual = move_line.amount_residual - assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for second Invoice" + assert (move_line.amount_residual_currency == 30 and move_line.amount_residual == 24) , "Residual amount is not correct for second Invoice" - I create the second voucher of payment with values, 45 USD, journal USD, and fill amounts 20 for the invoice of 200$ and 30 for the invoice of 100$ - @@ -344,9 +340,7 @@ move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) move_line = move_line_obj.browse(cr, uid, move_lines[0]) - residual_curr = move_line.amount_residual_currency - residual = move_line.amount_residual - assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for first Invoice" + assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0) , "Residual amount is not correct for first Invoice" - I check the residual amuont of invoice 2, should be 0 in residual currency and 0 in amount_residual - @@ -355,6 +349,4 @@ move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) move_line = move_line_obj.browse(cr, uid, move_lines[0]) - residual_curr = move_line.amount_residual_currency - residual = move_line.amount_residual - assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for second Invoice" \ No newline at end of file + assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0) , "Residual amount is not correct for second Invoice" \ No newline at end of file diff --git a/addons/account_voucher/test/case3_eur_eur.yml b/addons/account_voucher/test/case3_eur_eur.yml index bce4feb5a3d..d1b5de784a9 100644 --- a/addons/account_voucher/test/case3_eur_eur.yml +++ b/addons/account_voucher/test/case3_eur_eur.yml @@ -213,9 +213,7 @@ move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) move_line = move_line_obj.browse(cr, uid, move_lines[0]) - residual_curr = move_line.amount_residual_currency - residual = move_line.amount_residual - assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for first Invoice" + assert (move_line.amount_residual_currency == 50.0 and move_line.amount_residual == 50.0) , "Residual amount is not correct for first Invoice" - I check the residual amuont of Invoice2 is 60 - @@ -224,9 +222,7 @@ move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) move_line = move_line_obj.browse(cr, uid, move_lines[0]) - residual_curr = move_line.amount_residual_currency - residual = move_line.amount_residual - assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for second Invoice" + assert (move_line.amount_residual_currency == 60.0 and move_line.amount_residual == 60.0) , "Residual amount is not correct for second Invoice" - I create the second voucher of payment and check to let open the debtor overpaid amount. - @@ -315,9 +311,7 @@ move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) move_line = move_line_obj.browse(cr, uid, move_lines[0]) - residual_curr = move_line.amount_residual_currency - residual = move_line.amount_residual - assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for first Invoice" + assert (move_line.amount_residual_currency == 0 and move_line.amount_residual == 0) , "Residual amount is not correct for first Invoice" - I check the residual amuont of Invoice2 is -10 - @@ -326,6 +320,4 @@ move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) move_line = move_line_obj.browse(cr, uid, move_lines[0]) - residual_curr = move_line.amount_residual_currency - residual = move_line.amount_residual - assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for second Invoice" \ No newline at end of file + assert (move_line.amount_residual_currency == -10.0 and move_line.amount_residual == -10.0) , "Residual amount is not correct for second Invoice" \ No newline at end of file diff --git a/addons/account_voucher/test/case4_cad_chf.yml b/addons/account_voucher/test/case4_cad_chf.yml index 2156ec813ff..6ba92f6c8f3 100644 --- a/addons/account_voucher/test/case4_cad_chf.yml +++ b/addons/account_voucher/test/case4_cad_chf.yml @@ -168,14 +168,12 @@ if move_line.credit == -140.00: assert move_line.credit == -175, "Writeoff amount is wrong." - - I check the residual amount of invoice 1, should be 0 in residual currency and 0 in amount_residual + I check the residual amount of Invoice1, should be 0 in residual currency and 0 in amount_residual - !python {model: account.invoice}: | invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan")) move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) move_line = move_line_obj.browse(cr, uid, move_lines[0]) - residual_curr = move_line.amount_residual_currency - residual = move_line.amount_residual - assert (move_line.amount_residual_currency == residual_curr and move_line.amount_residual == residual) , "Residual amount is not correct for first Invoice" + assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0) , "Residual amount is not correct for first Invoice" - \ No newline at end of file From 1a3ac2facc5fd1304adeeccae4dffa02e0f4ff23 Mon Sep 17 00:00:00 2001 From: mtr Date: Wed, 3 Aug 2011 15:36:33 +0530 Subject: [PATCH 15/39] [IMP] account_voucher: improved string/sentence and code in yml bzr revid: mtr@mtr-20110803100633-xsh3olpk5bhc00at --- addons/account_voucher/test/case1_usd_usd.yml | 57 +++++++++++-------- addons/account_voucher/test/case2_usd_eur.yml | 57 ++++++++++--------- addons/account_voucher/test/case3_eur_eur.yml | 38 +++++++------ addons/account_voucher/test/case4_cad_chf.yml | 44 ++++++++------ 4 files changed, 112 insertions(+), 84 deletions(-) diff --git a/addons/account_voucher/test/case1_usd_usd.yml b/addons/account_voucher/test/case1_usd_usd.yml index 7751849120e..a4e59ccc4b3 100755 --- a/addons/account_voucher/test/case1_usd_usd.yml +++ b/addons/account_voucher/test/case1_usd_usd.yml @@ -52,7 +52,7 @@ property_expense_currency_exchange: account.o_expense property_income_currency_exchange: account.o_income - - I'm creating new partner "Mr. strauss". + I create new partner Mark Strauss. - !record {model: res.partner, id: res_partner_strauss0}: address: @@ -97,7 +97,7 @@ move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) move_line = move_line_obj.browse(cr, uid, move_lines[0]) - assert (move_line.debit - move_line.credit == 150.0), "Invoice move is correct for debtors account" + assert (move_line.debit - move_line.credit == 150.0), "Invoice move is not correct for debtors account" - I create the second invoice on 1st February for 100 USD - @@ -132,7 +132,7 @@ move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) move_line = move_line_obj.browse(cr, uid, move_lines[0]) - assert (move_line.debit - move_line.credit == 80), "Invoice move is correct for debtors account" + assert (move_line.debit - move_line.credit == 80), "Invoice move is not correct for debtors account" - I create the first voucher of payment @@ -191,13 +191,15 @@ wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) - - I check that my voucher is valid + I check that the move of my first voucher is valid - !python {model: account.voucher}: | - voucher = self.search(cr, uid, [('name', '=', 'First payment')]) + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - assert voucher_id.state == 'posted', "Voucher is not balanced" - + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) + for move_line in move_line_obj.browse(cr, uid, move_lines): + assert move_line.state == 'valid', "Voucher move is not valid" - I check that my debtor account is correct - @@ -215,11 +217,11 @@ for move_line in move_line_obj.browse(cr, uid, move_lines): if move_line.amount_currency == -180: assert move_line.credit == 135.00, "Debtor account has wrong entry." - if move_line.amount_currency == -70: + elif move_line.amount_currency == -70: assert move_line.credit == 56.00, "Debtor account has wrong entry." - if move_line.credit == 34.00: + elif move_line.credit == 34.00: assert move_line.amount_currency == 0, "Incorrect currency rate difference." - if move_line.amount_currency == 10: + elif move_line.amount_currency == 10: assert move_line.debit == 9.0, "Writeoff amount is wrong." - I check the residual amount of Invoice1, should be 20 in amount_currency and 15 in company currency @@ -231,7 +233,7 @@ move_line = move_line_obj.browse(cr, uid, move_lines[0]) assert (move_line.amount_residual_currency == 20.0 and move_line.amount_residual == 15.0) , "Residual amount is not correct for first Invoice" - - I check the residual amuont of Invoice2, should be 30 in residual currency and 24 in amount_residual + I check the residual amuont of Invoice2, should be 30 in residual currency and 24 in amount_residual - !python {model: account.invoice}: | invoice_id = self.browse(cr, uid, ref("account_invoice_feb")) @@ -240,7 +242,9 @@ move_line = move_line_obj.browse(cr, uid, move_lines[0]) assert (move_line.amount_residual_currency == 30.0 and move_line.amount_residual == 24.0) , "Residual amount is not correct for first Invoice" - - I create the second voucher of payment with Paid Amount as 45 USD, journal USD, and fill amounts 20 for the invoice of 200$ and 30 for the invoice of 100$ + I create the second voucher of payment + + - !python {model: account.voucher}: | import netsvc, time @@ -296,20 +300,23 @@ wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) - - I check that my voucher state is posted + I check that the move of my second voucher is valid - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - assert voucher_id.state == 'posted', "Voucher state is not posted" + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) + for move_line in move_line_obj.browse(cr, uid, move_lines): + assert move_line.state == 'valid', "Voucher move is not valid" - I check that my debtor account is correct - - I check that the debtor account has 2 new lines with -20 and -30 as amount_currency columns and their credit columns are respectively 15 and 24 and currency is USD($). + I check that the debtor account has 2 new lines with -20 and -30 as amount_currency columns and their credit columns are respectively 15 and 24. - - I check that my Currency Difference entry is created with a credit of 8.5 + I check that my currency rate difference is correct. 8.5 in credit with no amount_currency - - I check that my write-off entry is created with a debit of 4.75 and amount currency as 0.0 + I check that my writeoff is correct. 4.75 debit and 5 amount_currency - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))]) @@ -319,27 +326,27 @@ for move_line in move_line_obj.browse(cr, uid, move_lines): if move_line.amount_currency == -20: assert move_line.credit == 15, "Debtor account has wrong entry." - if move_line.amount_currency == -30: + elif move_line.amount_currency == -30: assert move_line.credit == 24, "Debtor account has wrong entry." - if move_line.credit == 8.5: + elif move_line.credit == 8.5: assert move_line.amount_currency == 0.00, "Incorrect Currency Difference." - if move_line.credit == 5: - assert move_line.credit == 4.75, "Writeoff amount is wrong." + elif move_line.amount_currency == 5: + assert move_line.debit == 4.75, "Writeoff amount is wrong." - - I check the residual amount of Invoice1, should be 0 in residual currency and 0 in amount_residual + I check the residual amount of Invoice1, should be 0 in residual currency and 0 in amount_residual and paid - !python {model: account.invoice}: | invoice_id = self.browse(cr, uid, ref("account_invoice_jan")) move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) move_line = move_line_obj.browse(cr, uid, move_lines[0]) - assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0) , "Residual amount is not correct for first Invoice" + assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for first Invoice" - - I check the residual amuont of Invoice2, should be 0 in residual currency and 0 in amount_residual + I check the residual amuont of Invoice2, should be 0 in residual currency and 0 in amount_residual and paid - !python {model: account.invoice}: | invoice_id = self.browse(cr, uid, ref("account_invoice_feb")) move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) move_line = move_line_obj.browse(cr, uid, move_lines[0]) - assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0) , "Residual amount is not correct for second Invoice" \ No newline at end of file + assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for second Invoice" \ No newline at end of file diff --git a/addons/account_voucher/test/case2_usd_eur.yml b/addons/account_voucher/test/case2_usd_eur.yml index 25d69a95bb1..35e0bf86231 100644 --- a/addons/account_voucher/test/case2_usd_eur.yml +++ b/addons/account_voucher/test/case2_usd_eur.yml @@ -55,7 +55,7 @@ company_id: base.main_company view_id: account.account_journal_bank_view - - I assign accounts for 'Income Curreny Rate' and 'Expense Currency Rate' + I set up some accounts for currency rate expense/income in my company - !record {model: res.company, id: base.main_company}: property_expense_currency_exchange: account.o_expense @@ -98,7 +98,7 @@ - !workflow {model: account.invoice, action: invoice_open, ref: account_first_invoice_jan} - - I check that first invoice move is correct + I check that first invoice move is correct for debtor account(debit - credit == 150) - !python {model: account.invoice}: | invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan")) @@ -143,7 +143,8 @@ move_line = move_line_obj.browse(cr, uid, move_lines[0]) assert (move_line.debit - move_line.credit == 80), "Invoice move is incorrect for debtors account" - - I create the first voucher of payment with values 240 EUR, journal EUR, and fill amount 180 for the invoice of 200$ and 70 for the 100$ invoice. + I create the first voucher of payment + - !python {model: account.voucher}: | import netsvc, time @@ -198,20 +199,23 @@ wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) - - I check that my voucher state is posted + I check that the move of my voucher is valid - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michael0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - assert voucher_id.state == 'posted', "Voucher state is not posted" + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) + for move_line in move_line_obj.browse(cr, uid, move_lines): + assert move_line.state == 'valid', "Voucher move is not valid" - I check that my debtor account is correct - - I check that the debtor account has 2 new lines with -180 and -70 as amount_currency columns and their credit columns are respectively 135 and 56 and currency is USD($). + I check that the debtor account has 2 new lines with -180 and -70 in amount_currency columns and their credit columns are respectively 135 and 56 and currency is USD($). - - I check that my Currency Difference entry is created with a credit of 34, amount currency as 0.0 + I check that my currency rate difference is correct. 34 in credit with no amount_currency - - I check that my write-off entry is created with a credit of 15.00 and amount currency as 0.0 + I check that my writeoff is correct. 15 in credit with no amount_currency - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michael0'))]) @@ -221,12 +225,12 @@ for move_line in move_line_obj.browse(cr, uid, move_lines): if move_line.amount_currency == -180: assert move_line.credit == 135, "Debtor account has wrong entry." - if move_line.amount_currency == -70: + elif move_line.amount_currency == -70: assert move_line.credit == 56.00, "Debtor account has wrong entry." - if move_line.credit == 34: + elif move_line.credit == 34: assert move_line.amount_currency == 0.00, "Incorrect Currency Difference." - if move_line.credit == 15.00: - assert move_line.credit == 0.00, "Writeoff amount is wrong." + elif move_line.credit == 15.00: + assert move_line.amount_currency == 0.00, "Writeoff amount is wrong." - I check the residual amount of Invoice1, should be 20 in residual currency and 15 in amount_residual - @@ -246,7 +250,8 @@ move_line = move_line_obj.browse(cr, uid, move_lines[0]) assert (move_line.amount_residual_currency == 30 and move_line.amount_residual == 24) , "Residual amount is not correct for second Invoice" - - I create the second voucher of payment with values, 45 USD, journal USD, and fill amounts 20 for the invoice of 200$ and 30 for the invoice of 100$ + I create the second voucher of payment + - !python {model: account.voucher}: | import netsvc, time @@ -291,8 +296,7 @@ !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - curr_diff = voucher_id.currency_rate_difference - assert (voucher_id.currency_rate_difference == curr_diff), "currency rate difference is not -8.50" + assert (voucher_id.currency_rate_difference == -8.50), "currency rate difference is not -8.50" - I confirm the voucher - @@ -311,11 +315,11 @@ - I check that my debtor account is correct - - I check that the debtor account has 2 new lines with -20 and -30 as amount_currency columns and their credit columns are respectively 15 and 24 and currency is USD($). + I check that the debtor account has 2 new lines with -20 and -30 in amount_currency columns and their credit columns are respectively 15 and 24 and currency is USD($). - - I check that my Currency Difference entry is created with a credit of 8.5 + I check that my currency rate difference is correct. 8.50 in credit with no amount_currency - - I check that my write-off entry is created with a debit of 4.75 and amount currency as 0.0 + I check that my writeoff is correct. 4.75 in debit and 5 in amount_currency - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))]) @@ -323,30 +327,29 @@ move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) for move_line in move_line_obj.browse(cr, uid, move_lines): - d if move_line.amount_currency == -20: assert move_line.credit == 15, "Debtor account has wrong entry." - if move_line.amount_currency == -30: + elif move_line.amount_currency == -30: assert move_line.credit == 24, "Debtor account has wrong entry." - if move_line.credit == 8.5: + elif move_line.credit == 8.5: assert move_line.amount_currency == 0.00, "Incorrect Currency Difference." - if move_line.credit == 5: - assert move_line.credit == 4.75, "Writeoff amount is wrong." + elif move_line.amount_currency == 5: + assert move_line.debit == 4.75, "Writeoff amount is wrong." - - I check the residual amount of invoice 1, should be 0 in residual currency and 0 in amount_residual + I check the residual amount of invoice 1, should be 0 in residual currency and 0 in amount_residual and paid - !python {model: account.invoice}: | invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan")) move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) move_line = move_line_obj.browse(cr, uid, move_lines[0]) - assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0) , "Residual amount is not correct for first Invoice" + assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for first Invoice" - - I check the residual amuont of invoice 2, should be 0 in residual currency and 0 in amount_residual + I check the residual amuont of invoice 2, should be 0 in residual currency and 0 in amount_residual and paid - !python {model: account.invoice}: | invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb")) move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) move_line = move_line_obj.browse(cr, uid, move_lines[0]) - assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0) , "Residual amount is not correct for second Invoice" \ No newline at end of file + assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for second Invoice" \ No newline at end of file diff --git a/addons/account_voucher/test/case3_eur_eur.yml b/addons/account_voucher/test/case3_eur_eur.yml index d1b5de784a9..5779028641e 100644 --- a/addons/account_voucher/test/case3_eur_eur.yml +++ b/addons/account_voucher/test/case3_eur_eur.yml @@ -41,7 +41,7 @@ company_id: base.main_company view_id: account.account_journal_bank_view - - I assign accounts for 'Income Curreny Rate' and 'Expense Currency Rate' + I set up some accounts for currency rate expense/income in my company - !record {model: res.company, id: base.main_company}: property_expense_currency_exchange: account.o_expense @@ -84,7 +84,7 @@ - !workflow {model: account.invoice, action: invoice_open, ref: account_first_invoice_jan_eur} - - I check that first invoice move is correct + I check that first invoice move is correct for debtor account(debit - credit == 150) - !python {model: account.invoice}: | invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_eur")) @@ -94,7 +94,7 @@ move_line = move_line_obj.browse(cr, uid, move_lines[0]) assert (move_line.debit - move_line.credit == 150.00), "Invoice move is incorrect for debtors account" - - I create the first invoice on 1st February for 80 EUR + I create the second invoice on 1st February for 80 EUR - !record {model: account.invoice, id: account_second_invoice_feb_eur}: account_id: account.a_recv @@ -119,7 +119,7 @@ - !workflow {model: account.invoice, action: invoice_open, ref: account_second_invoice_feb_eur} - - I check that second invoice move is correct + I check that second invoice move is correct for debtor account (debit - credit == 80) - !python {model: account.invoice}: | invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb_eur")) @@ -129,7 +129,8 @@ move_line = move_line_obj.browse(cr, uid, move_lines[0]) assert (move_line.debit - move_line.credit == 80.00), "Invoice move is incorrect for debtors account" - - I create the first voucher of payment with values 120 EUR, journal EUR, and fill amounts 100 for the invoice of 150 and 20 for the 80 EUR invoice. + I create the first voucher of payment + - !python {model: account.voucher}: | import netsvc, time @@ -162,7 +163,7 @@ voucher_id = self.browse(cr, uid, id) assert (voucher_id.state=='draft'), "Voucher is not in draft state" - - I check that writeoff amount computed is 0 + I check that writeoff amount computed is 0.00 - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))]) @@ -184,16 +185,19 @@ wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) - - I check that my voucher state is posted + I check that the move of my first voucher is valid - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - assert voucher_id.state == 'posted', "Voucher state is not posted" + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) + for move_line in move_line_obj.browse(cr, uid, move_lines): + assert move_line.state == 'valid', "Voucher move is not valid" - I check that my debtor account is correct - - I check that the debtor account has 2 new lines with 0.00 and 0.00 as amount_currency columns and their credit are 20 and 100 respectively + I check that the debtor account has 2 new lines with 0.00 and 0.00 in amount_currency columns and their credit are 20 and 100 respectively - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))]) @@ -203,7 +207,7 @@ for move_line in move_line_obj.browse(cr, uid, move_lines): if move_line.credit == 20: assert move_line.amount_currency == 0.00, "Debtor account has wrong entry." - if move_line.credit == 100: + elif move_line.credit == 100: assert move_line.amount_currency == 0.00, "Debtor account has wrong entry." - I check the residual amount of Invoice1 is 50 @@ -225,8 +229,7 @@ assert (move_line.amount_residual_currency == 60.0 and move_line.amount_residual == 60.0) , "Residual amount is not correct for second Invoice" - I create the second voucher of payment and check to let open the debtor overpaid amount. -- - I create the second voucher of payment with Paid Amount as 120, journal EUR, and fill amount 50 for the residual amount 50 for the invoice of 150 and 70 for the residual amount 60 for the invoice of 80 + - !python {model: account.voucher}: | import netsvc, time @@ -282,16 +285,19 @@ wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) - - I check that my voucher state is posted + I check that the move of my second voucher is valid - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_peter0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - assert voucher_id.state == 'posted', "Voucher state is not posted" + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) + for move_line in move_line_obj.browse(cr, uid, move_lines): + assert move_line.state == 'valid', "Voucher move is not valid" - I check that my debtor account is correct - - I check that the debtor account has 2 new lines with 0.00 and 0.00 as amount_currency columns and their credit are 70 and 50 + I check that the debtor account has 2 new lines with 0.00 and 0.00 in amount_currency columns and their credit are 70 and 50 - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_peter0'))]) @@ -301,7 +307,7 @@ for move_line in move_line_obj.browse(cr, uid, move_lines): if move_line.credit == 70.00: assert move_line.amount_currency == 0.00, "Debtor account has wrong entry." - if move_line.credit == 50.00: + elif move_line.credit == 50.00: assert move_line.amount_currency == 0.00, "Debtor account has wrong entry." - I check the residual amount of Invoice1 is 0 diff --git a/addons/account_voucher/test/case4_cad_chf.yml b/addons/account_voucher/test/case4_cad_chf.yml index 6ba92f6c8f3..3d989eaee7a 100644 --- a/addons/account_voucher/test/case4_cad_chf.yml +++ b/addons/account_voucher/test/case4_cad_chf.yml @@ -6,7 +6,7 @@ name: !eval "'%s-01-01' %(datetime.now().year)" rate: 1.338800 - - I create a currency rate for CAD for march of 0.500000 + I create a currency rate for CAD for march of 2.000000 - !record {model: res.currency.rate, id: mar_cad}: currency_id: base.CAD @@ -19,6 +19,13 @@ currency_id: base.CHF name: !eval "'%s-01-01' %(datetime.now().year)" rate: 1.308600 +- + I create a currency rate for CHF for march of 1.250000 +- + !record {model: res.currency.rate, id: jan_chf}: + currency_id: base.CHF + name: !eval "'%s-01-01' %(datetime.now().year)" + rate: 1.250000 - I create a bank journal with CHF as currency - @@ -34,7 +41,7 @@ company_id: base.main_company view_id: account.account_journal_bank_view - - I assign accounts for 'Income Curreny Rate' and 'Expense Currency Rate' + I set up some accounts for currency rate expense/income in my company - !record {model: res.company, id: base.main_company}: property_expense_currency_exchange: account.o_expense @@ -77,7 +84,7 @@ - !workflow {model: account.invoice, action: invoice_open, ref: account_first_invoice_jan_cad} - - I check that accounting move for first invoice is correct + I check that first invoice move is correct for debtor account (debit - credit == 149.39) - !python {model: account.invoice}: | invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_cad")) @@ -87,7 +94,8 @@ move_line = move_line_obj.browse(cr, uid, move_lines[0]) assert (move_line.debit - move_line.credit == 149.39), "Invoice move is incorrect for debtors account" - - I create the first voucher of payment with Paid amount as 300, journal CHF, and fill amounts 200 for the invoice of 200. + I create the first voucher of payment + - !python {model: account.voucher}: | import netsvc, time @@ -95,7 +103,7 @@ res = self.onchange_partner_id(cr, uid, [], ref("res_partner_john0"), ref('bank_journal_CHF'), 300.0, 2, ttype='receipt', date=False) vals = { 'account_id': ref('account.cash'), - 'amount': 120.0, + 'amount': 300.0, 'company_id': ref('base.main_company'), 'currency_id': ref('base.CHF'), 'journal_id': ref('bank_journal_CHF'), @@ -130,7 +138,7 @@ !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'First payment')]) voucher_id = self.browse(cr, uid, voucher[0]) - assert (voucher_id.currency_rate_difference == 49.39), "currency rate difference is not 0.00" + assert (voucher_id.currency_rate_difference == 49.39), "currency rate difference is not 49.39" - I confirm the voucher - @@ -140,40 +148,44 @@ wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) - - I check that my voucher state is posted + I check that the move of my voucher is valid - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'First payment')]) voucher_id = self.browse(cr, uid, voucher[0]) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) + for move_line in move_line_obj.browse(cr, uid, move_lines): + assert move_line.state == 'valid', "Voucher move is not valid" assert voucher_id.state == 'posted', "Voucher state is not posted" - I check that my debtor account is correct - - I check that the debtor account has 2 new lines with -20 and -30 as amount_currency columns and their credit columns are respectively 15 and 24 and currency is USD($). + I check that the debtor account has 1 new line with -200 as amount_currency columns and 149.39 of credit and currency is CAD($). - - I check that my Currency Difference entry is created with a credit of 8.5 + I check that my currency rate difference is correct. 49.39 in debit with no amount_currency - - I check that my write-off entry is created with a debit of 4.75 and amount currency as 0.0 + I check that my writeoff is correct. 140 credit and -175 amount_currency - !python {model: account.voucher}: | - voucher = self.search(cr, uid, [('name', '=', 'Second payment')]) + voucher = self.search(cr, uid, [('name', '=', 'First payment')]) voucher_id = self.browse(cr, uid, voucher[0]) move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) for move_line in move_line_obj.browse(cr, uid, move_lines): if move_line.amount_currency == -200: assert move_line.credit == 149.39, "Debtor account has wrong entry." - if move_line.credit == 49.39: + elif move_line.debit == 49.39: assert move_line.amount_currency == 0.00, "Incorrect Currency Difference." - if move_line.credit == -140.00: - assert move_line.credit == -175, "Writeoff amount is wrong." + elif move_line.credit == 140.00: + assert move_line.amount_currency == -175, "Writeoff amount is wrong." - - I check the residual amount of Invoice1, should be 0 in residual currency and 0 in amount_residual + I check the residual amount of Invoice1, should be 0 in residual currency and 0 in amount_residual and paid - !python {model: account.invoice}: | invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan")) move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) move_line = move_line_obj.browse(cr, uid, move_lines[0]) - assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0) , "Residual amount is not correct for first Invoice" + assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for first Invoice" - \ No newline at end of file From 1f4c3d2fbba83515f07d68193f67a2492bb0a3a7 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Thu, 4 Aug 2011 15:25:50 +0530 Subject: [PATCH 16/39] [IMP] improve find method of account period and make comapny_id as related on account voucher bzr revid: ara@tinyerp.com-20110804095550-xu04lz4wkfhusvg0 --- addons/account/account.py | 9 ++++++++- addons/account_voucher/account_voucher.py | 17 ++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index ad7b60ada4d..0c825b40b60 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -918,10 +918,17 @@ class account_period(osv.osv): return False def find(self, cr, uid, dt=None, context=None): + if context is None: context = {} if not dt: dt = time.strftime('%Y-%m-%d') #CHECKME: shouldn't we check the state of the period? - ids = self.search(cr, uid, [('date_start','<=',dt),('date_stop','>=',dt)]) + args = [('date_start', '<=' ,dt), ('date_stop', '>=', dt)] + if context.get('company_id', False): + args.append(('company_id', '=', context['company_id'])) + else: + company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id + args.append(('company_id', '=', company_id)) + ids = self.search(cr, uid, args, context=context) if not ids: raise osv.except_osv(_('Error !'), _('No period defined for this date: %s !\nPlease create one.')%dt) return ids diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 17940aa6f25..49972b25233 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -39,7 +39,10 @@ class account_voucher(osv.osv): if context is None: context = {} if context.get('period_id', False): return context.get('period_id') - periods = self.pool.get('account.period').find(cr, uid) + if context.get('invoice_id', False): + company_id = self.pool.get('account.invoice').browse(cr, uid, context['invoice_id'], context=context).company_id.id + context.update({'company_id': company_id}) + periods = self.pool.get('account.period').find(cr, uid, context=context) return periods and periods[0] or False def _get_journal(self, cr, uid, context=None): @@ -228,7 +231,7 @@ class account_voucher(osv.osv): 'currency_id': fields.function(_currency_id, type='many2one', relation='res.currency', string='Currency', store=True, readonly=True, multi="currency"), #duplicated field for display purposes 'currency_id2': fields.function(_currency_id, type='many2one', relation='res.currency', string='Currency', store=True, readonly=True, multi="currency"), - 'company_id': fields.many2one('res.company', 'Company', required=True, readonly=True, states={'draft':[('readonly',False)]}), + 'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True), 'company_currency': fields.related('company_id','currency_id', type='many2one', relation='res.currency', string='Currency', readonly=True), 'state':fields.selection( [('draft','Draft'), @@ -596,9 +599,13 @@ class account_voucher(osv.osv): @param context: context arguments, like lang, time zone @return: Returns a dict which contains new values, and context """ + if context is None: context = {} period_pool = self.pool.get('account.period') res = self.onchange_partner_id(cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=context) - pids = period_pool.search(cr, uid, [('date_start', '<=', date), ('date_stop', '>=', date)]) + if context.get('invoice_id', False): + company_id = self.pool.get('account.invoice').browse(cr, uid, context['invoice_id'], context=context).company_id.id + context.update({'company_id': company_id}) + pids = period_pool.find(cr, uid, date, context=context) if pids: if not 'value' in res: res['value'] = {} @@ -606,6 +613,7 @@ class account_voucher(osv.osv): return res def onchange_journal(self, cr, uid, ids, journal_id, line_ids, tax_id, partner_id, context=None): + if context is None: context = {} if not journal_id: return {} journal_pool = self.pool.get('account.journal') @@ -621,6 +629,9 @@ class account_voucher(osv.osv): if journal.currency: currency_id = journal.currency.id vals['value'].update({'currency_id':currency_id}) + context.update({'company_id': journal.company_id.id}) + periods = self.pool.get('account.period').find(cr, uid, context=context) + vals['value'].update({'period_id':periods[0]}) return vals def proforma_voucher(self, cr, uid, ids, context=None): From effaa191dcb673293bcb1c80a0ce2a07cf3dabd5 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Thu, 4 Aug 2011 15:34:57 +0530 Subject: [PATCH 17/39] [IMP] make move_line_id as required in account_voucher bzr revid: ara@tinyerp.com-20110804100457-50i5xn7dynpo1clg --- addons/account_voucher/account_voucher.py | 28 +++++++++---------- .../voucher_payment_receipt_view.xml | 14 +++++----- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 49972b25233..f30f04406a3 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -155,11 +155,11 @@ class account_voucher(osv.osv): for l in line_dr_ids: real_amount -= l.get('amount_in_company_currency', 0.0) counter_for_writeoff -= currency_pool.compute(cr, uid, l['company_currency_id'], l['voucher_currency_id'], l.get('amount_in_company_currency',0.0), context=ctx) - counter_for_currency_diff -= currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) + counter_for_currency_diff -= currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) for l in line_cr_ids: real_amount += l.get('amount_in_company_currency', 0.0) counter_for_writeoff += currency_pool.compute(cr, uid, l['company_currency_id'], l['voucher_currency_id'], l.get('amount_in_company_currency',0.0), context=ctx) - counter_for_currency_diff += currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) + counter_for_currency_diff += currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) writeoff_amount = amount - counter_for_writeoff currency_rate_difference = real_amount - counter_for_currency_diff return writeoff_amount, currency_rate_difference @@ -170,7 +170,7 @@ class account_voucher(osv.osv): line_osv = self.pool.get("account.voucher.line") line_dr_ids = resolve_o2m_operations(cr, uid, line_osv, line_dr_ids, ['amount'], context) line_cr_ids = resolve_o2m_operations(cr, uid, line_osv, line_cr_ids, ['amount'], context) - writeoff_amount, currency_rate_diff = self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount, voucher_date, context=context) + writeoff_amount, currency_rate_diff = self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount, voucher_date, context=context) return {'value': {'writeoff_amount': writeoff_amount,}}# 'currency_rate_difference': currency_rate_diff}} def _get_writeoff_amount(self, cr, uid, ids, name, args, context=None): @@ -188,15 +188,15 @@ class account_voucher(osv.osv): counter_for_writeoff -= (l.voucher_currency_id.id == l.company_currency_id.id) and l.amount_in_company_currency or l.amount_in_voucher_currency #ctx.update({'date': l.date_original}) #counter_for_writeoff -= currency_pool.compute(cr, uid, voucher.company_id.currency_id.id, voucher.currency_id.id, l.amount_in_company_currency, context=ctx) - counter_for_currency_diff -= currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) + counter_for_currency_diff -= currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) for l in voucher.line_cr_ids: real_amount += l.amount_in_company_currency counter_for_writeoff += (l.voucher_currency_id.id == l.company_currency_id.id) and l.amount_in_company_currency or l.amount_in_voucher_currency #ctx.update({'date': l.date_original}) #counter_for_writeoff += currency_pool.compute(cr, uid, voucher.company_id.currency_id.id, voucher.currency_id.id, l.amount_in_company_currency, context=ctx) - counter_for_currency_diff += currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) + counter_for_currency_diff += currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) writeoff_amount = voucher.amount - counter_for_writeoff - res[voucher.id]['writeoff_amount'] = writeoff_amount + res[voucher.id]['writeoff_amount'] = writeoff_amount res[voucher.id]['currency_rate_difference'] = real_amount - counter_for_currency_diff return res @@ -548,9 +548,9 @@ class account_voucher(osv.osv): 'move_line_id':line.id, 'account_id':line.account_id.id, 'amount_original': amount_original, - 'amount': (move_line_found == line.id) and min(price, amount_unreconciled) or 0.0, + 'amount': (move_line_found == line.id) and min(price, amount_unreconciled) or 0.0, 'currency_id': currency_id, - 'voucher_currency_id': voucher_currency_id, + 'voucher_currency_id': voucher_currency_id, 'date_original':line.date, 'company_currency_id': line.company_id.currency_id.id, 'date_due':line.date_maturity, @@ -777,7 +777,7 @@ class account_voucher(osv.osv): account_id = voucher.company_id.property_income_currency_exchange if not account_id: raise osv.except_osv(_('Warning'),_("Unable to create accounting entry for currency rate difference. You have to configure the field 'Expense Currency Rate' on the company! ")) - + currency_diff_line = { 'name': _('Currency Difference'), 'debit': voucher.currency_rate_difference > 0 and voucher.currency_rate_difference or 0.0, @@ -844,7 +844,7 @@ class account_voucher(osv.osv): if not currency_pool.is_zero(cr, uid, voucher.currency_id, voucher.writeoff_amount): #create one line for the write off if needed - diff = currency_pool.compute(cr, uid, voucher_currency, company_currency, voucher.writeoff_amount, context=context_multi_currency) + diff = currency_pool.compute(cr, uid, voucher_currency, company_currency, voucher.writeoff_amount, context=context_multi_currency) account_id = False write_off_name = '' if voucher.payment_option == 'with_writeoff': @@ -950,7 +950,7 @@ class account_voucher_line(osv.osv): def _get_amount_in_company_currency(self, cr, uid, ids, name, args, context=None): res = {} for line in self.browse(cr, uid, ids, context=context): - amount_in_company_currency, amount_in_voucher_currency = self.__company_currency_amount(cr, uid, line, line.amount, context=context) + amount_in_company_currency, amount_in_voucher_currency = self.__company_currency_amount(cr, uid, line, line.amount, context=context) res[line.id] = { 'amount_in_company_currency': amount_in_company_currency, 'amount_in_voucher_currency': amount_in_voucher_currency, @@ -959,7 +959,7 @@ class account_voucher_line(osv.osv): _columns = { 'voucher_id':fields.many2one('account.voucher', 'Voucher', required=1, ondelete='cascade'), - 'move_line_id': fields.many2one('account.move.line', 'Journal Item', required=True), + 'move_line_id': fields.many2one('account.move.line', 'Journal Item'), 'type':fields.selection([('dr','Debit'),('cr','Credit')], 'Dr/Cr'), 'name':fields.char('Description', size=256), 'account_id':fields.many2one('account.account','Account', required=True), @@ -972,8 +972,8 @@ class account_voucher_line(osv.osv): 'voucher_currency_id': fields.related('voucher_id', 'currency_id', type='many2one', relation='res.currency', string="Voucher Currency"), 'amount':fields.float('Amount', digits_compute=dp.get_precision('Account')), - 'amount_in_company_currency': fields.function(_get_amount_in_company_currency, string='Amount in Company Currency', type='float', digits_compute=dp.get_precision('Account'), multi="voucher_line_amount"), - 'amount_in_voucher_currency': fields.function(_get_amount_in_company_currency, string='Amount in Voucher Currency', type='float', digits_compute=dp.get_precision('Account'), multi="voucher_line_amount"), + 'amount_in_company_currency': fields.function(_get_amount_in_company_currency, string='Amount in Company Currency', type='float', digits_compute=dp.get_precision('Account'), multi="voucher_line_amount"), + 'amount_in_voucher_currency': fields.function(_get_amount_in_company_currency, string='Amount in Voucher Currency', type='float', digits_compute=dp.get_precision('Account'), multi="voucher_line_amount"), 'date_original': fields.related('move_line_id','date', type='date', relation='account.move.line', string='Date', readonly=1), 'date_due': fields.related('move_line_id','date_maturity', type='date', relation='account.move.line', string='Due Date', readonly=1), diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index c2344d681c1..0e2ac917153 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -108,7 +108,7 @@ - @@ -122,7 +122,7 @@ - + @@ -173,7 +173,7 @@ - @@ -187,7 +187,7 @@ - + @@ -306,7 +306,7 @@ - @@ -316,7 +316,7 @@ - @@ -335,7 +335,7 @@ - From b505b056e81c20589eb386a1c4053e032be48883 Mon Sep 17 00:00:00 2001 From: mtr Date: Thu, 4 Aug 2011 17:18:57 +0530 Subject: [PATCH 18/39] [IMP] account_voucher: corrected values and currency rate records so that demo data rates doesn't over shadow it bzr revid: mtr@mtr-20110804114857-zditm8vsx2hxr348 --- addons/account_voucher/test/case1_usd_usd.yml | 68 +++++++++---------- addons/account_voucher/test/case2_usd_eur.yml | 56 +++++++-------- addons/account_voucher/test/case3_eur_eur.yml | 25 ++++--- addons/account_voucher/test/case4_cad_chf.yml | 34 +++++----- 4 files changed, 92 insertions(+), 91 deletions(-) diff --git a/addons/account_voucher/test/case1_usd_usd.yml b/addons/account_voucher/test/case1_usd_usd.yml index a4e59ccc4b3..123a4463172 100755 --- a/addons/account_voucher/test/case1_usd_usd.yml +++ b/addons/account_voucher/test/case1_usd_usd.yml @@ -1,11 +1,12 @@ - I create a currency rate for USD for january of 1.333333 - - !record {model: res.currency.rate, id: jan_usd}: - currency_id: base.USD - name: !eval "'%s-01-01' %(datetime.now().year)" - rate: 1.333333 - + !python {model: res.currency.rate}: | + from datetime import datetime + curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'USD')]) + date = '%s-01-01' %(datetime.now().year) + ids = self.search(cr, uid, [('currency_id','=',curr_id), ('name', '=', date)]) + self.write(cr, uid, ids, {'rate': 1.333333}) - I create a currency rate for USD for february of 1.250000 - @@ -141,10 +142,10 @@ !python {model: account.voucher}: | import netsvc, time vals = {} - res = self.onchange_partner_id(cr, uid, [], ref("res_partner_strauss0"), ref('bank_journal_USD'), 240.0, 2, ttype='receipt', date=False) + res = self.onchange_partner_id(cr, uid, [], ref("res_partner_strauss0"), ref('bank_journal_USD'), 240.00, 2, ttype='receipt', date=False) vals = { 'account_id': ref('account.cash'), - 'amount': 240.0, + 'amount': 240.00, 'company_id': ref('base.main_company'), 'currency_id': ref('base.USD'), 'journal_id': ref('bank_journal_USD'), @@ -160,28 +161,28 @@ if not res['value']['line_cr_ids']: res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}] for item in res['value']['line_cr_ids']: - if item['amount_unreconciled'] == 200: - item['amount'] = 180 + if item['amount_unreconciled'] == 200.00: + item['amount'] = 180.00 else: - item['amount'] = 70 + item['amount'] = 70.00 vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']] id = self.create(cr, uid, vals) voucher_id = self.browse(cr, uid, id) assert (voucher_id.state=='draft'), "Voucher is not in draft state" - - I check that writeoff amount computed is -10 + I check that writeoff amount computed is -10.0 - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - assert (voucher_id.writeoff_amount == -10), "writeoff amount is not -10" + assert (voucher_id.writeoff_amount == -10.0), "Writeoff amount is not -10.0" - - I check that currency rate difference is -34 + I check that currency rate difference is -34.0 - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - assert (voucher_id.currency_rate_difference == -34), "currency rate difference is not -34" + assert (voucher_id.currency_rate_difference == -34.0), "Currency rate difference is not -34.0" - I confirm the voucher - @@ -215,14 +216,14 @@ move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) for move_line in move_line_obj.browse(cr, uid, move_lines): - if move_line.amount_currency == -180: + if move_line.amount_currency == -180.00: assert move_line.credit == 135.00, "Debtor account has wrong entry." - elif move_line.amount_currency == -70: + elif move_line.amount_currency == -70.00: assert move_line.credit == 56.00, "Debtor account has wrong entry." elif move_line.credit == 34.00: - assert move_line.amount_currency == 0, "Incorrect currency rate difference." - elif move_line.amount_currency == 10: - assert move_line.debit == 9.0, "Writeoff amount is wrong." + assert move_line.amount_currency == 0.00, "Incorrect currency rate difference." + elif move_line.amount_currency == 10.00: + assert move_line.debit == 9.00, "Writeoff amount is wrong." - I check the residual amount of Invoice1, should be 20 in amount_currency and 15 in company currency - @@ -249,10 +250,10 @@ !python {model: account.voucher}: | import netsvc, time vals = {} - res = self.onchange_partner_id(cr, uid, [], ref("res_partner_strauss0"), ref('bank_journal_USD'), 45.0, 2, ttype='receipt', date=False) + res = self.onchange_partner_id(cr, uid, [], ref("res_partner_strauss0"), ref('bank_journal_USD'), 45.00, 2, ttype='receipt', date=False) vals = { 'account_id': ref('account.cash'), - 'amount': 45.0, + 'amount': 45.00, 'company_id': ref('base.main_company'), 'currency_id': ref('base.USD'), 'journal_id': ref('bank_journal_USD'), @@ -268,29 +269,28 @@ if not res['value']['line_cr_ids']: res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}] for item in res['value']['line_cr_ids']: - if item['amount_unreconciled'] == 20: - item['amount'] = 20 + if item['amount_unreconciled'] == 20.00: + item['amount'] = 20.00 else: - item['amount'] = 30 + item['amount'] = 30.00 vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']] id = self.create(cr, uid, vals) voucher_id = self.browse(cr, uid, id) assert (voucher_id.state=='draft'), "Voucher is not in draft state" - - I check that writeoff amount computed is -5 + I check that writeoff amount computed is -5.0 - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - assert (voucher_id.writeoff_amount == -5), "writeoff amount is not -5" + assert (voucher_id.writeoff_amount == -5.0), "Writeoff amount is not -5.0" - I check that currency rate difference is -8.50 - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - curr_diff = voucher_id.currency_rate_difference - assert (voucher_id.currency_rate_difference == curr_diff), "currency rate difference is not -8.50" + assert (voucher_id.currency_rate_difference == -8.50), "Currency rate difference is not -8.50" - I confirm the voucher - @@ -324,13 +324,13 @@ move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) for move_line in move_line_obj.browse(cr, uid, move_lines): - if move_line.amount_currency == -20: - assert move_line.credit == 15, "Debtor account has wrong entry." - elif move_line.amount_currency == -30: - assert move_line.credit == 24, "Debtor account has wrong entry." - elif move_line.credit == 8.5: + if move_line.amount_currency == -20.00: + assert move_line.credit == 15.00, "Debtor account has wrong entry." + elif move_line.amount_currency == -30.00: + assert move_line.credit == 24.00, "Debtor account has wrong entry." + elif move_line.credit == 8.50: assert move_line.amount_currency == 0.00, "Incorrect Currency Difference." - elif move_line.amount_currency == 5: + elif move_line.amount_currency == 5.00: assert move_line.debit == 4.75, "Writeoff amount is wrong." - I check the residual amount of Invoice1, should be 0 in residual currency and 0 in amount_residual and paid diff --git a/addons/account_voucher/test/case2_usd_eur.yml b/addons/account_voucher/test/case2_usd_eur.yml index 35e0bf86231..e6d24fb5a1b 100644 --- a/addons/account_voucher/test/case2_usd_eur.yml +++ b/addons/account_voucher/test/case2_usd_eur.yml @@ -1,10 +1,12 @@ - I create a currency rate for USD for january of 1.333333 - - !record {model: res.currency.rate, id: janu_usd}: - currency_id: base.USD - name: !eval "'%s-01-01' %(datetime.now().year)" - rate: 1.333333 + !python {model: res.currency.rate}: | + from datetime import datetime + curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'USD')]) + date = '%s-01-01' %(datetime.now().year) + ids = self.search(cr, uid, [('currency_id', '=', curr_id), ('name', '=', date)]) + self.write(cr, uid, ids, {'rate': 1.333333}) - I create a currency rate for USD for february of 1.250000 - @@ -168,28 +170,28 @@ if not res['value']['line_cr_ids']: res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}] for item in res['value']['line_cr_ids']: - if item['amount_unreconciled'] == 200: - item['amount'] = 180 + if item['amount_unreconciled'] == 200.00: + item['amount'] = 180.00 else: - item['amount'] = 70 + item['amount'] = 70.00 vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']] id = self.create(cr, uid, vals) voucher_id = self.browse(cr, uid, id) assert (voucher_id.state=='draft'), "Voucher is not in draft state" - - I check that writeoff amount computed is 15 + I check that writeoff amount computed is 15.0 - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michael0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - assert (voucher_id.writeoff_amount == 15), "writeoff amount is not 15" + assert (voucher_id.writeoff_amount == 15.0), "Writeoff amount is not 15.0" - - I check that currency rate difference is -34 + I check that currency rate difference is -34.0 - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michael0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - assert (voucher_id.currency_rate_difference == -34), "currency rate difference is not -34" + assert (voucher_id.currency_rate_difference == -34.0), "Currency rate difference is not -34.0" - I confirm the voucher - @@ -223,11 +225,11 @@ move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) for move_line in move_line_obj.browse(cr, uid, move_lines): - if move_line.amount_currency == -180: - assert move_line.credit == 135, "Debtor account has wrong entry." - elif move_line.amount_currency == -70: + if move_line.amount_currency == -180.00: + assert move_line.credit == 135.00, "Debtor account has wrong entry." + elif move_line.amount_currency == -70.00: assert move_line.credit == 56.00, "Debtor account has wrong entry." - elif move_line.credit == 34: + elif move_line.credit == 34.00: assert move_line.amount_currency == 0.00, "Incorrect Currency Difference." elif move_line.credit == 15.00: assert move_line.amount_currency == 0.00, "Writeoff amount is wrong." @@ -275,28 +277,28 @@ if not res['value']['line_cr_ids']: res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}] for item in res['value']['line_cr_ids']: - if item['amount_unreconciled'] == 20: - item['amount'] = 20 + if item['amount_unreconciled'] == 20.00: + item['amount'] = 20.00 else: - item['amount'] = 30 + item['amount'] = 30.00 vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']] id = self.create(cr, uid, vals) voucher_id = self.browse(cr, uid, id) assert (voucher_id.state=='draft'), "Voucher is not in draft state" - - I check that writeoff amount computed is -5 + I check that writeoff amount computed is -5.0 - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - assert (voucher_id.writeoff_amount == -5), "writeoff amount is not -5" + assert (voucher_id.writeoff_amount == -5.0), "Writeoff amount is not -5.0" - I check that currency rate difference is -8.50 - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - assert (voucher_id.currency_rate_difference == -8.50), "currency rate difference is not -8.50" + assert (voucher_id.currency_rate_difference == -8.50), "Currency rate difference is not -8.50" - I confirm the voucher - @@ -327,13 +329,13 @@ move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) for move_line in move_line_obj.browse(cr, uid, move_lines): - if move_line.amount_currency == -20: - assert move_line.credit == 15, "Debtor account has wrong entry." - elif move_line.amount_currency == -30: - assert move_line.credit == 24, "Debtor account has wrong entry." - elif move_line.credit == 8.5: + if move_line.amount_currency == -20.00: + assert move_line.credit == 15.00, "Debtor account has wrong entry." + elif move_line.amount_currency == -30.00: + assert move_line.credit == 24.00, "Debtor account has wrong entry." + elif move_line.credit == 8.50: assert move_line.amount_currency == 0.00, "Incorrect Currency Difference." - elif move_line.amount_currency == 5: + elif move_line.amount_currency == 5.00: assert move_line.debit == 4.75, "Writeoff amount is wrong." - I check the residual amount of invoice 1, should be 0 in residual currency and 0 in amount_residual and paid diff --git a/addons/account_voucher/test/case3_eur_eur.yml b/addons/account_voucher/test/case3_eur_eur.yml index 5779028641e..904abb7f0db 100644 --- a/addons/account_voucher/test/case3_eur_eur.yml +++ b/addons/account_voucher/test/case3_eur_eur.yml @@ -138,7 +138,7 @@ res = self.onchange_partner_id(cr, uid, [], ref("res_partner_peter0"), ref('bank_journal_EUR'), 120.00, 2, ttype='receipt', date=False) vals = { 'account_id': ref('account.cash'), - 'amount': 120.0, + 'amount': 120.00, 'company_id': ref('base.main_company'), 'currency_id': ref('base.EUR'), 'journal_id': ref('bank_journal_EUR'), @@ -154,10 +154,10 @@ if not res['value']['line_cr_ids']: res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}] for item in res['value']['line_cr_ids']: - if item['amount_unreconciled'] == 150: - item['amount'] = 100 + if item['amount_unreconciled'] == 150.00: + item['amount'] = 100.00 else: - item['amount'] = 20 + item['amount'] = 20.00 vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']] id = self.create(cr, uid, vals) voucher_id = self.browse(cr, uid, id) @@ -168,14 +168,14 @@ !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - assert (voucher_id.writeoff_amount == 0), "writeoff amount is not 0" + assert (voucher_id.writeoff_amount == 0.00), "Writeoff amount is not 0.00" - I check that currency rate difference is 0.00 - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - assert (voucher_id.currency_rate_difference == 0.00), "currency rate difference is not 0.00" + assert (voucher_id.currency_rate_difference == 0.00), "Currency rate difference is not 0.00" - I confirm the voucher - @@ -205,9 +205,9 @@ move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) for move_line in move_line_obj.browse(cr, uid, move_lines): - if move_line.credit == 20: + if move_line.credit == 20.00: assert move_line.amount_currency == 0.00, "Debtor account has wrong entry." - elif move_line.credit == 100: + elif move_line.credit == 100.00: assert move_line.amount_currency == 0.00, "Debtor account has wrong entry." - I check the residual amount of Invoice1 is 50 @@ -234,10 +234,10 @@ !python {model: account.voucher}: | import netsvc, time vals = {} - res = self.onchange_partner_id(cr, uid, [], ref("res_partner_peter0"), ref('bank_journal_EUR'), 120.0, 2, ttype='receipt', date=False) + res = self.onchange_partner_id(cr, uid, [], ref("res_partner_peter0"), ref('bank_journal_EUR'), 120.00, 2, ttype='receipt', date=False) vals = { 'account_id': ref('account.cash'), - 'amount': 120.0, + 'amount': 120.00, 'company_id': ref('base.main_company'), 'currency_id': ref('base.EUR'), 'journal_id': ref('bank_journal_EUR'), @@ -267,15 +267,14 @@ !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'Second payment'),('partner_id', '=', ref('res_partner_peter0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - assert (voucher_id.writeoff_amount == 0.00), "writeoff amount is not 0" + assert (voucher_id.writeoff_amount == 0.00), "Writeoff amount is not 0" - I check that currency rate difference is 0.00 - !python {model: account.voucher}: | voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_peter0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - curr_diff = voucher_id.currency_rate_difference - assert (voucher_id.currency_rate_difference == curr_diff), "currency rate difference is not 0" + assert (voucher_id.currency_rate_difference == 0.00), "Currency rate difference is not 0" - I confirm the voucher - diff --git a/addons/account_voucher/test/case4_cad_chf.yml b/addons/account_voucher/test/case4_cad_chf.yml index 3d989eaee7a..56795fa127a 100644 --- a/addons/account_voucher/test/case4_cad_chf.yml +++ b/addons/account_voucher/test/case4_cad_chf.yml @@ -11,7 +11,7 @@ !record {model: res.currency.rate, id: mar_cad}: currency_id: base.CAD name: !eval "'%s-03-01' %(datetime.now().year)" - rate: 0.500000 + rate: 2.000000 - I create a currency rate for CHF for january of 1.308600 - @@ -24,7 +24,7 @@ - !record {model: res.currency.rate, id: jan_chf}: currency_id: base.CHF - name: !eval "'%s-01-01' %(datetime.now().year)" + name: !eval "'%s-03-01' %(datetime.now().year)" rate: 1.250000 - I create a bank journal with CHF as currency @@ -100,10 +100,10 @@ !python {model: account.voucher}: | import netsvc, time vals = {} - res = self.onchange_partner_id(cr, uid, [], ref("res_partner_john0"), ref('bank_journal_CHF'), 300.0, 2, ttype='receipt', date=False) + res = self.onchange_partner_id(cr, uid, [], ref("res_partner_john0"), ref('bank_journal_CHF'), 300.00, 2, ttype='receipt', date=False) vals = { 'account_id': ref('account.cash'), - 'amount': 300.0, + 'amount': 300.00, 'company_id': ref('base.main_company'), 'currency_id': ref('base.CHF'), 'journal_id': ref('bank_journal_CHF'), @@ -119,39 +119,40 @@ if not res['value']['line_cr_ids']: res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}] for item in res['value']['line_cr_ids']: - if item['amount_unreconciled'] == 200: - item['amount'] = 200 + if item['amount_unreconciled'] == 200.00: + item['amount'] = 200.00 vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']] id = self.create(cr, uid, vals) voucher_id = self.browse(cr, uid, id) assert (voucher_id.state=='draft'), "Voucher is not in draft state" - - I check that writeoff amount computed is 175 + I check that writeoff amount computed is 175.0 - !python {model: account.voucher}: | - voucher = self.search(cr, uid, [('name', '=', 'First payment')]) + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_john0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - assert (voucher_id.writeoff_amount == 175), "writeoff amount is not 175" + assert (voucher_id.writeoff_amount == 175.0), "Writeoff amount is not 175.0" - I check that currency rate difference is 49.39 - !python {model: account.voucher}: | - voucher = self.search(cr, uid, [('name', '=', 'First payment')]) + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_john0'))]) voucher_id = self.browse(cr, uid, voucher[0]) - assert (voucher_id.currency_rate_difference == 49.39), "currency rate difference is not 49.39" + curr_diff = float(str(voucher_id.currency_rate_difference)) + assert (curr_diff == 49.39), "Currency rate difference is not 49.39" - I confirm the voucher - !python {model: account.voucher}: | import netsvc - voucher = self.search(cr, uid, [('name', '=', 'First payment')]) + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_john0'))]) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) - I check that the move of my voucher is valid - !python {model: account.voucher}: | - voucher = self.search(cr, uid, [('name', '=', 'First payment')]) + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_john0'))]) voucher_id = self.browse(cr, uid, voucher[0]) move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) @@ -168,7 +169,7 @@ I check that my writeoff is correct. 140 credit and -175 amount_currency - !python {model: account.voucher}: | - voucher = self.search(cr, uid, [('name', '=', 'First payment')]) + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_john0'))]) voucher_id = self.browse(cr, uid, voucher[0]) move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) @@ -178,14 +179,13 @@ elif move_line.debit == 49.39: assert move_line.amount_currency == 0.00, "Incorrect Currency Difference." elif move_line.credit == 140.00: - assert move_line.amount_currency == -175, "Writeoff amount is wrong." + assert move_line.amount_currency == -175.00, "Writeoff amount is wrong." - I check the residual amount of Invoice1, should be 0 in residual currency and 0 in amount_residual and paid - !python {model: account.invoice}: | - invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan")) + invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_cad")) move_line_obj = self.pool.get('account.move.line') move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) move_line = move_line_obj.browse(cr, uid, move_lines[0]) assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for first Invoice" -- \ No newline at end of file From b752dde2870db8f2ff13135a4298cb11acaecf7c Mon Sep 17 00:00:00 2001 From: mtr Date: Fri, 5 Aug 2011 14:28:29 +0530 Subject: [PATCH 19/39] [IMP] account_voucher:improved strings bzr revid: mtr@mtr-20110805085829-m6qhtwu26fky7y9h --- addons/account_voucher/test/case1_usd_usd.yml | 11 +++++++---- addons/account_voucher/test/case2_usd_eur.yml | 11 +++++++---- addons/account_voucher/test/case3_eur_eur.yml | 11 +++++++---- addons/account_voucher/test/case4_cad_chf.yml | 13 ++++++++----- 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/addons/account_voucher/test/case1_usd_usd.yml b/addons/account_voucher/test/case1_usd_usd.yml index 123a4463172..dc7654ab9c3 100755 --- a/addons/account_voucher/test/case1_usd_usd.yml +++ b/addons/account_voucher/test/case1_usd_usd.yml @@ -1,5 +1,8 @@ - - I create a currency rate for USD for january of 1.333333 + In order to check the Account_voucher module with multi-currency in OpenERP, + I create 2 Invoices in USD and make 2 Payments in USD based on the currency rating on that particular date +- + I create currency USD in OpenERP for January of 1.333333 Rate - !python {model: res.currency.rate}: | from datetime import datetime @@ -8,7 +11,7 @@ ids = self.search(cr, uid, [('currency_id','=',curr_id), ('name', '=', date)]) self.write(cr, uid, ids, {'rate': 1.333333}) - - I create a currency rate for USD for february of 1.250000 + I create currency USD in OpenERP for February of 1.250000 Rate - !record {model: res.currency.rate, id: feb_usd}: currency_id: base.USD @@ -16,7 +19,7 @@ rate: 1.250000 - - I create a currency rate for USD for march of 1.111111 + I create currency USD in OpenERP for March of 1.111111 Rate - !record {model: res.currency.rate, id: mar_usd}: currency_id: base.USD @@ -24,7 +27,7 @@ rate: 1.111111 - - I create a currency rate for USD for april of 1.052632 + I create currency USD in OpenERP for April of 1.052632 Rate - !record {model: res.currency.rate, id: apr_usd}: currency_id: base.USD diff --git a/addons/account_voucher/test/case2_usd_eur.yml b/addons/account_voucher/test/case2_usd_eur.yml index e6d24fb5a1b..ded95095e5a 100644 --- a/addons/account_voucher/test/case2_usd_eur.yml +++ b/addons/account_voucher/test/case2_usd_eur.yml @@ -1,5 +1,8 @@ - - I create a currency rate for USD for january of 1.333333 + In order to check the Account_voucher module with multi-currency in OpenERP, + I create 2 Invoices in USD and make 2 Payments one in USD and another in EUR, based on the currency rating on that particular date +- + I create currency USD in OpenERP for January of 1.333333 Rate - !python {model: res.currency.rate}: | from datetime import datetime @@ -8,21 +11,21 @@ ids = self.search(cr, uid, [('currency_id', '=', curr_id), ('name', '=', date)]) self.write(cr, uid, ids, {'rate': 1.333333}) - - I create a currency rate for USD for february of 1.250000 + I create currency USD in OpenERP for February of 1.250000 Rate - !record {model: res.currency.rate, id: febr_usd}: currency_id: base.USD name: !eval "'%s-02-01' %(datetime.now().year)" rate: 1.250000 - - I create a currency rate for USD for march of 1.111111 + I create currency USD in OpenERP for March of 1.111111 Rate - !record {model: res.currency.rate, id: marc_usd}: currency_id: base.USD name: !eval "'%s-03-01' %(datetime.now().year)" rate: 1.111111 - - I create a currency rate for USD for april of 1.052632 + I create currency USD in OpenERP for April of 1.052632 Rate - !record {model: res.currency.rate, id: apri_usd}: currency_id: base.USD diff --git a/addons/account_voucher/test/case3_eur_eur.yml b/addons/account_voucher/test/case3_eur_eur.yml index 904abb7f0db..b35daf49402 100644 --- a/addons/account_voucher/test/case3_eur_eur.yml +++ b/addons/account_voucher/test/case3_eur_eur.yml @@ -1,26 +1,29 @@ - - I create a currency rate for EUR for january of 1.000000 + In order to check the Account_voucher module with multi-currency in OpenERP, + I create 2 Invoices in EUR and make 2 Payments in EUR based on the currency rating on that particular date. +- + I create currency EUR in OpenERP for January of 1.000000 Rate - !record {model: res.currency.rate, id: jan_eur}: currency_id: base.EUR name: !eval "'%s-01-01' %(datetime.now().year)" rate: 1.000000 - - I create a currency rate for EUR for february of 1.000000 + I create currency EUR in OpenERP for February of 1.000000 Rate - !record {model: res.currency.rate, id: feb_eur}: currency_id: base.EUR name: !eval "'%s-02-01' %(datetime.now().year)" rate: 1.000000 - - I create a currency rate for EUR for march of 1.000000 + I create currency EUR in OpenERP for March of 1.000000 Rate - !record {model: res.currency.rate, id: mar_eur}: currency_id: base.EUR name: !eval "'%s-03-01' %(datetime.now().year)" rate: 1.000000 - - I create a currency rate for EUR for april of 1.000000 + I create currency EUR in OpenERP for April of 1.000000 Rate - !record {model: res.currency.rate, id: apr_eur}: currency_id: base.EUR diff --git a/addons/account_voucher/test/case4_cad_chf.yml b/addons/account_voucher/test/case4_cad_chf.yml index 56795fa127a..b6ed790dffb 100644 --- a/addons/account_voucher/test/case4_cad_chf.yml +++ b/addons/account_voucher/test/case4_cad_chf.yml @@ -1,28 +1,31 @@ - - I create a currency rate for CAD for january of 1.338800 + In order to check the Account_voucher module with multi-currency in OpenERP, + I create an invoice in CAD and make its Payment in CHF based on the currency rating on that particular date. +- + I create currency CAD in OpenERP for January of 1.338800 Rate - !record {model: res.currency.rate, id: jan_cad}: currency_id: base.CAD name: !eval "'%s-01-01' %(datetime.now().year)" rate: 1.338800 - - I create a currency rate for CAD for march of 2.000000 + I create currency CAD in OpenERP for March of 2.000000 Rate - !record {model: res.currency.rate, id: mar_cad}: currency_id: base.CAD name: !eval "'%s-03-01' %(datetime.now().year)" rate: 2.000000 - - I create a currency rate for CHF for january of 1.308600 + I create currency CHF in OpenERP for January of 1.308600 Rate - !record {model: res.currency.rate, id: jan_chf}: currency_id: base.CHF name: !eval "'%s-01-01' %(datetime.now().year)" rate: 1.308600 - - I create a currency rate for CHF for march of 1.250000 + I create currency CHF in OpenERP for March of 1.250000 Rate - - !record {model: res.currency.rate, id: jan_chf}: + !record {model: res.currency.rate, id: mar_chf}: currency_id: base.CHF name: !eval "'%s-03-01' %(datetime.now().year)" rate: 1.250000 From 3008bf4b02f89e9659f433d7333942551fd14e78 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Tue, 9 Aug 2011 14:25:04 +0530 Subject: [PATCH 20/39] [IMP] improve period of account_voucher bzr revid: ara@tinyerp.com-20110809085504-d9clu2tbry1vagt8 --- addons/account_voucher/account_voucher.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index f30f04406a3..e42bf519b3d 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -631,7 +631,8 @@ class account_voucher(osv.osv): vals['value'].update({'currency_id':currency_id}) context.update({'company_id': journal.company_id.id}) periods = self.pool.get('account.period').find(cr, uid, context=context) - vals['value'].update({'period_id':periods[0]}) + if periods: + vals['value'].update({'period_id':periods[0]}) return vals def proforma_voucher(self, cr, uid, ids, context=None): From ef6a454dbb85c07820da0e419a3ca60e92cd903b Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 22 Aug 2011 12:02:14 +0200 Subject: [PATCH 21/39] [FIX] account_voucher: fixed writeoff amount method to compute correct values under multi-currency scenario bzr revid: qdp-launchpad@openerp.com-20110822100214-exxx5xigufvrppdu --- addons/account_voucher/account_voucher.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 17940aa6f25..2168cd31add 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -182,15 +182,11 @@ class account_voucher(osv.osv): ctx.update({'date': voucher.date}) for l in voucher.line_dr_ids: real_amount -= l.amount_in_company_currency - counter_for_writeoff -= (l.voucher_currency_id.id == l.company_currency_id.id) and l.amount_in_company_currency or l.amount_in_voucher_currency - #ctx.update({'date': l.date_original}) - #counter_for_writeoff -= currency_pool.compute(cr, uid, voucher.company_id.currency_id.id, voucher.currency_id.id, l.amount_in_company_currency, context=ctx) + counter_for_writeoff -= (l.voucher_currency_id.id == l.currency_id.id) and l.amount or l.amount_in_voucher_currency counter_for_currency_diff -= currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) for l in voucher.line_cr_ids: real_amount += l.amount_in_company_currency - counter_for_writeoff += (l.voucher_currency_id.id == l.company_currency_id.id) and l.amount_in_company_currency or l.amount_in_voucher_currency - #ctx.update({'date': l.date_original}) - #counter_for_writeoff += currency_pool.compute(cr, uid, voucher.company_id.currency_id.id, voucher.currency_id.id, l.amount_in_company_currency, context=ctx) + counter_for_writeoff += (l.voucher_currency_id.id == l.currency_id.id) and l.amount or l.amount_in_voucher_currency counter_for_currency_diff += currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) writeoff_amount = voucher.amount - counter_for_writeoff res[voucher.id]['writeoff_amount'] = writeoff_amount From 592297de432b6b0d2757a9942537697e40388095 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 22 Aug 2011 12:53:39 +0200 Subject: [PATCH 22/39] [FIX] account_voucher: fixed currency on voucher.line in case there was no move_line_id bzr revid: qdp-launchpad@openerp.com-20110822105339-i8r8lcy1pki43gdo --- addons/account_voucher/account_voucher.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index c9c2ee2aed2..ad3c4035f48 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -899,7 +899,10 @@ class account_voucher_line(osv.osv): res = {} for line in self.browse(cr, uid, ids, context=context): move_line = line.move_line_id - res[line.id] = move_line.currency_id and move_line.currency_id.id or move_line.company_id.currency_id.id + if move_line: + res[line.id] = move_line.currency_id and move_line.currency_id.id or move_line.company_id.currency_id.id + else: + res[line.id] = line.voucher_id.currency_id.id return res def _get_amounts(self, cr, uid, line_browse_rec, context=None): From b8796fa5f149563320fb2b3b4e94c9a20f55d696 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 22 Aug 2011 13:15:06 +0200 Subject: [PATCH 23/39] [FIX] account_voucher: usability. onchange amount in lines now update correctly the wirteoff amounts and amount of currency rate difference bzr revid: qdp-launchpad@openerp.com-20110822111506-r4pdrp4g6xiaiadd --- addons/account_voucher/account_voucher.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index ad3c4035f48..cc74b3485c1 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -148,17 +148,18 @@ class account_voucher(osv.osv): def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount, voucher_date, context=None): if context is None: context = {} + print 'ici changer' currency_pool = self.pool.get('res.currency') ctx = context.copy() counter_for_writeoff = counter_for_currency_diff = real_amount = 0.0 ctx.update({'date': voucher_date}) for l in line_dr_ids: real_amount -= l.get('amount_in_company_currency', 0.0) - counter_for_writeoff -= currency_pool.compute(cr, uid, l['company_currency_id'], l['voucher_currency_id'], l.get('amount_in_company_currency',0.0), context=ctx) + counter_for_writeoff -= l.get('voucher_currency_id') == l.get('currency_id') and l['amount'] or l.get('amount_in_voucher_currency',0.0) counter_for_currency_diff -= currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) for l in line_cr_ids: real_amount += l.get('amount_in_company_currency', 0.0) - counter_for_writeoff += currency_pool.compute(cr, uid, l['company_currency_id'], l['voucher_currency_id'], l.get('amount_in_company_currency',0.0), context=ctx) + counter_for_writeoff += l.get('voucher_currency_id') == l.get('currency_id') and l['amount'] or l.get('amount_in_voucher_currency',0.0) counter_for_currency_diff += currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) writeoff_amount = amount - counter_for_writeoff currency_rate_difference = real_amount - counter_for_currency_diff @@ -171,7 +172,7 @@ class account_voucher(osv.osv): line_dr_ids = resolve_o2m_operations(cr, uid, line_osv, line_dr_ids, ['amount'], context) line_cr_ids = resolve_o2m_operations(cr, uid, line_osv, line_cr_ids, ['amount'], context) writeoff_amount, currency_rate_diff = self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount, voucher_date, context=context) - return {'value': {'writeoff_amount': writeoff_amount,}}# 'currency_rate_difference': currency_rate_diff}} + return {'value': {'writeoff_amount': writeoff_amount, 'currency_rate_difference': currency_rate_diff}} def _get_writeoff_amount(self, cr, uid, ids, name, args, context=None): if not ids: return {} From e140748bc7da47df1688a00d86157a63d5492e2b Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 22 Aug 2011 13:37:22 +0200 Subject: [PATCH 24/39] [IMP] account_voucher: improved __openerp__ file and module description bzr revid: qdp-launchpad@openerp.com-20110822113722-xuc50rclszlp0img --- addons/account_voucher/__openerp__.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py index e9be5cc061e..289d26bb258 100644 --- a/addons/account_voucher/__openerp__.py +++ b/addons/account_voucher/__openerp__.py @@ -25,15 +25,22 @@ "author" : 'OpenERP SA', 'complexity': "normal", "description": """ -Account Voucher module includes all the basic requirements of Voucher Entries for Bank, Cash, Sales, Purchase, Expanse, Contra, etc. -==================================================================================================================================== +Account Voucher module offers an easy way to deal with all the basic requirements of Voucher Entries +==================================================================================================== - * Voucher Entry - * Voucher Receipt - * Cheque Register +Its increased usabililty allows you to create easily sales/purchases documents but also to encode payments. +Doing so, you'll be able to see all the open transactions for the selected partner and that will help you +to reconcile your entry with its invoice. + +Account Voucher module multi-currency support +============================================= + +Thanks to the contribution of CampToCamp, the vouchers fully support the multi currency and compute the +currency rate difference besides the write off amount. Of course, the accounting entries are also created +accordingly. """, "category" : "Finance", - "website" : "http://tinyerp.com", + "website" : "http://www.openerp.com", "images" : ["images/customer_payment.jpeg","images/journal_voucher.jpeg","images/sales_receipt.jpeg","images/supplier_voucher.jpeg"], "depends" : ["account"], "init_xml" : [], From eb940e8a683fd6409914d8544bd027266dbcde0b Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 22 Aug 2011 13:45:15 +0200 Subject: [PATCH 25/39] [IMP] account_voucher: removed debug statement bzr revid: qdp-launchpad@openerp.com-20110822114515-fdjibh32530k9jpz --- addons/account_voucher/account_voucher.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index cc74b3485c1..793d6f8634b 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -148,7 +148,6 @@ class account_voucher(osv.osv): def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount, voucher_date, context=None): if context is None: context = {} - print 'ici changer' currency_pool = self.pool.get('res.currency') ctx = context.copy() counter_for_writeoff = counter_for_currency_diff = real_amount = 0.0 From 69937fdd19a9441ea2c18e065c931ba352d34a27 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 22 Aug 2011 13:47:14 +0200 Subject: [PATCH 26/39] [IMP] account: when an invoice is put back to draft state, men should be able to change its date bzr revid: qdp-launchpad@openerp.com-20110822114714-fr3mdt7n6laow20i --- addons/account/invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 09e8304340c..547d3a9bd3e 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -209,7 +209,7 @@ class account_invoice(osv.osv): \n* The \'Open\' state is used when user create invoice,a invoice number is generated.Its in open state till user does not pay invoice. \ \n* The \'Paid\' state is set automatically when invoice is paid.\ \n* The \'Cancelled\' state is used when user cancel invoice.'), - 'date_invoice': fields.date('Invoice Date', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',True)]}, select=True, help="Keep empty to use the current date"), + 'date_invoice': fields.date('Invoice Date', readonly=True, states={'draft':[('readonly',False)]}, select=True, help="Keep empty to use the current date"), 'date_due': fields.date('Due Date', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',True)]}, select=True, help="If you use payment terms, the due date will be computed automatically at the generation "\ "of accounting entries. If you keep the payment term and the due date empty, it means direct payment. The payment term may compute several due dates, for example 50% now, 50% in one month."), From 5d29ffa125352da50138148d0bb92486f11ad864 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 22 Aug 2011 14:10:38 +0200 Subject: [PATCH 27/39] [FIX] account_voucher: typo bzr revid: qdp-launchpad@openerp.com-20110822121038-njpa3w6pszizheom --- addons/account_voucher/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py index 289d26bb258..2e3797c4745 100644 --- a/addons/account_voucher/__openerp__.py +++ b/addons/account_voucher/__openerp__.py @@ -35,7 +35,7 @@ to reconcile your entry with its invoice. Account Voucher module multi-currency support ============================================= -Thanks to the contribution of CampToCamp, the vouchers fully support the multi currency and compute the +Thanks to the contribution of Camptocamp, the vouchers fully support the multi currency and compute the currency rate difference besides the write off amount. Of course, the accounting entries are also created accordingly. """, From 6cc14d8764f5245254e2d1a0750d793c81a84bf6 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 22 Aug 2011 14:53:18 +0200 Subject: [PATCH 28/39] [IMP] account_voucher: selection of a specific invoice when coming from the button 'pay invoice' on that object, and context propagation bzr revid: qdp-launchpad@openerp.com-20110822125318-cdqdixkqdf1arpv3 --- addons/account_voucher/account_voucher.py | 9 +++--- .../voucher_payment_receipt_view.xml | 31 ++++++++++++++----- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 793d6f8634b..edd94d200f3 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -515,10 +515,11 @@ class account_voucher(osv.osv): continue if line.debit and line.reconcile_partial_id and ttype == 'payment': continue - if invoice_id and line.move_id.invoice_id.id == invoice_id: - move_line_found = line.id - break - if voucher_currency_id == company_currency: + if invoice_id: + if line.invoice.id == invoice_id: + move_line_found = line.id + break + elif voucher_currency_id == company_currency: if line.amount_residual == price: move_line_found = line.id break diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index f0ae39282d3..7f5363636e8 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -275,20 +275,35 @@ - + + widget="selection" + select="1" + on_change="onchange_partner_id(partner_id, journal_id, amount, + currency_id, type, date, context)" + string="Payment Method" + colspan="4"/> + on_change="onchange_partner_id(partner_id, journal_id, amount, + currency_id, type, date, context)"/> - + @@ -300,7 +315,7 @@ - + - + Date: Mon, 22 Aug 2011 15:31:14 +0200 Subject: [PATCH 29/39] [IMP] account_voucher: new voucher in multi-currency for suppliers payment too bzr revid: qdp-launchpad@openerp.com-20110822133114-0wyxfv98omjhhs43 --- .../voucher_payment_receipt_view.xml | 107 +++++++++++++----- 1 file changed, 78 insertions(+), 29 deletions(-) diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index 7f5363636e8..6b8bce0408a 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -74,14 +74,24 @@ - - + - + + - + - - - + + + + + + + + - - - + + + + + + + + + + @@ -137,15 +159,28 @@ - - + - + + @@ -166,18 +201,30 @@ - - - + + + + + + + + - - - + + + + + + + + + + @@ -185,24 +232,26 @@ - - - + + + + + + + domain="[('type','=','other')]" colspan="4"/> + attrs="{'invisible':[('payment_option','!=','with_writeoff')]}" colspan="4"/> + groups="analytic.group_analytic_accounting" colspan="4"/> - - + From ccc5925c9b062744f61d24093242580d53751da6 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Tue, 23 Aug 2011 15:27:01 +0200 Subject: [PATCH 30/39] [IMP] account_voucher: fixed the assignation of voucher amount per voucher line bzr revid: qdp-launchpad@openerp.com-20110823132701-wttepevy2jckm104 --- addons/account_voucher/account_voucher.py | 35 ++++++++++++----------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index edd94d200f3..60b84019b6e 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -484,32 +484,27 @@ class account_voucher(osv.osv): if journal.type not in ('cash', 'bank'): return default - total_credit = 0.0 - total_debit = 0.0 account_type = 'receivable' if ttype == 'payment': account_type = 'payable' - total_debit = price or 0.0 else: - total_credit = price or 0.0 account_type = 'receivable' if not context.get('move_line_ids', False): ids = move_line_pool.search(cr, uid, [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id)], context=context) else: ids = context['move_line_ids'] + + #computation of the assignation of voucher amount on voucher lines + total_credit = account_type == 'receivable' and price or 0.0 + total_debit = account_type == 'payable' and price or 0.0 + moves = move_line_pool.browse(cr, uid, ids, context=context) + company_currency = journal.company_id.currency_id.id + invoice_id = context.get('invoice_id', False) + move_line_found = False #order the lines by most old first ids.reverse() - moves = move_line_pool.browse(cr, uid, ids, context=context) - company_currency = journal.company_id.currency_id.id - if company_currency != voucher_currency_id and ttype == 'payment': - total_debit = currency_pool.compute(cr, uid, voucher_currency_id, company_currency, total_debit, context=context_multi_currency) - elif company_currency != voucher_currency_id and ttype == 'receipt': - total_credit = currency_pool.compute(cr, uid, voucher_currency_id, company_currency, total_credit, context=context_multi_currency) - - invoice_id = context.get('invoice_id', False) - move_line_found = False for line in moves: if line.credit and line.reconcile_partial_id and ttype == 'receipt': continue @@ -517,20 +512,28 @@ class account_voucher(osv.osv): continue if invoice_id: if line.invoice.id == invoice_id: + #if the invoice linked to the voucher line is equal to the invoice_id in context + #then we assign the amount on that line, whatever the other voucher lines move_line_found = line.id break elif voucher_currency_id == company_currency: + #otherwise treatments is the same but with other field names if line.amount_residual == price: + #if the amount residual is equal the amount voucher, we assign it to that voucher + #line, whatever the other voucher lines move_line_found = line.id break + #otherwise we will split the voucher amount on each line (by most old first) total_credit += line.credit or 0.0 total_debit += line.debit or 0.0 elif voucher_currency_id == line.currency_id.id: if line.amount_residual_currency == price: move_line_found = line.id break - total_credit += line.amount_currency or 0.0 - total_debit += line.amount_currency or 0.0 + total_credit += line.credit and line.amount_currency or 0.0 + total_debit += line.debit and line.amount_currency or 0.0 + + #voucher line creation for line in moves: if line.credit and line.reconcile_partial_id and ttype == 'receipt': continue @@ -554,9 +557,7 @@ class account_voucher(osv.osv): 'amount_unreconciled': amount_unreconciled, 'amount_in_company_currency': 0.0, } - if not move_line_found: - #TODO: this part isn't working really: we should assign the voucher amount on only lines that are or the same currency if company_currency == voucher_currency_id: if line.credit: amount = min(amount_unreconciled, abs(total_debit)) From 606484f0dbdb80c244b88581fc3fe7d1adea6f67 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Tue, 23 Aug 2011 16:23:44 +0200 Subject: [PATCH 31/39] [IMP] account_voucher: onchange amount now sets the writeoff amount and currency rate difference accordingly to the saved (and correct) values bzr revid: qdp-launchpad@openerp.com-20110823142344-cwvgp309xu445f1b --- addons/account_voucher/account_voucher.py | 74 +++++++++++++++-------- 1 file changed, 48 insertions(+), 26 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 60b84019b6e..01fd24c4a5a 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -153,12 +153,34 @@ class account_voucher(osv.osv): counter_for_writeoff = counter_for_currency_diff = real_amount = 0.0 ctx.update({'date': voucher_date}) for l in line_dr_ids: - real_amount -= l.get('amount_in_company_currency', 0.0) - counter_for_writeoff -= l.get('voucher_currency_id') == l.get('currency_id') and l['amount'] or l.get('amount_in_voucher_currency',0.0) + #compute the amount in voucher currency and in company currency if there aren't set yet + if not l.get('amount_in_company_currency', False): + ctx.update({'date': l['date_original']}) + amount_in_company_currency = currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) + ctx.update({'date': voucher_date}) + else: + amount_in_company_currency = l.get('amount_in_company_currency', 0.0) + if not l.get('amount_in_voucher_currency'): + amount_in_voucher_currency = currency_pool.compute(cr, uid, l['currency_id'], l['voucher_currency_id'], l['amount'], context=ctx) + else: + amount_in_voucher_currency = l.get('amount_in_voucher_currency', 0.0) + real_amount -= amount_in_company_currency + counter_for_writeoff -= l.get('voucher_currency_id') == l.get('currency_id') and l['amount'] or amount_in_voucher_currency counter_for_currency_diff -= currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) for l in line_cr_ids: - real_amount += l.get('amount_in_company_currency', 0.0) - counter_for_writeoff += l.get('voucher_currency_id') == l.get('currency_id') and l['amount'] or l.get('amount_in_voucher_currency',0.0) + #compute the amount in voucher currency and in company currency if there aren't set yet + if not l.get('amount_in_company_currency', False): + ctx.update({'date': l['date_original']}) + amount_in_company_currency = currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) + ctx.update({'date': voucher_date}) + else: + amount_in_company_currency = l.get('amount_in_company_currency', 0.0) + if not l.get('amount_in_voucher_currency'): + amount_in_voucher_currency = currency_pool.compute(cr, uid, l['currency_id'], l['voucher_currency_id'], l['amount'], context=ctx) + else: + amount_in_voucher_currency = l.get('amount_in_voucher_currency', 0.0) + real_amount += amount_in_company_currency + counter_for_writeoff += l.get('voucher_currency_id') == l.get('currency_id') and l['amount'] or amount_in_voucher_currency counter_for_currency_diff += currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) writeoff_amount = amount - counter_for_writeoff currency_rate_difference = real_amount - counter_for_currency_diff @@ -287,7 +309,7 @@ class account_voucher(osv.osv): tax_pool = self.pool.get('account.tax') partner_pool = self.pool.get('res.partner') position_pool = self.pool.get('account.fiscal.position') - voucher_line_pool = self.pool.get('account.voucher.line') + voucher_voucher_line_obj = self.pool.get('account.voucher.line') voucher_pool = self.pool.get('account.voucher') if context is None: context = {} @@ -296,7 +318,7 @@ class account_voucher(osv.osv): for line in voucher.line_ids: voucher_amount += line.untax_amount or line.amount line.amount = line.untax_amount or line.amount - voucher_line_pool.write(cr, uid, [line.id], {'amount':line.amount, 'untax_amount':line.untax_amount}) + voucher_voucher_line_obj.write(cr, uid, [line.id], {'amount':line.amount, 'untax_amount':line.untax_amount}) if not voucher.tax_id: self.write(cr, uid, [voucher.id], {'amount':voucher_amount, 'tax_amount':0.0}) @@ -324,7 +346,7 @@ class account_voucher(osv.osv): line_total += tax_line.get('price_unit') total_tax += line_tax untax_amount = line.untax_amount or line.amount - voucher_line_pool.write(cr, uid, [line.id], {'amount':line_total, 'untax_amount':untax_amount}) + voucher_voucher_line_obj.write(cr, uid, [line.id], {'amount':line_total, 'untax_amount':untax_amount}) self.write(cr, uid, [voucher.id], {'amount':total, 'tax_amount':total_tax}) return True @@ -334,14 +356,14 @@ class account_voucher(osv.osv): tax_pool = self.pool.get('account.tax') partner_pool = self.pool.get('res.partner') position_pool = self.pool.get('account.fiscal.position') - line_pool = self.pool.get('account.voucher.line') + voucher_line_obj = self.pool.get('account.voucher.line') res = { 'tax_amount': False, 'amount': False, } voucher_total = 0.0 - line_ids = resolve_o2m_operations(cr, uid, line_pool, line_ids, ["amount"], context) + line_ids = resolve_o2m_operations(cr, uid, voucher_line_obj, line_ids, ["amount"], context) total = 0.0 total_tax = 0.0 @@ -449,10 +471,10 @@ class account_voucher(osv.osv): context_multi_currency.update({'date': date}) currency_pool = self.pool.get('res.currency') - move_line_pool = self.pool.get('account.move.line') + move_line_obj = self.pool.get('account.move.line') partner_pool = self.pool.get('res.partner') journal_pool = self.pool.get('account.journal') - line_pool = self.pool.get('account.voucher.line') + voucher_line_obj = self.pool.get('account.voucher.line') #get default values vals = self.onchange_journal(cr, uid, ids, journal_id, [], False, partner_id, context=context) vals = vals.get('value',{}) @@ -462,9 +484,9 @@ class account_voucher(osv.osv): } #drop existing lines - line_ids = ids and line_pool.search(cr, uid, [('voucher_id', 'in', ids)]) or [] + line_ids = ids and voucher_line_obj.search(cr, uid, [('voucher_id', 'in', ids)]) or [] if line_ids: - line_pool.unlink(cr, uid, line_ids, context=context) + voucher_line_obj.unlink(cr, uid, line_ids, context=context) if not partner_id: return default @@ -491,14 +513,14 @@ class account_voucher(osv.osv): account_type = 'receivable' if not context.get('move_line_ids', False): - ids = move_line_pool.search(cr, uid, [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id)], context=context) + ids = move_line_obj.search(cr, uid, [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id)], context=context) else: ids = context['move_line_ids'] #computation of the assignation of voucher amount on voucher lines total_credit = account_type == 'receivable' and price or 0.0 total_debit = account_type == 'payable' and price or 0.0 - moves = move_line_pool.browse(cr, uid, ids, context=context) + moves = move_line_obj.browse(cr, uid, ids, context=context) company_currency = journal.company_id.currency_id.id invoice_id = context.get('invoice_id', False) move_line_found = False @@ -540,7 +562,7 @@ class account_voucher(osv.osv): if line.debit and line.reconcile_partial_id and ttype == 'payment': continue original_amount = line.credit or line.debit or 0.0 - amount_original, amount_unreconciled = line_pool._get_amounts(cr, uid, line, context=context) + amount_original, amount_unreconciled = voucher_line_obj._get_amounts(cr, uid, line, context=context) currency_id = line.currency_id and line.currency_id.id or line.company_id.currency_id.id rs = { 'name':line.move_id.name, @@ -555,8 +577,8 @@ class account_voucher(osv.osv): 'company_currency_id': line.company_id.currency_id.id, 'date_due':line.date_maturity, 'amount_unreconciled': amount_unreconciled, - 'amount_in_company_currency': 0.0, } + #split voucher amount by most old first if not move_line_found: if company_currency == voucher_currency_id: if line.credit: @@ -587,7 +609,7 @@ class account_voucher(osv.osv): default['value']['pre_line'] = 1 elif ttype == 'receipt' and len(default['value']['line_dr_ids']) > 0: default['value']['pre_line'] = 1 - default['value']['writeoff_amount'], default['value']['currency_rate_difference'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price, date, context=context) + default['value']['writeoff_amount'], default['value']['currency_rate_difference'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price, date, context=context) return default def onchange_date(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None): @@ -704,7 +726,7 @@ class account_voucher(osv.osv): if context is None: context = {} move_pool = self.pool.get('account.move') - move_line_pool = self.pool.get('account.move.line') + move_line_obj = self.pool.get('account.move.line') currency_pool = self.pool.get('res.currency') tax_obj = self.pool.get('account.tax') seq_obj = self.pool.get('ir.sequence') @@ -764,7 +786,7 @@ class account_voucher(osv.osv): 'date': voucher.date, 'date_maturity': voucher.date_due } - move_line_pool.create(cr, uid, move_line) + move_line_obj.create(cr, uid, move_line) #create the move line for the currency difference if voucher.currency_rate_difference: @@ -789,7 +811,7 @@ class account_voucher(osv.osv): 'date': voucher.date, 'date_maturity': voucher.date_due } - move_line_pool.create(cr, uid, currency_diff_line, context=context) + move_line_obj.create(cr, uid, currency_diff_line, context=context) rec_list_ids = [] for line in voucher.line_ids: @@ -836,7 +858,7 @@ class account_voucher(osv.osv): raise osv.except_osv(_('No Account Base Code and Account Tax Code!'),_("You have to configure account base code and account tax code on the '%s' tax!") % (tax_data.name)) sign = (move_line['debit'] - move_line['credit']) < 0 and -1 or 1 move_line['amount_currency'] = company_currency <> line.currency_id.id and sign * line.amount or 0.0 - voucher_line = move_line_pool.create(cr, uid, move_line) + voucher_line = move_line_obj.create(cr, uid, move_line) if line.move_line_id.id: rec_ids = [voucher_line, line.move_line_id.id] rec_list_ids.append(rec_ids) @@ -864,7 +886,7 @@ class account_voucher(osv.osv): 'amount_currency': company_currency <> voucher_currency and -voucher.writeoff_amount or 0.0, 'currency_id': company_currency <> voucher_currency and voucher_currency or False, } - move_line_pool.create(cr, uid, move_line) + move_line_obj.create(cr, uid, move_line) self.write(cr, uid, [voucher.id], { 'move_id': move_id, 'state': 'posted', @@ -874,7 +896,7 @@ class account_voucher(osv.osv): move_pool.post(cr, uid, [move_id], context={}) for rec_ids in rec_list_ids: if len(rec_ids) >= 2: - move_line_pool.reconcile_partial(cr, uid, rec_ids) + move_line_obj.reconcile_partial(cr, uid, rec_ids) return True def copy(self, cr, uid, id, default={}, context=None): @@ -998,9 +1020,9 @@ class account_voucher_line(osv.osv): @return: Returns a dict which contains new values, and context """ res = {} - move_line_pool = self.pool.get('account.move.line') + move_line_obj = self.pool.get('account.move.line') if move_line_id: - move_line = move_line_pool.browse(cr, user, move_line_id, context=context) + move_line = move_line_obj.browse(cr, user, move_line_id, context=context) if move_line.credit: ttype = 'dr' else: From 9ec72669ed57f5b722caf128ca1dae7d8e3d5b41 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 25 Aug 2011 17:25:45 +0200 Subject: [PATCH 32/39] [FIX] account_voucher: context passing bzr revid: qdp-launchpad@openerp.com-20110825152545-u0f4n2hlv7kmfsxc --- addons/account_voucher/account_voucher_view.xml | 2 +- addons/account_voucher/voucher_payment_receipt_view.xml | 2 +- addons/account_voucher/voucher_sales_purchase_view.xml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml index 1f59e12cd6a..6f421f762a1 100644 --- a/addons/account_voucher/account_voucher_view.xml +++ b/addons/account_voucher/account_voucher_view.xml @@ -43,7 +43,7 @@ - + diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index 6b8bce0408a..504fc4bbefc 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -352,7 +352,7 @@ select="1" invisible="context.get('line_type', False)" on_change="onchange_date(partner_id, journal_id, amount, - currency_id, type, datei, context)"/> + currency_id, type, date, context)"/> diff --git a/addons/account_voucher/voucher_sales_purchase_view.xml b/addons/account_voucher/voucher_sales_purchase_view.xml index 9d1f9c76c13..356c3f47ac9 100644 --- a/addons/account_voucher/voucher_sales_purchase_view.xml +++ b/addons/account_voucher/voucher_sales_purchase_view.xml @@ -83,7 +83,7 @@ - + @@ -209,7 +209,7 @@ - + From f3003d414384d8078a7028b1fb326b9f1953d13a Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 25 Aug 2011 19:42:01 +0200 Subject: [PATCH 33/39] [FIX] account_voucher: fixed the case of supplier payments bzr revid: qdp-launchpad@openerp.com-20110825174201-23wury3dpocfig3y --- addons/account_voucher/account_voucher.py | 7 +++++-- addons/account_voucher/invoice.py | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 01fd24c4a5a..da878458d6c 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -150,6 +150,7 @@ class account_voucher(osv.osv): context = {} currency_pool = self.pool.get('res.currency') ctx = context.copy() + voucher_type = context.get('type', False) counter_for_writeoff = counter_for_currency_diff = real_amount = 0.0 ctx.update({'date': voucher_date}) for l in line_dr_ids: @@ -182,7 +183,8 @@ class account_voucher(osv.osv): real_amount += amount_in_company_currency counter_for_writeoff += l.get('voucher_currency_id') == l.get('currency_id') and l['amount'] or amount_in_voucher_currency counter_for_currency_diff += currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx) - writeoff_amount = amount - counter_for_writeoff + sign = voucher_type in ['sale','receipt'] and 1 or -1 + writeoff_amount = (sign * amount) - counter_for_writeoff currency_rate_difference = real_amount - counter_for_currency_diff return writeoff_amount, currency_rate_difference @@ -213,7 +215,8 @@ class account_voucher(osv.osv): real_amount += l.amount_in_company_currency counter_for_writeoff += (l.voucher_currency_id.id == l.currency_id.id) and l.amount or l.amount_in_voucher_currency counter_for_currency_diff += currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx) - writeoff_amount = voucher.amount - counter_for_writeoff + sign = voucher.type in ['sale','receipt'] and 1 or -1 + writeoff_amount = (sign * voucher.amount) - counter_for_writeoff res[voucher.id]['writeoff_amount'] = writeoff_amount res[voucher.id]['currency_rate_difference'] = real_amount - counter_for_currency_diff return res diff --git a/addons/account_voucher/invoice.py b/addons/account_voucher/invoice.py index 0230cac1009..b108bc14fe3 100644 --- a/addons/account_voucher/invoice.py +++ b/addons/account_voucher/invoice.py @@ -45,10 +45,11 @@ class invoice(osv.osv): 'close_after_process': True, 'invoice_type':inv.type, 'invoice_id':inv.id, - 'default_type': inv.type in ('out_invoice','out_refund') and 'receipt' or 'payment' + 'default_type': inv.type in ('out_invoice','out_refund') and 'receipt' or 'payment', + 'type': inv.type in ('out_invoice','out_refund') and 'receipt' or 'payment' } } invoice() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 2dcccda2d3f4bd368af4a460f989a75f934cb366 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 25 Aug 2011 19:42:40 +0200 Subject: [PATCH 34/39] [IMP] account_voucher: added yaml test for supplier payments bzr revid: qdp-launchpad@openerp.com-20110825174240-frfok3lxy9if4qao --- addons/account_voucher/__openerp__.py | 1 + .../test/case2_suppl_usd_eur.yml | 328 ++++++++++++++++++ 2 files changed, 329 insertions(+) create mode 100644 addons/account_voucher/test/case2_suppl_usd_eur.yml diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py index 2e3797c4745..7b2a293c508 100644 --- a/addons/account_voucher/__openerp__.py +++ b/addons/account_voucher/__openerp__.py @@ -70,6 +70,7 @@ accordingly. "test/account_voucher_report.yml", "test/case1_usd_usd.yml", "test/case2_usd_eur.yml", + "test/case2_suppl_usd_eur.yml", "test/case3_eur_eur.yml", "test/case4_cad_chf.yml", ], diff --git a/addons/account_voucher/test/case2_suppl_usd_eur.yml b/addons/account_voucher/test/case2_suppl_usd_eur.yml new file mode 100644 index 00000000000..31e756d5355 --- /dev/null +++ b/addons/account_voucher/test/case2_suppl_usd_eur.yml @@ -0,0 +1,328 @@ +- + In order to check the Account_voucher module with multi-currency in OpenERP, + I create 2 Invoices in USD and make 2 Payments one in USD and another in EUR, based on the currency rating on that particular date +- + I create a bank journal with EUR as currency +- + !record {model: account.journal, id: bank_journal_EUR}: + name: Bank Journal(EUR) + code: BEUR + type: bank + analytic_journal_id: account.sit + sequence_id: account.sequence_bank_journal + default_debit_account_id: account.cash + default_credit_account_id: account.cash + currency: base.EUR + company_id: base.main_company + view_id: account.account_journal_bank_view +- + I create a bank journal with USD as currency +- + !record {model: account.journal, id: bank_journal_USD}: + name: Bank Journal(USD) + code: BUSD + type: bank + analytic_journal_id: account.sit + sequence_id: account.sequence_bank_journal + default_debit_account_id: account.cash + default_credit_account_id: account.cash + currency: base.USD + company_id: base.main_company + view_id: account.account_journal_bank_view +- + I create a new partner Robert Clements +- + !record {model: res.partner, id: res_partner_clements0}: + address: + - city: marseille + country_id: base.fr + name: Robert + street: 1 rue Rockfeller + type: invoice + zip: '13016' + name: Mr.Robert Clements +- + I create the first invoice on 1st January for 200 USD +- + !record {model: account.invoice, id: account_first_invoice_jan_suppl}: + account_id: account.a_pay + type : in_invoice + address_contact_id: base.res_partner_address_3000 + address_invoice_id: base.res_partner_address_3000 + company_id: base.main_company + currency_id: base.USD + date_invoice: !eval "'%s-01-01' %(datetime.now().year)" + period_id: account.period_1 + invoice_line: + - account_id: account.a_expense + name: '[PC1] Basic PC' + price_unit: 200.0 + quantity: 1.0 + product_id: product.product_product_pc1 + uos_id: product.product_uom_unit + journal_id: account.sales_journal + partner_id: res_partner_clements0 + reference_type: none + check_total : 200 +- + I Validate invoice by clicking on Validate button +- + !workflow {model: account.invoice, action: invoice_open, ref: account_first_invoice_jan_suppl} +- + I check that first invoice move is correct for debtor account(debit - credit == -150) +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_suppl")) + assert invoice_id.move_id, "Move not created for open invoice" + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + assert (move_line.debit - move_line.credit == -150.00), "Invoice move is incorrect for debtors account" +- + I create the second invoice on 1st February for 100 USD +- + !record {model: account.invoice, id: account_second_invoice_feb_suppl}: + account_id: account.a_pay + address_contact_id: base.res_partner_address_3000 + address_invoice_id: base.res_partner_address_3000 + company_id: base.main_company + currency_id: base.USD + date_invoice: !eval "'%s-02-01' %(datetime.now().year)" + period_id: account.period_2 + type : in_invoice + invoice_line: + - account_id: account.a_expense + name: '[PC1] Basic PC' + price_unit: 100.0 + quantity: 1.0 + product_id: product.product_product_pc1 + uos_id: product.product_uom_unit + journal_id: account.sales_journal + partner_id: res_partner_clements0 + reference_type: none + check_total : 100.0 +- + I Validate invoice by clicking on Validate button +- + !workflow {model: account.invoice, action: invoice_open, ref: account_second_invoice_feb_suppl} +- + I check that second invoice move is correct for debtor account (debit - credit == -80) +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb_suppl")) + assert invoice_id.move_id, "Move not created for open invoice" + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + assert (move_line.debit - move_line.credit == -80), "Invoice move is incorrect for debtors account" +- + I create the first voucher of payment + +- + !python {model: account.voucher}: | + import netsvc, time + vals = {} + res = self.onchange_partner_id(cr, uid, [], ref("res_partner_clements0"), ref('bank_journal_EUR'), 240.0, 2, ttype='payment', date=False) + vals = { + 'account_id': ref('account.cash'), + 'amount': 240.0, + 'company_id': ref('base.main_company'), + 'currency_id': ref('base.EUR'), + 'journal_id': ref('bank_journal_EUR'), + 'partner_id': ref('res_partner_clements0'), + 'period_id': ref('account.period_3'), + 'type': 'payment', + 'date': time.strftime("%Y-03-01"), + 'payment_option': 'with_writeoff', + 'writeoff_acc_id': ref('account.a_expense'), + 'comment': 'Write Off', + 'name': 'First payment', + } + if not res['value']['line_dr_ids']: + res['value']['line_dr_ids'] = [{'type': 'dr', 'account_id': ref('account.a_pay'),}] + for item in res['value']['line_dr_ids']: + if item['amount_unreconciled'] == 200.00: + item['amount'] = 180.00 + else: + item['amount'] = 70.00 + vals['line_dr_ids'] = [(0,0,i) for i in res['value']['line_dr_ids']] + id = self.create(cr, uid, vals) + voucher_id = self.browse(cr, uid, id) + assert (voucher_id.state=='draft'), "Voucher is not in draft state" +- + I check that writeoff amount computed is -15.0 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_clements0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert (voucher_id.writeoff_amount == -15.0), "Writeoff amount is not -15.0" +- + I check that currency rate difference is 34.0 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_clements0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert (voucher_id.currency_rate_difference == 34.0), "Currency rate difference is not 34.0" +- + I confirm the voucher +- + !python {model: account.voucher}: | + import netsvc + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_clements0'))]) + wf_service = netsvc.LocalService("workflow") + wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) +- + I check that the move of my voucher is valid +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_clements0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) + for move_line in move_line_obj.browse(cr, uid, move_lines): + assert move_line.state == 'valid', "Voucher move is not valid" +- + I check that my creditor account is correct +- + I check that the creditor account has 2 new lines with 180 and 70 in amount_currency columns and their debit columns are respectively 135 and 56 and currency is USD($). +- + I check that my currency rate difference is correct. -34 in credit with no amount_currency +- + I check that my writeoff is correct. -15 in credit with no amount_currency +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_clements0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) + for move_line in move_line_obj.browse(cr, uid, move_lines): + if move_line.amount_currency == 180.00: + assert move_line.debit == 135.00, "Creditor account has wrong entry." + elif move_line.amount_currency == 70.00: + assert move_line.debit == 56.00, "Debtor account has wrong entry." + elif move_line.debit == 34.00: + assert move_line.amount_currency == 0.00, "Incorrect Currency Difference." + elif move_line.debit == 15.00: + assert move_line.amount_currency == 0.00, "Writeoff amount is wrong." +- + I check the residual amount of Invoice1, should be 20 in residual currency and 15 in amount_residual +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_suppl")) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + assert (move_line.amount_residual_currency == 20.0 and move_line.amount_residual == 15) , "Residual amount is not correct for first Invoice" +- + I check the residual amuont of Invoice2, should be 30 in residual currency and 24 in amount_residual +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb_suppl")) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + assert (move_line.amount_residual_currency == 30 and move_line.amount_residual == 24) , "Residual amount is not correct for second Invoice" +- + I create the second voucher of payment + +- + !python {model: account.voucher}: | + import netsvc, time + vals = {} + res = self.onchange_partner_id(cr, uid, [], ref("res_partner_clements0"), ref('bank_journal_EUR'), 45.0, 2, ttype='payment', date=False) + vals = { + 'account_id': ref('account.cash'), + 'amount': 45.0, + 'company_id': ref('base.main_company'), + 'currency_id': ref('base.USD'), + 'journal_id': ref('bank_journal_USD'), + 'partner_id': ref('res_partner_clements0'), + 'period_id': ref('account.period_3'), + 'type': 'payment', + 'date': time.strftime("%Y-04-01"), + 'payment_option': 'with_writeoff', + 'writeoff_acc_id': ref('account.a_expense'), + 'comment': 'Write Off', + 'name': 'Second payment', + } + if not res['value']['line_dr_ids']: + res['value']['line_dr_ids'] = [{'type': 'dr', 'account_id': ref('account.a_pay'),}] + for item in res['value']['line_dr_ids']: + if item['amount_unreconciled'] == 20.00: + item['amount'] = 20.00 + else: + item['amount'] = 30.00 + vals['line_dr_ids'] = [(0,0,i) for i in res['value']['line_dr_ids']] + id = self.create(cr, uid, vals) + voucher_id = self.browse(cr, uid, id) + assert (voucher_id.state=='draft'), "Voucher is not in draft state" +- + I check that writeoff amount computed is -5.0 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_clements0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert (voucher_id.writeoff_amount == 5.0), "Writeoff amount is not 5.0" +- + I check that currency rate difference is 8.50 +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_clements0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert (voucher_id.currency_rate_difference == 8.50), "Currency rate difference is not 8.50" +- + I confirm the voucher +- + !python {model: account.voucher}: | + import netsvc + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_clements0'))]) + wf_service = netsvc.LocalService("workflow") + wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) +- + I check that my voucher state is posted +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_clements0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + assert voucher_id.state == 'posted', "Voucher state is not posted" +- + I check that my creditor account is correct +- + I check that the creditor account has 2 new lines with 20 and 30 in amount_currency columns and their debit columns are respectively 15 and 24 and currency is USD($). +- + I check that my currency rate difference is correct. 8.50 in debit with no amount_currency +- + I check that my writeoff is correct. 4.75 in credit and 5 in amount_currency +- + !python {model: account.voucher}: | + voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_clements0'))]) + voucher_id = self.browse(cr, uid, voucher[0]) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)]) + for move_line in move_line_obj.browse(cr, uid, move_lines): + if move_line.amount_currency == 20.00: + assert move_line.debit == 15.00, "Debtor account has wrong entry." + elif move_line.amount_currency == 30.00: + assert move_line.debit == 24.00, "Debtor account has wrong entry." + elif move_line.debit == 8.50: + assert move_line.amount_currency == 0.00, "Incorrect Currency Difference." + elif move_line.amount_currency == -5.00: + assert move_line.credit == 4.75, "Writeoff amount is wrong." +- + I check the residual amount of invoice 1, should be 0 in residual currency and 0 in amount_residual and paid +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_suppl")) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for first Invoice" +- + I check the residual amount of invoice 2, should be 0 in residual currency and 0 in amount_residual and paid +- + !python {model: account.invoice}: | + invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb_suppl")) + move_line_obj = self.pool.get('account.move.line') + move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)]) + move_line = move_line_obj.browse(cr, uid, move_lines[0]) + assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for second Invoice" From 4bb94db801522aea2272bfe9746e177c795e30d1 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 29 Aug 2011 12:54:39 +0200 Subject: [PATCH 35/39] [fix] put type = 'opportunity' in context for opportunities bzr revid: nicolas.vanhoren@openerp.com-20110829105439-fahrt37bzyfsrnoj --- addons/crm/crm_lead_menu.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_lead_menu.xml b/addons/crm/crm_lead_menu.xml index 5d5d0ef5824..264935fbe95 100644 --- a/addons/crm/crm_lead_menu.xml +++ b/addons/crm/crm_lead_menu.xml @@ -62,7 +62,7 @@ crm.lead tree,form,graph,calendar [('type','=','opportunity')] - {'search_default_user_id':uid,'search_default_current':1, 'search_default_section_id':section_id, 'stage_type': 'opportunity'} + {'search_default_user_id':uid,'search_default_current':1, 'search_default_section_id':section_id, 'stage_type': 'opportunity', 'default_type': 'opportunity'} With opportunities you can manage and keep track of your sales pipeline by creating specific customer- or prospect-related sales documents to follow up potential sales. Information such as expected revenue, opportunity stage, expected closing date, communication history and much more can be stored. Opportunities can be connected to the email gateway: new emails may create opportunities, each of them automatically gets the history of the conversation with the customer. From f0597f3686f8908c10759e75f607760ed664c4a3 Mon Sep 17 00:00:00 2001 From: Launchpad Translations on behalf of openerp <> Date: Tue, 30 Aug 2011 04:49:32 +0000 Subject: [PATCH 36/39] Launchpad automatic translations update. bzr revid: launchpad_translations_on_behalf_of_openerp-20110830044932-d9bjldtnpkkig57c --- addons/account_asset/i18n/fr.po | 92 +++++++++---------- addons/hr_timesheet_invoice/i18n/fr.po | 45 +++------- addons/membership/i18n/ru.po | 117 ++++++++++++------------- 3 files changed, 114 insertions(+), 140 deletions(-) diff --git a/addons/account_asset/i18n/fr.po b/addons/account_asset/i18n/fr.po index 470139e0958..0572c38dff4 100755 --- a/addons/account_asset/i18n/fr.po +++ b/addons/account_asset/i18n/fr.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-11-24 12:54+0000\n" -"PO-Revision-Date: 2011-07-12 12:04+0000\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2011-08-29 20:43+0000\n" +"Last-Translator: lholivier \n" "Language-Team: French \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-07-13 04:36+0000\n" -"X-Generator: Launchpad (build 13168)\n" +"X-Launchpad-Export-Date: 2011-08-30 04:49+0000\n" +"X-Generator: Launchpad (build 13794)\n" #. module: account_asset #: model:ir.actions.act_window,name:account_asset.action_account_asset_asset_list_normal @@ -27,7 +27,7 @@ msgstr "" #: field:account.asset.property,method_end:0 #: field:account.asset.property.history,method_end:0 msgid "Ending date" -msgstr "" +msgstr "Date de Fin" #. module: account_asset #: view:account.asset.asset:0 @@ -50,17 +50,17 @@ msgstr "" #. module: account_asset #: constraint:ir.actions.act_window:0 msgid "Invalid model name in the action definition." -msgstr "" +msgstr "Nom de modèle invalide pour la définition de l'action." #. module: account_asset #: selection:account.asset.property,method:0 msgid "Linear" -msgstr "" +msgstr "Linéaire" #. module: account_asset #: view:account.asset.asset:0 msgid "Change duration" -msgstr "" +msgstr "Changer la durée" #. module: account_asset #: field:account.asset.asset,child_ids:0 @@ -75,19 +75,19 @@ msgstr "" #. module: account_asset #: wizard_field:account.asset.modify,init,name:0 msgid "Reason" -msgstr "" +msgstr "Motif" #. module: account_asset #: view:account.asset.asset:0 #: field:account.asset.asset,entry_ids:0 #: wizard_field:account.asset.compute,asset_compute,move_ids:0 msgid "Entries" -msgstr "" +msgstr "Ecritures" #. module: account_asset #: wizard_view:account.asset.compute,asset_compute:0 msgid "Generated entries" -msgstr "" +msgstr "Écritures générées" #. module: account_asset #: wizard_field:account.asset.modify,init,method_delay:0 @@ -113,7 +113,7 @@ msgstr "" #. module: account_asset #: selection:account.asset.property,method:0 msgid "Progressive" -msgstr "" +msgstr "Progressif" #. module: account_asset #: model:ir.actions.act_window,name:account_asset.action_account_asset_asset_list_draft @@ -126,7 +126,7 @@ msgstr "" #: wizard_field:account.asset.modify,init,note:0 #: view:account.asset.property.history:0 msgid "Notes" -msgstr "" +msgstr "Commentaires" #. module: account_asset #: view:account.asset.asset:0 @@ -136,7 +136,7 @@ msgstr "" #. module: account_asset #: view:account.asset.asset:0 msgid "Depreciation entries" -msgstr "" +msgstr "Écritures d'amortissement" #. module: account_asset #: view:account.asset.asset:0 @@ -151,7 +151,7 @@ msgstr "" #. module: account_asset #: field:account.asset.asset,partner_id:0 msgid "Partner" -msgstr "" +msgstr "Partenaire" #. module: account_asset #: wizard_field:account.asset.modify,init,method_period:0 @@ -163,12 +163,12 @@ msgstr "" #. module: account_asset #: view:account.asset.asset:0 msgid "Depreciation duration" -msgstr "" +msgstr "Durée de l'amortissement" #. module: account_asset #: field:account.asset.property,account_analytic_id:0 msgid "Analytic account" -msgstr "" +msgstr "Compte Analytique" #. module: account_asset #: field:account.asset.property,state:0 @@ -178,17 +178,17 @@ msgstr "" #. module: account_asset #: view:account.asset.asset:0 msgid "Depreciation methods" -msgstr "" +msgstr "Méthodes d'amortissement" #. module: account_asset #: view:account.asset.asset:0 msgid "Other information" -msgstr "" +msgstr "Autre information" #. module: account_asset #: field:account.asset.board,value_asset_cumul:0 msgid "Cumul. value" -msgstr "" +msgstr "Valeur cumulée" #. module: account_asset #: view:account.asset.property:0 @@ -203,7 +203,7 @@ msgstr "" #. module: account_asset #: model:ir.model,name:account_asset.model_account_asset_property msgid "Asset property" -msgstr "" +msgstr "Propriété de l'immobilisation" #. module: account_asset #: wizard_view:account.asset.compute,asset_compute:0 @@ -212,30 +212,30 @@ msgstr "" #: model:ir.actions.wizard,name:account_asset.wizard_asset_compute #: model:ir.ui.menu,name:account_asset.menu_wizard_asset_compute msgid "Compute assets" -msgstr "" +msgstr "Calculer les immobilisations" #. module: account_asset #: wizard_view:account.asset.modify,init:0 #: wizard_button:account.asset.modify,init,asset_modify:0 #: model:ir.actions.wizard,name:account_asset.wizard_asset_modify msgid "Modify asset" -msgstr "" +msgstr "Modifier l'immobilisation" #. module: account_asset #: view:account.asset.asset:0 msgid "Confirm asset" -msgstr "" +msgstr "Confirmer l'immobilisation" #. module: account_asset #: view:account.asset.property.history:0 #: model:ir.model,name:account_asset.model_account_asset_property_history msgid "Asset history" -msgstr "" +msgstr "Historique de l'immobilisation" #. module: account_asset #: field:account.asset.property,date:0 msgid "Date created" -msgstr "" +msgstr "Date de création" #. module: account_asset #: model:ir.module.module,description:account_asset.module_meta_information @@ -274,43 +274,43 @@ msgstr "" #: field:account.asset.category,note:0 #: field:account.asset.property.history,note:0 msgid "Note" -msgstr "" +msgstr "Remarque" #. module: account_asset #: selection:account.asset.asset,state:0 #: selection:account.asset.property,state:0 msgid "Draft" -msgstr "" +msgstr "Brouilon" #. module: account_asset #: field:account.asset.property,type:0 msgid "Depr. method type" -msgstr "" +msgstr "Type de méthode d'immobilisation" #. module: account_asset #: field:account.asset.property,account_asset_id:0 msgid "Asset account" -msgstr "" +msgstr "Compte d'immobilisation" #. module: account_asset #: field:account.asset.property.history,asset_property_id:0 msgid "Method" -msgstr "" +msgstr "Méthode" #. module: account_asset #: selection:account.asset.asset,state:0 msgid "Normal" -msgstr "" +msgstr "Standard" #. module: account_asset #: field:account.asset.property,method_progress_factor:0 msgid "Progressif factor" -msgstr "" +msgstr "Facteur progressif" #. module: account_asset #: field:account.asset.asset,localisation:0 msgid "Localisation" -msgstr "" +msgstr "Emplacement" #. module: account_asset #: field:account.asset.property,method:0 @@ -330,7 +330,7 @@ msgstr "" #. module: account_asset #: field:account.asset.property.history,user_id:0 msgid "User" -msgstr "" +msgstr "Utilisateur" #. module: account_asset #: field:account.asset.asset,property_ids:0 @@ -346,7 +346,7 @@ msgstr "" #. module: account_asset #: field:account.asset.board,value_net:0 msgid "Net value" -msgstr "" +msgstr "Valeur nette" #. module: account_asset #: wizard_view:account.asset.close,init:0 @@ -357,12 +357,12 @@ msgstr "" #. module: account_asset #: field:account.asset.property,history_ids:0 msgid "History" -msgstr "" +msgstr "Hstorique" #. module: account_asset #: field:account.asset.property,account_actif_id:0 msgid "Depreciation account" -msgstr "" +msgstr "Comte d'amortissement" #. module: account_asset #: field:account.asset.asset,period_id:0 @@ -381,19 +381,19 @@ msgstr "" #: wizard_button:account.asset.compute,init,end:0 #: wizard_button:account.asset.modify,init,end:0 msgid "Cancel" -msgstr "" +msgstr "Annuler" #. module: account_asset #: selection:account.asset.asset,state:0 #: wizard_button:account.asset.compute,asset_compute,end:0 #: selection:account.asset.property,state:0 msgid "Close" -msgstr "" +msgstr "Fermer" #. module: account_asset #: selection:account.asset.property,state:0 msgid "Open" -msgstr "" +msgstr "Ouvrir" #. module: account_asset #: constraint:ir.model:0 @@ -416,7 +416,7 @@ msgstr "" #. module: account_asset #: field:account.asset.asset,state:0 msgid "Global state" -msgstr "" +msgstr "État global" #. module: account_asset #: selection:account.asset.property,method_time:0 @@ -431,7 +431,7 @@ msgstr "" #. module: account_asset #: field:account.asset.property,journal_analytic_id:0 msgid "Analytic journal" -msgstr "" +msgstr "Journal analytique" #. module: account_asset #: field:account.asset.property,name:0 @@ -441,7 +441,7 @@ msgstr "" #. module: account_asset #: field:account.asset.property,journal_id:0 msgid "Journal" -msgstr "" +msgstr "Journal" #. module: account_asset #: field:account.asset.property.history,name:0 @@ -464,12 +464,12 @@ msgstr "" #: field:account.asset.category,name:0 #: model:ir.model,name:account_asset.model_account_asset_category msgid "Asset category" -msgstr "" +msgstr "Catégorie d'immobilisation" #. module: account_asset #: view:account.asset.asset:0 msgid "Depreciation" -msgstr "" +msgstr "Amortissement" #. module: account_asset #: field:account.asset.asset,code:0 diff --git a/addons/hr_timesheet_invoice/i18n/fr.po b/addons/hr_timesheet_invoice/i18n/fr.po index b3bf04bdbbb..2dccd7e398c 100644 --- a/addons/hr_timesheet_invoice/i18n/fr.po +++ b/addons/hr_timesheet_invoice/i18n/fr.po @@ -7,15 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-01-11 11:15+0000\n" -"PO-Revision-Date: 2011-01-14 08:49+0000\n" -"Last-Translator: Maxime Chambreuil (http://www.savoirfairelinux.com) " -"\n" +"PO-Revision-Date: 2011-08-29 20:46+0000\n" +"Last-Translator: t.o \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: 2011-04-29 05:22+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-30 04:49+0000\n" +"X-Generator: Launchpad (build 13794)\n" #. module: hr_timesheet_invoice #: view:report.timesheet.line:0 @@ -109,7 +108,7 @@ msgstr "Cette année" #. module: hr_timesheet_invoice #: help:hr.timesheet.invoice.create.final,time:0 msgid "Display time in the history of works" -msgstr "Affiché le temps dans l'historique des travaux" +msgstr "Afficher le temps dans l'historique des travaux" #. module: hr_timesheet_invoice #: view:hr.timesheet.analytic.profit:0 @@ -136,7 +135,7 @@ msgstr "Compte" #: field:hr.timesheet.invoice.create,time:0 #: field:hr.timesheet.invoice.create.final,time:0 msgid "Time spent" -msgstr "Temps dépensé" +msgstr "Temps passé" #. module: hr_timesheet_invoice #: field:account.analytic.account,amount_invoiced:0 @@ -470,7 +469,7 @@ msgid "Employee or Journal Name" msgstr "Employé ou nom du journal" #. module: hr_timesheet_invoice -#: code:addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py:189 +#: code:addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py:191 #, python-format msgid "Invoices" msgstr "Factures" @@ -500,6 +499,7 @@ msgid "Currency" msgstr "Devise" #. module: hr_timesheet_invoice +#: field:hr.timesheet.analytic.profit,employee_ids:0 #: view:report.timesheet.line:0 #: field:report.timesheet.line,user_id:0 #: field:report_timesheet.account,user_id:0 @@ -833,7 +833,7 @@ msgid "Timesheet Line" msgstr "Ligne de feuille de temps" #. module: hr_timesheet_invoice -#: code:addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py:147 +#: code:addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py:142 #, python-format msgid "Balance product needed" msgstr "Balance produit nécéssaire" @@ -1073,7 +1073,7 @@ msgid "Analytic Lines to Invoice" msgstr "Lignes analytique à facturer" #. module: hr_timesheet_invoice -#: code:addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py:147 +#: code:addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py:142 #, python-format msgid "Please fill a Balance product in the wizard" msgstr "Veuillez remplir la balance produit dans l'assistant" @@ -1175,28 +1175,3 @@ msgstr "Année" #~ msgid "Invalid model name in the action definition." #~ msgstr "Nom du model invalide pour la définition de l'action." - -#~ msgid "Analytic Account Reporting" -#~ msgstr "Rapports des Comptes Analytiques" - -#~ msgid "My daily timesheets by account" -#~ msgstr "Mes feuilles de présence journalières par comptes" - -#~ msgid "My Timesheet of the Month" -#~ msgstr "Mes feuilles de présence du mois" - -#~ msgid "My timesheets by account" -#~ msgstr "Mes feuilles de présence par compte" - -#~ msgid "My timesheets to invoice" -#~ msgstr "Mes feuilles de présence à facturer" - -#~ msgid "Timesheet by user (this month)" -#~ msgstr "Feuille de présence par utilisateur (ce mois)" - -#~ msgid "" -#~ "This lists show you every task work you can invoice to the customer. Select " -#~ "the lines in order to generate the invoices automatically." -#~ msgstr "" -#~ "Cette liste regroupe toutes les tâches que vous pouvez facturer au client. " -#~ "Sélectionnez les lignes dans l'ordre pour créer les factures automatiquement." diff --git a/addons/membership/i18n/ru.po b/addons/membership/i18n/ru.po index c1ffa74a758..6e01aae3aa9 100644 --- a/addons/membership/i18n/ru.po +++ b/addons/membership/i18n/ru.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-01-11 11:15+0000\n" -"PO-Revision-Date: 2010-08-03 07:25+0000\n" -"Last-Translator: Mantavya Gajjar (Open ERP) \n" +"PO-Revision-Date: 2011-08-29 07:21+0000\n" +"Last-Translator: Stanislav Hanzhin \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: 2011-04-29 04:55+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-30 04:49+0000\n" +"X-Generator: Launchpad (build 13794)\n" #. module: membership #: model:process.transition,name:membership.process_transition_invoicetoassociate0 @@ -37,12 +37,12 @@ msgstr "Уплативший член" #: view:report.membership:0 #: view:res.partner:0 msgid "Group By..." -msgstr "" +msgstr "Группировать по ..." #. module: membership #: field:report.membership,num_paid:0 msgid "# Paid" -msgstr "" +msgstr "# Оплаченных" #. module: membership #: field:report.membership,tot_earned:0 @@ -57,7 +57,7 @@ msgstr "" #. module: membership #: selection:report.membership,month:0 msgid "March" -msgstr "" +msgstr "Март" #. module: membership #: model:process.node,note:membership.process_node_setassociation0 @@ -67,14 +67,14 @@ msgstr "" #. module: membership #: model:process.transition,note:membership.process_transition_invoicetopaid0 msgid "Invoice is be paid." -msgstr "" +msgstr "Счет будет оплачен." #. module: membership #: field:membership.membership_line,company_id:0 #: view:report.membership:0 #: field:report.membership,company_id:0 msgid "Company" -msgstr "" +msgstr "Организация" #. module: membership #: field:product.product,membership_date_to:0 @@ -84,7 +84,7 @@ msgstr "Дата до" #. module: membership #: model:process.transition,name:membership.process_transition_waitingtoinvoice0 msgid "Waiting to invoice" -msgstr "" +msgstr "Ожидание счета" #. module: membership #: help:report.membership,date_to:0 @@ -94,7 +94,7 @@ msgstr "" #. module: membership #: view:res.partner:0 msgid "Suppliers" -msgstr "" +msgstr "Поставщики" #. module: membership #: view:res.partner:0 @@ -140,7 +140,7 @@ msgstr "" #. module: membership #: field:report.membership,num_invoiced:0 msgid "# Invoiced" -msgstr "" +msgstr "# выставленных счетов" #. module: membership #: model:ir.ui.menu,name:membership.menu_report_membership @@ -161,7 +161,7 @@ msgstr "Дата с" #: code:addons/membership/membership.py:414 #, python-format msgid "Partner doesn't have an address to make the invoice." -msgstr "" +msgstr "Партнер не имеет адреса, чтобы выставить счет" #. module: membership #: model:ir.model,name:membership.model_res_partner @@ -228,7 +228,7 @@ msgstr "Начало членства" #: code:addons/membership/membership.py:413 #, python-format msgid "Error !" -msgstr "" +msgstr "Ошибка !" #. module: membership #: model:process.node,name:membership.process_node_paidmember0 @@ -238,7 +238,7 @@ msgstr "" #. module: membership #: field:report.membership,num_waiting:0 msgid "# Waiting" -msgstr "" +msgstr "# Ожидающих" #. module: membership #: model:ir.actions.act_window,name:membership.action_membership_members @@ -262,7 +262,7 @@ msgstr "" #. module: membership #: selection:report.membership,month:0 msgid "July" -msgstr "" +msgstr "Июль" #. module: membership #: model:product.template,name:membership.membership_0_product_template @@ -296,7 +296,7 @@ msgstr "" #. module: membership #: view:membership.invoice:0 msgid "Join" -msgstr "" +msgstr "Присоединиться" #. module: membership #: help:product.product,membership_date_to:0 @@ -312,7 +312,7 @@ msgstr "" #. module: membership #: field:membership.membership_line,date:0 msgid "Join Date" -msgstr "" +msgstr "Дата вступления" #. module: membership #: help:res.partner,free_member:0 @@ -342,12 +342,12 @@ msgstr "" #. module: membership #: model:ir.model,name:membership.model_product_template msgid "Product Template" -msgstr "" +msgstr "Шаблон ТМЦ" #. module: membership #: selection:report.membership,month:0 msgid "September" -msgstr "" +msgstr "Сентябрь" #. module: membership #: model:ir.module.module,description:membership.module_meta_information @@ -369,7 +369,7 @@ msgstr "" #. module: membership #: model:ir.model,name:membership.model_account_invoice_line msgid "Invoice Line" -msgstr "" +msgstr "Позиция счета" #. module: membership #: help:membership.membership_line,state:0 @@ -393,12 +393,12 @@ msgstr "" #: view:report.membership:0 #: field:report.membership,month:0 msgid "Month" -msgstr "" +msgstr "Месяц" #. module: membership #: view:product.product:0 msgid "Group by..." -msgstr "" +msgstr "Объединять по..." #. module: membership #: code:addons/membership/membership.py:411 @@ -426,7 +426,7 @@ msgstr "" #. module: membership #: view:report.membership:0 msgid "Associated Partner" -msgstr "" +msgstr "Связанный контрагент" #. module: membership #: model:ir.model,name:membership.model_membership_invoice @@ -439,7 +439,7 @@ msgstr "" #: field:report.membership,user_id:0 #: view:res.partner:0 msgid "Salesman" -msgstr "" +msgstr "Менеджер продаж" #. module: membership #: model:process.node,note:membership.process_node_membershipproduct0 @@ -449,13 +449,13 @@ msgstr "" #. module: membership #: view:product.product:0 msgid "Category" -msgstr "" +msgstr "Категория" #. module: membership #: model:ir.model,name:membership.model_account_invoice #: field:membership.membership_line,account_invoice_id:0 msgid "Invoice" -msgstr "" +msgstr "Счет" #. module: membership #: selection:membership.membership_line,state:0 @@ -474,26 +474,28 @@ msgstr "" msgid "" "Error: The default UOM and the purchase UOM must be in the same category." msgstr "" +"Ошибка. ед. изм. по умолчанию и закупочные ед. изм. должны иметь одинаковую " +"категорию." #. module: membership #: view:report.membership:0 msgid "Forecast" -msgstr "" +msgstr "Прогноз" #. module: membership #: field:report.membership,partner_id:0 msgid "Member" -msgstr "" +msgstr "Участник" #. module: membership #: constraint:res.partner:0 msgid "Error ! You can not create recursive associated members." -msgstr "" +msgstr "Ошибка! Вы не можете создать рекурсивно связанных участников." #. module: membership #: view:product.product:0 msgid "Date From" -msgstr "" +msgstr "Дата с" #. module: membership #: model:process.node,name:membership.process_node_associatedmember0 @@ -513,12 +515,12 @@ msgstr "Дата отмены членства" #. module: membership #: view:res.partner:0 msgid "Customers" -msgstr "" +msgstr "Заказчики" #. module: membership #: selection:report.membership,month:0 msgid "August" -msgstr "" +msgstr "Август" #. module: membership #: model:ir.actions.act_window,name:membership.action_membership_products @@ -530,7 +532,7 @@ msgstr "" #. module: membership #: selection:report.membership,month:0 msgid "June" -msgstr "" +msgstr "Июнь" #. module: membership #: model:ir.module.module,shortdesc:membership.module_meta_information @@ -571,12 +573,12 @@ msgstr "" #. module: membership #: selection:report.membership,month:0 msgid "November" -msgstr "" +msgstr "Ноябрь" #. module: membership #: view:product.product:0 msgid "Extended Filters..." -msgstr "" +msgstr "Расширенные фильтры..." #. module: membership #: field:membership.membership_line,state:0 @@ -586,17 +588,17 @@ msgstr "" #. module: membership #: selection:report.membership,month:0 msgid "October" -msgstr "" +msgstr "Октябрь" #. module: membership #: view:product.product:0 msgid "Sale Description" -msgstr "" +msgstr "Описание продажи" #. module: membership #: selection:report.membership,month:0 msgid "January" -msgstr "" +msgstr "Январь" #. module: membership #: view:product.product:0 @@ -645,37 +647,37 @@ msgstr "" #. module: membership #: view:report.membership:0 msgid "Last 365 Days" -msgstr "" +msgstr "Последние 365 дней" #. module: membership #: view:product.product:0 msgid "General" -msgstr "" +msgstr "Общие" #. module: membership #: model:process.transition,note:membership.process_transition_waitingtoinvoice0 msgid "Draft invoice is now open." -msgstr "" +msgstr "Черновик счета открыт." #. module: membership #: view:product.product:0 msgid "Inactive" -msgstr "" +msgstr "Неактивен" #. module: membership #: view:report.membership:0 msgid "Last 30 Days" -msgstr "" +msgstr "Последние 30 дней" #. module: membership #: selection:report.membership,month:0 msgid "December" -msgstr "" +msgstr "Декабрь" #. module: membership #: view:membership.invoice:0 msgid "Close" -msgstr "" +msgstr "Закрыть" #. module: membership #: view:res.partner:0 @@ -695,7 +697,7 @@ msgstr "" #. module: membership #: view:product.product:0 msgid "Categorization" -msgstr "" +msgstr "Категоризация" #. module: membership #: model:process.node,note:membership.process_node_waitingmember0 @@ -713,17 +715,17 @@ msgstr "Цена члена" #. module: membership #: view:product.product:0 msgid "Purchase Description" -msgstr "" +msgstr "Описание закупки" #. module: membership #: model:ir.model,name:membership.model_product_product msgid "Product" -msgstr "" +msgstr "ТМЦ" #. module: membership #: view:product.product:0 msgid "Description" -msgstr "" +msgstr "Описание" #. module: membership #: field:res.partner,free_member:0 @@ -733,7 +735,7 @@ msgstr "" #. module: membership #: selection:report.membership,month:0 msgid "May" -msgstr "" +msgstr "Май" #. module: membership #: model:product.template,name:membership.membership_1_product_template @@ -743,18 +745,18 @@ msgstr "" #. module: membership #: view:product.product:0 msgid "Sale Taxes" -msgstr "" +msgstr "Налоги с продаж" #. module: membership #: field:report.membership,date_to:0 #: view:res.partner:0 msgid "End Date" -msgstr "" +msgstr "Дата окончания" #. module: membership #: selection:report.membership,month:0 msgid "February" -msgstr "" +msgstr "Февраль" #. module: membership #: model:process.node,name:membership.process_node_invoicedmember0 @@ -764,7 +766,7 @@ msgstr "" #. module: membership #: selection:report.membership,month:0 msgid "April" -msgstr "" +msgstr "Апрель" #. module: membership #: help:res.partner,membership_cancel:0 @@ -785,7 +787,7 @@ msgstr "" #: field:report.membership,date_from:0 #: view:res.partner:0 msgid "Start Date" -msgstr "" +msgstr "Дата начала" #. module: membership #: model:process.node,name:membership.process_node_membershipproduct0 @@ -820,9 +822,6 @@ msgstr "Год" msgid "Revenue Done" msgstr "" -#~ msgid "You can not have 2 pricelist version that overlaps!" -#~ msgstr "Невозможно использовать 2 перекрывающиеся версии каталогов!" - #~ msgid "Currency" #~ msgstr "Валюта" From 866b95a7d021a9dd43c47e3b631098438b88212b Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Tue, 30 Aug 2011 11:57:31 +0200 Subject: [PATCH 37/39] [IMP] board: removed group=no one from the menuitem in customization bzr revid: qdp-launchpad@openerp.com-20110830095731-owg6svsnr5i0abk2 --- addons/board/board_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/board/board_view.xml b/addons/board/board_view.xml index cc97b1243db..22123aca661 100644 --- a/addons/board/board_view.xml +++ b/addons/board/board_view.xml @@ -137,7 +137,7 @@ + id="menu_view_board_form" parent="base.reporting_menu" sequence="1"/> Date: Wed, 31 Aug 2011 04:35:26 +0000 Subject: [PATCH 39/39] Launchpad automatic translations update. bzr revid: launchpad_translations_on_behalf_of_openerp-20110831043526-srexyqjyzm95gfc1 --- addons/account_cancel/i18n/lv.po | 37 +++++++++++ addons/account_coda/i18n/ar.po | 4 +- addons/account_coda/i18n/bg.po | 4 +- addons/account_coda/i18n/ca.po | 94 +++++++++++++++------------- addons/account_coda/i18n/de.po | 26 +------- addons/account_coda/i18n/el.po | 9 +-- addons/account_coda/i18n/es.po | 24 +------ addons/account_coda/i18n/es_EC.po | 24 ++++--- addons/account_coda/i18n/es_PY.po | 4 +- addons/account_coda/i18n/et.po | 4 +- addons/account_coda/i18n/fi.po | 17 ++--- addons/account_coda/i18n/fr.po | 6 +- addons/account_coda/i18n/gl.po | 4 +- addons/account_coda/i18n/hr.po | 4 +- addons/account_coda/i18n/hu.po | 4 +- addons/account_coda/i18n/it.po | 23 ++----- addons/account_coda/i18n/nb.po | 4 +- addons/account_coda/i18n/nl.po | 26 ++------ addons/account_coda/i18n/pl.po | 4 +- addons/account_coda/i18n/pt.po | 4 +- addons/account_coda/i18n/pt_BR.po | 4 +- addons/account_coda/i18n/ro.po | 6 +- addons/account_coda/i18n/ru.po | 62 ++++++++---------- addons/account_coda/i18n/sq.po | 4 +- addons/account_coda/i18n/sr.po | 12 +--- addons/account_coda/i18n/sr@latin.po | 12 +--- addons/account_coda/i18n/sv.po | 17 ++--- addons/account_coda/i18n/tr.po | 68 +++++++++++--------- addons/account_coda/i18n/vi.po | 4 +- addons/account_coda/i18n/zh_CN.po | 75 +++++++++++----------- 30 files changed, 276 insertions(+), 314 deletions(-) create mode 100644 addons/account_cancel/i18n/lv.po diff --git a/addons/account_cancel/i18n/lv.po b/addons/account_cancel/i18n/lv.po new file mode 100644 index 00000000000..aa80fe87d9f --- /dev/null +++ b/addons/account_cancel/i18n/lv.po @@ -0,0 +1,37 @@ +# Latvian translation for openobject-addons +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-01-11 11:14+0000\n" +"PO-Revision-Date: 2011-08-30 20:56+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Latvian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" + +#. module: account_cancel +#: model:ir.module.module,description:account_cancel.module_meta_information +msgid "" +"\n" +" Module adds 'Allow cancelling entries' field on form view of account " +"journal. If set to true it allows user to cancel entries & invoices.\n" +" " +msgstr "" +"\n" +" Modulis pievieno 'Atļaut anulējošus uzskaites žurnāla ierakstus' lauku " +"kontu plāna formas skatā. Ja tā ir aktivēta, tā ļauj lietotājam atcelt " +"ierakstus un rēķinus.\n" +" " + +#. module: account_cancel +#: model:ir.module.module,shortdesc:account_cancel.module_meta_information +msgid "Account Cancel" +msgstr "Atcelt Kontu" diff --git a/addons/account_coda/i18n/ar.po b/addons/account_coda/i18n/ar.po index 80435de6637..3d00aae74a4 100644 --- a/addons/account_coda/i18n/ar.po +++ b/addons/account_coda/i18n/ar.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: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:34+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 diff --git a/addons/account_coda/i18n/bg.po b/addons/account_coda/i18n/bg.po index c824d1d6c2a..472fef091ab 100644 --- a/addons/account_coda/i18n/bg.po +++ b/addons/account_coda/i18n/bg.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: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:34+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 diff --git a/addons/account_coda/i18n/ca.po b/addons/account_coda/i18n/ca.po index 49968d31ab1..388d6481069 100644 --- a/addons/account_coda/i18n/ca.po +++ b/addons/account_coda/i18n/ca.po @@ -14,66 +14,66 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:34+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 #: field:account.coda.import,journal_id:0 msgid "Bank Journal" -msgstr "" +msgstr "Diari bancari" #. module: account_coda #: view:account.coda:0 #: field:account.coda.import,note:0 msgid "Log" -msgstr "" +msgstr "Registre" #. module: account_coda #: model:ir.model,name:account_coda.model_account_coda_import msgid "Account Coda Import" -msgstr "" +msgstr "Importació comptabilitat Coda" #. module: account_coda #: field:account.coda,name:0 msgid "Coda file" -msgstr "" +msgstr "Fitxer Coda" #. module: account_coda #: view:account.coda:0 msgid "Group By..." -msgstr "" +msgstr "Agrupa per..." #. module: account_coda #: field:account.coda.import,awaiting_account:0 msgid "Default Account for Unrecognized Movement" -msgstr "" +msgstr "Compte per defecte per a moviments no reconeguts" #. module: account_coda #: help:account.coda,date:0 msgid "Import Date" -msgstr "" +msgstr "Data de l'importació" #. module: account_coda #: field:account.coda,note:0 msgid "Import log" -msgstr "" +msgstr "Registre de la importació" #. module: account_coda #: view:account.coda.import:0 msgid "Import" -msgstr "" +msgstr "Importa" #. module: account_coda #: view:account.coda:0 msgid "Coda import" -msgstr "" +msgstr "Importa Coda" #. module: account_coda #: code:addons/account_coda/account_coda.py:51 #, python-format msgid "Coda file not found for bank statement !!" -msgstr "" +msgstr "No s'ha trobat el fitxer Coda per a l'extracte bancari!" #. module: account_coda #: help:account.coda.import,awaiting_account:0 @@ -81,12 +81,14 @@ msgid "" "Set here the default account that will be used, if the partner is found but " "does not have the bank account, or if he is domiciled" msgstr "" +"Indiqueu aquí el compte per defecte que s'utilitzarà, si es troba l'empresa " +"però no té el compte bancari, o si està domiciliat." #. module: account_coda #: view:account.coda:0 #: field:account.coda,company_id:0 msgid "Company" -msgstr "" +msgstr "Companyia" #. module: account_coda #: help:account.coda.import,def_payable:0 @@ -94,70 +96,72 @@ msgid "" "Set here the payable account that will be used, by default, if the partner " "is not found" msgstr "" +"Indiqueu aquí el compte a pagar que s'utilitzarà per defecte, si no es troba " +"l'empresa." #. module: account_coda #: view:account.coda:0 msgid "Search Coda" -msgstr "" +msgstr "Cerca Coda" #. module: account_coda #: view:account.coda:0 #: field:account.coda,user_id:0 msgid "User" -msgstr "" +msgstr "Usuari" #. module: account_coda #: view:account.coda:0 #: field:account.coda,date:0 msgid "Date" -msgstr "" +msgstr "Data" #. module: account_coda #: model:ir.ui.menu,name:account_coda.menu_account_coda_statement msgid "Coda Import Logs" -msgstr "" +msgstr "Històric de la importació Coda" #. module: account_coda #: model:ir.model,name:account_coda.model_account_coda msgid "coda for an Account" -msgstr "" +msgstr "Coda per a un compte" #. module: account_coda #: field:account.coda.import,def_payable:0 msgid "Default Payable Account" -msgstr "" +msgstr "Compte a pagar per defecte" #. module: account_coda #: help:account.coda,name:0 msgid "Store the detail of bank statements" -msgstr "" +msgstr "Desa el detall d'extractes bancaris." #. module: account_coda #: view:account.coda.import:0 msgid "Cancel" -msgstr "" +msgstr "Cancel·la" #. module: account_coda #: view:account.coda.import:0 msgid "Open Statements" -msgstr "" +msgstr "Obre extractes" #. module: account_coda #: code:addons/account_coda/wizard/account_coda_import.py:167 #, python-format msgid "The bank account %s is not defined for the partner %s.\n" -msgstr "" +msgstr "El compte bancari %s no està definit per a l'empresa %s.\n" #. module: account_coda #: model:ir.ui.menu,name:account_coda.menu_account_coda_import msgid "Import Coda Statements" -msgstr "" +msgstr "Importa els extractes Coda" #. module: account_coda #: view:account.coda.import:0 #: model:ir.actions.act_window,name:account_coda.action_account_coda_import msgid "Import Coda Statement" -msgstr "" +msgstr "Importa l'extracte Coda" #. module: account_coda #: model:ir.module.module,description:account_coda.module_meta_information @@ -167,26 +171,30 @@ msgid "" " bank statements from coda files.\n" " " msgstr "" +"\n" +" El mòdul proporciona la funcionalitat per importar\n" +" extractes bancaris des de fitxers coda.\n" +" " #. module: account_coda #: view:account.coda:0 msgid "Statements" -msgstr "" +msgstr "Extractes" #. module: account_coda #: field:account.bank.statement,coda_id:0 msgid "Coda" -msgstr "" +msgstr "Coda" #. module: account_coda #: view:account.coda.import:0 msgid "Results :" -msgstr "" +msgstr "Resultats :" #. module: account_coda #: view:account.coda.import:0 msgid "Result of Imported Coda Statements" -msgstr "" +msgstr "Resultat dels extractes Coda importats" #. module: account_coda #: help:account.coda.import,def_receivable:0 @@ -194,66 +202,68 @@ msgid "" "Set here the receivable account that will be used, by default, if the " "partner is not found" msgstr "" +"Indiqueu aquí el compte a cobrar que s'utilitzarà per defecte, si no es " +"troba l'empresa." #. module: account_coda #: field:account.coda.import,coda:0 #: model:ir.actions.act_window,name:account_coda.act_account_payment_account_bank_statement msgid "Coda File" -msgstr "" +msgstr "Fitxer Coda" #. module: account_coda #: model:ir.model,name:account_coda.model_account_bank_statement msgid "Bank Statement" -msgstr "" +msgstr "Extracte bancari" #. module: account_coda #: model:ir.actions.act_window,name:account_coda.action_account_coda msgid "Coda Logs" -msgstr "" +msgstr "Històric Coda" #. module: account_coda #: code:addons/account_coda/wizard/account_coda_import.py:311 #, python-format msgid "Result" -msgstr "" +msgstr "Resultat" #. module: account_coda #: view:account.coda.import:0 msgid "Click on 'New' to select your file :" -msgstr "" +msgstr "Feu clic en 'Nou' per seleccionar el fitxer :" #. module: account_coda #: field:account.coda.import,def_receivable:0 msgid "Default Receivable Account" -msgstr "" +msgstr "Compte a cobrar per defecte" #. module: account_coda #: view:account.coda.import:0 msgid "Close" -msgstr "" +msgstr "Tanca" #. module: account_coda #: field:account.coda,statement_ids:0 msgid "Generated Bank Statements" -msgstr "" +msgstr "Extractes bancaris generats" #. module: account_coda #: model:ir.module.module,shortdesc:account_coda.module_meta_information msgid "Account CODA - import bank statements from coda file" -msgstr "" +msgstr "Comptabilitat CODA - importa extractes bancaris des de fitxer Coda" #. module: account_coda #: view:account.coda.import:0 msgid "Configure Your Journal and Account :" -msgstr "" +msgstr "Configureu el diari i compte :" #. module: account_coda #: view:account.coda:0 msgid "Coda Import" -msgstr "" +msgstr "Importació Coda" #. module: account_coda #: view:account.coda:0 #: field:account.coda,journal_id:0 msgid "Journal" -msgstr "" +msgstr "Diari" diff --git a/addons/account_coda/i18n/de.po b/addons/account_coda/i18n/de.po index f982612e961..b2b8705d2ce 100644 --- a/addons/account_coda/i18n/de.po +++ b/addons/account_coda/i18n/de.po @@ -7,15 +7,15 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-01-11 11:14+0000\n" -"PO-Revision-Date: 2011-01-13 17:16+0000\n" +"PO-Revision-Date: 2011-08-30 17:18+0000\n" "Last-Translator: Thorsten Vocks (OpenBig.org) \n" "Language-Team: German \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 @@ -319,23 +319,3 @@ msgstr "Journal" #~ msgid "Select your bank journal :" #~ msgstr "Wähle Bank Journal :" - -#~ msgid "Error ! You can not create recursive Menu." -#~ msgstr "Fehler ! Sie können kein rekursives Menü erstellen." - -#~ msgid "Rules are not supported for osv_memory objects !" -#~ msgstr "Regeln werden nur unterstützt für osv_memory Objekte !" - -#~ msgid "The certificate ID of the module must be unique !" -#~ msgstr "Die Zertifikat ID des Moduls sollte eindeutig sein !" - -#~ msgid "Rule must have at least one checked access right !" -#~ msgstr "" -#~ "Die Berechtigung für diese Regel sollte mindestens bei einem Benutzer " -#~ "vorhanden sein !" - -#~ msgid "The name of the module must be unique !" -#~ msgstr "Die Modulbezeichnung sollte eindeutig sein !" - -#~ msgid "Size of the field can never be less than 1 !" -#~ msgstr "Die Größe des Feldes sollte niemals kleiner als 1 sein !" diff --git a/addons/account_coda/i18n/el.po b/addons/account_coda/i18n/el.po index efe6f72647c..a894108d323 100644 --- a/addons/account_coda/i18n/el.po +++ b/addons/account_coda/i18n/el.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-01-11 11:14+0000\n" -"PO-Revision-Date: 2010-11-14 08:11+0000\n" +"PO-Revision-Date: 2011-08-30 17:18+0000\n" "Last-Translator: Dimitris Andavoglou \n" "Language-Team: Greek \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 @@ -311,6 +311,3 @@ msgstr "Ημερολόγιο" #~ msgid "Select your bank journal :" #~ msgstr "Επιλέξτε το ημερολόγιο τράπεζά σας :" - -#~ msgid "Error ! You can not create recursive Menu." -#~ msgstr "Λάθος ! Δεν μπορείς να δημιουργήσεις κενό Μενού" diff --git a/addons/account_coda/i18n/es.po b/addons/account_coda/i18n/es.po index 2c157224053..44503d727ad 100644 --- a/addons/account_coda/i18n/es.po +++ b/addons/account_coda/i18n/es.po @@ -8,15 +8,15 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-01-11 11:14+0000\n" -"PO-Revision-Date: 2010-12-26 07:57+0000\n" +"PO-Revision-Date: 2011-08-30 17:18+0000\n" "Last-Translator: Jordi Esteve (www.zikzakmedia.com) " "\n" "Language-Team: Spanish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 @@ -294,21 +294,3 @@ msgstr "Diario" #~ msgid "Select your bank journal :" #~ msgstr "Seleccione su diario bancario :" - -#~ msgid "Error ! You can not create recursive Menu." -#~ msgstr "¡Error! No puede crear menús recursivos." - -#~ msgid "Rules are not supported for osv_memory objects !" -#~ msgstr "¡Las reglas no son soportadas en objetos osv_memory!" - -#~ msgid "The certificate ID of the module must be unique !" -#~ msgstr "¡El ID del certificado del módulo debe ser único!" - -#~ msgid "Rule must have at least one checked access right !" -#~ msgstr "¡La regla debe tener por lo menos un derecho de acceso marcado!" - -#~ msgid "The name of the module must be unique !" -#~ msgstr "¡El nombre del módulo debe ser único!" - -#~ msgid "Size of the field can never be less than 1 !" -#~ msgstr "¡El tamaño del campo nunca puede ser menor que 1!" diff --git a/addons/account_coda/i18n/es_EC.po b/addons/account_coda/i18n/es_EC.po index 6a8208ad7eb..fb7b8932d60 100644 --- a/addons/account_coda/i18n/es_EC.po +++ b/addons/account_coda/i18n/es_EC.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: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 @@ -32,22 +32,22 @@ msgstr "Registro" #. module: account_coda #: model:ir.model,name:account_coda.model_account_coda_import msgid "Account Coda Import" -msgstr "" +msgstr "Contabilidad Importación Coda" #. module: account_coda #: field:account.coda,name:0 msgid "Coda file" -msgstr "" +msgstr "Fichero Coda" #. module: account_coda #: view:account.coda:0 msgid "Group By..." -msgstr "" +msgstr "Agrupar por..." #. module: account_coda #: field:account.coda.import,awaiting_account:0 msgid "Default Account for Unrecognized Movement" -msgstr "" +msgstr "Cuenta por defecto para movimientos no reconocidos" #. module: account_coda #: help:account.coda,date:0 @@ -62,18 +62,18 @@ msgstr "Registro de importación" #. module: account_coda #: view:account.coda.import:0 msgid "Import" -msgstr "" +msgstr "Importar" #. module: account_coda #: view:account.coda:0 msgid "Coda import" -msgstr "" +msgstr "Importar Coda" #. module: account_coda #: code:addons/account_coda/account_coda.py:51 #, python-format msgid "Coda file not found for bank statement !!" -msgstr "" +msgstr "¡No se ha encontrado el archivo Coda para el extracto bancario!" #. module: account_coda #: help:account.coda.import,awaiting_account:0 @@ -81,12 +81,14 @@ msgid "" "Set here the default account that will be used, if the partner is found but " "does not have the bank account, or if he is domiciled" msgstr "" +"Indique aquí la cuenta por defecto que se utilizará, si se encuentra la " +"empresa pero no tiene la cuenta bancaria, o si está domiciliado." #. module: account_coda #: view:account.coda:0 #: field:account.coda,company_id:0 msgid "Company" -msgstr "" +msgstr "Compañía" #. module: account_coda #: help:account.coda.import,def_payable:0 @@ -94,6 +96,8 @@ msgid "" "Set here the payable account that will be used, by default, if the partner " "is not found" msgstr "" +"Indique aquí la cuenta a pagar que se utilizará por defecto, si no se " +"encuentra la empresa." #. module: account_coda #: view:account.coda:0 diff --git a/addons/account_coda/i18n/es_PY.po b/addons/account_coda/i18n/es_PY.po index 914cf2a9b17..be285332016 100644 --- a/addons/account_coda/i18n/es_PY.po +++ b/addons/account_coda/i18n/es_PY.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: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 diff --git a/addons/account_coda/i18n/et.po b/addons/account_coda/i18n/et.po index c9a37fd526a..ef24b65d6a9 100644 --- a/addons/account_coda/i18n/et.po +++ b/addons/account_coda/i18n/et.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: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 diff --git a/addons/account_coda/i18n/fi.po b/addons/account_coda/i18n/fi.po index 8daf08f08c8..80e528a37d3 100644 --- a/addons/account_coda/i18n/fi.po +++ b/addons/account_coda/i18n/fi.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: 2011-06-29 04:43+0000\n" -"X-Generator: Launchpad (build 13168)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 @@ -81,6 +81,8 @@ msgid "" "Set here the default account that will be used, if the partner is found but " "does not have the bank account, or if he is domiciled" msgstr "" +"Aseta tähän tili jota käytetään oletuksena, jos kumppani löytyy mutta " +"pankkitiliä ei ole määriteltynä" #. module: account_coda #: view:account.coda:0 @@ -94,6 +96,7 @@ msgid "" "Set here the payable account that will be used, by default, if the partner " "is not found" msgstr "" +"Aseta tähän maksutili jota käytetään oletuksena, jos kumppania ei löydy" #. module: account_coda #: view:account.coda:0 @@ -146,7 +149,7 @@ msgstr "Avaa tiliotteet" #: code:addons/account_coda/wizard/account_coda_import.py:167 #, python-format msgid "The bank account %s is not defined for the partner %s.\n" -msgstr "" +msgstr "Pankkitiliä %s ei ole määritelty kumppanille %s.\n" #. module: account_coda #: model:ir.ui.menu,name:account_coda.menu_account_coda_import @@ -242,20 +245,20 @@ msgstr "Luodut tiliotteet" #. module: account_coda #: model:ir.module.module,shortdesc:account_coda.module_meta_information msgid "Account CODA - import bank statements from coda file" -msgstr "" +msgstr "CODA tili - tuo pankkitiliotteet coda tiedostosta" #. module: account_coda #: view:account.coda.import:0 msgid "Configure Your Journal and Account :" -msgstr "" +msgstr "Konfiguroi päiväkirja ja tili :" #. module: account_coda #: view:account.coda:0 msgid "Coda Import" -msgstr "" +msgstr "Coda tuonti" #. module: account_coda #: view:account.coda:0 #: field:account.coda,journal_id:0 msgid "Journal" -msgstr "" +msgstr "Päiväkirja" diff --git a/addons/account_coda/i18n/fr.po b/addons/account_coda/i18n/fr.po index 95d35961980..8be25154f8a 100644 --- a/addons/account_coda/i18n/fr.po +++ b/addons/account_coda/i18n/fr.po @@ -9,13 +9,13 @@ msgstr "" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-01-11 11:14+0000\n" "PO-Revision-Date: 2010-12-31 10:33+0000\n" -"Last-Translator: lolivier \n" +"Last-Translator: lholivier \n" "Language-Team: French \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 diff --git a/addons/account_coda/i18n/gl.po b/addons/account_coda/i18n/gl.po index 2afe72f294c..fe23a07d356 100644 --- a/addons/account_coda/i18n/gl.po +++ b/addons/account_coda/i18n/gl.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: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 diff --git a/addons/account_coda/i18n/hr.po b/addons/account_coda/i18n/hr.po index 76944f9dd50..4499aaf9c6d 100644 --- a/addons/account_coda/i18n/hr.po +++ b/addons/account_coda/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: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 diff --git a/addons/account_coda/i18n/hu.po b/addons/account_coda/i18n/hu.po index 7e3bbaf9957..84373ec7eb2 100644 --- a/addons/account_coda/i18n/hu.po +++ b/addons/account_coda/i18n/hu.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: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 diff --git a/addons/account_coda/i18n/it.po b/addons/account_coda/i18n/it.po index ab6a2cf668e..2ff1f5c3ceb 100644 --- a/addons/account_coda/i18n/it.po +++ b/addons/account_coda/i18n/it.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-01-11 11:14+0000\n" -"PO-Revision-Date: 2011-01-13 08:19+0000\n" -"Last-Translator: Nicola Riolini - Micronaet \n" +"PO-Revision-Date: 2011-08-30 17:18+0000\n" +"Last-Translator: OpenERP Administrators \n" "Language-Team: Italian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 @@ -303,18 +303,3 @@ msgstr "" #~ msgid "Coda Statements" #~ msgstr "Dichiarazione CODA" - -#~ msgid "The certificate ID of the module must be unique !" -#~ msgstr "L'ID certificato del modulo deve essere unico!" - -#~ msgid "Error ! You can not create recursive Menu." -#~ msgstr "Errore! Non è possibile creare un menù ricorsivo." - -#~ msgid "Rules are not supported for osv_memory objects !" -#~ msgstr "Le regole non sono supportate per gli oggetti: osv_memory!" - -#~ msgid "Rule must have at least one checked access right !" -#~ msgstr "La regola deve avere almeno un diritto di accesso spuntato!" - -#~ msgid "The name of the module must be unique !" -#~ msgstr "Il nome del modulo deve essere unico!" diff --git a/addons/account_coda/i18n/nb.po b/addons/account_coda/i18n/nb.po index 4efcfb97fd3..91cf99f6def 100644 --- a/addons/account_coda/i18n/nb.po +++ b/addons/account_coda/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: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 diff --git a/addons/account_coda/i18n/nl.po b/addons/account_coda/i18n/nl.po index b940ab8d5a5..f3cdecb1f7c 100644 --- a/addons/account_coda/i18n/nl.po +++ b/addons/account_coda/i18n/nl.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-01-11 11:14+0000\n" -"PO-Revision-Date: 2011-01-13 06:02+0000\n" -"Last-Translator: Douwe Wullink (Dypalio) \n" +"PO-Revision-Date: 2011-08-30 17:18+0000\n" +"Last-Translator: OpenERP Administrators \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: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 @@ -317,21 +317,3 @@ msgstr "Dagboek" #~ msgid "Select your bank journal :" #~ msgstr "Selecteer bank dagboek :" - -#~ msgid "Error ! You can not create recursive Menu." -#~ msgstr "Fout ! U kan geen herhalend Menu maken" - -#~ msgid "Rules are not supported for osv_memory objects !" -#~ msgstr "Regels worden niet ondersteund bij osv_memory objecten !" - -#~ msgid "The certificate ID of the module must be unique !" -#~ msgstr "Het kwaliteitscertificaat id van de module moet uniek zijn !" - -#~ msgid "Rule must have at least one checked access right !" -#~ msgstr "Regel moet tenminste één toegangsrecht aangevinkt hebben !" - -#~ msgid "The name of the module must be unique !" -#~ msgstr "De modulenaam moet uniek zijn !" - -#~ msgid "Size of the field can never be less than 1 !" -#~ msgstr "De veldlengte kan nooit kleiner dan 1 zijn !" diff --git a/addons/account_coda/i18n/pl.po b/addons/account_coda/i18n/pl.po index e396859057d..c3df86b904f 100644 --- a/addons/account_coda/i18n/pl.po +++ b/addons/account_coda/i18n/pl.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: 2011-08-26 04:33+0000\n" -"X-Generator: Launchpad (build 13779)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 diff --git a/addons/account_coda/i18n/pt.po b/addons/account_coda/i18n/pt.po index f70d84abe7c..49d63c7e0e4 100644 --- a/addons/account_coda/i18n/pt.po +++ b/addons/account_coda/i18n/pt.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: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 diff --git a/addons/account_coda/i18n/pt_BR.po b/addons/account_coda/i18n/pt_BR.po index 747470302d8..49e38ac2598 100644 --- a/addons/account_coda/i18n/pt_BR.po +++ b/addons/account_coda/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: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 diff --git a/addons/account_coda/i18n/ro.po b/addons/account_coda/i18n/ro.po index 9a13a2d27cd..8d36a4febec 100644 --- a/addons/account_coda/i18n/ro.po +++ b/addons/account_coda/i18n/ro.po @@ -9,13 +9,13 @@ msgstr "" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-01-11 11:14+0000\n" "PO-Revision-Date: 2011-01-20 20:13+0000\n" -"Last-Translator: Mihai Boiciuc \n" +"Last-Translator: Mihai Satmarean \n" "Language-Team: Romanian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 diff --git a/addons/account_coda/i18n/ru.po b/addons/account_coda/i18n/ru.po index 837231db165..0bf17b9e0f4 100644 --- a/addons/account_coda/i18n/ru.po +++ b/addons/account_coda/i18n/ru.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-01-11 11:14+0000\n" -"PO-Revision-Date: 2010-11-29 07:47+0000\n" +"PO-Revision-Date: 2011-08-30 17:18+0000\n" "Last-Translator: OpenERP Administrators \n" "Language-Team: Russian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 @@ -37,7 +37,7 @@ msgstr "" #. module: account_coda #: field:account.coda,name:0 msgid "Coda file" -msgstr "" +msgstr "Coda файл" #. module: account_coda #: view:account.coda:0 @@ -67,13 +67,13 @@ msgstr "Импорт" #. module: account_coda #: view:account.coda:0 msgid "Coda import" -msgstr "" +msgstr "Импорт coda" #. module: account_coda #: code:addons/account_coda/account_coda.py:51 #, python-format msgid "Coda file not found for bank statement !!" -msgstr "" +msgstr "Не найден coda файл для банковской выписки!" #. module: account_coda #: help:account.coda.import,awaiting_account:0 @@ -81,6 +81,8 @@ msgid "" "Set here the default account that will be used, if the partner is found but " "does not have the bank account, or if he is domiciled" msgstr "" +"Установите счет, который будет использоваться, если у партнера не имеется " +"банковского счета или он домицилирован" #. module: account_coda #: view:account.coda:0 @@ -94,11 +96,13 @@ msgid "" "Set here the payable account that will be used, by default, if the partner " "is not found" msgstr "" +"Установите расчетный счет для использования по-умолчанию, если партнер не " +"найден." #. module: account_coda #: view:account.coda:0 msgid "Search Coda" -msgstr "" +msgstr "Искать Coda файл" #. module: account_coda #: view:account.coda:0 @@ -115,22 +119,22 @@ msgstr "Дата" #. module: account_coda #: model:ir.ui.menu,name:account_coda.menu_account_coda_statement msgid "Coda Import Logs" -msgstr "" +msgstr "Журналы импорта Coda" #. module: account_coda #: model:ir.model,name:account_coda.model_account_coda msgid "coda for an Account" -msgstr "" +msgstr "coda для счета" #. module: account_coda #: field:account.coda.import,def_payable:0 msgid "Default Payable Account" -msgstr "" +msgstr "Расчетный счет по-умолчанию" #. module: account_coda #: help:account.coda,name:0 msgid "Store the detail of bank statements" -msgstr "" +msgstr "Сохранить детали банковской выписки" #. module: account_coda #: view:account.coda.import:0 @@ -146,18 +150,18 @@ msgstr "" #: code:addons/account_coda/wizard/account_coda_import.py:167 #, python-format msgid "The bank account %s is not defined for the partner %s.\n" -msgstr "" +msgstr "Банковский счет %s не установлен для контрагента %s.\n" #. module: account_coda #: model:ir.ui.menu,name:account_coda.menu_account_coda_import msgid "Import Coda Statements" -msgstr "" +msgstr "Импортировать Coda выписки" #. module: account_coda #: view:account.coda.import:0 #: model:ir.actions.act_window,name:account_coda.action_account_coda_import msgid "Import Coda Statement" -msgstr "" +msgstr "Импортировать Coda выписку" #. module: account_coda #: model:ir.module.module,description:account_coda.module_meta_information @@ -167,6 +171,10 @@ msgid "" " bank statements from coda files.\n" " " msgstr "" +"\n" +" Модуль предоставляет функции импорта\n" +" банковских выписок из Coda файлов.\n" +" " #. module: account_coda #: view:account.coda:0 @@ -186,7 +194,7 @@ msgstr "Результаты:" #. module: account_coda #: view:account.coda.import:0 msgid "Result of Imported Coda Statements" -msgstr "" +msgstr "Результат импортированных из Coda выписок" #. module: account_coda #: help:account.coda.import,def_receivable:0 @@ -199,7 +207,7 @@ msgstr "" #: field:account.coda.import,coda:0 #: model:ir.actions.act_window,name:account_coda.act_account_payment_account_bank_statement msgid "Coda File" -msgstr "" +msgstr "Coda файл" #. module: account_coda #: model:ir.model,name:account_coda.model_account_bank_statement @@ -245,12 +253,12 @@ msgstr "" #. module: account_coda #: view:account.coda.import:0 msgid "Configure Your Journal and Account :" -msgstr "" +msgstr "Настройте журнал и счет:" #. module: account_coda #: view:account.coda:0 msgid "Coda Import" -msgstr "" +msgstr "Импорт Coda файла" #. module: account_coda #: view:account.coda:0 @@ -275,21 +283,3 @@ msgstr "Журнал" #~ msgid "_Ok" #~ msgstr "_Далее" - -#~ msgid "Error ! You can not create recursive Menu." -#~ msgstr "Ошибка ! Нельзя создать зацикленные меню." - -#~ msgid "The certificate ID of the module must be unique !" -#~ msgstr "Идентификатор сертификата модуля должен быть уникальным !" - -#~ msgid "Rules are not supported for osv_memory objects !" -#~ msgstr "Правила не поддерживаются в объектах osv_memory !" - -#~ msgid "Rule must have at least one checked access right !" -#~ msgstr "Правило должно иметь хотя бы одно проверенное право доступа !" - -#~ msgid "The name of the module must be unique !" -#~ msgstr "Название модуля должно быть уникальным !" - -#~ msgid "Size of the field can never be less than 1 !" -#~ msgstr "Размер поля никогда не может быть меньше 1 !" diff --git a/addons/account_coda/i18n/sq.po b/addons/account_coda/i18n/sq.po index f4372f095e6..a189db35de0 100644 --- a/addons/account_coda/i18n/sq.po +++ b/addons/account_coda/i18n/sq.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: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:34+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 diff --git a/addons/account_coda/i18n/sr.po b/addons/account_coda/i18n/sr.po index 8e6038f5a69..f4e35c979eb 100644 --- a/addons/account_coda/i18n/sr.po +++ b/addons/account_coda/i18n/sr.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-01-11 11:14+0000\n" -"PO-Revision-Date: 2010-11-14 08:09+0000\n" +"PO-Revision-Date: 2011-08-30 17:18+0000\n" "Last-Translator: OpenERP Administrators \n" "Language-Team: Serbian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 @@ -313,9 +313,3 @@ msgstr "Dnevnik" #~ msgid "Select your bank journal :" #~ msgstr "Izaberi svoj bancin dnevnik" - -#~ msgid "Error ! You can not create recursive Menu." -#~ msgstr "Greska ! Ne mozes kreirati rekursivni meni." - -#~ msgid "Rules are not supported for osv_memory objects !" -#~ msgstr "Pravila nisu podrzana od strane osv_memory objekta !" diff --git a/addons/account_coda/i18n/sr@latin.po b/addons/account_coda/i18n/sr@latin.po index 9a7601d4e26..1e39edd38e5 100644 --- a/addons/account_coda/i18n/sr@latin.po +++ b/addons/account_coda/i18n/sr@latin.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-01-11 11:14+0000\n" -"PO-Revision-Date: 2010-12-23 15:47+0000\n" +"PO-Revision-Date: 2011-08-30 17:18+0000\n" "Last-Translator: OpenERP Administrators \n" "Language-Team: Serbian latin \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 @@ -272,15 +272,9 @@ msgstr "Dnevnik" #~ msgid "Invalid model name in the action definition." #~ msgstr "Pogrešno ime modela u definiciji akcije." -#~ msgid "Error ! You can not create recursive Menu." -#~ msgstr "Greska ! Ne mozes kreirati rekursivni meni." - #~ msgid "Invalid XML for View Architecture!" #~ msgstr "Nevažeći XML za pregled arhitekture" -#~ msgid "Rules are not supported for osv_memory objects !" -#~ msgstr "Pravila nisu podrzana od strane osv_memory objekta !" - #~ msgid "Clic on 'New' to select your file :" #~ msgstr "Klikni na 'Novi' da izaberes svoj fajl" diff --git a/addons/account_coda/i18n/sv.po b/addons/account_coda/i18n/sv.po index 317835039c5..0af73b8376d 100644 --- a/addons/account_coda/i18n/sv.po +++ b/addons/account_coda/i18n/sv.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-01-11 11:14+0000\n" -"PO-Revision-Date: 2011-01-26 07:01+0000\n" -"Last-Translator: Magnus Brandt (mba), Aspirix AB \n" +"PO-Revision-Date: 2011-08-30 17:18+0000\n" +"Last-Translator: OpenERP Administrators \n" "Language-Team: Swedish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 @@ -266,14 +266,5 @@ msgstr "" #~ msgid "Invalid model name in the action definition." #~ msgstr "Ogiltigt modellnamn i åtgärdsdefinitionen." -#~ msgid "Error ! You can not create recursive Menu." -#~ msgstr "Fel! Ni kan inte skapa recursiva menyer" - -#~ msgid "The certificate ID of the module must be unique !" -#~ msgstr "Certifikat ID för modulen måste vara unik!" - #~ msgid "Invalid XML for View Architecture!" #~ msgstr "Ogiltig XML för Vy-arkitektur!" - -#~ msgid "The name of the module must be unique !" -#~ msgstr "Namnet på modulen måste vara unikt!" diff --git a/addons/account_coda/i18n/tr.po b/addons/account_coda/i18n/tr.po index 26be8e7e3a1..d1d4b326165 100644 --- a/addons/account_coda/i18n/tr.po +++ b/addons/account_coda/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: 2011-05-16 04:39+0000\n" -"X-Generator: Launchpad (build 12959)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 @@ -81,6 +81,8 @@ msgid "" "Set here the default account that will be used, if the partner is found but " "does not have the bank account, or if he is domiciled" msgstr "" +"Eğer bir paydaş var ama banka hesabı yok ise ya da ikametgahlı ise burada " +"kullanılacak varsayılan hesabı ayarlayın" #. module: account_coda #: view:account.coda:0 @@ -94,6 +96,8 @@ msgid "" "Set here the payable account that will be used, by default, if the partner " "is not found" msgstr "" +"Eğer bir paydaş yok ise burada kullanılacak varsayılan alıcı hesabını " +"ayarlayın" #. module: account_coda #: view:account.coda:0 @@ -104,60 +108,60 @@ msgstr "Coda Araştır" #: view:account.coda:0 #: field:account.coda,user_id:0 msgid "User" -msgstr "" +msgstr "Kullanıcı" #. module: account_coda #: view:account.coda:0 #: field:account.coda,date:0 msgid "Date" -msgstr "" +msgstr "Tarih" #. module: account_coda #: model:ir.ui.menu,name:account_coda.menu_account_coda_statement msgid "Coda Import Logs" -msgstr "" +msgstr "Coda içeaktarım günlüğü" #. module: account_coda #: model:ir.model,name:account_coda.model_account_coda msgid "coda for an Account" -msgstr "" +msgstr "Bir hesap için Coda" #. module: account_coda #: field:account.coda.import,def_payable:0 msgid "Default Payable Account" -msgstr "" +msgstr "Varsayılan Satıcılar Hesabı" #. module: account_coda #: help:account.coda,name:0 msgid "Store the detail of bank statements" -msgstr "" +msgstr "Banka ekstreleri ayrıntılarını saklayın" #. module: account_coda #: view:account.coda.import:0 msgid "Cancel" -msgstr "" +msgstr "Vazgeç" #. module: account_coda #: view:account.coda.import:0 msgid "Open Statements" -msgstr "" +msgstr "Ekstreleri Aç" #. module: account_coda #: code:addons/account_coda/wizard/account_coda_import.py:167 #, python-format msgid "The bank account %s is not defined for the partner %s.\n" -msgstr "" +msgstr "%s Paydaşı için %s banka hesabı tanımlanmamıştır.\n" #. module: account_coda #: model:ir.ui.menu,name:account_coda.menu_account_coda_import msgid "Import Coda Statements" -msgstr "" +msgstr "Coda Ekstrelerini İçeaktar" #. module: account_coda #: view:account.coda.import:0 #: model:ir.actions.act_window,name:account_coda.action_account_coda_import msgid "Import Coda Statement" -msgstr "" +msgstr "Coda Ekstresini İçeaktar" #. module: account_coda #: model:ir.module.module,description:account_coda.module_meta_information @@ -167,26 +171,30 @@ msgid "" " bank statements from coda files.\n" " " msgstr "" +"\n" +" Modül banka ekstrelerinin coda\n" +" dosyalarından içeaktarımını sağlar.\n" +" " #. module: account_coda #: view:account.coda:0 msgid "Statements" -msgstr "" +msgstr "Ekstreler" #. module: account_coda #: field:account.bank.statement,coda_id:0 msgid "Coda" -msgstr "" +msgstr "Coda" #. module: account_coda #: view:account.coda.import:0 msgid "Results :" -msgstr "" +msgstr "Sonuçlar :" #. module: account_coda #: view:account.coda.import:0 msgid "Result of Imported Coda Statements" -msgstr "" +msgstr "İçeaktarılmış Coda Ekstreleri Sonucu" #. module: account_coda #: help:account.coda.import,def_receivable:0 @@ -194,66 +202,68 @@ msgid "" "Set here the receivable account that will be used, by default, if the " "partner is not found" msgstr "" +"Eğer bir paydaş yoksa, burada kullanılacak varsayılan alıcılar hesabını " +"ayarlayın" #. module: account_coda #: field:account.coda.import,coda:0 #: model:ir.actions.act_window,name:account_coda.act_account_payment_account_bank_statement msgid "Coda File" -msgstr "" +msgstr "Coda Dosyası" #. module: account_coda #: model:ir.model,name:account_coda.model_account_bank_statement msgid "Bank Statement" -msgstr "" +msgstr "Banka Ekstresi" #. module: account_coda #: model:ir.actions.act_window,name:account_coda.action_account_coda msgid "Coda Logs" -msgstr "" +msgstr "Coda Günlükleri" #. module: account_coda #: code:addons/account_coda/wizard/account_coda_import.py:311 #, python-format msgid "Result" -msgstr "" +msgstr "Sonuç" #. module: account_coda #: view:account.coda.import:0 msgid "Click on 'New' to select your file :" -msgstr "" +msgstr "Dosyanızı seçmek için 'Yeni' ye tıklayın :" #. module: account_coda #: field:account.coda.import,def_receivable:0 msgid "Default Receivable Account" -msgstr "" +msgstr "Varsayılan Alıcı Hesabı" #. module: account_coda #: view:account.coda.import:0 msgid "Close" -msgstr "" +msgstr "Kapat" #. module: account_coda #: field:account.coda,statement_ids:0 msgid "Generated Bank Statements" -msgstr "" +msgstr "Oluşturulan Banka Ekstreleri" #. module: account_coda #: model:ir.module.module,shortdesc:account_coda.module_meta_information msgid "Account CODA - import bank statements from coda file" -msgstr "" +msgstr "CODA Hesabı - coda dosyalarından banka ekstrelerini içe aktar" #. module: account_coda #: view:account.coda.import:0 msgid "Configure Your Journal and Account :" -msgstr "" +msgstr "Yevmiye ve Hesaplarınızı Yapılandırın" #. module: account_coda #: view:account.coda:0 msgid "Coda Import" -msgstr "" +msgstr "Coda İçeaktar" #. module: account_coda #: view:account.coda:0 #: field:account.coda,journal_id:0 msgid "Journal" -msgstr "" +msgstr "Yevmiye" diff --git a/addons/account_coda/i18n/vi.po b/addons/account_coda/i18n/vi.po index c81c4dd2dfd..7576d47f715 100644 --- a/addons/account_coda/i18n/vi.po +++ b/addons/account_coda/i18n/vi.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: 2011-06-06 04:37+0000\n" -"X-Generator: Launchpad (build 12959)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 diff --git a/addons/account_coda/i18n/zh_CN.po b/addons/account_coda/i18n/zh_CN.po index 87cf5b0f5d7..18f5dc457f7 100644 --- a/addons/account_coda/i18n/zh_CN.po +++ b/addons/account_coda/i18n/zh_CN.po @@ -14,14 +14,14 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-04-29 05:42+0000\n" -"X-Generator: Launchpad (build 12758)\n" +"X-Launchpad-Export-Date: 2011-08-31 04:35+0000\n" +"X-Generator: Launchpad (build 13815)\n" #. module: account_coda #: help:account.coda,journal_id:0 #: field:account.coda.import,journal_id:0 msgid "Bank Journal" -msgstr "银行记录集合" +msgstr "银行日记账" #. module: account_coda #: view:account.coda:0 @@ -32,12 +32,12 @@ msgstr "日志" #. module: account_coda #: model:ir.model,name:account_coda.model_account_coda_import msgid "Account Coda Import" -msgstr "" +msgstr "结帐科目录入" #. module: account_coda #: field:account.coda,name:0 msgid "Coda file" -msgstr "Coda 文件" +msgstr "归档结帐" #. module: account_coda #: view:account.coda:0 @@ -47,7 +47,7 @@ msgstr "分组..." #. module: account_coda #: field:account.coda.import,awaiting_account:0 msgid "Default Account for Unrecognized Movement" -msgstr "" +msgstr "默认科目无法识别的记帐" #. module: account_coda #: help:account.coda,date:0 @@ -67,38 +67,38 @@ msgstr "导入" #. module: account_coda #: view:account.coda:0 msgid "Coda import" -msgstr "Coda 导入" +msgstr "结帐录入" #. module: account_coda #: code:addons/account_coda/account_coda.py:51 #, python-format msgid "Coda file not found for bank statement !!" -msgstr "" +msgstr "结账文件未找到银行对帐单" #. module: account_coda #: help:account.coda.import,awaiting_account:0 msgid "" "Set here the default account that will be used, if the partner is found but " "does not have the bank account, or if he is domiciled" -msgstr "" +msgstr "针对没有银行帐号或指定支付地点的业务伙伴,这里设置要使用的默认银行帐号。" #. module: account_coda #: view:account.coda:0 #: field:account.coda,company_id:0 msgid "Company" -msgstr "" +msgstr "公司" #. module: account_coda #: help:account.coda.import,def_payable:0 msgid "" "Set here the payable account that will be used, by default, if the partner " "is not found" -msgstr "" +msgstr "如果没有找到合作伙伴,那么在这里设置默认支付帐户." #. module: account_coda #: view:account.coda:0 msgid "Search Coda" -msgstr "" +msgstr "结账搜索" #. module: account_coda #: view:account.coda:0 @@ -110,17 +110,17 @@ msgstr "用户" #: view:account.coda:0 #: field:account.coda,date:0 msgid "Date" -msgstr "" +msgstr "日期" #. module: account_coda #: model:ir.ui.menu,name:account_coda.menu_account_coda_statement msgid "Coda Import Logs" -msgstr "" +msgstr "导入结账日志" #. module: account_coda #: model:ir.model,name:account_coda.model_account_coda msgid "coda for an Account" -msgstr "帐号的CODA" +msgstr "科目结账" #. module: account_coda #: field:account.coda.import,def_payable:0 @@ -130,34 +130,34 @@ msgstr "默认应付帐款科目" #. module: account_coda #: help:account.coda,name:0 msgid "Store the detail of bank statements" -msgstr "" +msgstr "银行对账单的详细" #. module: account_coda #: view:account.coda.import:0 msgid "Cancel" -msgstr "" +msgstr "取消" #. module: account_coda #: view:account.coda.import:0 msgid "Open Statements" -msgstr "" +msgstr "打开报表" #. module: account_coda #: code:addons/account_coda/wizard/account_coda_import.py:167 #, python-format msgid "The bank account %s is not defined for the partner %s.\n" -msgstr "" +msgstr "银行帐户%s没有定义合作伙伴%s\n" #. module: account_coda #: model:ir.ui.menu,name:account_coda.menu_account_coda_import msgid "Import Coda Statements" -msgstr "导入CODA" +msgstr "导入结账" #. module: account_coda #: view:account.coda.import:0 #: model:ir.actions.act_window,name:account_coda.action_account_coda_import msgid "Import Coda Statement" -msgstr "导入CODA" +msgstr "导入结账报表" #. module: account_coda #: model:ir.module.module,description:account_coda.module_meta_information @@ -167,11 +167,14 @@ msgid "" " bank statements from coda files.\n" " " msgstr "" +"\n" +" 模块提供了导入结账报表功能\n" +" " #. module: account_coda #: view:account.coda:0 msgid "Statements" -msgstr "" +msgstr "报表" #. module: account_coda #: field:account.bank.statement,coda_id:0 @@ -186,77 +189,77 @@ msgstr "结果:" #. module: account_coda #: view:account.coda.import:0 msgid "Result of Imported Coda Statements" -msgstr "" +msgstr "导入结账报表" #. module: account_coda #: help:account.coda.import,def_receivable:0 msgid "" "Set here the receivable account that will be used, by default, if the " "partner is not found" -msgstr "" +msgstr "如果没找到业务伙伴,在这里设置应收账款科目" #. module: account_coda #: field:account.coda.import,coda:0 #: model:ir.actions.act_window,name:account_coda.act_account_payment_account_bank_statement msgid "Coda File" -msgstr "CODA文件" +msgstr "结账文件" #. module: account_coda #: model:ir.model,name:account_coda.model_account_bank_statement msgid "Bank Statement" -msgstr "" +msgstr "银行对账单" #. module: account_coda #: model:ir.actions.act_window,name:account_coda.action_account_coda msgid "Coda Logs" -msgstr "" +msgstr "结账日志" #. module: account_coda #: code:addons/account_coda/wizard/account_coda_import.py:311 #, python-format msgid "Result" -msgstr "" +msgstr "结果" #. module: account_coda #: view:account.coda.import:0 msgid "Click on 'New' to select your file :" -msgstr "" +msgstr "点击“新建”,选择您的文件" #. module: account_coda #: field:account.coda.import,def_receivable:0 msgid "Default Receivable Account" -msgstr "" +msgstr "默认的应收账款" #. module: account_coda #: view:account.coda.import:0 msgid "Close" -msgstr "" +msgstr "关闭" #. module: account_coda #: field:account.coda,statement_ids:0 msgid "Generated Bank Statements" -msgstr "" +msgstr "生成银行对账单" #. module: account_coda #: model:ir.module.module,shortdesc:account_coda.module_meta_information msgid "Account CODA - import bank statements from coda file" -msgstr "" +msgstr "科目结账 - 导入结账的银行对账单" #. module: account_coda #: view:account.coda.import:0 msgid "Configure Your Journal and Account :" -msgstr "" +msgstr "设置你的账簿和科目" #. module: account_coda #: view:account.coda:0 msgid "Coda Import" -msgstr "" +msgstr "导入结账" #. module: account_coda #: view:account.coda:0 #: field:account.coda,journal_id:0 msgid "Journal" -msgstr "" +msgstr "账簿" #~ msgid "Clic on 'New' to select your file :" #~ msgstr "点击\"新\"去选择你的文件:"