[MERGE] branch merged with lp:openobject-addons

bzr revid: mtr@tinyerp.com-20111007093347-cz3zsb98xz2xw51y
This commit is contained in:
Meera Trambadia (OpenERP) 2011-10-07 15:03:47 +05:30
commit 11b29eedd0
483 changed files with 10535 additions and 7439 deletions

View File

@ -23,7 +23,7 @@ import account
import installer
import project
import partner
import invoice
import account_invoice
import account_bank_statement
import account_bank
import account_cash_statement
@ -32,7 +32,7 @@ import account_analytic_line
import wizard
import report
import product
import sequence
import ir_sequence
import company
import res_currency

View File

@ -22,7 +22,7 @@
"name" : "Accounting and Financial Management",
"version" : "1.1",
"author" : "OpenERP SA",
"category": 'Finance',
"category": 'Accounting & Finance',
'complexity': "normal",
"description": """
Accounting and Financial Management.
@ -103,8 +103,7 @@ module named account_voucher.
'account_end_fy.xml',
'account_invoice_view.xml',
'partner_view.xml',
'data/account_invoice.xml',
'data/account_data2.xml',
'data/account_data.xml',
'account_invoice_workflow.xml',
'project/project_view.xml',
'project/project_report.xml',
@ -119,7 +118,7 @@ module named account_voucher.
'process/statement_process.xml',
'process/customer_invoice_process.xml',
'process/supplier_invoice_process.xml',
'sequence_view.xml',
'ir_sequence_view.xml',
'company_view.xml',
'board_account_view.xml',
"wizard/account_report_profit_loss_view.xml",

View File

@ -346,6 +346,52 @@ class account_account(osv.osv):
res[account.id] = level
return res
def _set_credit_debit(self, cr, uid, account_id, name, value, arg, context=None):
if context.get('config_invisible', True):
return True
account = self.browse(cr, uid, account_id, context=context)
diff = value - getattr(account,name)
if not diff:
return True
journal_obj = self.pool.get('account.journal')
jids = journal_obj.search(cr, uid, [('type','=','situation'),('centralisation','=',1),('company_id','=',account.company_id.id)], context=context)
if not jids:
raise osv.except_osv(_('Error!'),_("You need an Opening journal with centralisation checked to set the initial balance!"))
period_obj = self.pool.get('account.period')
pids = period_obj.search(cr, uid, [('special','=',True),('company_id','=',account.company_id.id)], context=context)
if not pids:
raise osv.except_osv(_('Error!'),_("No opening/closing period defined, please create one to set the initial balance!"))
move_obj = self.pool.get('account.move.line')
move_id = move_obj.search(cr, uid, [
('journal_id','=',jids[0]),
('period_id','=',pids[0]),
('account_id','=', account_id),
(name,'>', 0.0),
('name','=', _('Opening Balance'))
], context=context)
if move_id:
move = move_obj.browse(cr, uid, move_id[0], context=context)
move_obj.write(cr, uid, move_id[0], {
name: diff+getattr(move,name)
}, context=context)
else:
if diff<0.0:
raise osv.except_osv(_('Error!'),_("Unable to adapt the initial balance (negative value)!"))
nameinv = (name=='credit' and 'debit') or 'credit'
move_id = move_obj.create(cr, uid, {
'name': _('Opening Balance'),
'account_id': account_id,
'journal_id': jids[0],
'period_id': pids[0],
name: diff,
nameinv: 0.0
}, context=context)
return True
_columns = {
'name': fields.char('Name', size=128, required=True, select=True),
'currency_id': fields.many2one('res.currency', 'Secondary Currency', help="Forces all moves for this account to have this secondary currency."),
@ -370,9 +416,9 @@ class account_account(osv.osv):
'child_consol_ids': fields.many2many('account.account', 'account_account_consol_rel', 'child_id', 'parent_id', 'Consolidated Children'),
'child_id': fields.function(_get_child_ids, type='many2many', relation="account.account", string="Child Accounts"),
'balance': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Balance', multi='balance'),
'credit': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Credit', multi='balance'),
'debit': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Debit', multi='balance'),
'reconcile': fields.boolean('Reconcile', help="Check this if the user is allowed to reconcile entries in this account."),
'credit': fields.function(__compute, fnct_inv=_set_credit_debit, digits_compute=dp.get_precision('Account'), string='Credit', multi='balance'),
'debit': fields.function(__compute, fnct_inv=_set_credit_debit, digits_compute=dp.get_precision('Account'), string='Debit', multi='balance'),
'reconcile': fields.boolean('Allow Reconciliation', help="Check this box if this account allows reconciliation of journal items."),
'shortcut': fields.char('Shortcut', size=12),
'tax_ids': fields.many2many('account.tax', 'account_account_tax_default_rel',
'account_id', 'tax_id', 'Default Taxes'),
@ -672,32 +718,22 @@ class account_journal(osv.osv):
return super(account_journal, self).write(cr, uid, ids, vals, context=context)
def create_sequence(self, cr, uid, vals, context=None):
""" Create new no_gap entry sequence for every new Joural
"""
Create new entry sequence for every new Joural
"""
seq_pool = self.pool.get('ir.sequence')
seq_typ_pool = self.pool.get('ir.sequence.type')
name = vals['name']
code = vals['code'].lower()
types = {
'name': name,
'code': code
}
seq_typ_pool.create(cr, uid, types)
# in account.journal code is actually the prefix of the sequence
# whereas ir.sequence code is a key to lookup global sequences.
prefix = vals['code'].upper()
seq = {
'name': name,
'code': code,
'active': True,
'prefix': code + "/%(year)s/",
'name': vals['name'],
'implementation':'no_gap',
'prefix': prefix + "/%(year)s/",
'padding': 4,
'number_increment': 1
}
if 'company_id' in vals:
seq['company_id'] = vals['company_id']
return seq_pool.create(cr, uid, seq)
return self.pool.get('ir.sequence').create(cr, uid, seq)
def create(self, cr, uid, vals, context=None):
if not 'sequence_id' in vals or not vals['sequence_id']:
@ -722,8 +758,6 @@ 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
@ -932,17 +966,10 @@ 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?
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)
ids = self.search(cr, uid, [('date_start','<=',dt),('date_stop','>=',dt)])
if not ids:
raise osv.except_osv(_('Error !'), _('No period defined for this date: %s !\nPlease create one.')%dt)
return ids
@ -1223,7 +1250,7 @@ class account_move(osv.osv):
else:
if journal.sequence_id:
c = {'fiscalyear_id': move.period_id.fiscalyear_id.id}
new_name = obj_sequence.get_id(cr, uid, journal.sequence_id.id, context=c)
new_name = obj_sequence.next_by_id(cr, uid, journal.sequence_id.id, c)
else:
raise osv.except_osv(_('Error'), _('No sequence defined on the journal !'))
@ -1265,7 +1292,7 @@ class account_move(osv.osv):
context = {}
c = context.copy()
c['novalidate'] = True
result = super(osv.osv, self).write(cr, uid, ids, vals, c)
result = super(account_move, self).write(cr, uid, ids, vals, c)
self.validate(cr, uid, ids, context=context)
return result
@ -2739,7 +2766,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
_columns = {
'company_id':fields.many2one('res.company', 'Company', required=True),
'chart_template_id': fields.many2one('account.chart.template', 'Chart Template', required=True),
'bank_accounts_id': fields.one2many('account.bank.accounts.wizard', 'bank_account_id', 'Bank Accounts', required=True),
'bank_accounts_id': fields.one2many('account.bank.accounts.wizard', 'bank_account_id', 'Cash and Banks', required=True),
'code_digits':fields.integer('# of Digits', required=True, help="No. of Digits to use for account code"),
'seq_journal':fields.boolean('Separated Journal Sequences', help="Check this box if you want to use a different sequence for each created journal. Otherwise, all will use the same sequence."),
"sale_tax": fields.many2one("account.tax.template", "Default Sale Tax"),
@ -2787,7 +2814,6 @@ class wizard_multi_charts_accounts(osv.osv_memory):
def _get_default_accounts(self, cr, uid, context=None):
return [
{'acc_name': _('Bank Account'),'account_type':'bank'},
{'acc_name': _('Cash'),'account_type':'cash'}
]

View File

@ -340,9 +340,9 @@ class account_bank_statement(osv.osv):
else:
if st.journal_id.sequence_id:
c = {'fiscalyear_id': st.period_id.fiscalyear_id.id}
st_number = obj_seq.get_id(cr, uid, st.journal_id.sequence_id.id, context=c)
st_number = obj_seq.next_by_id(cr, uid, st.journal_id.sequence_id.id, context=c)
else:
st_number = obj_seq.get(cr, uid, 'account.bank.statement')
st_number = obj_seq.next_by_code(cr, uid, 'account.bank.statement')
for line in st.move_line_ids:
if line.state <> 'valid':

View File

@ -13,7 +13,7 @@
<field name="inherit_id" ref="base.view_partner_bank_form"/>
<field name="arch" type="xml">
<group name="bank" position="after">
<group name="accounting" col="2" colspan="2" attrs="{'invisible': [('company_id','=', False)]}">
<group name="accounting" col="2" colspan="2" attrs="{'invisible': [('company_id','=', False)]}" groups="base.group_extended">
<separator string="Accounting Information" colspan="2"/>
<field name="journal_id"/>
</group>
@ -23,16 +23,16 @@
<record id="action_bank_tree" model="ir.actions.act_window">
<field name="name">Bank Accounts</field>
<field name="name">Setup your Bank Accounts</field>
<field name="res_model">res.partner.bank</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context" eval="{'default_partner_id':ref('base.main_partner'), 'company_hide':False, 'default_company_id':ref('base.main_company'), 'search_default_my_bank':1}"/>
<field name="help">Configure your company's bank account and select those that must appear on the report footer. You can drag &amp; drop bank in the list view to reorder bank accounts. If you use the accounting application of OpenERP, journals and accounts will be created automatically based on these data.</field>
<field name="help">Configure your company's bank account and select those that must appear on the report footer. You can reorder banks in the list view. If you use the accounting application of OpenERP, journals and accounts will be created automatically based on these data.</field>
</record>
<menuitem
sequence="0"
parent="account.account_account_menu"
parent="account.account_account_menu"
id="menu_action_bank_tree"
action="action_bank_tree"/>

View File

@ -294,9 +294,9 @@ class account_cash_statement(osv.osv):
if statement.name and statement.name == '/':
if statement.journal_id.sequence_id:
c = {'fiscalyear_id': statement.period_id.fiscalyear_id.id}
st_number = obj_seq.get_id(cr, uid, statement.journal_id.sequence_id.id, context=c)
st_number = obj_seq.next_by_id(cr, uid, statement.journal_id.sequence_id.id, context=c)
else:
st_number = obj_seq.get(cr, uid, 'account.cash.statement')
st_number = obj_seq.next_by_code(cr, uid, 'account.cash.statement')
vals.update({
'name': st_number
})

View File

@ -11,7 +11,7 @@
<attribute name="string">Accounting Application Configuration</attribute>
</form>
<separator string="title" position="attributes">
<attribute name="string">Configure Your Accounting Chart</attribute>
<attribute name="string">Configure Your Chart of Accounts</attribute>
</separator>
<xpath expr="//label[@string='description']" position="attributes">
<attribute name="string">The default Chart of Accounts is matching your country selection. If no certified Chart of Accounts exists for your specified country, a generic one can be installed and will be selected by default.</attribute>
@ -26,7 +26,7 @@
<group colspan="8" position="inside">
<group colspan="4" width="600">
<field name="charts"/>
<group colspan="4" groups="base.group_extended">
<group colspan="4" groups="account.group_account_user">
<separator col="4" colspan="4" string="Configure Fiscal Year"/>
<field name="company_id" colspan="4" widget="selection"/><!-- we assume that this wizard will be run only by administrators and as this field may cause problem if hidden (because of the default company of the user removed from the selection because already configured), we simply choosed to remove the group "multi company" of it -->
<field name="date_start" on_change="on_change_start_date(date_start)"/>
@ -43,28 +43,8 @@
</field>
</record>
<record id="view_account_modules_installer" model="ir.ui.view">
<field name="name">account.installer.modules.form</field>
<field name="model">base.setup.installer</field>
<field name="type">form</field>
<field name="inherit_id" ref="base_setup.view_base_setup_installer"/>
<field name="arch" type="xml">
<data>
<xpath expr="//group[@name='account_accountant']" position="replace">
<newline/>
<separator string="Accounting &amp; Finance Features" colspan="4"/>
<field name="account_followup"/>
<field name="account_payment"/>
<field name="account_analytic_plans"/>
<field name="account_anglo_saxon"/>
<field name="account_asset"/>
</xpath>
</data>
</field>
</record>
<record id="action_account_configuration_installer" model="ir.actions.act_window">
<field name="name">Accounting Chart Configuration</field>
<field name="name">Install your Chart of Accounts</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.installer</field>
<field name="view_id" ref="view_account_configuration_installer"/>
@ -85,25 +65,13 @@
<field name="type">automatic</field>
</record>
<record id="action_bank_account_configuration_installer" model="ir.actions.act_window">
<field name="name">Define your Bank Account</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.partner.bank</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
</record>
<record id="bank_account_configuration_todo" model="ir.actions.todo">
<field name="action_id" ref="action_bank_account_configuration_installer" />
<field name="category_id" ref="category_accounting_configuration" />
</record>
<record id="action_view_financial_accounts_installer" model="ir.actions.act_window">
<field name="name">Review your Financial Accounts</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.account</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'config_invisible': False}</field>
</record>
<record id="view_financial_accounts_todo" model="ir.actions.todo">
@ -113,11 +81,12 @@
</record>
<record id="action_review_financial_journals_installer" model="ir.actions.act_window">
<field name="name">Review your Financial Journal</field>
<field name="name">Review your Financial Journals</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.journal</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="help">Setup your accounting journals. For bank accounts, it's better to use the 'Setup Your Bank Accounts' tool that will automatically create the accounts and journals for you.</field>
</record>
<record id="review_financial_journals_todo" model="ir.actions.todo">
@ -131,6 +100,7 @@
<field name="res_model">account.payment.term</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="help">Payment terms define the conditions to pay a customer or supplier invoice in one or several payments. Customers periodic reminders will use the payment terms for each letter. Each customer or supplier can be assigned to one of these payment terms.</field>
</record>
<record id="review_payment_terms_todo" model="ir.actions.todo">

View File

@ -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', readonly=True, states={'draft':[('readonly',False)]}, select=True, help="Keep empty to use the current date"),
'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_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."),

View File

@ -234,7 +234,6 @@
<field name="payment_ids" colspan="4" nolabel="1" >
<tree string="Payments">
<field name="date" string="Payment Date"/>
<field name="move_id"/>
<field name="ref"/>
<field name="name" groups="base.group_extended"/>
<field name="journal_id"/>
@ -333,7 +332,6 @@
<field name="payment_ids" colspan="4" nolabel="1">
<tree string="Payments">
<field name="date"/>
<field name="move_id"/>
<field name="ref"/>
<field name="name"/>
<field name="journal_id" groups="base.group_user"/>

View File

@ -23,8 +23,10 @@ import time
from datetime import datetime
from operator import itemgetter
from lxml import etree
import netsvc
from osv import fields, osv
from osv import fields, osv, orm
from tools.translate import _
import decimal_precision as dp
import tools
@ -718,7 +720,7 @@ class account_move_line(osv.osv):
)
return cr.fetchone()
def reconcile_partial(self, cr, uid, ids, type='auto', context=None):
def reconcile_partial(self, cr, uid, ids, type='auto', context=None, writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False):
move_rec_obj = self.pool.get('account.move.reconcile')
merges = []
unmerge = []
@ -747,7 +749,7 @@ class account_move_line(osv.osv):
unmerge.append(line.id)
total += (line.debit or 0.0) - (line.credit or 0.0)
if self.pool.get('res.currency').is_zero(cr, uid, company_currency_id, total):
res = self.reconcile(cr, uid, merges+unmerge, context=context)
res = self.reconcile(cr, uid, merges+unmerge, context=context, writeoff_acc_id=writeoff_acc_id, writeoff_period_id=writeoff_period_id, writeoff_journal_id=writeoff_journal_id)
return res
r_id = move_rec_obj.create(cr, uid, {
'type': type,
@ -812,7 +814,7 @@ class account_move_line(osv.osv):
if (not currency_obj.is_zero(cr, uid, account.company_id.currency_id, writeoff)) or \
(account.currency_id and (not currency_obj.is_zero(cr, uid, account.currency_id, currency))):
if not writeoff_acc_id:
raise osv.except_osv(_('Warning'), _('You have to provide an account for the write off entry !'))
raise osv.except_osv(_('Warning'), _('You have to provide an account for the write off/exchange difference entry !'))
if writeoff > 0:
debit = writeoff
credit = 0.0
@ -970,7 +972,6 @@ class account_move_line(osv.osv):
fields = {}
flds = []
title = _("Accounting Entries") #self.view_header_get(cr, uid, view_id, view_type, context)
xml = '''<?xml version="1.0"?>\n<tree string="%s" editable="top" refresh="5" on_write="on_create_write" colors="red:state==\'draft\';black:state==\'valid\'">\n\t''' % (title)
ids = journal_pool.search(cr, uid, [])
journals = journal_pool.browse(cr, uid, ids, context=context)
@ -982,14 +983,14 @@ class account_move_line(osv.osv):
for field in journal.view_id.columns_id:
if not field.field in fields:
fields[field.field] = [journal.id]
fld.append((field.field, field.sequence, field.name))
fld.append((field.field, field.sequence))
flds.append(field.field)
common_fields[field.field] = 1
else:
fields.get(field.field).append(journal.id)
common_fields[field.field] = common_fields[field.field] + 1
fld.append(('period_id', 3, _('Period')))
fld.append(('journal_id', 10, _('Journal')))
fld.append(('period_id', 3))
fld.append(('journal_id', 10))
flds.append('period_id')
flds.append('journal_id')
fields['period_id'] = all_journal
@ -1001,62 +1002,71 @@ class account_move_line(osv.osv):
'tax_code_id': 50,
'move_id': 40,
}
for field_it in fld:
field = field_it[0]
document = etree.Element('tree', string=title, editable="top",
refresh="5", on_write="on_create_write",
colors="red:state=='draft';black:state=='valid'")
fields_get = self.fields_get(cr, uid, flds, context)
for field, _seq in fld:
if common_fields.get(field) == total:
fields.get(field).append(None)
# if field=='state':
# state = 'colors="red:state==\'draft\'"'
attrs = []
# if field=='state':
# state = 'colors="red:state==\'draft\'"'
f = etree.SubElement(document, 'field', name=field)
if field == 'debit':
attrs.append('sum = "%s"' % _("Total debit"))
f.set('sum', _("Total debit"))
elif field == 'credit':
attrs.append('sum = "%s"' % _("Total credit"))
f.set('sum', _("Total credit"))
elif field == 'move_id':
attrs.append('required = "False"')
f.set('required', 'False')
elif field == 'account_tax_id':
attrs.append('domain="[(\'parent_id\', \'=\' ,False)]"')
attrs.append("context=\"{'journal_id': journal_id}\"")
f.set('domain', "[('parent_id', '=' ,False)]")
f.set('context', "{'journal_id': journal_id}")
elif field == 'account_id' and journal.id:
attrs.append('domain="[(\'journal_id\', \'=\', journal_id),(\'type\',\'&lt;&gt;\',\'view\'), (\'type\',\'&lt;&gt;\',\'closed\')]" on_change="onchange_account_id(account_id, partner_id)"')
f.set('domain', "[('journal_id', '=', journal_id),('type','!=','view'), ('type','!=','closed')]")
f.set('on_change', 'onchange_account_id(account_id, partner_id)')
elif field == 'partner_id':
attrs.append('on_change="onchange_partner_id(move_id, partner_id, account_id, debit, credit, date, journal_id)"')
f.set('on_change', 'onchange_partner_id(move_id, partner_id, account_id, debit, credit, date, journal_id)')
elif field == 'journal_id':
attrs.append("context=\"{'journal_id': journal_id}\"")
f.set('context', "{'journal_id': journal_id}")
elif field == 'statement_id':
attrs.append("domain=\"[('state', '!=', 'confirm'),('journal_id.type', '=', 'bank')]\"")
f.set('domain', "[('state', '!=', 'confirm'),('journal_id.type', '=', 'bank')]")
elif field == 'date':
attrs.append('on_change="onchange_date(date)"')
f.set('on_change', 'onchange_date(date)')
elif field == 'analytic_account_id':
attrs.append('''groups="analytic.group_analytic_accounting"''') # Currently it is not working due to framework problem may be ..
# Currently it is not working due to being executed by superclass's fields_view_get
# f.set('groups', 'analytic.group_analytic_accounting')
pass
if field in ('amount_currency', 'currency_id'):
attrs.append('on_change="onchange_currency(account_id, amount_currency, currency_id, date, journal_id)"')
attrs.append('''attrs="{'readonly': [('state', '=', 'valid')]}"''')
f.set('on_change', 'onchange_currency(account_id, amount_currency, currency_id, date, journal_id)')
f.set('attrs', "{'readonly': [('state', '=', 'valid')]}")
if field in widths:
attrs.append('width="'+str(widths[field])+'"')
f.set('width', str(widths[field]))
if field in ('journal_id',):
attrs.append("invisible=\"context.get('journal_id', False)\"")
f.set("invisible", "context.get('journal_id', False)")
elif field in ('period_id',):
attrs.append("invisible=\"context.get('period_id', False)\"")
f.set("invisible", "context.get('period_id', False)")
else:
attrs.append("invisible=\"context.get('visible_id') not in %s\"" % (fields.get(field)))
xml += '''<field name="%s" %s/>\n''' % (field,' '.join(attrs))
f.set('invisible', "context.get('visible_id') not in %s" % (fields.get(field)))
xml += '''</tree>'''
result['arch'] = xml
result['fields'] = self.fields_get(cr, uid, flds, context)
orm.setup_modifiers(f, fields_get[field], context=context,
in_tree_view=True)
result['arch'] = etree.tostring(document, pretty_print=True)
result['fields'] = fields_get
return result
def _check_moves(self, cr, uid, context=None):
@ -1221,7 +1231,7 @@ class account_move_line(osv.osv):
vals['move_id'] = res[0]
if not vals.get('move_id', False):
if journal.sequence_id:
#name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id)
#name = self.pool.get('ir.sequence').next_by_id(cr, uid, journal.sequence_id.id)
v = {
'date': vals.get('date', time.strftime('%Y-%m-%d')),
'period_id': context['period_id'],
@ -1249,7 +1259,7 @@ class account_move_line(osv.osv):
break
# Automatically convert in the account's secondary currency if there is one and
# the provided values were not already multi-currency
if account.currency_id and 'amount_currency' not in vals and account.currency_id.id != account.company_id.currency_id.id:
if account.currency_id and not vals.get('ammount_currency') and account.currency_id.id != account.company_id.currency_id.id:
vals['currency_id'] = account.currency_id.id
ctx = {}
if 'date' in vals:
@ -1273,7 +1283,7 @@ class account_move_line(osv.osv):
'user_id': uid
})]
result = super(osv.osv, self).create(cr, uid, vals, context=context)
result = super(account_move_line, self).create(cr, uid, vals, context=context)
# CREATE Taxes
if vals.get('account_tax_id', False):
tax_id = tax_obj.browse(cr, uid, vals['account_tax_id'])

View File

@ -162,17 +162,21 @@
<field name="arch" type="xml">
<form string="Account">
<group col="6" colspan="4">
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<newline/>
<field name="parent_id"/>
<field name="type" select="1"/>
<field name="user_type" select="1"/>
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<newline/>
<field name="parent_id"/>
<field name="type" select="1"/>
<field name="user_type" select="1"/>
<field name="active" groups="base.group_extended" />
<newline/>
<field name="debit" invisible="context.get('config_invisible', True)"/>
<field name="credit" invisible="context.get('config_invisible', True)"/>
<field name="balance" invisible="context.get('config_invisible', True)"/>
</group>
<notebook colspan="4">
<page string="General Information">
<field name="active" groups="base.group_extended" />
<newline/>
<group col="2" colspan="2">
<separator string="Currency" colspan="2"/>
@ -209,7 +213,6 @@
<field name="code"/>
<field name="name"/>
<field name="user_type"/>
<field name="type"/>
</group>
<newline/>
<group expand="0" string="Group By...">
@ -438,9 +441,9 @@
<field name="user_id" groups="base.group_extended"/>
<field name="currency"/>
</group>
<group colspan="2" col="2">
<group colspan="2" col="2" groups="base.group_extended">
<separator string="Validations" colspan="4"/>
<field name="allow_date" groups="base.group_extended"/>
<field name="allow_date"/>
</group>
<group colspan="2" col="2">
<separator string="Other Configuration" colspan="4"/>
@ -1193,7 +1196,7 @@
<field name="date"/>
<field name="account_id"/>
<field name="partner_id">
<filter help="Next Partner Entries to reconcile" name="next_partner" string="Next Partner to reconcile" context="{'next_partner_only': 1}" icon="terp-gtk-jump-to-ltr" domain="[('account_id.reconcile','=',True),('reconcile_id','=',False)]"/>
<filter help="Next Partner Entries to reconcile" name="next_partner" context="{'next_partner_only': 1}" icon="terp-gtk-jump-to-ltr" domain="[('account_id.reconcile','=',True),('reconcile_id','=',False)]"/>
</field>
</group>
<newline/>
@ -2375,8 +2378,7 @@
<attribute name="string">Accounting Application Configuration</attribute>
</form>
<separator string="title" position="attributes">
<attribute name="string"
>Generate Your Accounting Chart from a Chart Template</attribute>
<attribute name="string">Generate Your Chart of Accounts from a Chart Template</attribute>
</separator>
<xpath expr="//label[@string='description']" position="attributes">
<attribute name="string">This will automatically configure your chart of accounts, bank accounts, taxes and journals according to the selected template</attribute>
@ -2388,13 +2390,13 @@
</xpath>
<group string="res_config_contents" position="replace">
<field name="company_id" widget="selection"/> <!-- we assume that this wizard will be run only by administrators and as this field may cause problem if hidden (because of the default company of the user removed from the selection because already configured), we simply choosed to remove the group "multi company" of it -->
<field name ="code_digits" groups="base.group_extended"/>
<field name ="code_digits" groups="account.group_account_user"/>
<field name="chart_template_id" widget="selection" on_change="onchange_chart_template_id(chart_template_id)"/>
<field name ="seq_journal" groups="base.group_extended"/>
<field name ="seq_journal" groups="account.group_account_user"/>
<field name="sale_tax" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('sale','all'))]"/>
<field name="purchase_tax" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('purchase', 'all'))]"/>
<newline/> <!-- extended view because the web UI is not good for one2many -->
<field colspan="4" mode="tree" name="bank_accounts_id" nolabel="1" widget="one2many_list" groups="base.group_extended">
<field colspan="4" mode="tree" name="bank_accounts_id" nolabel="1" widget="one2many_list" groups="account.group_account_user">
<form string="Bank Information">
<field name="acc_name"/>
<field name="account_type"/>

View File

@ -32,7 +32,7 @@ class res_company(osv.osv):
string="Reserve and Profit/Loss Account",
view_load=True,
domain="[('type', '=', 'other')]",
help="This Account is used for transferring Profit/Loss(If It is Profit: Amount will be added, Loss : Amount will be deducted.), Which is calculated from Profit & Loss Report"),
help="This account is used for transferring Profit/Loss (If It is Profit: Amount will be added, Loss : Amount will be deducted.), as calculated in Profit & Loss Report"),
}
_defaults = {

View File

@ -21,26 +21,26 @@
<field name="close_method">none</field>
</record>
<record model="account.account.type" id="account_type_income_view1">
<field name="name">Income View</field>
<field name="code">view</field>
<field name="report_type">income</field>
</record>
<record model="account.account.type" id="account_type_expense_view1">
<field name="name">Expense View</field>
<field name="code">expense</field>
<field name="report_type">expense</field>
</record>
<record model="account.account.type" id="account_type_asset_view1">
<field name="name">Asset View</field>
<field name="code">asset</field>
<field name="report_type">asset</field>
</record>
<record model="account.account.type" id="account_type_liability_view1">
<field name="name">Liability View</field>
<field name="code">liability</field>
<field name="report_type">liability</field>
</record>
<record model="account.account.type" id="account_type_income_view1">
<field name="name">Income View</field>
<field name="code">view</field>
<field name="report_type">income</field>
</record>
<record model="account.account.type" id="account_type_expense_view1">
<field name="name">Expense View</field>
<field name="code">expense</field>
<field name="report_type">expense</field>
</record>
<record model="account.account.type" id="account_type_asset_view1">
<field name="name">Asset View</field>
<field name="code">asset</field>
<field name="report_type">asset</field>
</record>
<record model="account.account.type" id="account_type_liability_view1">
<field name="name">Liability View</field>
<field name="code">liability</field>
<field name="report_type">liability</field>
</record>
<record model="account.account.type" id="conf_account_type_income">
<field name="name">Income</field>
@ -87,7 +87,7 @@
<record model="account.account.type" id="conf_account_type_equity">
<field name="name">Equity</field>
<field name="code">equity</field>
<field name="report_type">asset</field>
<field name="report_type">liability</field>
<field name="close_method">balance</field>
</record>
@ -106,16 +106,16 @@
<!-- Account Templates-->
<record id="conf_chart0" model="account.account.template">
<field name="code">0</field>
<field name="name">Configurable Account Chart</field>
<field eval="0" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="conf_account_type_view"/>
</record>
<!-- Account Templates-->
<record id="conf_chart0" model="account.account.template">
<field name="code">0</field>
<field name="name">Configurable Account Chart</field>
<field eval="0" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="conf_account_type_view"/>
</record>
<!-- Balance Sheet -->
<!-- Balance Sheet -->
<record id="conf_bal" model="account.account.template">
<field name="code">1</field>
@ -125,120 +125,120 @@
<field name="user_type" ref="conf_account_type_view"/>
</record>
<record id="conf_fas" model="account.account.template">
<field name="code">10</field>
<field name="name">Fixed Assets</field>
<field ref="conf_bal" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_asset_view1"/>
</record>
<record id="conf_fas" model="account.account.template">
<field name="code">10</field>
<field name="name">Fixed Assets</field>
<field ref="conf_bal" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_asset_view1"/>
</record>
<record id="conf_xfa" model="account.account.template">
<field name="code">100</field>
<field name="name">Fixed Asset Account</field>
<field ref="conf_fas" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_asset_view1"/>
</record>
<record id="conf_xfa" model="account.account.template">
<field name="code">100</field>
<field name="name">Fixed Asset Account</field>
<field ref="conf_fas" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="account_type_asset_view1"/>
</record>
<record id="conf_nca" model="account.account.template">
<field name="code">11</field>
<field name="name">Net Current Assets</field>
<field ref="conf_bal" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_asset_view1"/>
</record>
<record id="conf_nca" model="account.account.template">
<field name="code">11</field>
<field name="name">Net Current Assets</field>
<field ref="conf_bal" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_asset_view1"/>
</record>
<record id="conf_cas" model="account.account.template">
<field name="code">110</field>
<field name="name">Current Assets</field>
<field ref="conf_nca" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_asset_view1"/>
</record>
<record id="conf_cas" model="account.account.template">
<field name="code">110</field>
<field name="name">Current Assets</field>
<field ref="conf_nca" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_asset_view1"/>
</record>
<record id="conf_stk" model="account.account.template">
<field name="code">1101</field>
<field name="name">Purchased Stocks</field>
<field ref="conf_cas" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_asset"/>
</record>
<record id="conf_stk" model="account.account.template">
<field name="code">1101</field>
<field name="name">Purchased Stocks</field>
<field ref="conf_cas" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_asset"/>
</record>
<record id="conf_a_recv" model="account.account.template">
<field name="code">1102</field>
<field name="name">Debtors</field>
<field ref="conf_cas" name="parent_id"/>
<field name="type">receivable</field>
<field eval="True" name="reconcile"/>
<field name="user_type" ref="conf_account_type_asset"/>
</record>
<record id="conf_a_recv" model="account.account.template">
<field name="code">1102</field>
<field name="name">Debtors</field>
<field ref="conf_cas" name="parent_id"/>
<field name="type">receivable</field>
<field eval="True" name="reconcile"/>
<field name="user_type" ref="conf_account_type_asset"/>
</record>
<record id="conf_ova" model="account.account.template">
<field name="code">1103</field>
<field name="name">Tax Paid</field>
<field ref="conf_cas" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_asset"/>
</record>
<record id="conf_ova" model="account.account.template">
<field name="code">1103</field>
<field name="name">Tax Paid</field>
<field ref="conf_cas" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_asset"/>
</record>
<record id="conf_bnk" model="account.account.template">
<field name="code">1104</field>
<field name="name">Bank Current Account</field>
<field ref="conf_cas" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_asset_view1"/>
</record>
<record id="conf_bnk" model="account.account.template">
<field name="code">1104</field>
<field name="name">Bank Current Account</field>
<field ref="conf_cas" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_asset_view1"/>
</record>
<record id="conf_o_income" model="account.account.template">
<field name="code">1106</field>
<field name="name">Opening Income Account</field>
<field ref="conf_cas" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_income"/>
</record>
<record id="conf_o_income" model="account.account.template">
<field name="code">1106</field>
<field name="name">Opening Income Account</field>
<field ref="conf_cas" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_income"/>
</record>
<record id="conf_cli" model="account.account.template">
<field name="code">111</field>
<field name="name">Current Liabilities</field>
<field ref="conf_nca" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_liability_view1"/>
</record>
<record id="conf_cli" model="account.account.template">
<field name="code">111</field>
<field name="name">Current Liabilities</field>
<field ref="conf_nca" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_liability_view1"/>
</record>
<record id="conf_a_pay" model="account.account.template">
<field name="code">1111</field>
<field name="name">Creditors</field>
<field ref="conf_cli" name="parent_id"/>
<field name="type">payable</field>
<field eval="True" name="reconcile"/>
<field name="user_type" ref="conf_account_type_liability"/>
</record>
<record id="conf_a_pay" model="account.account.template">
<field name="code">1111</field>
<field name="name">Creditors</field>
<field ref="conf_cli" name="parent_id"/>
<field name="type">payable</field>
<field eval="True" name="reconcile"/>
<field name="user_type" ref="conf_account_type_liability"/>
</record>
<record id="conf_iva" model="account.account.template">
<field name="code">1112</field>
<field name="name">Tax Received</field>
<field ref="conf_cli" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_liability"/>
</record>
<record id="conf_iva" model="account.account.template">
<field name="code">1112</field>
<field name="name">Tax Received</field>
<field ref="conf_cli" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_liability"/>
</record>
<record id="conf_a_reserve_and_surplus" model="account.account.template">
<field name="code">1113</field>
<field name="name">Reserve and Profit/Loss Account</field>
<field ref="conf_cli" name="parent_id"/>
<field name="type">other</field>
<field eval="True" name="reconcile"/>
<field name="user_type" ref="conf_account_type_liability"/>
</record>
<record id="conf_a_reserve_and_surplus" model="account.account.template">
<field name="code">1113</field>
<field name="name">Reserve and Profit/Loss Account</field>
<field ref="conf_cli" name="parent_id"/>
<field name="type">other</field>
<field eval="True" name="reconcile"/>
<field name="user_type" ref="conf_account_type_liability"/>
</record>
<record id="conf_o_expense" model="account.account.template">
<field name="code">1114</field>
<field name="name">Opening Expense Account</field>
<field ref="conf_cli" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_expense"/>
</record>
<record id="conf_o_expense" model="account.account.template">
<field name="code">1114</field>
<field name="name">Opening Expense Account</field>
<field ref="conf_cli" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_expense"/>
</record>
<!-- Profit and Loss -->
@ -250,53 +250,53 @@
<field name="user_type" ref="conf_account_type_view"/>
</record>
<record id="conf_rev" model="account.account.template">
<field name="code">20</field>
<field name="name">Revenue</field>
<field ref="conf_gpf" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_income_view1"/>
</record>
<record id="conf_rev" model="account.account.template">
<field name="code">20</field>
<field name="name">Revenue</field>
<field ref="conf_gpf" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_income_view1"/>
</record>
<record id="conf_a_sale" model="account.account.template">
<field name="code">200</field>
<field name="name">Product Sales</field>
<field ref="conf_rev" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_income"/>
</record>
<record id="conf_a_sale" model="account.account.template">
<field name="code">200</field>
<field name="name">Product Sales</field>
<field ref="conf_rev" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_income"/>
</record>
<record id="conf_cos" model="account.account.template">
<field name="code">21</field>
<field name="name">Cost of Sales</field>
<field ref="conf_gpf" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_income_view1"/>
</record>
<record id="conf_cos" model="account.account.template">
<field name="code">21</field>
<field name="name">Cost of Sales</field>
<field ref="conf_gpf" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_income_view1"/>
</record>
<record id="conf_cog" model="account.account.template">
<field name="code">210</field>
<field name="name">Cost of Goods Sold</field>
<field ref="conf_cos" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_expense"/>
</record>
<record id="conf_cog" model="account.account.template">
<field name="code">210</field>
<field name="name">Cost of Goods Sold</field>
<field ref="conf_cos" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_expense"/>
</record>
<record id="conf_ovr" model="account.account.template">
<field name="code">22</field>
<field name="name">Overheads</field>
<field ref="conf_gpf" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_expense_view1"/>
</record>
<record id="conf_ovr" model="account.account.template">
<field name="code">22</field>
<field name="name">Overheads</field>
<field ref="conf_gpf" name="parent_id"/>
<field name="type">view</field>
<field name="user_type" ref="account_type_expense_view1"/>
</record>
<record id="conf_a_expense" model="account.account.template">
<field name="code">220</field>
<field name="name">Expenses</field>
<field ref="conf_ovr" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_expense"/>
</record>
<record id="conf_a_expense" model="account.account.template">
<field name="code">220</field>
<field name="name">Expenses</field>
<field ref="conf_ovr" name="parent_id"/>
<field name="type">other</field>
<field name="user_type" ref="conf_account_type_expense"/>
</record>
<record id="conf_a_salary_expense" model="account.account.template">
<field name="code">221</field>
@ -315,126 +315,126 @@
<field name="name">Plan Fees </field>
</record>
<record id="tax_code_balance_net" model="account.tax.code.template">
<field name="name">Tax Balance to Pay</field>
<field name="parent_id" ref="tax_code_chart_root"/>
</record>
<record id="tax_code_balance_net" model="account.tax.code.template">
<field name="name">Tax Balance to Pay</field>
<field name="parent_id" ref="tax_code_chart_root"/>
</record>
<!-- Input TAX -->
<record id="tax_code_input" model="account.tax.code.template">
<field name="name">Tax Received</field>
<field name="parent_id" ref="tax_code_balance_net"/>
<field eval="-1" name="sign"/>
</record>
<!-- Input TAX -->
<record id="tax_code_input" model="account.tax.code.template">
<field name="name">Tax Received</field>
<field name="parent_id" ref="tax_code_balance_net"/>
<field eval="-1" name="sign"/>
</record>
<record id="tax_code_input_S" model="account.tax.code.template">
<field name="name">Tax Received Rate S (15%)</field>
<field name="parent_id" ref="tax_code_input"/>
</record>
<record id="tax_code_input_S" model="account.tax.code.template">
<field name="name">Tax Received Rate S (15%)</field>
<field name="parent_id" ref="tax_code_input"/>
</record>
<record id="tax_code_input_R" model="account.tax.code.template">
<field name="name">Tax Received Rate R (5%)</field>
<field name="parent_id" ref="tax_code_input"/>
</record>
<record id="tax_code_input_R" model="account.tax.code.template">
<field name="name">Tax Received Rate R (5%)</field>
<field name="parent_id" ref="tax_code_input"/>
</record>
<record id="tax_code_input_X" model="account.tax.code.template">
<field name="name">Tax Received Rate X (Exempt)</field>
<field name="parent_id" ref="tax_code_input"/>
</record>
<record id="tax_code_input_X" model="account.tax.code.template">
<field name="name">Tax Received Rate X (Exempt)</field>
<field name="parent_id" ref="tax_code_input"/>
</record>
<record id="tax_code_input_O" model="account.tax.code.template">
<field name="name">Tax Received Rate O (Out of scope)</field>
<field name="parent_id" ref="tax_code_input"/>
</record>
<record id="tax_code_input_O" model="account.tax.code.template">
<field name="name">Tax Received Rate O (Out of scope)</field>
<field name="parent_id" ref="tax_code_input"/>
</record>
<!-- Output TAX -->
<!-- Output TAX -->
<record id="tax_code_output" model="account.tax.code.template">
<field name="name">Tax Paid</field>
<field name="parent_id" ref="tax_code_balance_net"/>
</record>
<record id="tax_code_output" model="account.tax.code.template">
<field name="name">Tax Paid</field>
<field name="parent_id" ref="tax_code_balance_net"/>
</record>
<record id="tax_code_output_S" model="account.tax.code.template">
<field name="name">Tax Paid Rate S (15%)</field>
<field name="parent_id" ref="tax_code_output"/>
</record>
<record id="tax_code_output_S" model="account.tax.code.template">
<field name="name">Tax Paid Rate S (15%)</field>
<field name="parent_id" ref="tax_code_output"/>
</record>
<record id="tax_code_output_R" model="account.tax.code.template">
<field name="name">Tax Paid Rate R (5%)</field>
<field name="parent_id" ref="tax_code_output"/>
</record>
<record id="tax_code_output_R" model="account.tax.code.template">
<field name="name">Tax Paid Rate R (5%)</field>
<field name="parent_id" ref="tax_code_output"/>
</record>
<record id="tax_code_output_X" model="account.tax.code.template">
<field name="name">Tax Paid Rate X (Exempt)</field>
<field name="parent_id" ref="tax_code_output"/>
</record>
<record id="tax_code_output_X" model="account.tax.code.template">
<field name="name">Tax Paid Rate X (Exempt)</field>
<field name="parent_id" ref="tax_code_output"/>
</record>
<record id="tax_code_output_O" model="account.tax.code.template">
<field name="name">Tax Paid Rate O (Out of scope)</field>
<field name="parent_id" ref="tax_code_output"/>
</record>
<record id="tax_code_output_O" model="account.tax.code.template">
<field name="name">Tax Paid Rate O (Out of scope)</field>
<field name="parent_id" ref="tax_code_output"/>
</record>
<!-- Invoiced Base of TAX -->
<!-- Invoiced Base of TAX -->
<!-- Purchases -->
<!-- Purchases -->
<record id="tax_code_base_net" model="account.tax.code.template">
<field name="name">Tax Bases</field>
<field name="parent_id" ref="tax_code_chart_root"/>
</record>
<record id="tax_code_base_net" model="account.tax.code.template">
<field name="name">Tax Bases</field>
<field name="parent_id" ref="tax_code_chart_root"/>
</record>
<record id="tax_code_base_purchases" model="account.tax.code.template">
<field name="name">Taxable Purchases Base</field>
<field name="parent_id" ref="tax_code_base_net"/>
</record>
<record id="tax_code_base_purchases" model="account.tax.code.template">
<field name="name">Taxable Purchases Base</field>
<field name="parent_id" ref="tax_code_base_net"/>
</record>
<record id="tax_code_purch_S" model="account.tax.code.template">
<field name="name">Taxable Purchases Rated S (15%)</field>
<field name="parent_id" ref="tax_code_base_purchases"/>
</record>
<record id="tax_code_purch_S" model="account.tax.code.template">
<field name="name">Taxable Purchases Rated S (15%)</field>
<field name="parent_id" ref="tax_code_base_purchases"/>
</record>
<record id="tax_code_purch_R" model="account.tax.code.template">
<field name="name">Taxable Purchases Rated R (5%)</field>
<field name="parent_id" ref="tax_code_base_purchases"/>
</record>
<record id="tax_code_purch_R" model="account.tax.code.template">
<field name="name">Taxable Purchases Rated R (5%)</field>
<field name="parent_id" ref="tax_code_base_purchases"/>
</record>
<record id="tax_code_purch_X" model="account.tax.code.template">
<field name="name">Taxable Purchases Type X (Exempt)</field>
<field name="parent_id" ref="tax_code_base_purchases"/>
</record>
<record id="tax_code_purch_X" model="account.tax.code.template">
<field name="name">Taxable Purchases Type X (Exempt)</field>
<field name="parent_id" ref="tax_code_base_purchases"/>
</record>
<record id="tax_code_purch_O" model="account.tax.code.template">
<field name="name">Taxable Purchases Type O (Out of scope)</field>
<field name="parent_id" ref="tax_code_base_purchases"/>
</record>
<record id="tax_code_purch_O" model="account.tax.code.template">
<field name="name">Taxable Purchases Type O (Out of scope)</field>
<field name="parent_id" ref="tax_code_base_purchases"/>
</record>
<!-- Sales -->
<!-- Sales -->
<record id="tax_code_base_sales" model="account.tax.code.template">
<field name="name">Base of Taxable Sales</field>
<field name="parent_id" ref="tax_code_base_net"/>
</record>
<record id="tax_code_base_sales" model="account.tax.code.template">
<field name="name">Base of Taxable Sales</field>
<field name="parent_id" ref="tax_code_base_net"/>
</record>
<record id="tax_code_sales_S" model="account.tax.code.template">
<field name="name">Taxable Sales Rated S (15%)</field>
<field name="parent_id" ref="tax_code_base_sales"/>
</record>
<record id="tax_code_sales_S" model="account.tax.code.template">
<field name="name">Taxable Sales Rated S (15%)</field>
<field name="parent_id" ref="tax_code_base_sales"/>
</record>
<record id="tax_code_sales_R" model="account.tax.code.template">
<field name="name">Taxable Sales Rated R (5%)</field>
<field name="parent_id" ref="tax_code_base_sales"/>
</record>
<record id="tax_code_sales_R" model="account.tax.code.template">
<field name="name">Taxable Sales Rated R (5%)</field>
<field name="parent_id" ref="tax_code_base_sales"/>
</record>
<record id="tax_code_sales_X" model="account.tax.code.template">
<field name="name">Taxable Sales Type X (Exempt)</field>
<field name="parent_id" ref="tax_code_base_sales"/>
</record>
<record id="tax_code_sales_X" model="account.tax.code.template">
<field name="name">Taxable Sales Type X (Exempt)</field>
<field name="parent_id" ref="tax_code_base_sales"/>
</record>
<record id="tax_code_sales_O" model="account.tax.code.template">
<field name="name">Taxable Sales Type O (Out of scope)</field>
<field name="parent_id" ref="tax_code_base_sales"/>
</record>
<record id="tax_code_sales_O" model="account.tax.code.template">
<field name="name">Taxable Sales Type O (Out of scope)</field>
<field name="parent_id" ref="tax_code_base_sales"/>
</record>
<record id="configurable_chart_template" model="account.chart.template">
<field name="name">Configurable Account Chart Template</field>
@ -450,7 +450,7 @@
<field name="property_reserve_and_surplus_account" ref="conf_a_reserve_and_surplus"/>
</record>
<!-- VAT Codes -->
<!-- VAT Codes -->
<!-- Purchases + Output VAT -->
<record id="otaxs" model="account.tax.template">
@ -569,9 +569,9 @@
<!-- = = = = = = = = = = = = = = = -->
<!-- Fiscal Mapping Templates -->
<!-- = = = = = = = = = = = = = = = -->
<!-- = = = = = = = = = = = = = = = -->
<!-- Fiscal Mapping Templates -->
<!-- = = = = = = = = = = = = = = = -->
<record id="fiscal_position_normal_taxes_template1" model="account.fiscal.position.template">
@ -584,40 +584,40 @@
<field name="chart_template_id" ref="configurable_chart_template"/>
</record>
<!-- = = = = = = = = = = = = = = = -->
<!-- Fiscal Position Tax Templates -->
<!-- = = = = = = = = = = = = = = = -->
<!-- = = = = = = = = = = = = = = = -->
<!-- Fiscal Position Tax Templates -->
<!-- = = = = = = = = = = = = = = = -->
<record id="fiscal_position_normal_taxes" model="account.fiscal.position.tax.template">
<record id="fiscal_position_normal_taxes" model="account.fiscal.position.tax.template">
<field name="position_id" ref="fiscal_position_normal_taxes_template1"/>
<field name="tax_src_id" ref="itaxs"/>
<field name="tax_dest_id" ref="otaxs"/>
</record>
<record id="fiscal_position_tax_exempt" model="account.fiscal.position.tax.template">
<record id="fiscal_position_tax_exempt" model="account.fiscal.position.tax.template">
<field name="position_id" ref="fiscal_position_tax_exempt_template2"/>
<field name="tax_src_id" ref="itaxx"/>
<field name="tax_dest_id" ref="otaxx"/>
</record>
<!-- Assigned Default Taxes For Different Account -->
<!-- Assigned Default Taxes For Different Account -->
<record id="conf_a_sale" model="account.account.template">
<field name="tax_ids" eval="[(6,0,[ref('itaxs')])]"/>
</record>
<record id="conf_a_sale" model="account.account.template">
<field name="tax_ids" eval="[(6,0,[ref('itaxs')])]"/>
</record>
<record id="conf_a_expense" model="account.account.template">
<field name="tax_ids" eval="[(6,0,[ref('otaxs')])]"/>
</record>
<record id="conf_a_expense" model="account.account.template">
<field name="tax_ids" eval="[(6,0,[ref('otaxs')])]"/>
</record>
<record id="action_wizard_multi_chart_todo" model="ir.actions.todo">
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="action_id" ref="account.action_wizard_multi_chart"/>
<field name="category_id" ref="account.category_accounting_configuration"/>
<field name="type">automatic</field>
</record>
<record id="action_wizard_multi_chart_todo" model="ir.actions.todo">
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="action_id" ref="account.action_wizard_multi_chart"/>
<field name="category_id" ref="account.category_accounting_configuration"/>
<field name="type">automatic</field>
</record>
</data>

View File

@ -469,66 +469,48 @@
Account Journal Sequences
-->
<record id="sequence_journal_type" model="ir.sequence.type">
<field name="name">Account Journal</field>
<field name="code">account.journal</field>
</record>
<record id="sequence_journal" model="ir.sequence">
<field name="name">Account Journal</field>
<field name="code">account.journal</field>
<field name="prefix"/>
</record>
<record id="sequence_sale_journal" model="ir.sequence">
<field name="name">Sale Journal</field>
<field name="code">account.journal</field>
<field name="name">Account Default Sales Journal</field>
<field eval="3" name="padding"/>
<field name="prefix">SAJ/%(year)s/</field>
</record>
<record id="sequence_refund_sales_journal" model="ir.sequence">
<field name="name">Sales Credit Note Journal</field>
<field name="code">account.journal</field>
<field name="name">Account Default Sales Credit Note Journal</field>
<field eval="3" name="padding"/>
<field name="prefix">SCNJ/%(year)s/</field>
</record>
<record id="sequence_purchase_journal" model="ir.sequence">
<field name="name">Purchase Journal</field>
<field name="code">account.journal</field>
<field name="name">Account Default Expenses Journal</field>
<field eval="3" name="padding"/>
<field name="prefix">EXJ/%(year)s/</field>
</record>
<record id="sequence_refund_purchase_journal" model="ir.sequence">
<field name="name">Expenses Credit Notes Journal</field>
<field name="code">account.journal</field>
<field name="name">Account Default Expenses Credit Notes Journal</field>
<field eval="3" name="padding"/>
<field name="prefix">ECNJ/%(year)s/</field>
</record>
<record id="sequence_bank_journal" model="ir.sequence">
<field name="name">Bank Journal</field>
<field name="code">account.journal</field>
<field name="name">Account Default Bank Journal</field>
<field eval="3" name="padding"/>
<field name="prefix">BNK/%(year)s/</field>
</record>
<record id="sequence_check_journal" model="ir.sequence">
<field name="name">Checks Journal</field>
<field name="code">account.journal</field>
<field name="name">Account Default Checks Journal</field>
<field eval="3" name="padding"/>
<field name="prefix">CHK/%(year)s/</field>
</record>
<record id="sequence_cash_journal" model="ir.sequence">
<field name="name">Cash Journal</field>
<field name="code">account.journal</field>
<field name="name">Account Default Cash Journal</field>
<field eval="3" name="padding"/>
<field name="prefix">CSH/%(year)s/</field>
</record>
<record id="sequence_opening_journal" model="ir.sequence">
<field name="name">Opening Entries Journal</field>
<field name="code">account.journal</field>
<field name="name">Account Default Opening Entries Journal</field>
<field eval="3" name="padding"/>
<field name="prefix">OPEJ/%(year)s/</field>
</record>
<record id="sequence_miscellaneous_journal" model="ir.sequence">
<field name="name">Miscellaneous Journal</field>
<field name="code">account.journal</field>
<field name="name">Account Default Miscellaneous Journal</field>
<field eval="3" name="padding"/>
<field name="prefix">MISJ/%(year)s/</field>
</record>
@ -538,7 +520,7 @@
-->
<record id="sequence_reconcile" model="ir.sequence.type">
<field name="name">Account reconcile sequence</field>
<field name="name">Account Reconcile</field>
<field name="code">account.reconcile</field>
</record>
<record id="sequence_reconcile_seq" model="ir.sequence">
@ -550,7 +532,7 @@
</record>
<record id="sequence_statement_type" model="ir.sequence.type">
<field name="name">Bank Statement</field>
<field name="name">Account Bank Statement</field>
<field name="code">account.bank.statement</field>
</record>
<record id="sequence_statement" model="ir.sequence">
@ -562,7 +544,7 @@
</record>
<record id="cash_sequence_statement_type" model="ir.sequence.type">
<field name="name">Cash Statement</field>
<field name="name">Account Cash Statement</field>
<field name="code">account.cash.statement</field>
</record>
<record id="cash_sequence_statement" model="ir.sequence">
@ -572,5 +554,30 @@
<field eval="1" name="number_next"/>
<field eval="1" name="number_increment"/>
</record>
<!--
Sequence for analytic account
-->
<record id="seq_type_analytic_account" model="ir.sequence.type">
<field name="name">Analytic account</field>
<field name="code">account.analytic.account</field>
</record>
<record id="seq_analytic_account" model="ir.sequence">
<field name="name">Analytic account sequence</field>
<field name="code">account.analytic.account</field>
<field eval="3" name="padding"/>
<field eval="2708" name="number_next"/>
</record>
<!--
Invoice requests (deprecated)
-->
<record id="req_link_invoice" model="res.request.link">
<field name="name">Invoice</field>
<field name="object">account.invoice</field>
</record>
</data>
</openerp>

View File

@ -1,75 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="req_link_invoice" model="res.request.link">
<field name="name">Invoice</field>
<field name="object">account.invoice</field>
</record>
<!--
Sequences types for invoices
-->
<record id="seq_type_out_invoice" model="ir.sequence.type">
<field name="name">Account Invoice Out</field>
<field name="code">account.invoice.out_invoice</field>
</record>
<record id="seq_type_in_invoice" model="ir.sequence.type">
<field name="name">Account Invoice In</field>
<field name="code">account.invoice.in_invoice</field>
</record>
<record id="seq_type_out_refund" model="ir.sequence.type">
<field name="name">Account Refund Out</field>
<field name="code">account.invoice.out_refund</field>
</record>
<record id="seq_type_in_refund" model="ir.sequence.type">
<field name="name">Account Refund In</field>
<field name="code">account.invoice.in_refund</field>
</record>
<!--
Sequences for invoices
-->
<record id="seq_out_invoice" model="ir.sequence">
<field name="name">Account Invoice Out</field>
<field name="code">account.invoice.out_invoice</field>
<field eval="3" name="padding"/>
<field name="prefix">%(year)s/</field>
</record>
<record id="seq_in_invoice" model="ir.sequence">
<field name="name">Account Invoice In</field>
<field name="code">account.invoice.in_invoice</field>
<field eval="3" name="padding"/>
<field name="prefix">%(year)s/</field>
</record>
<record id="seq_out_refund" model="ir.sequence">
<field name="name">Account Refund Out</field>
<field name="code">account.invoice.out_refund</field>
<field eval="3" name="padding"/>
<field name="prefix">%(year)s/</field>
</record>
<record id="seq_in_refund" model="ir.sequence">
<field name="name">Account Refund In</field>
<field name="code">account.invoice.in_refund</field>
<field eval="3" name="padding"/>
<field name="prefix">%(year)s/</field>
</record>
<!--
Sequences types for analytic account
-->
<record id="seq_type_analytic_account" model="ir.sequence.type">
<field name="name">Analytic account</field>
<field name="code">account.analytic.account</field>
</record>
<!--
Sequence for analytic account
-->
<record id="seq_analytic_account" model="ir.sequence">
<field name="name">Analytic account sequence</field>
<field name="code">account.analytic.account</field>
<field eval="3" name="padding"/>
<field eval="2708" name="number_next"/>
</record>
</data>
</openerp>

View File

@ -49,7 +49,7 @@
<record id="account_type_cash_equity" model="account.account.type">
<field name="name">Equity</field>
<field name="code">equity</field>
<field name="report_type">asset</field>
<field name="report_type">liability</field>
<field name="close_method">balance</field>
</record>
<record id="account_type_cash_moves" model="account.account.type">

View File

@ -7,19 +7,19 @@ 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-09-22 02:55+0000\n"
"PO-Revision-Date: 2011-09-30 23:12+0000\n"
"Last-Translator: Majed Majbour <Unknown>\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-09-23 04:38+0000\n"
"X-Generator: Launchpad (build 14012)\n"
"X-Launchpad-Export-Date: 2011-10-02 04:51+0000\n"
"X-Generator: Launchpad (build 14071)\n"
#. module: account
#: model:process.transition,name:account.process_transition_supplierreconcilepaid0
msgid "System payment"
msgstr "الدفع عن طريق النظام"
msgstr "نظام الدفع"
#. module: account
#: view:account.journal:0
@ -124,6 +124,8 @@ msgid ""
"If you unreconciliate transactions, you must also verify all the actions "
"that are linked to those transactions because they will not be disabled"
msgstr ""
"إذا كنت توافق على المعاملات ، يجب عليك أيضا التحقق من كافة الإجراءات التي "
"ترتبط بتلك المعاملات لأنه لن يكونوا غير مفعّلين"
#. module: account
#: report:account.tax.code.entries:0

View File

@ -7,24 +7,24 @@ 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: 2010-12-12 00:12+0000\n"
"Last-Translator: qdp (OpenERP) <qdp-launchpad@tinyerp.com>\n"
"PO-Revision-Date: 2011-09-30 07:02+0000\n"
"Last-Translator: Raiko Pajur <Unknown>\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-09-17 04:56+0000\n"
"X-Generator: Launchpad (build 13955)\n"
"X-Launchpad-Export-Date: 2011-10-01 05:08+0000\n"
"X-Generator: Launchpad (build 14071)\n"
#. module: account
#: model:process.transition,name:account.process_transition_supplierreconcilepaid0
msgid "System payment"
msgstr ""
msgstr "Süsteemi maksed"
#. module: account
#: view:account.journal:0
msgid "Other Configuration"
msgstr ""
msgstr "Muud konfiguratsioonid"
#. module: account
#: code:addons/account/wizard/account_open_closed_fiscalyear.py:40
@ -39,6 +39,8 @@ msgid ""
"You cannot remove/deactivate an account which is set as a property to any "
"Partner."
msgstr ""
"Sa ei saa kustutada / desaktiveerida kontot, mis on määratud mis tahes "
"\"Partner\" varaks."
#. module: account
#: view:account.move.reconcile:0
@ -48,7 +50,7 @@ msgstr ""
#. module: account
#: field:account.installer.modules,account_voucher:0
msgid "Voucher Management"
msgstr ""
msgstr "Voucheri juhtimine"
#. module: account
#: view:account.account:0
@ -133,13 +135,13 @@ msgstr "Raamatupidamise kirjed-"
#: code:addons/account/account.py:1291
#, python-format
msgid "You can not delete posted movement: \"%s\"!"
msgstr ""
msgstr "Sa ei saa kustutada postitatud liikumist: \"%s\"!"
#. module: account
#: report:account.invoice:0
#: field:account.invoice.line,origin:0
msgid "Origin"
msgstr "Päritolu"
msgstr "Allikas"
#. module: account
#: view:account.account:0
@ -164,7 +166,7 @@ msgstr "Viide"
#. module: account
#: view:account.open.closed.fiscalyear:0
msgid "Choose Fiscal Year "
msgstr ""
msgstr "Vali eelarveaasta "
#. module: account
#: help:account.payment.term,active:0
@ -172,12 +174,14 @@ msgid ""
"If the active field is set to False, it will allow you to hide the payment "
"term without removing it."
msgstr ""
"Kui aktiivne ala on väärne ( False ), siis see võimaldab teil peita/varjata "
"maksetähtaeg seda kustutamata."
#. module: account
#: code:addons/account/invoice.py:1421
#, python-format
msgid "Warning!"
msgstr ""
msgstr "Hoiatus!"
#. module: account
#: field:account.fiscal.position.account,account_src_id:0
@ -204,7 +208,7 @@ msgstr "Negatiivne"
#: code:addons/account/wizard/account_move_journal.py:95
#, python-format
msgid "Journal: %s"
msgstr ""
msgstr "Päevik: %s"
#. module: account
#: help:account.analytic.journal,type:0
@ -231,7 +235,7 @@ msgstr "konto.maks"
msgid ""
"No period defined for this date: %s !\n"
"Please create a fiscal year."
msgstr ""
msgstr "Periood ei ole defineeritud sellele kuupäevale: %s"
#. module: account
#: model:ir.model,name:account.model_account_move_line_reconcile_select
@ -259,7 +263,7 @@ msgstr ""
#: code:addons/account/invoice.py:1210
#, python-format
msgid "Invoice '%s' is paid partially: %s%s of %s%s (%s%s remaining)"
msgstr ""
msgstr "Arve '%s' on makstud osaliselt: %s%s on tasutud %s%s (%s%s maksmata)"
#. module: account
#: model:process.transition,note:account.process_transition_supplierentriesreconcile0
@ -280,7 +284,7 @@ msgstr "Teie ei saa lisada/muuta suletud päeviku kirjeid."
#. module: account
#: view:account.bank.statement:0
msgid "Calculated Balance"
msgstr ""
msgstr "Välja arvutatud tasakaal (Calculated Balance)"
#. module: account
#: model:ir.actions.act_window,name:account.action_account_use_model_create_entry
@ -352,7 +356,7 @@ msgstr "Ostu omadused"
#: view:account.installer:0
#: view:account.installer.modules:0
msgid "Configure"
msgstr ""
msgstr "Seadista"
#. module: account
#: selection:account.entries.report,month:0
@ -361,7 +365,7 @@ msgstr ""
#: selection:report.account.sales,month:0
#: selection:report.account_type.sales,month:0
msgid "June"
msgstr ""
msgstr "Juuni"
#. module: account
#: model:ir.actions.act_window,help:account.action_account_moves_bank
@ -395,12 +399,12 @@ msgstr ""
#. module: account
#: selection:account.journal,type:0
msgid "Opening/Closing Situation"
msgstr ""
msgstr "Avamise/Sulgemise situatsioon"
#. module: account
#: help:account.journal,currency:0
msgid "The currency used to enter statement"
msgstr ""
msgstr "Valuuta väite sisestamiseks"
#. module: account
#: field:account.open.closed.fiscalyear,fyear_id:0
@ -498,17 +502,17 @@ msgstr "Päevik"
#. module: account
#: model:ir.model,name:account.model_account_invoice_confirm
msgid "Confirm the selected invoices"
msgstr ""
msgstr "Kinnita valitud arved"
#. module: account
#: field:account.addtmpl.wizard,cparent_id:0
msgid "Parent target"
msgstr ""
msgstr "Lapsevanema sihtmärk"
#. module: account
#: field:account.bank.statement,account_id:0
msgid "Account used in this journal"
msgstr ""
msgstr "Konto kasutatud selles arveraamatus"
#. module: account
#: help:account.aged.trial.balance,chart_account_id:0
@ -527,7 +531,7 @@ msgstr ""
#: help:account.report.general.ledger,chart_account_id:0
#: help:account.vat.declaration,chart_account_id:0
msgid "Select Charts of Accounts"
msgstr ""
msgstr "Vali Kontode graafikud"
#. module: account
#: view:product.product:0
@ -537,7 +541,7 @@ msgstr "Ostumaksud"
#. module: account
#: model:ir.model,name:account.model_account_invoice_refund
msgid "Invoice Refund"
msgstr ""
msgstr "Arveraamatu tagasimakse"
#. module: account
#: report:account.overdue:0
@ -560,7 +564,7 @@ msgstr ""
#: field:account.fiscal.position,tax_ids:0
#: field:account.fiscal.position.template,tax_ids:0
msgid "Tax Mapping"
msgstr ""
msgstr "Maksude kaardistamine"
#. module: account
#: model:ir.actions.act_window,name:account.action_account_fiscalyear_close_state
@ -571,7 +575,7 @@ msgstr "Sule majandusaasta"
#. module: account
#: model:process.transition,note:account.process_transition_confirmstatementfromdraft0
msgid "The accountant confirms the statement."
msgstr ""
msgstr "Raamatupidaja kinnitab selle avalduse"
#. module: account
#: selection:account.balance.report,display_account:0
@ -587,12 +591,12 @@ msgstr "Kõik"
#. module: account
#: field:account.invoice.report,address_invoice_id:0
msgid "Invoice Address Name"
msgstr ""
msgstr "Arveraamatu Aadressi Nimi"
#. module: account
#: selection:account.installer,period:0
msgid "3 Monthly"
msgstr ""
msgstr "Iga 3 kuu tagant"
#. module: account
#: view:account.unreconcile.reconcile:0
@ -604,7 +608,7 @@ msgstr ""
#. module: account
#: view:analytic.entries.report:0
msgid " 30 Days "
msgstr ""
msgstr " 30 päeva "
#. module: account
#: field:ir.sequence,fiscal_ids:0
@ -624,7 +628,7 @@ msgstr ""
#. module: account
#: sql_constraint:account.sequence.fiscalyear:0
msgid "Main Sequence must be different from current !"
msgstr ""
msgstr "Pea"
#. module: account
#: field:account.invoice.tax,tax_amount:0
@ -652,12 +656,12 @@ msgstr "Sulge periood"
#. module: account
#: model:ir.model,name:account.model_account_common_partner_report
msgid "Account Common Partner Report"
msgstr ""
msgstr "Konto tava \"Partner\" aruanne"
#. module: account
#: field:account.fiscalyear.close,period_id:0
msgid "Opening Entries Period"
msgstr ""
msgstr "Avatud sissekanete periood"
#. module: account
#: model:ir.model,name:account.model_account_journal_period
@ -791,7 +795,7 @@ msgstr "J.C./liiguta nime"
#: selection:report.account.sales,month:0
#: selection:report.account_type.sales,month:0
msgid "September"
msgstr ""
msgstr "September"
#. module: account
#: selection:account.subscription,period_type:0
@ -802,7 +806,7 @@ msgstr "päevad"
#: help:account.account.template,nocreate:0
msgid ""
"If checked, the new chart of accounts will not contain this by default."
msgstr ""
msgstr "Kui märgitud, siis uus kontode graafik ei sisalda seda puudujääki."
#. module: account
#: code:addons/account/wizard/account_invoice_refund.py:102
@ -825,7 +829,7 @@ msgstr "Arvutus"
#. module: account
#: view:account.move.line:0
msgid "Next Partner to reconcile"
msgstr ""
msgstr "Kooskõlastama järgmise \"Partner\"-iga"
#. module: account
#: code:addons/account/account_move_line.py:1191
@ -834,12 +838,14 @@ msgid ""
"You can not do this modification on a confirmed entry ! Please note that you "
"can just change some non important fields !"
msgstr ""
"Teie ei saa teha see muudatus kinnitatud kirjel ! Teie saate muuta ainult "
"mõned vähetähtsad väljad !"
#. module: account
#: view:account.invoice.report:0
#: field:account.invoice.report,delay_to_pay:0
msgid "Avg. Delay To Pay"
msgstr ""
msgstr "Keskmine viivitus maksete tegemisel"
#. module: account
#: model:ir.actions.act_window,name:account.action_account_tax_chart
@ -862,7 +868,7 @@ msgstr "Tähtaeg"
#: view:account.invoice.report:0
#: field:account.invoice.report,price_total_tax:0
msgid "Total With Tax"
msgstr ""
msgstr "Kokku koos maksudega"
#. module: account
#: view:account.invoice:0
@ -870,7 +876,7 @@ msgstr ""
#: view:validate.account.move:0
#: view:validate.account.move.lines:0
msgid "Approve"
msgstr ""
msgstr "Nõustu"
#. module: account
#: view:account.invoice:0
@ -925,7 +931,7 @@ msgstr ""
#. module: account
#: view:account.analytic.line:0
msgid "Purchases"
msgstr ""
msgstr "Ostud"
#. module: account
#: field:account.model,lines_id:0
@ -972,7 +978,7 @@ msgstr "Partneri bilanss"
#. module: account
#: field:account.bank.accounts.wizard,acc_name:0
msgid "Account Name."
msgstr ""
msgstr "Konto nimi."
#. module: account
#: field:account.chart.template,property_reserve_and_surplus_account:0
@ -983,7 +989,7 @@ msgstr ""
#. module: account
#: field:report.account.receivable,name:0
msgid "Week of Year"
msgstr ""
msgstr "Nädal"
#. module: account
#: field:account.bs.report,display_type:0
@ -995,12 +1001,12 @@ msgstr "Rõhtpaigutus"
#. module: account
#: view:board.board:0
msgid "Customer Invoices to Approve"
msgstr ""
msgstr "Kliendi arved kinnitamiseks"
#. module: account
#: help:account.fiscalyear.close,fy_id:0
msgid "Select a Fiscal year to close"
msgstr ""
msgstr "Vali eelarve aasta mida sulgeda"
#. module: account
#: help:account.account,user_type:0
@ -1018,13 +1024,13 @@ msgstr ""
#. module: account
#: report:account.partner.balance:0
msgid "In dispute"
msgstr ""
msgstr "Vaidlustatav"
#. module: account
#: model:ir.actions.act_window,name:account.action_view_bank_statement_tree
#: model:ir.ui.menu,name:account.journal_cash_move_lines
msgid "Cash Registers"
msgstr ""
msgstr "Raha register"
#. module: account
#: selection:account.account.type,report_type:0
@ -1042,7 +1048,7 @@ msgstr "-"
#. module: account
#: view:account.analytic.account:0
msgid "Manager"
msgstr ""
msgstr "Juhataja"
#. module: account
#: view:account.subscription.generate:0
@ -1052,7 +1058,7 @@ msgstr ""
#. module: account
#: selection:account.bank.accounts.wizard,account_type:0
msgid "Bank"
msgstr ""
msgstr "Pank"
#. module: account
#: field:account.period,date_start:0
@ -1062,13 +1068,13 @@ msgstr "Perioodi algus"
#. module: account
#: model:process.transition,name:account.process_transition_confirmstatementfromdraft0
msgid "Confirm statement"
msgstr ""
msgstr "Kinnita avaldus"
#. module: account
#: field:account.fiscal.position.tax,tax_dest_id:0
#: field:account.fiscal.position.tax.template,tax_dest_id:0
msgid "Replacement Tax"
msgstr ""
msgstr "Vahetus maks"
#. module: account
#: selection:account.move.line,centralisation:0
@ -1087,12 +1093,12 @@ msgstr ""
#. module: account
#: view:account.invoice.cancel:0
msgid "Cancel Invoices"
msgstr ""
msgstr "Peata arved"
#. module: account
#: view:account.unreconcile.reconcile:0
msgid "Unreconciliation transactions"
msgstr ""
msgstr "Mittesobivad tehingud"
#. module: account
#: field:account.invoice.tax,tax_code_id:0
@ -1110,7 +1116,7 @@ msgstr ""
#. module: account
#: help:account.move.line,move_id:0
msgid "The move of this entry line."
msgstr ""
msgstr "Selle rea liigutus."
#. module: account
#: field:account.move.line.reconcile,trans_nbr:0
@ -1174,7 +1180,7 @@ msgstr "Konto"
#. module: account
#: field:account.tax,include_base_amount:0
msgid "Included in base amount"
msgstr ""
msgstr "Lisa baas osa"
#. module: account
#: view:account.entries.report:0
@ -1186,7 +1192,7 @@ msgstr ""
#. module: account
#: field:account.account,level:0
msgid "Level"
msgstr ""
msgstr "Tase"
#. module: account
#: report:account.invoice:0
@ -1207,7 +1213,7 @@ msgstr "Maksud"
#: code:addons/account/wizard/account_report_common.py:120
#, python-format
msgid "Select a starting and an ending period"
msgstr ""
msgstr "Vali algus ja lõpp periood"
#. module: account
#: model:ir.model,name:account.model_account_account_template
@ -1217,12 +1223,12 @@ msgstr "Mallid kontodele"
#. module: account
#: view:account.tax.code.template:0
msgid "Search tax template"
msgstr ""
msgstr "Otsi maksu templati"
#. module: account
#: report:account.invoice:0
msgid "Your Reference"
msgstr ""
msgstr "Teie viide"
#. module: account
#: view:account.move.reconcile:0
@ -1246,7 +1252,7 @@ msgstr ""
#. module: account
#: view:account.invoice:0
msgid "Reset to Draft"
msgstr ""
msgstr "Lähtesta mustandiks"
#. module: account
#: view:wizard.multi.charts.accounts:0
@ -1268,7 +1274,7 @@ msgstr ""
#: model:ir.actions.act_window,name:account.action_partner_all
#: model:ir.ui.menu,name:account.next_id_22
msgid "Partners"
msgstr ""
msgstr "Partnerid"
#. module: account
#: view:account.bank.statement:0
@ -1323,7 +1329,7 @@ msgstr "Bilanss pole 0"
#. module: account
#: view:account.tax:0
msgid "Search Taxes"
msgstr ""
msgstr "Otsi maksu"
#. module: account
#: model:ir.model,name:account.model_account_analytic_cost_ledger
@ -1338,7 +1344,7 @@ msgstr "Loo sissekanded"
#. module: account
#: field:account.entries.report,nbr:0
msgid "# of Items"
msgstr ""
msgstr "# detaile"
#. module: account
#: field:account.automatic.reconcile,max_amount:0
@ -1353,7 +1359,7 @@ msgstr "Arvuta maksud"
#. module: account
#: field:wizard.multi.charts.accounts,code_digits:0
msgid "# of Digits"
msgstr ""
msgstr "# numbrit"
#. module: account
#: field:account.journal,entry_posted:0
@ -1364,7 +1370,7 @@ msgstr ""
#: view:account.invoice.report:0
#: field:account.invoice.report,price_total:0
msgid "Total Without Tax"
msgstr ""
msgstr "Kokku ilma maksudeta"
#. module: account
#: model:ir.actions.act_window,help:account.action_move_journal_line
@ -1378,7 +1384,7 @@ msgstr ""
#. module: account
#: view:account.entries.report:0
msgid "# of Entries "
msgstr ""
msgstr "# sisestusi "
#. module: account
#: model:ir.model,name:account.model_temp_range
@ -1435,7 +1441,7 @@ msgstr "Mall finantspositsioonile"
#. module: account
#: model:account.tax.code,name:account.account_tax_code_0
msgid "Tax Code Test"
msgstr ""
msgstr "Maksu koodi test"
#. module: account
#: field:account.automatic.reconcile,reconciled:0
@ -1445,22 +1451,22 @@ msgstr ""
#. module: account
#: field:account.journal.view,columns_id:0
msgid "Columns"
msgstr ""
msgstr "Veerud"
#. module: account
#: report:account.overdue:0
msgid "."
msgstr ""
msgstr "."
#. module: account
#: view:account.analytic.cost.ledger.journal.report:0
msgid "and Journals"
msgstr ""
msgstr "ja arveraamatud"
#. module: account
#: field:account.journal,groups_id:0
msgid "Groups"
msgstr ""
msgstr "Grupid"
#. module: account
#: field:account.invoice,amount_untaxed:0
@ -1471,18 +1477,20 @@ msgstr "Maksuvaba"
#. module: account
#: view:account.partner.reconcile.process:0
msgid "Go to next partner"
msgstr ""
msgstr "Mine järgmise \"Partner\"-ile"
#. module: account
#: view:account.bank.statement:0
msgid "Search Bank Statements"
msgstr ""
msgstr "Otsi panga avaldust"
#. module: account
#: sql_constraint:account.model.line:0
msgid ""
"Wrong credit or debit value in model (Credit + Debit Must Be greater \"0\")!"
msgstr ""
"Vale krediidi või deebeti arv mudelis ( Krediit + Deebet Peab olema suurem "
"kui \"0\" ) !"
#. module: account
#: view:account.chart.template:0
@ -1516,14 +1524,14 @@ msgstr ""
#. module: account
#: report:account.analytic.account.cost_ledger:0
msgid "Date/Code"
msgstr ""
msgstr "Kuupäev/Kood"
#. module: account
#: field:account.analytic.line,general_account_id:0
#: view:analytic.entries.report:0
#: field:analytic.entries.report,general_account_id:0
msgid "General Account"
msgstr ""
msgstr "Üldine konto"
#. module: account
#: field:res.partner,debit_limit:0
@ -1554,13 +1562,13 @@ msgstr ""
#. module: account
#: field:wizard.multi.charts.accounts,seq_journal:0
msgid "Separated Journal Sequences"
msgstr ""
msgstr "Eraldatud päeviku järjekorrad"
#. module: account
#: field:account.bank.statement,user_id:0
#: view:account.invoice:0
msgid "Responsible"
msgstr ""
msgstr "Vastutav"
#. module: account
#: report:account.overdue:0
@ -1570,7 +1578,7 @@ msgstr "Vahesumma:"
#. module: account
#: model:ir.actions.act_window,name:account.action_report_account_type_sales_tree_all
msgid "Sales by Account Type"
msgstr ""
msgstr "Müügid konto järgi"
#. module: account
#: view:account.invoice.refund:0
@ -1582,7 +1590,7 @@ msgstr ""
#. module: account
#: model:ir.ui.menu,name:account.periodical_processing_invoicing
msgid "Invoicing"
msgstr ""
msgstr "Arveldamine"
#. module: account
#: field:account.chart.template,tax_code_root_id:0
@ -1598,17 +1606,17 @@ msgstr "Kaasa algsed"
#. module: account
#: field:account.tax.code,sum:0
msgid "Year Sum"
msgstr ""
msgstr "Aasta kokkuvõtte"
#. module: account
#: model:ir.actions.report.xml,name:account.report_account_voucher_new
msgid "Print Voucher"
msgstr ""
msgstr "Prindi voucher"
#. module: account
#: view:account.change.currency:0
msgid "This wizard will change the currency of the invoice"
msgstr ""
msgstr "See wizard muudab valuuta arvelduses"
#. module: account
#: model:ir.actions.act_window,help:account.action_account_chart
@ -1632,7 +1640,7 @@ msgstr ""
#. module: account
#: field:account.cashbox.line,pieces:0
msgid "Values"
msgstr ""
msgstr "Väärtused"
#. module: account
#: help:account.journal.period,active:0
@ -1675,7 +1683,7 @@ msgstr ""
#. module: account
#: report:account.move.voucher:0
msgid "Ref. :"
msgstr ""
msgstr "Viide:"
#. module: account
#: view:account.analytic.chart:0
@ -1685,7 +1693,7 @@ msgstr "Analüütilised kontoplaanid"
#. module: account
#: view:account.analytic.line:0
msgid "My Entries"
msgstr ""
msgstr "Minu sisestused"
#. module: account
#: report:account.overdue:0
@ -1696,7 +1704,7 @@ msgstr "Kliendi viide:"
#: code:addons/account/account_cash_statement.py:328
#, python-format
msgid "User %s does not have rights to access %s journal !"
msgstr ""
msgstr "Kasutajal %s ei ole õigusi et siseneda %s arveraamatusse !"
#. module: account
#: help:account.period,special:0
@ -1717,12 +1725,12 @@ msgstr ""
#: code:addons/account/account.py:499
#, python-format
msgid "You cannot deactivate an account that contains account moves."
msgstr ""
msgstr "Sa ei saa deaktiveerida kontot mis sisaldab konto liikumisi."
#. module: account
#: field:account.move.line.reconcile,credit:0
msgid "Credit amount"
msgstr ""
msgstr "Kreedidi kogus"
#. module: account
#: constraint:account.move.line:0
@ -1745,7 +1753,7 @@ msgstr ""
#. module: account
#: sql_constraint:account.move.line:0
msgid "Wrong credit or debit value in accounting entry !"
msgstr ""
msgstr "Vale kreedit või deebeti raamatupidamise sisend !"
#. module: account
#: view:account.invoice.report:0
@ -1757,7 +1765,7 @@ msgstr ""
#. module: account
#: model:ir.model,name:account.model_account_period_close
msgid "period close"
msgstr ""
msgstr "Periood suletud"
#. module: account
#: view:account.installer:0
@ -1767,18 +1775,18 @@ msgstr ""
#. module: account
#: model:ir.actions.act_window,name:account.action_project_account_analytic_line_form
msgid "Entries By Line"
msgstr ""
msgstr "SIsestused ridade kaupa"
#. module: account
#: report:account.tax.code.entries:0
msgid "A/c Code"
msgstr ""
msgstr "A/c kood"
#. module: account
#: field:account.invoice,move_id:0
#: field:account.invoice,move_name:0
msgid "Journal Entry"
msgstr ""
msgstr "Päevaraamatu kanne"
#. module: account
#: view:account.tax:0
@ -1788,7 +1796,7 @@ msgstr ""
#. module: account
#: field:account.cashbox.line,subtotal:0
msgid "Sub Total"
msgstr ""
msgstr "Vahesumma"
#. module: account
#: view:account.account:0
@ -1798,7 +1806,7 @@ msgstr ""
#. module: account
#: constraint:res.company:0
msgid "Error! You can not create recursive companies."
msgstr ""
msgstr "Viga! Sa ei saa luua rekursiivseid ettevõtteid."
#. module: account
#: view:account.analytic.account:0
@ -1821,12 +1829,12 @@ msgstr "Kehtiv"
#: model:ir.actions.act_window,name:account.action_account_print_journal
#: model:ir.model,name:account.model_account_print_journal
msgid "Account Print Journal"
msgstr ""
msgstr "Prindi konto arveraamat"
#. module: account
#: model:ir.model,name:account.model_product_category
msgid "Product Category"
msgstr ""
msgstr "Toote kategooria"
#. module: account
#: selection:account.account.type,report_type:0
@ -1836,7 +1844,7 @@ msgstr "/"
#. module: account
#: field:account.bs.report,reserve_account_id:0
msgid "Reserve & Profit/Loss Account"
msgstr ""
msgstr "Reservi & kasumi/kahjumi konto"
#. module: account
#: help:account.bank.statement,balance_end:0
@ -1887,12 +1895,12 @@ msgstr ""
#: field:account.installer.modules,config_logo:0
#: field:wizard.multi.charts.accounts,config_logo:0
msgid "Image"
msgstr ""
msgstr "Pilt"
#. module: account
#: report:account.move.voucher:0
msgid "Canceled"
msgstr ""
msgstr "Tühistatud"
#. module: account
#: view:account.invoice:0

View File

@ -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:14+0000\n"
"PO-Revision-Date: 2010-12-11 23:34+0000\n"
"Last-Translator: BlueT - Matthew Lien - 練喆明 <bluet@ubuntu-tw.org>\n"
"PO-Revision-Date: 2011-09-27 10:01+0000\n"
"Last-Translator: Walter Cheuk <wwycheuk@gmail.com>\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-09-17 05:02+0000\n"
"X-Generator: Launchpad (build 13955)\n"
"X-Launchpad-Export-Date: 2011-09-28 05:20+0000\n"
"X-Generator: Launchpad (build 14049)\n"
#. module: account
#: model:process.transition,name:account.process_transition_supplierreconcilepaid0
@ -48,7 +48,7 @@ msgstr ""
#. module: account
#: field:account.installer.modules,account_voucher:0
msgid "Voucher Management"
msgstr ""
msgstr "換票券管理"
#. module: account
#: view:account.account:0
@ -3550,7 +3550,7 @@ msgstr ""
#: view:product.template:0
#: view:res.partner:0
msgid "Accounting"
msgstr "账号"
msgstr "會計"
#. module: account
#: help:account.central.journal,amount_currency:0
@ -6779,7 +6779,7 @@ msgstr ""
#: field:account.invoice.tax,invoice_id:0
#: model:ir.model,name:account.model_account_invoice_line
msgid "Invoice Line"
msgstr "发票行"
msgstr "發票明細"
#. module: account
#: field:account.balance.report,display_account:0
@ -6788,7 +6788,7 @@ msgstr "发票行"
#: field:account.pl.report,display_account:0
#: field:account.report.general.ledger,display_account:0
msgid "Display accounts"
msgstr ""
msgstr "顯示帳號"
#. module: account
#: field:account.account.type,sign:0
@ -9305,7 +9305,7 @@ msgstr ""
#. module: account
#: field:account.invoice,invoice_line:0
msgid "Invoice Lines"
msgstr "发票行"
msgstr "發票明細"
#. module: account
#: constraint:account.account.template:0

View File

@ -65,21 +65,6 @@ class account_installer(osv.osv_memory):
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
return user.company_id and user.company_id.id or False
def _get_default_charts(self, cr, uid, context=None):
module_name = False
company_id = self._default_company(cr, uid, context=context)
company = self.pool.get('res.company').browse(cr, uid, company_id, context=context)
address_id = self.pool.get('res.partner').address_get(cr, uid, [company.partner_id.id])
if address_id['default']:
address = self.pool.get('res.partner.address').browse(cr, uid, address_id['default'], context=context)
code = address.country_id.code
module_name = (code and 'l10n_' + code.lower()) or False
if module_name:
module_id = self.pool.get('ir.module.module').search(cr, uid, [('name', '=', module_name)], context=context)
if module_id:
return module_name
return 'configurable'
_defaults = {
'date_start': lambda *a: time.strftime('%Y-01-01'),
'date_stop': lambda *a: time.strftime('%Y-12-31'),
@ -87,7 +72,7 @@ class account_installer(osv.osv_memory):
'sale_tax': 0.0,
'purchase_tax': 0.0,
'company_id': _default_company,
'charts': _get_default_charts
'charts': 'configurable'
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
@ -239,26 +224,4 @@ class account_installer(osv.osv_memory):
account_installer()
class account_installer_modules(osv.osv_memory):
_inherit = 'base.setup.installer'
_columns = {
'account_analytic_plans': fields.boolean('Multiple Analytic Plans',
help="Allows invoice lines to impact multiple analytic accounts "
"simultaneously."),
'account_payment': fields.boolean('Suppliers Payment Management',
help="Streamlines invoice payment and creates hooks to plug "
"automated payment systems in."),
'account_followup': fields.boolean('Followups Management',
help="Helps you generate reminder letters for unpaid invoices, "
"including multiple levels of reminding and customized "
"per-partner policies."),
'account_anglo_saxon': fields.boolean('Anglo-Saxon Accounting',
help="This module will support the Anglo-Saxons accounting methodology by "
"changing the accounting logic with stock transactions."),
'account_asset': fields.boolean('Assets Management',
help="Helps you to manage your assets and their depreciation entries."),
}
account_installer_modules()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -46,23 +46,14 @@ class ir_sequence(osv.osv):
'fiscal_ids': fields.one2many('account.sequence.fiscalyear',
'sequence_main_id', 'Sequences')
}
def get_id(self, cr, uid, sequence_id, test='id', context=None):
if context is None:
context = {}
cr.execute('select id from ir_sequence where '
+ test + '=%s and active=%s', (sequence_id, True,))
res = cr.dictfetchone()
if res:
for line in self.browse(cr, uid, res['id'],
context=context).fiscal_ids:
if line.fiscalyear_id.id == context.get('fiscalyear_id', False):
return super(ir_sequence, self).get_id(cr, uid,
line.sequence_id.id,
test="id",
context=context)
return super(ir_sequence, self).get_id(cr, uid, sequence_id, test,
context=context)
def _next(self, cr, uid, seq_ids, context=None):
for seq in self.browse(cr, uid, seq_ids, context):
for line in seq.fiscal_ids:
if line.fiscalyear_id.id == context.get('fiscalyear_id'):
return super(ir_sequence, self)._next(cr, uid, [line.sequence_id.id], context)
return super(ir_sequence, self)._next(cr, uid, seq_ids, context)
ir_sequence()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -29,7 +29,7 @@ class account_analytic_cost_ledger_journal_report(osv.osv_memory):
_columns = {
'date1': fields.date('Start of period', required=True),
'date2': fields.date('End of period', required=True),
'journal': fields.many2many('account.analytic.journal', 'ledger_journal_rel', 'ledger_id', 'Journal_id', 'Journals'),
'journal': fields.many2many('account.analytic.journal', 'ledger_journal_rel', 'ledger_id', 'journal_id', 'Journals'),
}
_defaults = {

View File

@ -26,7 +26,6 @@
code: NEW
type: situation
analytic_journal_id: sit
sequence_id: sequence_journal
default_debit_account_id: cash
default_credit_account_id: cash
company_id: base.main_company

View File

@ -147,7 +147,7 @@
!python {model: account.account}: |
ctx={}
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False}
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False,'target_move': 'all'}
from tools import test_reports
test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
-
@ -156,7 +156,7 @@
!python {model: account.account}: |
ctx={}
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True}
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True,'target_move': 'all'}
from tools import test_reports
test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
-

View File

@ -19,13 +19,17 @@
#
##############################################################################
from osv import osv
from osv import osv, fields
class account_balance_report(osv.osv_memory):
_inherit = "account.common.account.report"
_name = 'account.balance.report'
_description = 'Trial Balance Report'
_columns = {
'journal_ids': fields.many2many('account.journal', 'account_balance_report_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
_defaults = {
'journal_ids': [],
}

View File

@ -35,6 +35,7 @@ class account_aged_trial_balance(osv.osv_memory):
'direction_selection': fields.selection([('past','Past'),
('future','Future')],
'Analysis Direction', required=True),
'journal_ids': fields.many2many('account.journal', 'account_aged_trial_balance_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
_defaults = {
'period_length': 30,

View File

@ -40,11 +40,9 @@ class account_bs_report(osv.osv_memory):
_columns = {
'display_type': fields.boolean("Landscape Mode"),
'reserve_account_id': fields.many2one('account.account', 'Reserve & Profit/Loss Account',
required=True,
help='This Account is used for transfering Profit/Loss ' \
'(Profit: Amount will be added, Loss: Amount will be duducted), ' \
'which is calculated from Profilt & Loss Report',
help='This account is used for transferring Profit/Loss (If It is Profit: Amount will be added, Loss : Amount will be deducted.), as calculated in Profit & Loss Report',
domain = [('type','=','other')]),
'journal_ids': fields.many2many('account.journal', 'account_bs_report_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
_defaults={

View File

@ -21,7 +21,7 @@
</xpath>
<xpath expr="//field[@name='target_move']" position="after">
<field name="display_account"/>
<field name="reserve_account_id" required="1"/>
<field name="reserve_account_id"/>
<field name="display_type"/>
<newline/>
</xpath>

View File

@ -19,13 +19,17 @@
#
##############################################################################
from osv import osv
from osv import osv, fields
class account_central_journal(osv.osv_memory):
_name = 'account.central.journal'
_description = 'Account Central Journal'
_inherit = "account.common.journal.report"
_columns = {
'journal_ids': fields.many2many('account.journal', 'account_central_journal_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
def _print_report(self, cr, uid, ids, data, context=None):
data = self.pre_print_report(cr, uid, ids, data, context=context)
return {

View File

@ -35,7 +35,7 @@ class account_common_report(osv.osv_memory):
'filter': fields.selection([('filter_no', 'No Filters'), ('filter_date', 'Date'), ('filter_period', 'Periods')], "Filter by", required=True),
'period_from': fields.many2one('account.period', 'Start Period'),
'period_to': fields.many2one('account.period', 'End Period'),
'journal_ids': fields.many2many('account.journal', 'account_common_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
'journal_ids': fields.many2many('account.journal', string='Journals', required=True),
'date_from': fields.date("Start Date"),
'date_to': fields.date("End Date"),
'target_move': fields.selection([('posted', 'All Posted Entries'),

View File

@ -19,17 +19,21 @@
#
##############################################################################
from osv import osv
from osv import osv, fields
class account_general_journal(osv.osv_memory):
_inherit = "account.common.journal.report"
_name = 'account.general.journal'
_description = 'Account General Journal'
_columns = {
'journal_ids': fields.many2many('account.journal', 'account_general_journal_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
def _print_report(self, cr, uid, ids, data, context=None):
data = self.pre_print_report(cr, uid, ids, data, context=context)
return {'type': 'ir.actions.report.xml', 'report_name': 'account.general.journal', 'datas': data}
account_general_journal()
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -32,6 +32,7 @@ class account_report_general_ledger(osv.osv_memory):
help='If you selected to filter by date or period, this field allow you to add a row to display the amount of debit/credit/balance that precedes the filter you\'ve set.'),
'amount_currency': fields.boolean("With Currency", help="It adds the currency column if the currency is different then the company currency"),
'sortby': fields.selection([('sort_date', 'Date'), ('sort_journal_partner', 'Journal & Partner')], 'Sort by', required=True),
'journal_ids': fields.many2many('account.journal', 'account_report_general_ledger_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
_defaults = {
'landscape': True,

View File

@ -31,6 +31,7 @@ class account_partner_balance(osv.osv_memory):
_columns = {
'display_partner': fields.selection([('non-zero_balance', 'With balance is not equal to 0'), ('all', 'All Partners')]
,'Display Partners'),
'journal_ids': fields.many2many('account.journal', 'account_partner_balance_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
_defaults = {
@ -51,4 +52,4 @@ class account_partner_balance(osv.osv_memory):
account_partner_balance()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -35,6 +35,7 @@ class account_partner_ledger(osv.osv_memory):
'filter': fields.selection([('filter_no', 'No Filters'), ('filter_date', 'Date'), ('filter_period', 'Periods'), ('unreconciled', 'Unreconciled Entries')], "Filter by", required=True),
'page_split': fields.boolean('One Partner Per Page', help='Display Ledger Report with One partner per page'),
'amount_currency': fields.boolean("With Currency", help="It adds the currency column if the currency is different then the company currency"),
'journal_ids': fields.many2many('account.journal', 'account_partner_ledger_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
_defaults = {
'initial_balance': False,

View File

@ -30,6 +30,7 @@ class account_print_journal(osv.osv_memory):
'sort_selection': fields.selection([('date', 'Date'),
('ref', 'Reference Number'),],
'Entries Sorted by', required=True),
'journal_ids': fields.many2many('account.journal', 'account_print_journal_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
_defaults = {
'sort_selection': 'date',
@ -44,4 +45,4 @@ class account_print_journal(osv.osv_memory):
account_print_journal()
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -28,14 +28,15 @@ class account_pl_report(osv.osv_memory):
_inherit = "account.common.account.report"
_name = "account.pl.report"
_description = "Account Profit And Loss Report"
_columns = {
'display_type': fields.boolean("Landscape Mode"),
'journal_ids': fields.many2many('account.journal', 'account_pl_report_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
}
_defaults = {
'display_type': False,
'journal_ids': [],
'target_move': False
}
def _print_report(self, cr, uid, ids, data, context=None):

View File

@ -9,9 +9,6 @@
<field name="inherit_id" ref="account.account_common_report_view" />
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='target_move']" position="replace">
<field name="target_move" required="0" readonly="1"/>
</xpath>
<xpath expr="//field[@name='journal_ids']" position="replace">
<field name="journal_ids" required="0" colspan="4" nolabel="1" readonly="1"/>
</xpath>

View File

@ -22,7 +22,7 @@
"name" : "Accountant Access",
"version" : "1.1",
"author" : "OpenERP SA",
"category": 'Finance',
"category": 'Hidden',
'complexity': "normal",
"description": """
Accounting Access Rights.

View File

@ -0,0 +1,33 @@
# Chinese (Traditional) 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 <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-09-27 09:57+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Chinese (Traditional) <zh_TW@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-09-28 05:20+0000\n"
"X-Generator: Launchpad (build 14049)\n"
#. module: account_accountant
#: model:ir.module.module,description:account_accountant.module_meta_information
msgid ""
"\n"
"This module gives the admin user the access to all the accounting features "
"like the journal\n"
"items and the chart of accounts.\n"
" "
msgstr ""
#. module: account_accountant
#: model:ir.module.module,shortdesc:account_accountant.module_meta_information
msgid "Accountant"
msgstr "會計師"

View File

@ -23,7 +23,7 @@
{
'name' : 'Analytic Account View',
'version' : '1.1',
'category' : 'Finance',
'category' : 'Hidden',
'complexity': "normal",
'description': """
This module is for modifying account analytic view to show important data to project manager of services companies.

View File

@ -22,7 +22,7 @@
{
'name' : 'Account Analytic Defaults',
'version' : '1.0',
'category' : 'Finance',
'category' : 'Hidden',
'complexity': "normal",
'description': """Set default values for your analytic accounts
Allows to automatically select analytic accounts based on criterions:

View File

@ -21,9 +21,9 @@
{
'name' : 'Manage multiple plans in Analytic Accounting',
'name' : 'Multiple Analytic Plans',
'version' : '1.0',
'category' : 'Finance',
'category' : 'Accounting & Finance',
'complexity': "normal",
'description': """
This module allows to use several analytic plans, according to the general journal.

View File

@ -366,7 +366,7 @@ class account_move_line(osv.osv):
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
if context is None:
context = {}
result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
result = super(account_move_line, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
return result
account_move_line()
@ -496,4 +496,4 @@ class account_bank_statement_line(osv.osv):
}
account_bank_statement_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -7,14 +7,15 @@
<field name="res_model">account.analytic.plan</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="account_analytic_plans.account_analytic_plan_form"/>
<field name="view_id" eval="False"/>
<field name="help">To setup a multiple analytic plans environment, you must define the root analytic accounts for each plan set. Then, you must attach a plan set to your account journals.</field>
</record>
<record id="account_analytic_plan_installer_todo" model="ir.actions.todo">
<field name="action_id" ref="account_analytic_plan_form_action_installer"/>
<field name="category_id" ref="account.category_accounting_configuration"/>
<field name="sequence">15</field>
</record>
<record id="account_analytic_plan_installer_todo" model="ir.actions.todo">
<field name="action_id" ref="account_analytic_plan_form_action_installer"/>
<field name="category_id" ref="account.category_accounting_configuration"/>
<field name="sequence">15</field>
</record>
</data>
</openerp>

View File

@ -19,7 +19,7 @@
##############################################################################
{
"name" : "Stock Accounting for Anglo-Saxon countries",
"name" : "Anglo-Saxon Accouting",
"version" : "1.2",
"author" : "OpenERP SA, Veritos",
"website" : "http://tinyerp.com - http://veritos.nl",
@ -36,7 +36,7 @@ when the invoice is created to transfer this amount to the debtor or creditor ac
Secondly, price differences between actual purchase price and fixed product standard price are booked on a separate account""",
"images" : ["images/account_anglo_saxon.jpeg"],
"depends" : ["product", "purchase"],
"category" : "Warehouse",
"category" : "Accounting & Finance",
"init_xml" : [],
"demo_xml" : [],
"update_xml" : ["product_view.xml",],

View File

@ -0,0 +1,107 @@
# Chinese (Traditional) 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 <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-09-27 10:28+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Chinese (Traditional) <zh_TW@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-09-28 05:20+0000\n"
"X-Generator: Launchpad (build 14049)\n"
#. module: account_anglo_saxon
#: view:product.category:0
msgid " Accounting Property"
msgstr ""
#. module: account_anglo_saxon
#: sql_constraint:purchase.order:0
msgid "Order Reference must be unique !"
msgstr "訂單參考不能重覆!"
#. module: account_anglo_saxon
#: constraint:product.category:0
msgid "Error ! You can not create recursive categories."
msgstr ""
#. module: account_anglo_saxon
#: constraint:product.template:0
msgid ""
"Error: The default UOM and the purchase UOM must be in the same category."
msgstr ""
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_account_invoice_line
msgid "Invoice Line"
msgstr "發票明細"
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_purchase_order
msgid "Purchase Order"
msgstr "購貨單"
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_product_template
msgid "Product Template"
msgstr "產品範本"
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_product_category
msgid "Product Category"
msgstr "產品分類"
#. module: account_anglo_saxon
#: model:ir.module.module,shortdesc:account_anglo_saxon.module_meta_information
msgid "Stock Accounting for Anglo Saxon countries"
msgstr ""
#. module: account_anglo_saxon
#: field:product.category,property_account_creditor_price_difference_categ:0
#: field:product.template,property_account_creditor_price_difference:0
msgid "Price Difference Account"
msgstr ""
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_account_invoice
msgid "Invoice"
msgstr "發票"
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_stock_picking
msgid "Picking List"
msgstr "提貨清單"
#. module: account_anglo_saxon
#: model:ir.module.module,description:account_anglo_saxon.module_meta_information
msgid ""
"This module will support the Anglo-Saxons accounting methodology by\n"
" changing the accounting logic with stock transactions. The difference "
"between the Anglo-Saxon accounting countries\n"
" and the Rhine or also called Continental accounting countries is the "
"moment of taking the Cost of Goods Sold versus Cost of Sales.\n"
" Anglo-Saxons accounting does take the cost when sales invoice is "
"created, Continental accounting will take the cost at the moment the goods "
"are shipped.\n"
" This module will add this functionality by using a interim account, to "
"store the value of shipped goods and will contra book this interim account\n"
" when the invoice is created to transfer this amount to the debtor or "
"creditor account.\n"
" Secondly, price differences between actual purchase price and fixed "
"product standard price are booked on a separate account"
msgstr ""
#. module: account_anglo_saxon
#: help:product.category,property_account_creditor_price_difference_categ:0
#: help:product.template,property_account_creditor_price_difference:0
msgid ""
"This account will be used to value price difference between purchase price "
"and cost price."
msgstr ""

View File

@ -20,16 +20,16 @@
##############################################################################
{
"name" : "Asset management",
"name" : "Assets Management",
"version" : "1.0",
"depends" : ["account"],
"author" : "Tiny",
"author" : "OpenERP S.A.",
"description": """Financial and accounting asset management.
This Module manages the assets owned by a company or an individual. It will keep track of depreciation's occurred on
those assets. And it allows to create Move's of the depreciation lines.
""",
"website" : "http://www.openerp.com",
"category" : "Generic Modules/Accounting",
"category" : "Accounting & Finance",
"init_xml" : [
],
"demo_xml" : [ 'account_asset_demo.xml'

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-11-24 12:54+0000\n"
"PO-Revision-Date: 2011-09-17 13:42+0000\n"
"PO-Revision-Date: 2011-09-26 12:09+0000\n"
"Last-Translator: lholivier <olivier.lenoir@free.fr>\n"
"Language-Team: French <fr@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-09-18 04:58+0000\n"
"X-Generator: Launchpad (build 13955)\n"
"X-Launchpad-Export-Date: 2011-09-27 04:47+0000\n"
"X-Generator: Launchpad (build 14028)\n"
#. module: account_asset
#: model:ir.actions.act_window,name:account_asset.action_account_asset_asset_list_normal
@ -131,7 +131,7 @@ msgstr "Commentaires"
#. module: account_asset
#: view:account.asset.asset:0
msgid "Change history"
msgstr ""
msgstr "Historique des modifications"
#. module: account_asset
#: view:account.asset.asset:0
@ -341,7 +341,7 @@ msgstr ""
#: field:account.asset.asset,date:0
#: field:account.asset.property.history,date:0
msgid "Date"
msgstr ""
msgstr "Date"
#. module: account_asset
#: field:account.asset.board,value_net:0

View File

@ -0,0 +1,529 @@
# Brazilian Portuguese 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 <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-11-24 12:54+0000\n"
"PO-Revision-Date: 2011-09-30 14:07+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Brazilian Portuguese <pt_BR@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-01 05:08+0000\n"
"X-Generator: Launchpad (build 14071)\n"
#. module: account_asset
#: model:ir.actions.act_window,name:account_asset.action_account_asset_asset_list_normal
#: model:ir.ui.menu,name:account_asset.menu_action_account_asset_asset_list_normal
msgid "Open Assets"
msgstr ""
#. module: account_asset
#: field:account.asset.property,method_end:0
#: field:account.asset.property.history,method_end:0
msgid "Ending date"
msgstr ""
#. module: account_asset
#: view:account.asset.asset:0
msgid "Depreciation board"
msgstr ""
#. module: account_asset
#: view:account.asset.asset:0
#: field:account.asset.asset,name:0
#: field:account.asset.board,asset_id:0
#: field:account.asset.property,asset_id:0
#: field:account.invoice.line,asset_id:0
#: field:account.move.line,asset_id:0
#: model:ir.actions.act_window,name:account_asset.action_account_asset_asset_form
#: model:ir.model,name:account_asset.model_account_asset_asset
#: model:ir.ui.menu,name:account_asset.menu_action_account_asset_asset_form
msgid "Asset"
msgstr ""
#. module: account_asset
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
#. module: account_asset
#: selection:account.asset.property,method:0
msgid "Linear"
msgstr ""
#. module: account_asset
#: view:account.asset.asset:0
msgid "Change duration"
msgstr ""
#. module: account_asset
#: field:account.asset.asset,child_ids:0
msgid "Child assets"
msgstr ""
#. module: account_asset
#: field:account.asset.board,value_asset:0
msgid "Asset Value"
msgstr ""
#. module: account_asset
#: wizard_field:account.asset.modify,init,name:0
msgid "Reason"
msgstr ""
#. 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 ""
#. module: account_asset
#: wizard_view:account.asset.compute,asset_compute:0
msgid "Generated entries"
msgstr ""
#. module: account_asset
#: wizard_field:account.asset.modify,init,method_delay:0
#: field:account.asset.property,method_delay:0
#: field:account.asset.property.history,method_delay:0
msgid "Number of interval"
msgstr ""
#. module: account_asset
#: wizard_button:account.asset.compute,asset_compute,asset_open:0
msgid "Open entries"
msgstr ""
#. module: account_asset
#: view:account.asset.asset:0
#: model:ir.actions.act_window,name:account_asset.action_account_asset_asset_list
#: model:ir.ui.menu,name:account_asset.menu_action_account_asset_asset_list
#: model:ir.ui.menu,name:account_asset.menu_finance_Assets
#: model:ir.ui.menu,name:account_asset.menu_finance_config_Assets
msgid "Assets"
msgstr ""
#. module: account_asset
#: selection:account.asset.property,method:0
msgid "Progressive"
msgstr ""
#. module: account_asset
#: model:ir.actions.act_window,name:account_asset.action_account_asset_asset_list_draft
#: model:ir.ui.menu,name:account_asset.menu_action_account_asset_asset_list_draft
msgid "Draft Assets"
msgstr ""
#. module: account_asset
#: wizard_view:account.asset.modify,init:0
#: wizard_field:account.asset.modify,init,note:0
#: view:account.asset.property.history:0
msgid "Notes"
msgstr ""
#. module: account_asset
#: view:account.asset.asset:0
msgid "Change history"
msgstr ""
#. module: account_asset
#: view:account.asset.asset:0
msgid "Depreciation entries"
msgstr ""
#. module: account_asset
#: view:account.asset.asset:0
msgid "Methods"
msgstr ""
#. module: account_asset
#: wizard_view:account.asset.modify,init:0
msgid "Asset properties to modify"
msgstr ""
#. module: account_asset
#: field:account.asset.asset,partner_id:0
msgid "Partner"
msgstr ""
#. module: account_asset
#: wizard_field:account.asset.modify,init,method_period:0
#: field:account.asset.property,method_period:0
#: field:account.asset.property.history,method_period:0
msgid "Period per interval"
msgstr ""
#. module: account_asset
#: view:account.asset.asset:0
msgid "Depreciation duration"
msgstr ""
#. module: account_asset
#: field:account.asset.property,account_analytic_id:0
msgid "Analytic account"
msgstr ""
#. module: account_asset
#: field:account.asset.property,state:0
msgid "State"
msgstr ""
#. module: account_asset
#: view:account.asset.asset:0
msgid "Depreciation methods"
msgstr ""
#. module: account_asset
#: view:account.asset.asset:0
msgid "Other information"
msgstr ""
#. module: account_asset
#: field:account.asset.board,value_asset_cumul:0
msgid "Cumul. value"
msgstr ""
#. module: account_asset
#: view:account.asset.property:0
msgid "Assets methods"
msgstr ""
#. module: account_asset
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: account_asset
#: model:ir.model,name:account_asset.model_account_asset_property
msgid "Asset property"
msgstr ""
#. module: account_asset
#: wizard_view:account.asset.compute,asset_compute:0
#: wizard_view:account.asset.compute,init:0
#: wizard_button:account.asset.compute,init,asset_compute:0
#: 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 ""
#. 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 ""
#. module: account_asset
#: view:account.asset.asset:0
msgid "Confirm asset"
msgstr ""
#. module: account_asset
#: view:account.asset.property.history:0
#: model:ir.model,name:account_asset.model_account_asset_property_history
msgid "Asset history"
msgstr ""
#. module: account_asset
#: field:account.asset.property,date:0
msgid "Date created"
msgstr ""
#. module: account_asset
#: model:ir.module.module,description:account_asset.module_meta_information
msgid ""
"Financial and accounting asset management.\n"
" Allows to define\n"
" * Asset category. \n"
" * Assets.\n"
" *Asset usage period and property.\n"
" "
msgstr ""
#. module: account_asset
#: field:account.asset.board,value_gross:0
#: field:account.asset.property,value_total:0
msgid "Gross value"
msgstr ""
#. module: account_asset
#: selection:account.asset.property,method_time:0
msgid "Ending period"
msgstr ""
#. module: account_asset
#: field:account.asset.board,name:0
msgid "Asset name"
msgstr ""
#. module: account_asset
#: view:account.asset.asset:0
msgid "Accounts information"
msgstr ""
#. module: account_asset
#: field:account.asset.asset,note:0
#: field:account.asset.category,note:0
#: field:account.asset.property.history,note:0
msgid "Note"
msgstr ""
#. module: account_asset
#: selection:account.asset.asset,state:0
#: selection:account.asset.property,state:0
msgid "Draft"
msgstr ""
#. module: account_asset
#: field:account.asset.property,type:0
msgid "Depr. method type"
msgstr ""
#. module: account_asset
#: field:account.asset.property,account_asset_id:0
msgid "Asset account"
msgstr ""
#. module: account_asset
#: field:account.asset.property.history,asset_property_id:0
msgid "Method"
msgstr ""
#. module: account_asset
#: selection:account.asset.asset,state:0
msgid "Normal"
msgstr ""
#. module: account_asset
#: field:account.asset.property,method_progress_factor:0
msgid "Progressif factor"
msgstr ""
#. module: account_asset
#: field:account.asset.asset,localisation:0
msgid "Localisation"
msgstr ""
#. module: account_asset
#: field:account.asset.property,method:0
msgid "Computation method"
msgstr ""
#. module: account_asset
#: field:account.asset.property,method_time:0
msgid "Time method"
msgstr ""
#. module: account_asset
#: field:account.asset.asset,active:0
msgid "Active"
msgstr ""
#. module: account_asset
#: field:account.asset.property.history,user_id:0
msgid "User"
msgstr ""
#. module: account_asset
#: field:account.asset.asset,property_ids:0
msgid "Asset method name"
msgstr ""
#. module: account_asset
#: field:account.asset.asset,date:0
#: field:account.asset.property.history,date:0
msgid "Date"
msgstr ""
#. module: account_asset
#: field:account.asset.board,value_net:0
msgid "Net value"
msgstr ""
#. module: account_asset
#: wizard_view:account.asset.close,init:0
#: model:ir.actions.wizard,name:account_asset.wizard_asset_close
msgid "Close asset"
msgstr ""
#. module: account_asset
#: field:account.asset.property,history_ids:0
msgid "History"
msgstr ""
#. module: account_asset
#: field:account.asset.property,account_actif_id:0
msgid "Depreciation account"
msgstr ""
#. module: account_asset
#: field:account.asset.asset,period_id:0
#: wizard_field:account.asset.compute,init,period_id:0
msgid "Period"
msgstr ""
#. module: account_asset
#: model:ir.actions.act_window,name:account_asset.action_account_asset_category_form
#: model:ir.ui.menu,name:account_asset.menu_action_account_asset_category_form
msgid "Asset Category"
msgstr ""
#. module: account_asset
#: wizard_button:account.asset.close,init,end:0
#: wizard_button:account.asset.compute,init,end:0
#: wizard_button:account.asset.modify,init,end:0
msgid "Cancel"
msgstr ""
#. 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 ""
#. module: account_asset
#: selection:account.asset.property,state:0
msgid "Open"
msgstr ""
#. module: account_asset
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: account_asset
#: model:ir.module.module,shortdesc:account_asset.module_meta_information
msgid "Asset management"
msgstr ""
#. module: account_asset
#: view:account.asset.board:0
#: field:account.asset.property,board_ids:0
#: model:ir.model,name:account_asset.model_account_asset_board
msgid "Asset board"
msgstr ""
#. module: account_asset
#: field:account.asset.asset,state:0
msgid "Global state"
msgstr ""
#. module: account_asset
#: selection:account.asset.property,method_time:0
msgid "Delay"
msgstr ""
#. module: account_asset
#: wizard_view:account.asset.close,init:0
msgid "General information"
msgstr ""
#. module: account_asset
#: field:account.asset.property,journal_analytic_id:0
msgid "Analytic journal"
msgstr ""
#. module: account_asset
#: field:account.asset.property,name:0
msgid "Method name"
msgstr ""
#. module: account_asset
#: field:account.asset.property,journal_id:0
msgid "Journal"
msgstr ""
#. module: account_asset
#: field:account.asset.property.history,name:0
msgid "History name"
msgstr ""
#. module: account_asset
#: view:account.asset.asset:0
msgid "Close method"
msgstr ""
#. module: account_asset
#: field:account.asset.property,entry_asset_ids:0
msgid "Asset Entries"
msgstr ""
#. module: account_asset
#: field:account.asset.asset,category_id:0
#: view:account.asset.category:0
#: field:account.asset.category,name:0
#: model:ir.model,name:account_asset.model_account_asset_category
msgid "Asset category"
msgstr ""
#. module: account_asset
#: view:account.asset.asset:0
msgid "Depreciation"
msgstr ""
#. module: account_asset
#: field:account.asset.asset,code:0
#: field:account.asset.category,code:0
msgid "Asset code"
msgstr ""
#. module: account_asset
#: field:account.asset.asset,value_total:0
msgid "Total value"
msgstr ""
#. module: account_asset
#: selection:account.asset.asset,state:0
msgid "View"
msgstr ""
#. module: account_asset
#: view:account.asset.asset:0
msgid "General info"
msgstr ""
#. module: account_asset
#: field:account.asset.asset,sequence:0
msgid "Sequence"
msgstr ""
#. module: account_asset
#: field:account.asset.property,value_residual:0
msgid "Residual value"
msgstr ""
#. module: account_asset
#: wizard_button:account.asset.close,init,asset_close:0
msgid "End of asset"
msgstr ""
#. module: account_asset
#: selection:account.asset.property,type:0
msgid "Direct"
msgstr ""
#. module: account_asset
#: selection:account.asset.property,type:0
msgid "Indirect"
msgstr ""
#. module: account_asset
#: field:account.asset.asset,parent_id:0
msgid "Parent asset"
msgstr ""
#. module: account_asset
#: model:ir.actions.act_window,name:account_asset.action_account_asset_asset_tree
#: model:ir.ui.menu,name:account_asset.menu_action_account_asset_asset_tree
msgid "Asset Hierarchy"
msgstr ""

View File

@ -21,9 +21,9 @@
{
'name': 'Budget Management',
'name': 'Budgets',
'version': '1.0',
'category': 'Finance',
'category': 'Project Management',
'complexity': "normal",
'description': """
This module allows accountants to manage analytic and crossovered budgets.

View File

@ -23,7 +23,7 @@
"name" : "Cancel Entries",
"version" : "1.1",
"author" : "OpenERP SA",
"category": 'Finance',
"category": 'Hidden',
'complexity': "normal",
"description": """
Allows cancelling accounting entries.

View File

@ -23,7 +23,7 @@
{
'name': 'Charts of Accounts',
'version': '1.1',
'category': 'Finance',
'category': 'Hidden',
'description': """
Remove minimal account chart.
=============================

View File

@ -23,7 +23,7 @@
"name" : "Account CODA - import bank statements from coda file",
"version" : "1.0",
"author" : "OpenERP SA",
"category" : "Finance",
"category" : "Hidden",
'complexity': "normal",
"description": """
Module provides functionality to import bank statements from coda files.

View File

@ -0,0 +1,259 @@
# Chinese (Traditional) 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 <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-09-27 10:40+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Chinese (Traditional) <zh_TW@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-09-28 05:20+0000\n"
"X-Generator: Launchpad (build 14049)\n"
#. module: account_coda
#: help:account.coda,journal_id:0
#: field:account.coda.import,journal_id:0
msgid "Bank Journal"
msgstr ""
#. module: account_coda
#: view:account.coda:0
#: field:account.coda.import,note:0
msgid "Log"
msgstr ""
#. module: account_coda
#: model:ir.model,name:account_coda.model_account_coda_import
msgid "Account Coda Import"
msgstr ""
#. module: account_coda
#: field:account.coda,name:0
msgid "Coda file"
msgstr ""
#. module: account_coda
#: view:account.coda:0
msgid "Group By..."
msgstr ""
#. module: account_coda
#: field:account.coda.import,awaiting_account:0
msgid "Default Account for Unrecognized Movement"
msgstr ""
#. module: account_coda
#: help:account.coda,date:0
msgid "Import Date"
msgstr "匯入日期"
#. module: account_coda
#: field:account.coda,note:0
msgid "Import log"
msgstr ""
#. module: account_coda
#: view:account.coda.import:0
msgid "Import"
msgstr "匯入"
#. module: account_coda
#: view:account.coda:0
msgid "Coda import"
msgstr ""
#. module: account_coda
#: code:addons/account_coda/account_coda.py:51
#, python-format
msgid "Coda file not found for bank statement !!"
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 ""
#. module: account_coda
#: view:account.coda:0
#: field:account.coda,company_id:0
msgid "Company"
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 ""
#. module: account_coda
#: view:account.coda:0
msgid "Search Coda"
msgstr ""
#. module: account_coda
#: view:account.coda:0
#: field:account.coda,user_id:0
msgid "User"
msgstr ""
#. module: account_coda
#: view:account.coda:0
#: field:account.coda,date:0
msgid "Date"
msgstr "日期"
#. module: account_coda
#: model:ir.ui.menu,name:account_coda.menu_account_coda_statement
msgid "Coda Import Logs"
msgstr ""
#. module: account_coda
#: model:ir.model,name:account_coda.model_account_coda
msgid "coda for an Account"
msgstr ""
#. module: account_coda
#: field:account.coda.import,def_payable:0
msgid "Default Payable Account"
msgstr ""
#. module: account_coda
#: help:account.coda,name:0
msgid "Store the detail of bank statements"
msgstr ""
#. module: account_coda
#: view:account.coda.import:0
msgid "Cancel"
msgstr "取消"
#. module: account_coda
#: view:account.coda.import:0
msgid "Open Statements"
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 ""
#. module: account_coda
#: model:ir.ui.menu,name:account_coda.menu_account_coda_import
msgid "Import Coda Statements"
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 ""
#. module: account_coda
#: model:ir.module.module,description:account_coda.module_meta_information
msgid ""
"\n"
" Module provides functionality to import\n"
" bank statements from coda files.\n"
" "
msgstr ""
#. module: account_coda
#: view:account.coda:0
msgid "Statements"
msgstr ""
#. module: account_coda
#: field:account.bank.statement,coda_id:0
msgid "Coda"
msgstr ""
#. module: account_coda
#: view:account.coda.import:0
msgid "Results :"
msgstr ""
#. module: account_coda
#: view:account.coda.import:0
msgid "Result of Imported Coda Statements"
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 ""
#. 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 ""
#. module: account_coda
#: model:ir.model,name:account_coda.model_account_bank_statement
msgid "Bank Statement"
msgstr ""
#. module: account_coda
#: model:ir.actions.act_window,name:account_coda.action_account_coda
msgid "Coda Logs"
msgstr ""
#. module: account_coda
#: code:addons/account_coda/wizard/account_coda_import.py:311
#, python-format
msgid "Result"
msgstr ""
#. module: account_coda
#: view:account.coda.import:0
msgid "Click on 'New' to select your file :"
msgstr ""
#. module: account_coda
#: field:account.coda.import,def_receivable:0
msgid "Default Receivable Account"
msgstr ""
#. module: account_coda
#: view:account.coda.import:0
msgid "Close"
msgstr "關閉"
#. module: account_coda
#: field:account.coda,statement_ids:0
msgid "Generated Bank Statements"
msgstr ""
#. module: account_coda
#: model:ir.module.module,shortdesc:account_coda.module_meta_information
msgid "Account CODA - import bank statements from coda file"
msgstr ""
#. module: account_coda
#: view:account.coda.import:0
msgid "Configure Your Journal and Account :"
msgstr ""
#. module: account_coda
#: view:account.coda:0
msgid "Coda Import"
msgstr ""
#. module: account_coda
#: view:account.coda:0
#: field:account.coda,journal_id:0
msgid "Journal"
msgstr ""

View File

@ -20,9 +20,9 @@
##############################################################################
{
'name': 'Reminders',
'name': 'Followups Management',
'version': '1.0',
'category': 'Finance',
'category': 'Accounting & Finance',
'complexity': "normal",
'description': """
Modules to automate letters for unpaid invoices, with multi-level recalls.
@ -52,10 +52,11 @@ Note that if you want to check the followup level for a given partner/account en
'security/ir.model.access.csv',
'wizard/account_followup_print_view.xml',
'report/account_followup_report.xml',
'account_followup_demo.xml', # Defined by default
'account_followup_view.xml',
'account_followup_data.xml'
'account_followup_data.xml',
],
'demo_xml': ['account_followup_demo.xml'],
'demo_xml': [],
'test': ['test/account_followup.yml'],
'installable': True,
'active': False,

View File

@ -3,7 +3,7 @@
<data noupdate="1">
<record id="demo_followup1" model="account_followup.followup">
<field name="name">Default follow-up</field>
<field name="name">Default Follow-Up</field>
<field name="company_id" ref="base.main_company"/>
<field name="description">First letter after 15 net days, 30 net days and 45 days end of month levels.</field>
</record>

View File

@ -6,7 +6,7 @@
<field name="model">account_followup.followup.line</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Follow-Up Lines">
<tree string="Follow-Up Steps">
<field name="name"/>
<field name="delay"/>
<field name="start" groups="base.group_extended"/>
@ -19,7 +19,7 @@
<field name="model">account_followup.followup.line</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Follow-Up Lines">
<form string="Follow-Up Steps">
<group col="6" colspan="4">
<field name="name"/>
<field name="delay"/>
@ -45,7 +45,7 @@
<form string="Follow-Up">
<field name="name"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<separator colspan="4" string=""/>
<newline/>
<field colspan="4" name="followup_line" nolabel="1"/>
</form>
</field>
@ -73,10 +73,6 @@
<field name="name"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
</group>
</search>
</field>
</record>
@ -169,6 +165,7 @@
<field name="res_model">account_followup.followup</field>
<field name="view_type">form</field>
<field name="view_mode">form,tree</field>
<field name="context" eval="'{\'res_id\': %s}' % (ref('demo_followup1'),)"/>
<field name="view_id" ref="view_account_followup_followup_form"/>
</record>

View File

@ -23,7 +23,7 @@
{
'name': 'Improve Invoice Layout',
'version': '1.0',
'category': 'Finance',
'category': 'Hidden',
'complexity': "easy",
'description': """
This module provides some features to improve the layout of the invoices.

View File

@ -10,7 +10,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<field name="name" position="before">
<field name="state" select="1" on_change="onchange_invoice_line_view(state)" />
<field name="state" on_change="onchange_invoice_line_view(state)" />
<field name="sequence"/>
</field>
</field>
@ -23,6 +23,7 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<xpath expr="/tree/field[@name='name']" position="before">
<field name="state" invisible="1"/>
<field name="sequence" string="Seq."/>
</xpath>
</field>

View File

@ -20,10 +20,10 @@
##############################################################################
{
"name": "Payment Management",
"name": "Suppliers Payment Management",
"version": "1.1",
"author": "OpenERP SA",
"category": "Finance",
"category": "Accounting & Finance",
'complexity': "easy",
"description": """
Module to manage invoice payment.

View File

@ -22,7 +22,7 @@
{
'name': 'Entries Sequence Numbering',
'version': '1.1',
'category': 'Finance',
'category': 'Hidden',
'complexity': "easy",
'description': """
This module maintains internal sequence number for accounting entries.

View File

@ -35,7 +35,7 @@ class account_move(osv.osv):
seq_no = False
for move in self.browse(cr, uid, ids, context=context):
if move.journal_id.internal_sequence_id:
seq_no = obj_sequence.get_id(cr, uid, move.journal_id.internal_sequence_id.id, context=context)
seq_no = obj_sequence.next_by_id(cr, uid, move.journal_id.internal_sequence_id.id, context=context)
if seq_no:
self.write(cr, uid, [move.id], {'internal_sequence_number': seq_no})
return res

View File

@ -0,0 +1,221 @@
# Chinese (Traditional) 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 <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-09-27 11:32+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Chinese (Traditional) <zh_TW@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-09-28 05:20+0000\n"
"X-Generator: Launchpad (build 14049)\n"
#. module: account_sequence
#: view:account.sequence.installer:0
#: model:ir.actions.act_window,name:account_sequence.action_account_seq_installer
msgid "Account Sequence Application Configuration"
msgstr ""
#. module: account_sequence
#: constraint:account.move:0
msgid ""
"You cannot create entries on different periods/journals in the same move"
msgstr ""
#. module: account_sequence
#: help:account.move,internal_sequence_number:0
#: help:account.move.line,internal_sequence_number:0
msgid "Internal Sequence Number"
msgstr "內部序列號碼"
#. module: account_sequence
#: help:account.sequence.installer,number_next:0
msgid "Next number of this sequence"
msgstr "本序列下個號碼"
#. module: account_sequence
#: field:account.sequence.installer,number_next:0
msgid "Next Number"
msgstr "下個號碼"
#. module: account_sequence
#: field:account.sequence.installer,number_increment:0
msgid "Increment Number"
msgstr "編號增量"
#. module: account_sequence
#: model:ir.module.module,description:account_sequence.module_meta_information
msgid ""
"\n"
" This module maintains internal sequence number for accounting entries.\n"
" "
msgstr ""
#. module: account_sequence
#: model:ir.module.module,shortdesc:account_sequence.module_meta_information
msgid "Entries Sequence Numbering"
msgstr ""
#. module: account_sequence
#: help:account.sequence.installer,number_increment:0
msgid "The next number of the sequence will be incremented by this number"
msgstr "序列下個號碼按此數字遞增"
#. module: account_sequence
#: view:account.sequence.installer:0
msgid "Configure Your Account Sequence Application"
msgstr ""
#. module: account_sequence
#: field:account.sequence.installer,progress:0
msgid "Configuration Progress"
msgstr "配置進度"
#. module: account_sequence
#: help:account.sequence.installer,suffix:0
msgid "Suffix value of the record for the sequence"
msgstr ""
#. module: account_sequence
#: field:account.sequence.installer,company_id:0
msgid "Company"
msgstr "公司"
#. module: account_sequence
#: help:account.journal,internal_sequence_id:0
msgid ""
"This sequence will be used to maintain the internal number for the journal "
"entries related to this journal."
msgstr ""
#. module: account_sequence
#: field:account.sequence.installer,padding:0
msgid "Number padding"
msgstr "數字位數"
#. module: account_sequence
#: model:ir.model,name:account_sequence.model_account_move_line
msgid "Journal Items"
msgstr ""
#. module: account_sequence
#: field:account.move,internal_sequence_number:0
#: field:account.move.line,internal_sequence_number:0
msgid "Internal Number"
msgstr "內部號碼"
#. module: account_sequence
#: constraint:account.move.line:0
msgid "Company must be same for its related account and period."
msgstr ""
#. module: account_sequence
#: help:account.sequence.installer,padding:0
msgid ""
"OpenERP will automatically adds some '0' on the left of the 'Next Number' to "
"get the required padding size."
msgstr ""
#. module: account_sequence
#: field:account.sequence.installer,name:0
msgid "Name"
msgstr "名稱"
#. module: account_sequence
#: constraint:account.move.line:0
msgid "You can not create move line on closed account."
msgstr ""
#. module: account_sequence
#: constraint:account.move:0
msgid ""
"You cannot create more than one move per period on centralized journal"
msgstr ""
#. module: account_sequence
#: sql_constraint:account.move.line:0
msgid "Wrong credit or debit value in accounting entry !"
msgstr ""
#. module: account_sequence
#: field:account.journal,internal_sequence_id:0
msgid "Internal Sequence"
msgstr "內部序列"
#. module: account_sequence
#: model:ir.model,name:account_sequence.model_account_sequence_installer
msgid "account.sequence.installer"
msgstr ""
#. module: account_sequence
#: view:account.sequence.installer:0
msgid "Configure"
msgstr "設定"
#. module: account_sequence
#: help:account.sequence.installer,prefix:0
msgid "Prefix value of the record for the sequence"
msgstr ""
#. module: account_sequence
#: model:ir.model,name:account_sequence.model_account_move
msgid "Account Entry"
msgstr ""
#. module: account_sequence
#: field:account.sequence.installer,suffix:0
msgid "Suffix"
msgstr ""
#. module: account_sequence
#: field:account.sequence.installer,config_logo:0
msgid "Image"
msgstr "圖像"
#. module: account_sequence
#: view:account.sequence.installer:0
msgid "title"
msgstr ""
#. module: account_sequence
#: sql_constraint:account.journal:0
msgid "The name of the journal must be unique per company !"
msgstr ""
#. module: account_sequence
#: field:account.sequence.installer,prefix:0
msgid "Prefix"
msgstr ""
#. module: account_sequence
#: sql_constraint:account.journal:0
msgid "The code of the journal must be unique per company !"
msgstr ""
#. module: account_sequence
#: constraint:account.move.line:0
msgid ""
"You can not create move line on receivable/payable account without partner"
msgstr ""
#. module: account_sequence
#: model:ir.model,name:account_sequence.model_account_journal
msgid "Journal"
msgstr ""
#. module: account_sequence
#: view:account.sequence.installer:0
msgid "You can enhance the Account Sequence Application by installing ."
msgstr ""
#. module: account_sequence
#: constraint:account.move.line:0
msgid "You can not create move line on view account."
msgstr ""

View File

@ -20,9 +20,8 @@
##############################################################################
import account_voucher
import company
import invoice
import report
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -25,22 +25,15 @@
"author" : 'OpenERP SA',
'complexity': "normal",
"description": """
Account Voucher module offers an easy way to deal with all the basic requirements of Voucher Entries
====================================================================================================
Account Voucher module includes all the basic requirements of Voucher Entries for Bank, Cash, Sales, Purchase, Expanse, Contra, etc.
====================================================================================================================================
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.
* Voucher Entry
* Voucher Receipt
* Cheque Register
""",
"category" : "Finance",
"website" : "http://www.openerp.com",
"category" : "Hidden",
"website" : "http://tinyerp.com",
"images" : ["images/customer_payment.jpeg","images/journal_voucher.jpeg","images/sales_receipt.jpeg","images/supplier_voucher.jpeg"],
"depends" : ["account"],
"init_xml" : [],
@ -55,7 +48,6 @@ accordingly.
"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",
@ -67,12 +59,7 @@ accordingly.
"test/account_voucher.yml",
"test/sales_receipt.yml",
"test/sales_payment.yml",
"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",
"test/account_voucher_report.yml"
],
'certificate': '0037580727101',
"active": False,

View File

@ -29,6 +29,17 @@ from tools.translate import _
class account_voucher(osv.osv):
def _check_paid(self, cr, uid, ids, name, args, context=None):
res = {}
for voucher in self.browse(cr, uid, ids, context=context):
ok = True
for line in voucher.move_ids:
if (line.account_id.type, 'in', ('receivable', 'payable')) and not line.reconcile_id:
ok = False
res[voucher.id] = ok
return res
def _get_type(self, cr, uid, context=None):
if context is None:
@ -39,10 +50,7 @@ class account_voucher(osv.osv):
if context is None: context = {}
if context.get('period_id', False):
return context.get('period_id')
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)
periods = self.pool.get('account.period').find(cr, uid)
return periods and periods[0] or False
def _get_journal(self, cr, uid, context=None):
@ -145,102 +153,39 @@ class account_voucher(osv.osv):
res['arch'] = etree.tostring(doc)
return res
def _check_paid(self, cr, uid, ids, name, args, context=None):
res = {}
for voucher in self.browse(cr, uid, ids, context=context):
ok = True
for line in voucher.move_ids:
if (line.account_id.type, 'in', ('receivable', 'payable')) and not line.reconcile_id:
ok = False
res[voucher.id] = ok
return res
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()
voucher_type = context.get('type', False)
counter_for_writeoff = counter_for_currency_diff = real_amount = 0.0
ctx.update({'date': voucher_date})
def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount):
debit = credit = 0.0
for l in line_dr_ids:
#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)
debit += l['amount']
for l in line_cr_ids:
#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)
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
credit += l['amount']
return abs(amount - abs(credit - debit))
def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, voucher_date, context=None):
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)
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': self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount)}}
def _get_writeoff_amount(self, cr, uid, ids, name, args, context=None):
if not ids: return {}
if context is None:
context = {}
res = {}.fromkeys(ids,{})
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()
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.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.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)
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
def _currency_id(self, cr, uid, ids, name, args, context=None):
res = {}
debit = credit = 0.0
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}
for l in voucher.line_dr_ids:
debit += l.amount
for l in voucher.line_cr_ids:
credit += l.amount
res[voucher.id] = abs(voucher.amount - abs(credit - debit))
return res
_name = 'account.voucher'
_description = 'Accounting Voucher'
_order = "date desc, id desc"
# _rec_name = 'number'
_columns = {
'type':fields.selection([
('sale','Sale'),
@ -250,7 +195,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)]}, change_default=1),
'journal_id':fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'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',
@ -259,13 +204,11 @@ 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.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.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),
# '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', readonly=True),
'company_id': fields.many2one('res.company', 'Company', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'state':fields.selection(
[('draft','New'),
[('draft','Draft'),
('proforma','Pro-forma'),
('posted','Posted'),
('cancel','Cancelled')
@ -282,6 +225,7 @@ class account_voucher(osv.osv):
'move_ids': fields.related('move_id','line_id', type='one2many', relation='account.move.line', string='Journal Items', readonly=True),
'partner_id':fields.many2one('res.partner', 'Partner', change_default=1, readonly=True, states={'draft':[('readonly',False)]}),
'audit': fields.related('move_id','to_check', type='boolean', help='Check this box if you are unsure of that journal entry and if you want to note it as \'to be reviewed\' by an accounting expert.', relation='account.move', string='To Review'),
'paid': fields.function(_check_paid, string='Paid', type='boolean', help="The Voucher has been totally paid."),
'pay_now':fields.selection([
('pay_now','Pay Directly'),
('pay_later','Pay Later or Group Funds'),
@ -291,14 +235,13 @@ 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_writeoff', 'Reconcile Payment Balance'),
], '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)]}),
'exchange_acc_id': fields.many2one('account.account', 'Exchange Diff. Account', readonly=True, states={'draft': [('readonly', False)]}),
'writeoff_acc_id': fields.many2one('account.account', 'Counterpart Account', readonly=True, states={'draft': [('readonly', False)]}),
'comment': fields.char('Counterpart 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, multi="writeoff"),
'currency_rate_difference': fields.function(_get_writeoff_amount, string="Currency Rate Difference", type='float', multi="writeoff"),
'paid': fields.function(_check_paid, string='Paid', type='boolean', help="The Voucher has been totally paid."),
'writeoff_amount': fields.function(_get_writeoff_amount, string='Reconcile Amount', type='float', readonly=True),
}
_defaults = {
'period_id': _get_period,
@ -323,7 +266,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_voucher_line_obj = self.pool.get('account.voucher.line')
voucher_line_pool = self.pool.get('account.voucher.line')
voucher_pool = self.pool.get('account.voucher')
if context is None: context = {}
@ -332,7 +275,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_voucher_line_obj.write(cr, uid, [line.id], {'amount':line.amount, 'untax_amount':line.untax_amount})
voucher_line_pool.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})
@ -360,7 +303,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_voucher_line_obj.write(cr, uid, [line.id], {'amount':line_total, 'untax_amount':untax_amount})
voucher_line_pool.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
@ -370,14 +313,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')
voucher_line_obj = self.pool.get('account.voucher.line')
line_pool = self.pool.get('account.voucher.line')
res = {
'tax_amount': False,
'amount': False,
}
voucher_total = 0.0
line_ids = resolve_o2m_operations(cr, uid, voucher_line_obj, line_ids, ["amount"], context)
line_ids = resolve_o2m_operations(cr, uid, line_pool, line_ids, ["amount"], context)
total = 0.0
total_tax = 0.0
@ -466,8 +409,8 @@ class account_voucher(osv.osv):
return default
def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id, price, voucher_currency_id, ttype, date, context=None):
"""price
def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None):
"""
Returns a dict that contains new values and context
@param partner_id: latest value from user input for field partner_id
@ -476,36 +419,43 @@ class account_voucher(osv.osv):
@return: Returns a dict which contains new values, and context
"""
if not journal_id:
return {}
if context is None:
context = {}
if not journal_id:
return {}
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_obj = self.pool.get('account.move.line')
move_line_pool = self.pool.get('account.move.line')
partner_pool = self.pool.get('res.partner')
journal_pool = self.pool.get('account.journal')
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',{})
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},
}
#drop existing lines
line_ids = ids and voucher_line_obj.search(cr, uid, [('voucher_id', 'in', ids)]) or []
if line_ids:
voucher_line_obj.unlink(cr, uid, line_ids, context=context)
vals = self.onchange_journal(cr, uid, ids, journal_id, [], False, partner_id, context)
vals = vals.get('value')
journal = journal_pool.browse(cr, uid, journal_id, context=context)
currency_id = vals.get('currency_id', currency_id)
default = {
'value':{'line_ids':[], 'line_dr_ids':[], 'line_cr_ids':[], 'pre_line': False, 'currency_id':currency_id},
}
currency_id = currency_id or journal.company_id.currency_id.id
if not partner_id:
return default
journal = journal_pool.browse(cr, uid, journal_id, 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)
return default
partner = partner_pool.browse(cr, uid, partner_id, context=context)
account_id = False
if journal.type in ('sale','sale_refund'):
@ -520,98 +470,78 @@ 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_obj.search(cr, uid, [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id)], context=context)
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_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
#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 != 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)
company_currency = journal.company_id.currency_id.id
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
if line.currency_id and currency_id==line.currency_id.id:
total_credit += line.amount_currency <0 and -line.amount_currency or 0.0
total_debit += line.amount_currency >0 and line.amount_currency or 0.0
else:
total_credit += currency_pool.compute(cr, uid, company_currency, currency_id, line.credit or 0.0)
total_debit += currency_pool.compute(cr, uid, company_currency, currency_id, line.debit or 0.0)
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
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.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
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 = 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
if line.currency_id and currency_id==line.currency_id.id:
amount_original = abs(line.amount_currency)
amount_unreconciled = abs(line.amount_residual_currency)
else:
amount_original = currency_pool.compute(cr, uid, company_currency, currency_id, line.credit or line.debit or 0.0)
amount_unreconciled = currency_pool.compute(cr, uid, company_currency, currency_id, abs(line.amount_residual))
#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)
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': amount_original,
'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,
'company_currency_id': line.company_id.currency_id.id,
'date_due':line.date_maturity,
'amount_unreconciled': amount_unreconciled,
}
#split voucher amount by most old first
if not move_line_found:
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
if line.credit:
amount = min(amount_unreconciled, total_debit)
rs['amount'] = amount
total_debit -= amount
else:
amount = min(amount_unreconciled, total_credit)
rs['amount'] = amount
total_credit -= amount
default['value']['line_ids'].append(rs)
if rs['type'] == 'cr':
@ -623,7 +553,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'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price)
return default
def onchange_date(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None):
@ -633,13 +563,9 @@ 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)
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)
pids = period_pool.search(cr, uid, [('date_start', '<=', date), ('date_stop', '>=', date)])
if pids:
if not 'value' in res:
res['value'] = {}
@ -647,9 +573,8 @@ 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 {}
return False
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
@ -659,14 +584,10 @@ class account_voucher(osv.osv):
vals = self.onchange_price(cr, uid, ids, line_ids, tax_id, partner_id, context)
vals['value'].update({'tax_id':tax_id})
currency_id = journal.company_id.currency_id.id
currency_id = False #journal.company_id.currency_id.id
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)
if periods:
vals['value'].update({'period_id':periods[0]})
return vals
def proforma_voucher(self, cr, uid, ids, context=None):
@ -707,9 +628,10 @@ class account_voucher(osv.osv):
def unlink(self, cr, uid, ids, context=None):
for t in self.read(cr, uid, ids, ['state'], context=context):
if t['state'] not in ('draft', 'cancel'):
raise osv.except_osv(_('Invalid action !'), _('In order to delete a voucher, you must cancel it!'))
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:
@ -730,7 +652,6 @@ class account_voucher(osv.osv):
return {'value':res}
def action_move_line_create(self, cr, uid, ids, context=None):
def _get_payment_term_lines(term_id, amount):
term_pool = self.pool.get('account.payment.term')
if term_id and amount:
@ -740,44 +661,49 @@ class account_voucher(osv.osv):
if context is None:
context = {}
move_pool = self.pool.get('account.move')
move_line_obj = self.pool.get('account.move.line')
move_line_pool = 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')
for voucher in self.browse(cr, uid, ids, context=context):
if voucher.move_id:
for inv in self.browse(cr, uid, ids, context=context):
if inv.move_id:
continue
context_multi_currency = context.copy()
context_multi_currency.update({'date': voucher.date})
context_multi_currency.update({'date': inv.date})
if voucher.number:
name = voucher.number
if inv.number:
name = inv.number
elif inv.journal_id.sequence_id:
name = seq_obj.next_by_id(cr, uid, inv.journal_id.sequence_id.id)
else:
name = seq_obj.get_id(cr, uid, voucher.journal_id.sequence_id.id)
if not voucher.reference:
raise osv.except_osv(_('Error !'), _('Please define a sequence on the journal !'))
if not inv.reference:
ref = name.replace('/','')
else:
ref = voucher.reference
ref = inv.reference
move = {
'name': name,
'journal_id': voucher.journal_id.id,
'narration': voucher.narration,
'date': voucher.date,
'journal_id': inv.journal_id.id,
'narration': inv.narration,
'date': inv.date,
'ref': ref,
'period_id': voucher.period_id and voucher.period_id.id or False
'period_id': inv.period_id and inv.period_id.id or False
}
move_id = move_pool.create(cr, uid, move)
#create the first line manually
company_currency = voucher.journal_id.company_id.currency_id.id
voucher_currency = voucher.currency_id.id
company_currency = inv.journal_id.company_id.currency_id.id
current_currency = inv.currency_id.id or company_currency
current_currency_obj = inv.currency_id or inv.journal_id.company_id.currency_id
debit = 0.0
credit = 0.0
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'):
debit = currency_pool.compute(cr, uid, voucher_currency, company_currency, voucher.amount, context=context_multi_currency)
# 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 debit < 0:
credit = -debit
debit = 0.0
@ -785,71 +711,53 @@ class account_voucher(osv.osv):
debit = -credit
credit = 0.0
sign = debit - credit < 0 and -1 or 1
#create the first line of the voucher
#create the first line of the voucher, the payment made
move_line = {
'name': voucher.name or '/',
'name': inv.name or '/',
'debit': debit,
'credit': credit,
'account_id': voucher.account_id.id,
'account_id': inv.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,
'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
'journal_id': inv.journal_id.id,
'period_id': inv.period_id.id,
'partner_id': inv.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
}
move_line_obj.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_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! "))
else:
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! "))
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_obj.create(cr, uid, currency_diff_line, context=context)
move_line_pool.create(cr, uid, move_line)
rec_list_ids = []
for line in voucher.line_ids:
line_total = debit - credit
if inv.type == 'sale':
line_total = line_total - currency_pool.compute(cr, uid, current_currency, company_currency, inv.tax_amount, context=context_multi_currency)
elif inv.type == 'purchase':
line_total = line_total + currency_pool.compute(cr, uid, current_currency, company_currency, inv.tax_amount, context=context_multi_currency)
for line in inv.line_ids:
#create one move line per voucher line where amount is not 0.0
if not line.amount:
continue
#we check if the voucher line is fully paid or not and create a move line to balance the payment and initial invoice if needed
if line.amount == line.amount_unreconciled:
amount = line.move_line_id.amount_residual #residual amount in company currency
amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=context_multi_currency)
amount_residual = line.move_line_id.amount_residual - amount #residual amount in company currency
else:
amount = line.amount_in_company_currency
amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=context_multi_currency)
amount_residual = 0.0
move_line = {
'journal_id': voucher.journal_id.id,
'period_id': voucher.period_id.id,
'journal_id': inv.journal_id.id,
'period_id': inv.period_id.id,
'name': line.name or '/',
'account_id': line.account_id.id,
'move_id': move_id,
'partner_id': voucher.partner_id.id,
'currency_id': company_currency <> line.currency_id.id and line.currency_id.id or False,
'partner_id': inv.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': voucher.date
'date': inv.date
}
if amount < 0:
amount = -amount
@ -858,68 +766,97 @@ 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'):
if inv.tax_id and inv.type in ('sale', 'purchase'):
move_line.update({
'account_tax_id': voucher.tax_id.id,
'account_tax_id': inv.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]
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 <> line.currency_id.id and sign * line.amount or 0.0
voucher_line = move_line_obj.create(cr, uid, move_line)
move_line['amount_currency'] = company_currency <> current_currency and sign * line.amount or 0.0
voucher_line = move_line_pool.create(cr, uid, move_line)
rec_ids = [voucher_line, line.move_line_id.id]
# Change difference entry
if amount_residual:
if not inv.exchange_acc_id.id:
raise osv.except_osv(_('Error!'), _('You must provide an account for the exchange difference.'))
move_line = {
'journal_id': inv.journal_id.id,
'period_id': inv.period_id.id,
'name': _('change')+': '+(line.name or '/'),
'account_id': line.account_id.id,
'move_id': move_id,
'partner_id': inv.partner_id.id,
'currency_id': company_currency <> current_currency and current_currency or False,
'amount_currency': 0.0,
'quantity': 1,
'credit': amount_residual > 0 and amount_residual or 0.0,
'debit': amount_residual < 0 and -amount_residual or 0.0,
'date': inv.date
}
new_id = move_line_pool.create(cr, uid, move_line)
move_line = {
'journal_id': inv.journal_id.id,
'period_id': inv.period_id.id,
'name': _('change')+': '+(line.name or '/'),
'account_id': inv.exchange_acc_id.id,
'move_id': move_id,
'amount_currency': 0.0,
'partner_id': inv.partner_id.id,
'currency_id': company_currency <> current_currency and current_currency or False,
'quantity': 1,
'debit': amount_residual > 0 and amount_residual or 0.0,
'credit': amount_residual < 0 and -amount_residual or 0.0,
'date': inv.date
}
move_line_pool.create(cr, uid, move_line)
rec_ids.append(new_id)
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):
#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)
if not currency_pool.is_zero(cr, uid, current_currency_obj, line_total):
diff = line_total
account_id = False
write_off_name = ''
if voucher.payment_option == 'with_writeoff':
account_id = voucher.writeoff_acc_id.id
write_off_name = voucher.comment
elif voucher.type in ('sale', 'receipt'):
if not voucher.partner_id:
account_id = property_obj.search(cr,uid,[('name','=','property_account_receivable'),('res_id','=',False)])
else:
account_id = voucher.partner_id.property_account_receivable.id
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
else:
if not voucher.partner_id:
account_id = property_obj.search(cr,uid,[('name','=','property_account_payable'),('res_id','=',False)])
else:
account_id = voucher.partner_id.property_account_payable.id
if not account_id:
raise osv.except_osv(_('Error !'), _('No receivable/payable account defined in properties!'))
account_id = inv.partner_id.property_account_payable.id
move_line = {
'name': write_off_name or name,
'account_id': account_id,
'move_id': move_id,
'partner_id': voucher.partner_id.id,
'date': voucher.date,
'debit': diff < 0 and -diff or 0.0,
'partner_id': inv.partner_id.id,
'date': inv.date,
'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,
'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_obj.create(cr, uid, move_line)
self.write(cr, uid, [voucher.id], {
move_line_pool.create(cr, uid, move_line)
self.write(cr, uid, [inv.id], {
'move_id': move_id,
'state': 'posted',
'number': name,
})
if voucher.journal_id.entry_posted:
if inv.journal_id.entry_posted:
move_pool.post(cr, uid, [move_id], context={})
for rec_ids in rec_list_ids:
if len(rec_ids) >= 2:
move_line_obj.reconcile_partial(cr, uid, rec_ids)
move_line_pool.reconcile_partial(cr, uid, rec_ids, writeoff_acc_id=inv.exchange_acc_id.id, writeoff_period_id=inv.period_id.id, writeoff_journal_id=inv.journal_id.id)
return True
def copy(self, cr, uid, id, default={}, context=None):
@ -942,86 +879,45 @@ 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
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):
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
# If the payment is in the same currency than the invoice, we keep the same amount
# Otherwise, we compute from company currency to payment currency
def _compute_balance(self, cr, uid, ids, name, args, context=None):
currency_pool = self.pool.get('res.currency')
res = {}
rs_data = {}
for line in self.browse(cr, uid, ids, context=context):
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,
}
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 and line.voucher_id.currency_id.id or company_currency
move_line = line.move_line_id or False
return res
if not move_line:
res['amount_original'] = 0.0
res['amount_unreconciled'] = 0.0
elif move_line.currency_id and voucher_currency==move_line.currency_id.id:
res['amount_original'] = currency_pool.compute(cr, uid, move_line.currency_id.id, voucher_currency, abs(move_line.amount_currency), context=ctx)
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)
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)
res['amount_unreconciled'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, abs(move_line.amount_residual), context=ctx)
else:
res['amount_original'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, move_line.debit, context=ctx)
res['amount_unreconciled'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, abs(move_line.amount_residual), 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')
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 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_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):
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
rs_data[line.id] = res
return rs_data
_columns = {
'voucher_id':fields.many2one('account.voucher', 'Voucher', required=1, ondelete='cascade'),
'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),
'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'),
'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"),
'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"),
'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'),
'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),
@ -1043,9 +939,9 @@ class account_voucher_line(osv.osv):
@return: Returns a dict which contains new values, and context
"""
res = {}
move_line_obj = self.pool.get('account.move.line')
move_line_pool = self.pool.get('account.move.line')
if move_line_id:
move_line = move_line_obj.browse(cr, user, move_line_id, context=context)
move_line = move_line_pool.browse(cr, user, move_line_id, context=context)
if move_line.credit:
ttype = 'dr'
else:
@ -1120,7 +1016,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, 'date': st_line.date}, context=context)
voucher_obj.write(cr, uid, [st_line.voucher_id.id], {'number': next_number}, 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)
@ -1130,7 +1026,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, 'date': st_line.date}, update_check=False, context=context)
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 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()

View File

@ -1,28 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record id="view_invoice_customer" model="ir.ui.view">
<field name="name">account.invoice.customer.pay</field>
<field name="model">account.invoice</field>
<field name="type">form</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<button name="invoice_open" position="after">
<button name="invoice_pay_customer" type="object" string="Payment" states="open" icon="gtk-go-forward"/>
</button>
</field>
</record>
<record id="view_invoice_supplier" model="ir.ui.view">
<field name="name">account.invoice.supplier.pay</field>
<field name="model">account.invoice</field>
<field name="type">form</field>
<field name="inherit_id" ref="account.invoice_supplier_form"/>
<field name="arch" type="xml">
<button name="invoice_open" position="after">
<button name="invoice_pay_customer" type="object" string="Pay Invoice" states="open" icon="gtk-go-forward"/>
</button>
</field>
</record>
<record id="view_invoice_customer" model="ir.ui.view">
<field name="name">account.invoice.customer.pay</field>
<field name="model">account.invoice</field>
<field name="type">form</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<button name="invoice_open" position="after">
<button name="invoice_pay_customer" type="object" string="Payment" states="open" icon="gtk-go-forward"/>
</button>
</field>
</record>
<record id="view_invoice_supplier" model="ir.ui.view">
<field name="name">account.invoice.supplier.pay</field>
<field name="model">account.invoice</field>
<field name="type">form</field>
<field name="inherit_id" ref="account.invoice_supplier_form"/>
<field name="arch" type="xml">
<button name="invoice_open" position="after">
<button name="invoice_pay_customer" type="object" string="Pay Invoice" states="open" icon="gtk-go-forward"/>
</button>
</field>
</record>
</data>
</openerp>

View File

@ -43,7 +43,7 @@
<form string="Accounting Voucher">
<group col="6" colspan="4">
<field name="partner_id" required="1" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>
<field name="date" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date, context)"/>
<field name="date" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="journal_id" widget="selection" select="1" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>
<field name="type" required="1"/>
<field name="name" colspan="2"/>

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_company_inherit_currency_xchange_form">
<field name="name">res.company.form.inherit</field>
<field name="inherit_id" ref="base.view_company_form"/>
<field name="model">res.company</field>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="currency_id" position="after">
<field name="property_income_currency_exchange" colspan="2"/>
<field name="property_expense_currency_exchange" colspan="2"/>
</field>
</field>
</record>
</data>
</openerp>

View File

@ -45,11 +45,10 @@ 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',
'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'
}
}
invoice()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -73,7 +73,7 @@ class sale_receipt_report(osv.osv):
to_char(av.date, 'MM') as month,
to_char(av.date, 'YYYY-MM-DD') as day,
av.partner_id as partner_id,
av.currency_id as currency_id,
aj.currency as currency_id,
av.journal_id as journal_id,
rp.user_id as user_id,
av.company_id as company_id,
@ -111,7 +111,7 @@ class sale_receipt_report(osv.osv):
to_char(av.date, 'MM'),
to_char(av.date, 'YYYY-MM-DD'),
av.partner_id,
av.currency_id,
aj.currency,
av.journal_id,
rp.user_id,
av.company_id,

View File

@ -1,355 +0,0 @@
-
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
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 currency USD in OpenERP for February of 1.250000 Rate
-
!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 currency USD in OpenERP for March of 1.111111 Rate
-
!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 currency USD in OpenERP for April of 1.052632 Rate
-
!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 create new partner Mark 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 not 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 not correct for debtors account"
-
I create the first voucher of payment
<create with values 240 USD, journal USD, and fill amounts 180 for the invoice of 200$ and 70 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'), 240.00, 2, ttype='receipt', date=False)
vals = {
'account_id': ref('account.cash'),
'amount': 240.00,
'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.00:
item['amount'] = 180.00
else:
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.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.0), "Writeoff amount is not -10.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_strauss0'))])
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_strauss0'))])
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
-
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_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):
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 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.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.00:
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
-
!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
<create 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_strauss0"), ref('bank_journal_USD'), 45.00, 2, ttype='receipt', date=False)
vals = {
'account_id': ref('account.cash'),
'amount': 45.00,
'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.00:
item['amount'] = 20.00
else:
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.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.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])
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_strauss0'))])
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
-
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])
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.
-
I check that my currency rate difference is correct. 8.5 in credit with no amount_currency
-
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'))])
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.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.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
-
!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 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 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 and invoice_id.state == 'paid') , "Residual amount is not correct for second Invoice"

View File

@ -1,328 +0,0 @@
-
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
<create with values 240 EUR, journal EUR, and fills amount 180 for the invoice of 200$ and 70 for the invoice of 100$>
-
!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
<create 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_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"

View File

@ -1,360 +0,0 @@
-
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
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 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 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 currency USD in OpenERP for April of 1.052632 Rate
-
!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 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 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 for debtor account(debit - credit == 150)
-
!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
<create with values 240 EUR, journal EUR, and fills amount 180 for the invoice of 200$ and 70 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'), 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.00:
item['amount'] = 180.00
else:
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.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.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_michael0'))])
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_michael0'))])
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_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):
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 in amount_currency columns and their credit 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_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):
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.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."
-
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])
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"))
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
<create 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.00:
item['amount'] = 20.00
else:
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.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.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"
-
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 in amount_currency columns and their credit columns are respectively 15 and 24 and currency is USD($).
-
I check that my currency rate difference is correct. 8.50 in credit with no amount_currency
-
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'))])
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.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.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
-
!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 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 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 and invoice_id.state == 'paid') , "Residual amount is not correct for second Invoice"

View File

@ -1,331 +0,0 @@
-
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 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 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 currency EUR in OpenERP for April of 1.000000 Rate
-
!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 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 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 for debtor account(debit - credit == 150)
-
!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 second 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 for debtor account (debit - credit == 80)
-
!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
<create with values 120 EUR, journal EUR, and fill amounts 100 for the invoice of 150 EUR and 20 for the invoice of 80 EUR>
-
!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.00,
'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.00:
item['amount'] = 100.00
else:
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)
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', '=', 'First 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.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"
-
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 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])
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 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'))])
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.00:
assert move_line.amount_currency == 0.00, "Debtor account has wrong entry."
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
-
!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])
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
-
!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])
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.
<create with values 120 EUR, journal EUR, and fill amounts 50 for the invoice of 150 EUR and 70 for the invoice of 80 EUR>
-
!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.00,
'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])
assert (voucher_id.currency_rate_difference == 0.00), "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 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])
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 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'))])
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."
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
-
!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])
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
-
!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])
assert (move_line.amount_residual_currency == -10.0 and move_line.amount_residual == -10.0) , "Residual amount is not correct for second Invoice"

View File

@ -1,194 +0,0 @@
-
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 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 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 currency CHF in OpenERP for March of 1.250000 Rate
-
!record {model: res.currency.rate, id: mar_chf}:
currency_id: base.CHF
name: !eval "'%s-03-01' %(datetime.now().year)"
rate: 1.250000
-
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 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 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 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"))
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
<create with values 300 CHF, journal CHF, and fill amounts 200 for the invoice of 200 CAD>
-
!python {model: account.voucher}: |
import netsvc, time
vals = {}
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.00,
'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.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.0
-
!python {model: account.voucher}: |
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.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'), ('partner_id', '=', ref('res_partner_john0'))])
voucher_id = self.browse(cr, uid, voucher[0])
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'), ('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'), ('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)])
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 1 new line with -200 as amount_currency columns and 149.39 of credit and currency is CAD($).
-
I check that my currency rate difference is correct. 49.39 in debit with no amount_currency
-
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'), ('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)])
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."
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.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_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"

View File

@ -74,24 +74,14 @@
<field name="arch" type="xml">
<form string="Bill Payment">
<group col="6" colspan="4">
<field name="partner_id"
required="1"
on_change="onchange_partner_id(partner_id, journal_id, amount,
currency_id, type, date, context)"
string="Supplier"/>
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" context="{'invoice_currency':currency_id}" string="Supplier"/>
<field name="amount" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="journal_id"
domain="[('type','in',['bank', 'cash'])]"
widget="selection" select="1"
on_change="onchange_partner_id(partner_id, journal_id, amount,
currency_id, type, date, context)"
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"
string="Payment Method"/>
<field name="amount"
on_change="onchange_partner_id(partner_id, journal_id, amount,
currency_id, type, date, context)"/>
<field name="date"
select="1"
on_change="onchange_date(partner_id, journal_id, amount,
currency_id, type, date, context)"/>
<field name="date" select="1" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="reference" select="1" string="Payment Ref"/>
<field name="name" colspan="2"/>
<field name="account_id"
@ -104,37 +94,25 @@
<page string="Payment Information">
<field name="line_dr_ids" attrs="{'invisible': [('type', '=', 'receipt')]}" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount)">
<tree string="Open Supplier Journal Entries" editable="bottom">
<field name="move_line_id" required="1" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
on_change="onchange_move_line_id(move_line_id)"
domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
/>
<field name="account_id" groups="base.group_extended" domain="[('type','=','payable')]" invisible="1"/>
<field name="account_id" groups="base.group_extended" domain="[('type','=','payable')]"/>
<field name="date_original" readonly="1"/>
<field name="date_due" readonly="1"/>
<field name="currency_id" readonly="1"/>
<field name="amount_original" readonly="1" invisible="1"/>
<field name="amount_unreconciled" readonly="1"/>
<field name="amount" on_change="onchange_amount(amount)"/>
<field name="amount_in_voucher_currency" readonly="1" groups="base.group_no_one"/>
<field name="voucher_currency_id" readonly="1" groups="base.group_no_one"/>
<field name="amount_in_company_currency" readonly="1" invisible="1"/>
<field name="company_currency_id" readonly="1" invisible="1"/>
<field name="amount_original" readonly="1"/>
<field name="amount_unreconciled" sum="Open Balance" readonly="1"/>
<field name="amount" sum="Payment"/>
</tree>
</field>
<field name="line_cr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('type', '=', 'payment')]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount)">
<tree string="Open Customer Journal Entries" editable="bottom">
<field name="move_line_id" required="1"/>
<field name="move_line_id"/>
<field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/>
<field name="date_original" readonly="1"/>
<field name="date_due" readonly="1"/>
<field name="currency_id" readonly="1"/>
<field name="amount_original" readonly="1" invisible="1"/>
<field name="amount_unreconciled" readonly="1"/>
<field name="amount" on_change="onchange_amount(amount)"/>
<field name="amount_in_voucher_currency" readonly="1" groups="base.group_no_one"/>
<field name="voucher_currency_id" readonly="1" groups="base.group_no_one"/>
<field name="amount_in_company_currency" readonly="1" invisible="1"/>
<field name="company_currency_id" readonly="1" invisible="1"/>
<field name="date_original"/>
<field name="amount_original"/>
<field name="amount" sum="Payment"/>
</tree>
</field>
<group col="2" colspan="3">
@ -159,28 +137,15 @@
<field name="arch" type="xml">
<form string="Bill Payment">
<group col="6" colspan="4">
<field name="partner_id"
domain="[('supplier','=',True)]"
required="1"
invisible="context.get('line_type', False)"
on_change="onchange_partner_id(partner_id, journal_id, amount,
currency_id, type, date, context)"
string="Supplier"/>
<field name="partner_id" domain="[('supplier','=',True)]" required="1" invisible="context.get('line_type', False)" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" context="{'invoice_currency':currency_id}" string="Supplier"/>
<field name="amount" invisible="context.get('line_type', False)" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="journal_id"
domain="[('type','in',['bank', 'cash'])]"
invisible="context.get('line_type', False)"
widget="selection" select="1"
on_change="onchange_partner_id(partner_id, journal_id, amount,
currency_id, type, date, context)"
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"
string="Payment Method"/>
<field name="amount"
invisible="context.get('line_type', False)"
on_change="onchange_partner_id(partner_id, journal_id, amount,
currency_id, type, date, context)"/>
<field name="date"
invisible="context.get('line_type', False)"
on_change="onchange_date(partner_id, journal_id, amount,
currency_id, type, date, context)"/>
<field name="date" select="1" invisible="context.get('line_type', False)" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="reference" select="1" invisible="context.get('line_type', False)" string="Payment Ref"/>
<field name="name" colspan="2" invisible="context.get('line_type', False)"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
@ -194,37 +159,26 @@
<page string="Payment Information">
<field name="line_dr_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140">
<tree string="Supplier Invoices and Outstanding transactions" editable="bottom">
<field name="move_line_id" required="1" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
on_change="onchange_move_line_id(move_line_id)"
domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
required="1"
/>
<field name="account_id" groups="base.group_extended" domain="[('type','=','payable')]"/>
<field name="account_id" groups="base.group_no_one" domain="[('type','=','payable')]"/>
<field name="date_original" readonly="1"/>
<field name="date_due" readonly="1"/>
<field name="currency_id" readonly="1"/>
<field name="amount_original" readonly="1" invisible="1"/>
<field name="amount_unreconciled" readonly="1"/>
<field name="amount" on_change="onchange_amount(amount)"/>
<field name="amount_in_voucher_currency" readonly="1" groups="base.group_no_one"/>
<field name="voucher_currency_id" readonly="1" groups="base.group_no_one"/>
<field name="amount_in_company_currency" readonly="1" invisible="1"/>
<field name="company_currency_id" readonly="1" invisible="1"/>
<field name="amount_original" readonly="1"/>
<field name="amount_unreconciled" sum="Open Balance" readonly="1"/>
<field name="amount" sum="Payment"/>
</tree>
</field>
<field name="line_cr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('pre_line','=',False)]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}">
<tree string="Credits" editable="bottom">
<field name="move_line_id" required="1"/>
<field name="move_line_id"/>
<field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/>
<field name="date_original" readonly="1"/>
<field name="date_due" readonly="1"/>
<field name="currency_id" readonly="1"/>
<field name="amount_original" readonly="1" invisible="1"/>
<field name="amount_unreconciled" readonly="1"/>
<field name="amount" on_change="onchange_amount(amount)"/>
<field name="amount_in_voucher_currency" readonly="1" groups="base.group_no_one"/>
<field name="voucher_currency_id" readonly="1" groups="base.group_no_one"/>
<field name="amount_in_company_currency" readonly="1" invisible="1"/>
<field name="company_currency_id" readonly="1" invisible="1"/>
<field name="date_original"/>
<field name="amount_original"/>
<field name="amount" sum="Payment"/>
</tree>
</field>
<group col="2" colspan="3">
@ -232,26 +186,27 @@
<field name="narration" colspan="2" nolabel="1"/>
</group>
<group col="2" colspan="1">
<group col="4" colspan="1">
<separator string="Payment Options" colspan="4"/>
<field name="payment_option" required="1" colspan="4"/>
<field name="currency_rate_difference" attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
<field name="company_currency" attrs="{'invisible':[('payment_option','!=','with_writeoff')]}" nolabel="1"/><newline/>
<group col="2" colspan="1">
<field name="exchange_acc_id"
attrs="{'invisible':[('currency_id','=',False)]}"
domain="[('type','=','other')]"/>
<field name="analytic_id"
groups="analytic.group_analytic_accounting"/>
<separator string="Payment Options" colspan="2"/>
<field name="payment_option" required="1"/>
<field name="writeoff_amount"
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
<field name="currency_id2" nolabel="1" attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/><newline/>
<field name="writeoff_acc_id"
attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
domain="[('type','=','other')]" colspan="4"/>
domain="[('type','=','other')]"/>
<field name="comment"
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}" colspan="4"/>
<field name="analytic_id"
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"
groups="analytic.group_analytic_accounting" colspan="4"/>
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
</group>
<separator string="Other Information" colspan="2"/>
<group col="4" colspan="1">
<group col="2" colspan="1">
<field name="number"/>
<field name="currency_id" invisible="1"/>
</group>
</group>
</page>
@ -318,88 +273,58 @@
id="menu_action_vendor_payment" parent="account.menu_finance_payables"/>
<record model="ir.ui.view" id="view_vendor_receipt_form">
<field name="name">voucher.form.customer.payment</field>
<field name="name">account.voucher.receipt.form</field>
<field name="model">account.voucher</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Customer Payment">
<group col="12" colspan="4">
<field name="partner_id"
colspan="4"
required="1"
invisible="context.get('line_type', False)"
on_change="onchange_partner_id(partner_id, journal_id, amount,
currency_id, type, date, context)"
string="Customer"/>
<group col="6" colspan="4">
<field name="partner_id" required="1" invisible="context.get('line_type', False)" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" string="Customer"/>
<field name="currency_id" invisible="1"/>
<field name="amount"
invisible="context.get('line_type', False)"
string="Paid Amount"
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="journal_id"
domain="[('type','in',['bank', 'cash'])]"
invisible="context.get('line_type', False)"
widget="selection"
select="1"
on_change="onchange_partner_id(partner_id, journal_id, amount,
currency_id, type, date, context)"
string="Payment Method"
colspan="4"/>
<field name="amount"
colspan="1"
invisible="context.get('line_type', False)"
string="Paid Amount"
on_change="onchange_partner_id(partner_id, journal_id, amount,
currency_id, type, date, context)"/>
<field name="currency_id" nolabel="1" invisible="1"/>
<field name="date"
colspan="4"
select="1"
invisible="context.get('line_type', False)"
on_change="onchange_date(partner_id, journal_id, amount,
currency_id, type, date, context)"/>
<field name="reference" colspan="4" select="1" invisible="context.get('line_type', False)" string="Payment Ref"/>
<field name="name" colspan="4" invisible="context.get('line_type', False)"/>
<field name="company_id" colspan="4" widget="selection" groups="base.group_multi_company"/>
<field name="account_id" colspan="4"
widget="selection" select="1"
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"
string="Payment Method"/>
<field name="date" select="1" invisible="context.get('line_type', False)" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="reference" select="1" invisible="context.get('line_type', False)" string="Payment Ref"/>
<field name="name" colspan="2" invisible="context.get('line_type', False)"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="account_id"
widget="selection"
invisible="True"/>
<field name="pre_line" colspan="4" invisible="1"/>
<field name="type" colspan="4" invisible="True"/>
<field name="pre_line" invisible="1"/>
<field name="type" invisible="True"/>
</group>
<notebook colspan="4">
<page string="Payment Information">
<field name="line_cr_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, date, context)">
<field name="line_cr_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount)">
<tree string="Invoices and outstanding transactions" editable="bottom">
<field name="move_line_id" required="1" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
on_change="onchange_move_line_id(move_line_id)"
domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
required="1"
/>
<field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]" invisible="1"/>
<field name="account_id" groups="base.group_no_one" domain="[('type','=','receivable')]"/>
<field name="date_original" readonly="1"/>
<field name="date_due" readonly="1"/>
<field name="currency_id" readonly="1"/>
<field name="amount_original" readonly="1" invisible="1"/>
<field name="amount_unreconciled" readonly="1"/>
<field name="amount" on_change="onchange_amount(amount)"/>
<field name="amount_in_voucher_currency" readonly="1" groups="base.group_no_one"/>
<field name="voucher_currency_id" readonly="1" groups="base.group_no_one"/>
<field name="amount_in_company_currency" readonly="1" invisible="1"/>
<field name="company_currency_id" readonly="1" invisible="1"/>
<field name="amount_original" readonly="1"/>
<field name="amount_unreconciled" sum="Open Balance" readonly="1"/>
<field name="amount" sum="Payment"/>
</tree>
</field>
<field name="line_dr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('pre_line','=',False)]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, date, context)">
<field name="line_dr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('pre_line','=',False)]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount)">
<tree string="Credits" editable="bottom">
<field name="move_line_id" required="1" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
on_change="onchange_move_line_id(move_line_id)"
domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
/>
<field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]" invisible="1"/>
<field name="date_original" readonly="1"/>
<field name="date_due" readonly="1"/>
<field name="currency_id" readonly="1"/>
<field name="amount_original" readonly="1" invisible="1"/>
<field name="amount_unreconciled" readonly="1"/>
<field name="amount" on_change="onchange_amount(amount)"/>
<field name="amount_in_voucher_currency" readonly="1" groups="base.group_no_one"/>
<field name="voucher_currency_id" readonly="1" groups="base.group_no_one"/>
<field name="amount_in_company_currency" readonly="1" invisible="1"/>
<field name="company_currency_id" readonly="1" invisible="1"/>
<field name="move_line_id"/>
<field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/>
<field name="date_original"/>
<field name="amount_original"/>
<field name="amount" sum="Payment"/>
</tree>
</field>
<group col="2" colspan="3">
@ -407,22 +332,21 @@
<field name="narration" colspan="2" nolabel="1"/>
</group>
<group col="2" colspan="1">
<group col="4" colspan="1">
<separator string="Payment Options" colspan="4"/>
<field name="payment_option" required="1" colspan="4"/>
<field name="currency_rate_difference" attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
<field name="company_currency" attrs="{'invisible':[('payment_option','!=','with_writeoff')]}" nolabel="1"/><newline/>
<group col="2" colspan="1">
<separator string="Payment Options" colspan="2"/>
<field name="analytic_id"
groups="analytic.group_analytic_accounting"/>
<field name="exchange_acc_id"
attrs="{'invisible':[('currency_id','=',False)]}"
domain="[('type','=','other')]"/>
<field name="payment_option" required="1"/>
<field name="writeoff_amount"
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
<field name="currency_id2" nolabel="1" attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/><newline/>
<field name="writeoff_acc_id"
attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
domain="[('type','=','other')]" colspan="4"/>
domain="[('type','=','other')]"/>
<field name="comment"
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}" colspan="4"/>
<field name="analytic_id"
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"
groups="analytic.group_analytic_accounting" colspan="4"/>
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
</group>
<separator string="Other Information" colspan="2"/>
<group col="4" colspan="1">

View File

@ -83,7 +83,7 @@
<form string="Sales Receipt">
<group col="6" colspan="4">
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" string="Customer"/>
<field name="date" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date, context)"/>
<field name="date" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="journal_id" domain="[('type','in',['sale','sale_refund'])]" widget="selection" on_change="onchange_journal(journal_id, line_cr_ids, tax_id, partner_id)"/>
<field name="number"/>
<field name="name" colspan="2"/>
@ -210,7 +210,7 @@
<form string="Supplier Voucher">
<group col="6" colspan="4">
<field name="partner_id" domain="[('supplier','=',True)]" required="1" string="Supplier" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="date" string="Bill Date" select="1" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date, context)"/>
<field name="date" string="Bill Date" select="1" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="journal_id" domain="[('type','in',['purchase','purchase_refund'])]" widget="selection" select="1" on_change="onchange_journal(journal_id, line_dr_ids, tax_id, partner_id)"/>
<field name="number"/>
<field name="name" colspan="2"/>

View File

@ -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), voucher_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), 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,

View File

@ -24,7 +24,7 @@
"version": "1.1",
"author" : "OpenERP SA",
"website" : "http://www.openerp.com",
"category" : "Finance",
"category" : "Hidden",
"depends" : ["base", "decimal_precision"],
"description": """
Module for defining analytic accounting object.

View File

@ -22,7 +22,7 @@
{
'name': 'Analytic Journal Billing Rate, Define the default invoicing rate for a specific journal',
'version': '1.0',
'category': 'Human Resources',
'category': 'Hidden',
'description': """
This module allows you to define what is the default invoicing rate for a specific journal on a given account.
==============================================================================================================

View File

@ -23,7 +23,7 @@
{
'name': 'Human Resources',
'version': '1.0',
'category': 'Generic Modules/Others',
'category': 'Hidden',
'description': """
This module allows you to define what is the default function of a specific user on a given account.
====================================================================================================

View File

@ -24,7 +24,7 @@
{
'name': 'Database Anonymization',
'version': '1.0',
'category': 'Tools',
'category': 'Hidden',
'complexity': "easy",
'description': """
This module allows you to anonymize a database.

View File

@ -239,7 +239,7 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory):
return res
_columns = {
'name': fields.char(size='64', string='File Name'),
'name': fields.char(size=64, string='File Name'),
'summary': fields.function(_get_summary, type='text', string='Summary'),
'file_export': fields.binary(string='Export'),
'file_import': fields.binary(string='Import'),

View File

@ -18,6 +18,5 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import profile_association
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -23,8 +23,7 @@
{
'name': 'Association profile',
'version': '0.1',
'category': 'General',
'category': 'Profile',
'category': 'Vertical Applications',
'complexity': "normal",
'description': """
This module is to configure modules related to an association.

View File

@ -1,53 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
from lxml import etree
from osv import fields, osv
class profile_association_config_install_modules_wizard(osv.osv_memory):
_inherit = 'base.setup.installer'
_columns = {
'hr_expense':fields.boolean('Resources Management: Expenses Tracking', help="Tracks and manages employee expenses, and can "
"automatically re-invoice clients if the expenses are "
"project-related."),
'event_project':fields.boolean('Event Management: Events', help="Helps you to manage and organize your events."),
'project_gtd':fields.boolean('Getting Things Done',
help="GTD is a methodology to efficiently organise yourself and your tasks. This module fully integrates GTD principle with OpenERP's project management."),
'wiki': fields.boolean('Wiki', help="Lets you create wiki pages and page groups in order "
"to keep track of business knowledge and share it with "
"and between your employees."),
}
# Will be removed when rd-v61-al-config-depends will be done
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
res = super(profile_association_config_install_modules_wizard, self).fields_view_get(cr, user, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
doc = etree.XML(res['arch'])
for module in ['project_gtd','hr_expense']:
count = 0
for node in doc.xpath("//field[@name='%s']" % (module)):
count = count + 1
if count > 1:
node.set('invisible', '1')
res['arch'] = etree.tostring(doc)
return res
profile_association_config_install_modules_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,24 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_confirm_install_module_form" model="ir.ui.view">
<field name="name">Association Application Configuration</field>
<field name="model">base.setup.installer</field>
<field name="type">form</field>
<field name="inherit_id" ref="base_setup.view_base_setup_installer"/>
<field name="arch" type="xml">
<data>
<xpath expr="//group[@name='association']" position="replace">
<newline/>
<separator string="Associations Features" colspan="4" />
<field name="project_gtd" />
<field name="wiki" />
<field name="event_project" />
<field name="hr_expense" />
</xpath>
</data>
</field>
</record>
<menuitem
name="Association"
id="base.menu_association"

View File

@ -23,7 +23,7 @@
{
'name': 'Auction Management',
'version': '1.0',
'category': 'General',
'category': 'Vertical Applications',
'complexity': "normal",
'description': """
This module manages the records of artists, auction articles, buyers and sellers.

View File

@ -23,7 +23,7 @@
{
'name': 'Audit Trail',
'version': '1.0',
'category': 'Tools',
'category': 'Hidden',
'description': """
This module lets administrator track every user operation on all the objects of the system.
===========================================================================================

View File

@ -123,9 +123,6 @@ class audittrail_rule(osv.osv):
#End Loop
return True
audittrail_rule()
class audittrail_log(osv.osv):
"""
For Audittrail Log
@ -161,9 +158,6 @@ class audittrail_log(osv.osv):
}
_order = "timestamp desc"
audittrail_log()
class audittrail_log_line(osv.osv):
"""
Audittrail Log Line.
@ -181,9 +175,6 @@ class audittrail_log_line(osv.osv):
'field_description': fields.char('Field Description', size=64),
}
audittrail_log_line()
class audittrail_objects_proxy(object_proxy):
""" Uses Object proxy for auditing changes on object of subscribed Rules"""
@ -289,8 +280,7 @@ class audittrail_objects_proxy(object_proxy):
#End Loop
return True
def log_fct(self, db, uid, model, method, fct_src, *args):
def log_fct(self, cr, uid, model, method, fct_src, *args):
"""
Logging function: This function is performs logging oprations according to method
@param db: the current database
@ -304,8 +294,7 @@ class audittrail_objects_proxy(object_proxy):
uid_orig = uid
uid = 1
res2 = args
pool = pooler.get_pool(db)
cr = pooler.get_db(db).cursor()
pool = pooler.get_pool(cr.dbname)
resource_pool = pool.get(model)
log_pool = pool.get('audittrail.log')
model_pool = pool.get('ir.model')
@ -316,8 +305,7 @@ class audittrail_objects_proxy(object_proxy):
model = model_pool.browse(cr, uid, model_id)
if method in ('create'):
res_id = fct_src(db, uid_orig, model.model, method, *args)
cr.commit()
res_id = fct_src(cr, uid_orig, model.model, method, *args)
resource = resource_pool.read(cr, uid, res_id, args[0].keys())
vals = {
"method": method,
@ -338,14 +326,12 @@ class audittrail_objects_proxy(object_proxy):
lines.append(line)
self.create_log_line(cr, uid, log_id, model, lines)
cr.commit()
cr.close()
return res_id
elif method in ('read'):
res_ids = args[0]
old_values = {}
res = fct_src(db, uid_orig, model.model, method, *args)
res = fct_src(cr, uid_orig, model.model, method, *args)
if type(res) == list:
for v in res:
old_values[v['id']] = v
@ -370,8 +356,6 @@ class audittrail_objects_proxy(object_proxy):
lines.append(line)
self.create_log_line(cr, uid, log_id, model, lines)
cr.commit()
cr.close()
return res
elif method in ('unlink'):
@ -401,9 +385,7 @@ class audittrail_objects_proxy(object_proxy):
lines.append(line)
self.create_log_line(cr, uid, log_id, model, lines)
res = fct_src(db, uid_orig, model.model, method, *args)
cr.commit()
cr.close()
res = fct_src(cr, uid_orig, model.model, method, *args)
return res
else:
res_ids = []
@ -428,8 +410,7 @@ class audittrail_objects_proxy(object_proxy):
old_values_text[field] = self.get_value_text(cr, uid, field, resource[field], model)
old_values[resource_id] = {'text':old_values_text, 'value': old_value}
res = fct_src(db, uid_orig, model.model, method, *args)
cr.commit()
res = fct_src(cr, uid_orig, model.model, method, *args)
if res_ids:
for resource in resource_pool.read(cr, uid, res_ids):
@ -457,107 +438,40 @@ class audittrail_objects_proxy(object_proxy):
lines.append(line)
self.create_log_line(cr, uid, log_id, model, lines)
cr.commit()
cr.close()
return res
return True
def execute(self, db, uid, model, method, *args, **kw):
"""
Overrides Object Proxy execute method
@param db: the current database
@param uid: the current user's ID for security checks,
@param object: Object who's values are being changed
@param method: get any method and create log
@return: Returns result as per method of Object proxy
"""
uid_orig = uid
uid = 1
pool = pooler.get_pool(db)
model_pool = pool.get('ir.model')
rule_pool = pool.get('audittrail.rule')
cr = pooler.get_db(db).cursor()
cr.autocommit(True)
logged_uids = []
fct_src = super(audittrail_objects_proxy, self).execute
def my_fct(db, uid, model, method, *args):
rule = False
model_ids = model_pool.search(cr, uid, [('model', '=', model)])
def check_rules(self, cr, uid, model, method):
pool = pooler.get_pool(cr.dbname)
# Check if auditrails is installed for that db and then if one rule match
if 'audittrail.rule' in pool.models:
model_ids = pool.get('ir.model').search(cr, 1, [('model', '=', model)])
model_id = model_ids and model_ids[0] or False
if model_id:
rule_ids = pool.get('audittrail.rule').search(cr, 1, [('object_id', '=', model_id), ('state', '=', 'subscribed')])
for rule in pool.get('audittrail.rule').read(cr, 1, rule_ids, ['user_id','log_read','log_write','log_create','log_unlink','log_action','log_workflow']):
if len(rule['user_id'])==0 or uid in rule['user_id']:
if rule.get('log_'+method,0):
return True
elif method not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc', 'unlink', 'write', 'create'):
if rule['log_action']:
return True
for model_name in pool.obj_list():
if model_name == 'audittrail.rule':
rule = True
if not rule:
return fct_src(db, uid_orig, model, method, *args)
if not model_id:
return fct_src(db, uid_orig, model, method, *args)
def execute_cr(self, cr, uid, model, method, *args, **kw):
fct_src = super(audittrail_objects_proxy, self).execute_cr
if self.check_rules(cr,uid,model,method):
res = self.log_fct(cr, uid, model, method, fct_src, *args)
else:
res = fct_src(cr, uid, model, method, *args)
return res
rule_ids = rule_pool.search(cr, uid, [('object_id', '=', model_id), ('state', '=', 'subscribed')])
if not rule_ids:
return fct_src(db, uid_orig, model, method, *args)
for thisrule in rule_pool.browse(cr, uid, rule_ids):
for user in thisrule.user_id:
logged_uids.append(user.id)
if not logged_uids or uid in logged_uids:
if method in ('read', 'write', 'create', 'unlink'):
if getattr(thisrule, 'log_' + method):
return self.log_fct(db, uid_orig, model, method, fct_src, *args)
elif method not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc', 'unlink', 'write', 'create'):
if thisrule.log_action:
return self.log_fct(db, uid_orig, model, method, fct_src, *args)
return fct_src(db, uid_orig, model, method, *args)
try:
res = my_fct(db, uid, model, method, *args)
return res
finally:
cr.close()
def exec_workflow(self, db, uid, model, method, *args, **argv):
uid_orig = uid
uid = 1
pool = pooler.get_pool(db)
logged_uids = []
fct_src = super(audittrail_objects_proxy, self).exec_workflow
field = method
rule = False
model_pool = pool.get('ir.model')
rule_pool = pool.get('audittrail.rule')
cr = pooler.get_db(db).cursor()
cr.autocommit(True)
try:
model_ids = model_pool.search(cr, uid, [('model', '=', model)])
for obj_name in pool.obj_list():
if obj_name == 'audittrail.rule':
rule = True
if not rule:
return super(audittrail_objects_proxy, self).exec_workflow(db, uid_orig, model, method, *args, **argv)
if not model_ids:
return super(audittrail_objects_proxy, self).exec_workflow(db, uid_orig, model, method, *args, **argv)
rule_ids = rule_pool.search(cr, uid, [('object_id', 'in', model_ids), ('state', '=', 'subscribed')])
if not rule_ids:
return super(audittrail_objects_proxy, self).exec_workflow(db, uid_orig, model, method, *args, **argv)
for thisrule in rule_pool.browse(cr, uid, rule_ids):
for user in thisrule.user_id:
logged_uids.append(user.id)
if not logged_uids or uid in logged_uids:
if thisrule.log_workflow:
return self.log_fct(db, uid_orig, model, method, fct_src, *args)
return super(audittrail_objects_proxy, self).exec_workflow(db, uid_orig, model, method, *args, **argv)
return True
finally:
cr.close()
def exec_workflow_cr(self, cr, uid, model, method, *args, **argv):
fct_src = super(audittrail_objects_proxy, self).exec_workflow_cr
if self.check_rules(cr,uid,model,'workflow'):
res = self.log_fct(cr, uid, model, method, fct_src, *args)
else:
res = fct_src(cr, uid, model, method, *args)
return res
audittrail_objects_proxy()

View File

@ -2,7 +2,7 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@ -19,27 +19,8 @@
#
##############################################################################
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 Rate",
view_load=True,
domain="[('type', '=', 'other')]",),
'property_expense_currency_exchange': fields.property(
'account.account',
type='many2one',
relation='account.account',
string="Expense Currency Rate",
view_load=True,
domain="[('type', '=', 'other')]",),
}
res_company()
import res_users
import controllers
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@ -15,26 +15,33 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
class marketing_installer(osv.osv_memory):
_inherit = 'base.setup.installer'
_columns = {
'email_template':fields.boolean('Automated E-Mails',
help="Helps you to design templates of emails and integrate them in your different processes."),
'marketing_campaign':fields.boolean('Marketing Campaigns',
help="Helps you to manage marketing campaigns and automate actions and communication steps."),
'crm_profiling':fields.boolean('Profiling Tools',
help="Helps you to perform segmentation of partners and design segmentation questionnaires")
}
_defaults = {
'marketing_campaign': lambda *a: 1,
}
marketing_installer()
{
'name': 'OpenID',
'version': '2.0',
'category': 'Hidden',
'description': """Allow users to login through OpenID.""",
'author': 'OpenERP s.a.',
'maintainer': 'OpenERP s.a.',
'website': 'http://www.openerp.com',
'depends': ['base'],
'data': [
'res_users.xml',
],
'js': [
'static/src/js/auth_openid.js',
],
'css': [
'static/src/css/openid.css',
],
'external_dependencies': {
'python' : ['openid'],
},
'installable': True,
'active': False,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@ -18,18 +17,4 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
class report_designer_installer(osv.osv_memory):
_inherit = 'base.setup.installer'
_columns = {
# Reporting
'base_report_designer':fields.boolean('OpenOffice Report Designer',help="Adds wizards to Import/Export .SXW report which "
"you can modify in OpenOffice.Once you have modified it you can "
"upload the report using the same wizard."),
'base_report_creator':fields.boolean('Query Builder',help="Allows you to create any statistic "
"reports on several objects. It's a SQL query builder and browser for end users."),
}
report_designer_installer()
import main

View File

@ -0,0 +1,225 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
import logging
import os
import sys
import urllib
import werkzeug.urls
import werkzeug.exceptions
from openerp.modules.registry import RegistryManager
import web.common.http as openerpweb
from openid import oidutil
from openid.store import memstore
#from openid.store import filestore
from openid.consumer import consumer
from openid.cryptutil import randomString
from openid.extensions import ax, sreg
from .. import utils
_logger = logging.getLogger('web.auth_openid')
oidutil.log = logging.getLogger('openid').debug
class GoogleAppsAwareConsumer(consumer.GenericConsumer):
def complete(self, message, endpoint, return_to):
if message.getOpenIDNamespace() == consumer.OPENID2_NS:
server_url = message.getArg(consumer.OPENID2_NS, 'op_endpoint', consumer.no_default)
if server_url.startswith('https://www.google.com/a/'):
# update fields
for attr in ['claimed_id', 'identity']:
value = message.getArg(consumer.OPENID2_NS, attr)
value = 'https://www.google.com/accounts/o8/user-xrds?uri=%s' % urllib.quote_plus(value)
message.setArg(consumer.OPENID2_NS, attr, value)
# now, resign the message
assoc_handle = message.getArg(consumer.OPENID_NS, 'assoc_handle')
assoc = self.store.getAssociation(server_url, assoc_handle)
message.delArg(consumer.OPENID2_NS, 'sig')
message.delArg(consumer.OPENID2_NS, 'signed')
message = assoc.signMessage(message)
return super(GoogleAppsAwareConsumer, self).complete(message, endpoint, return_to)
class OpenIDController(openerpweb.Controller):
_cp_path = '/auth_openid/login'
_store = memstore.MemoryStore() # TODO use a filestore
_REQUIRED_ATTRIBUTES = ['email']
_OPTIONAL_ATTRIBUTES = 'nickname fullname postcode country language timezone'.split()
def _add_extensions(self, request):
"""Add extensions to the request"""
sreg_request = sreg.SRegRequest(required=self._REQUIRED_ATTRIBUTES,
optional=self._OPTIONAL_ATTRIBUTES)
request.addExtension(sreg_request)
ax_request = ax.FetchRequest()
for alias in self._REQUIRED_ATTRIBUTES:
uri = utils.SREG2AX[alias]
ax_request.add(ax.AttrInfo(uri, required=True, alias=alias))
for alias in self._OPTIONAL_ATTRIBUTES:
uri = utils.SREG2AX[alias]
ax_request.add(ax.AttrInfo(uri, required=False, alias=alias))
request.addExtension(ax_request)
def _get_attributes_from_success_response(self, success_response):
attrs = {}
all_attrs = self._REQUIRED_ATTRIBUTES + self._OPTIONAL_ATTRIBUTES
sreg_resp = sreg.SRegResponse.fromSuccessResponse(success_response)
if sreg_resp:
for attr in all_attrs:
value = sreg_resp.get(attr)
if value is not None:
attrs[attr] = value
ax_resp = ax.FetchResponse.fromSuccessResponse(success_response)
if ax_resp:
for attr in all_attrs:
value = ax_resp.getSingle(utils.SREG2AX[attr])
if value is not None:
attrs[attr] = value
return attrs
def _get_realm(self, req):
return req.httprequest.host_url
@openerpweb.jsonrequest
def verify(self, req, db, url):
redirect_to = werkzeug.urls.Href(req.httprequest.host_url + 'auth_openid/login/process')(session_id=req.session_id)
realm = self._get_realm(req)
session = dict(dbname=db, openid_url=url) # TODO add origin page ?
oidconsumer = consumer.Consumer(session, self._store)
try:
request = oidconsumer.begin(url)
except consumer.DiscoveryFailure, exc:
fetch_error_string = 'Error in discovery: %s' % (str(exc[0]),)
return {'error': fetch_error_string, 'title': 'OpenID Error'}
if request is None:
return {'error': 'No OpenID services found', 'title': 'OpenID Error'}
req.session.openid_session = session
self._add_extensions(request)
if request.shouldSendRedirect():
redirect_url = request.redirectURL(realm, redirect_to)
return {'action': 'redirect', 'value': redirect_url, 'session_id': req.session_id}
else:
form_html = request.htmlMarkup(realm, redirect_to)
return {'action': 'post', 'value': form_html, 'session_id': req.session_id}
@openerpweb.httprequest
def process(self, req, **kw):
session = getattr(req.session, 'openid_session', None)
if not session:
return werkzeug.utils.redirect('/')
oidconsumer = consumer.Consumer(session, self._store, consumer_class=GoogleAppsAwareConsumer)
query = req.httprequest.args
info = oidconsumer.complete(query, req.httprequest.base_url)
display_identifier = info.getDisplayIdentifier()
session['status'] = info.status
user_id = None
if info.status == consumer.SUCCESS:
dbname = session['dbname']
with utils.cursor(dbname) as cr:
registry = RegistryManager.get(dbname)
Modules = registry.get('ir.module.module')
installed = Modules.search_count(cr, 1, ['&', ('name', '=', 'auth_openid'), ('state', '=', 'installed')]) == 1
if installed:
Users = registry.get('res.users')
#openid_url = info.endpoint.canonicalID or display_identifier
openid_url = session['openid_url']
attrs = self._get_attributes_from_success_response(info)
attrs['openid_url'] = openid_url
session['attributes'] = attrs
openid_email = attrs.get('email', False)
domain = []
if openid_email:
domain += ['|', ('openid_email', '=', False)]
domain += [('openid_email', '=', openid_email)]
domain += [
('openid_url', '=', openid_url),
('active', '=', True),
]
ids = Users.search(cr, 1, domain)
assert len(ids) < 2
if ids:
user_id = ids[0]
login = Users.browse(cr, 1, user_id).login
key = randomString(utils.KEY_LENGTH, '0123456789abcdef')
Users.write(cr, 1, [user_id], {'openid_key': key})
# TODO fill empty fields with the ones from sreg/ax
cr.commit()
u = req.session.login(dbname, login, key)
if not user_id:
session['message'] = 'This OpenID identifier is not associated to any active users'
elif info.status == consumer.SETUP_NEEDED:
session['message'] = info.setup_url
elif info.status == consumer.FAILURE and display_identifier:
fmt = "Verification of %s failed: %s"
session['message'] = fmt % (display_identifier, info.message)
else: # FAILURE
# Either we don't understand the code or there is no
# openid_url included with the error. Give a generic
# failure message. The library should supply debug
# information in a log.
session['message'] = 'Verification failed.'
fragment = '#loginerror' if not user_id else ''
return werkzeug.utils.redirect('/web/webclient/home?debug=1'+fragment)
@openerpweb.jsonrequest
def status(self, req):
session = getattr(req.session, 'openid_session', {})
return {'status': session.get('status'), 'message': session.get('message')}

View File

@ -0,0 +1,94 @@
#!/usr/bin/env python
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.osv import osv, fields
import openerp.exceptions
import tools
import utils
class res_users(osv.osv):
_inherit = 'res.users'
# TODO create helper fields for autofill openid_url and openid_email -> http://pad.openerp.com/web-openid
_columns = {
'openid_url': fields.char('OpenID URL', size=1024),
'openid_email': fields.char('OpenID Email', size=256,
help="Used for disambiguation in case of a shared OpenID URL"),
'openid_key': fields.char('OpenID Key', size=utils.KEY_LENGTH,
readonly=True),
}
def _check_openid_url_email(self, cr, uid, ids, context=None):
return all(self.search_count(cr, uid, [('active', '=', True), ('openid_url', '=', u.openid_url), ('openid_email', '=', u.openid_email)]) == 1 \
for u in self.browse(cr, uid, ids, context) if u.active and u.openid_url)
def _check_openid_url_email_msg(self, cr, uid, ids, context):
return "There is already an active user with this OpenID Email for this OpenID URL"
_constraints = [
(_check_openid_url_email, lambda self, *a, **kw: self._check_openid_url_email_msg(*a, **kw), ['active', 'openid_url', 'openid_email']),
]
def copy(self, cr, uid, rid, defaults=None, context=None):
reset_fields = 'openid_url openid_email'.split()
reset_values = dict.fromkeys(reset_fields, False)
if defaults is None:
defaults = reset_values
else:
defaults = dict(reset_values, **defaults)
defaults['openid_key'] = False
return super(res_users, self).copy(cr, uid, rid, defaults, context)
def login(self, db, login, password):
result = super(res_users, self).login(db, login, password)
if result:
return result
else:
with utils.cursor(db) as cr:
cr.execute('UPDATE res_users SET date=now() WHERE login=%s AND openid_key=%s AND active=%s RETURNING id',
(tools.ustr(login), tools.ustr(password), True))
res = cr.fetchone()
cr.commit()
return res[0] if res else False
def check(self, db, uid, passwd):
try:
return super(res_users, self).check(db, uid, passwd)
except openerp.exceptions.AccessDenied:
if not passwd:
raise
with utils.cursor(db) as cr:
cr.execute('''SELECT COUNT(1)
FROM res_users
WHERE id=%s
AND openid_key=%s
AND active=%s''',
(int(uid), passwd, True))
if not cr.fetchone()[0]:
raise
self._uid_cache.setdefault(db, {})[uid] = passwd
res_users()

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_users_form" model="ir.ui.view">
<field name="name">res.users.form</field>
<field name="model">res.users</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<notebook colspan="4" position="inside">
<page string="OpenID">
<field name="openid_url"/>
<field name="openid_email"/>
</page>
</notebook>
</field>
</record>
</data>
</openerp>

View File

@ -0,0 +1,64 @@
input[name='openid_url'] {
background: #fff url(../img/login-bg.gif) no-repeat 1px;
padding-left: 20px;
}
.auth_choice {
position: static;
display: none;
}
.openerp .login .oe_forms .oe_box2 td input[name="db"], .oe_forms .oe_box2 td select[name="db"] {
width: 50%;
float: left;
margin-top: 15px;
}
.openerp .login .oe_login_right_pane {
margin-left: 525px;
}
.openerp .login form {
width: 475px;
}
.openid_providers {
padding: 0;
list-style: none;
float: right;
}
.openid_providers li {
display: block;
float: left;
margin: 0 1px 3px 2px;
}
.openid_providers a {
display: block;
width: 24px;
height: 24px;
border: 1px solid #ddd;
background: #fff url(../img/openid_16.png) no-repeat 50%;
text-indent: -9999px;
overflow: hidden;
text-align: left;
}
.openid_providers a.selected {
border-color: #9A0404;
}
.openid_providers a[title="Password"] { background-image: url(../img/textfield_key.png); }
.openid_providers a[title="AOL"] { background-image: url(../img/aol.png); }
.openid_providers a[title="ClaimID"] { background-image: url(../img/claimid.png); }
.openid_providers a[title="Google"] { background-image: url(../img/googlefav.png); }
.openid_providers a[title="Google Apps"] { background-image: url(../img/marketplace.gif); }
.openid_providers a[title="MyOpenID"] { background-image: url(../img/myopenid.png); }
.openid_providers a[title="VeriSign"] { background-image: url(../img/verisign.png); }
.openid_providers a[title="Yahoo!"] { background-image: url(../img/yahoo.png); }
.openid_providers a[title="Launchpad"] { background-image: url(../img/launchpad.png); }
tr.auth_choice.selected {
display: table-row;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Some files were not shown because too many files have changed in this diff Show More