[MERGE] Merge lp:openobject-addons

bzr revid: sbh@tinyerp.com-20101011051526-rn7qauj3zkaqgopm
This commit is contained in:
sbh (Open ERP) 2010-10-11 10:45:26 +05:30
commit 9b536faec7
366 changed files with 24248 additions and 5893 deletions

View File

@ -49,6 +49,10 @@ module named account_voucher.
'security/ir.model.access.csv',
'account_menuitem.xml',
'account_wizard.xml',
'report/account_invoice_report_view.xml',
'report/account_entries_report_view.xml',
'report/account_report_view.xml',
'report/account_analytic_entries_report_view.xml',
'wizard/account_move_bank_reconcile_view.xml',
'wizard/account_use_model_view.xml',
'account_installer.xml',
@ -106,10 +110,6 @@ module named account_voucher.
'process/supplier_invoice_process.xml',
'sequence_view.xml',
'company_view.xml',
'report/account_invoice_report_view.xml',
'report/account_entries_report_view.xml',
'report/account_report_view.xml',
'report/account_analytic_entries_report_view.xml',
'board_account_view.xml',
"wizard/account_report_profit_loss_view.xml",
"wizard/account_report_balance_sheet_view.xml"

View File

@ -25,12 +25,9 @@ from dateutil.relativedelta import relativedelta
from operator import itemgetter
import netsvc
import pooler
from osv import fields, osv
import decimal_precision as dp
from tools.misc import currency
from tools.translate import _
from tools import config
def check_cycle(self, cr, uid, ids):
""" climbs the ``self._table.parent_id`` chains for 100 levels or
@ -71,8 +68,9 @@ class account_payment_term(osv.osv):
pt = self.browse(cr, uid, id, context=context)
amount = value
result = []
obj_precision = self.pool.get('decimal.precision')
for line in pt.line_ids:
prec = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
prec = obj_precision.precision_get(cr, uid, 'Account')
if line.value == 'fixed':
amt = round(line.value_amount, prec)
elif line.value == 'procent':
@ -345,7 +343,7 @@ class account_account(osv.osv):
accounts = self.browse(cr, uid, ids)
for account in accounts:
level = 0
if account.parent_id :
if account.parent_id:
obj = self.browse(cr, uid, account.parent_id.id)
level = obj.level + 1
res[account.id] = level
@ -465,7 +463,7 @@ class account_account(osv.osv):
return self.name_get(cr, user, ids, context=context)
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
if not ids:
return []
reads = self.read(cr, uid, ids, ['name', 'code'], context=context)
res = []
@ -624,7 +622,6 @@ class account_journal(osv.osv):
}
def write(self, cr, uid, ids, vals, context=None):
obj=[]
if 'company_id' in vals:
move_lines = self.pool.get('account.move.line').search(cr, uid, [('journal_id', 'in', ids)])
if move_lines:
@ -640,20 +637,9 @@ class account_journal(osv.osv):
@param context: context arguments, like lang, time zone
@return: return a result
"""
journal_type = ('sale', 'sale_refund', 'purchase', 'purchase_refund')
journal_seq = {
'sale':'seq_out_invoice',
'purchase':'seq_in_invoice',
'purchase_refund':'seq_out_refund',
'sale_refund':'seq_in_refund'
}
seq_pool = self.pool.get('ir.sequence')
seq_typ_pool = self.pool.get('ir.sequence.type')
date_pool = self.pool.get('ir.model.data')
result = True
name = vals['name']
code = vals['code'].lower()
@ -661,7 +647,7 @@ class account_journal(osv.osv):
'name': name,
'code': code
}
type_id = seq_typ_pool.create(cr, uid, types)
seq_typ_pool.create(cr, uid, types)
seq = {
'name': name,
@ -675,13 +661,13 @@ class account_journal(osv.osv):
def create(self, cr, uid, vals, context=None):
if not 'sequence_id' in vals or not vals['sequence_id']:
vals.update({'sequence_id' : self.create_sequence(cr, uid, vals, context)})
vals.update({'sequence_id': self.create_sequence(cr, uid, vals, context)})
return super(account_journal, self).create(cr, uid, vals, context)
def name_get(self, cr, user, ids, context=None):
"""
Returns a list of tupples containing id, name.
result format : {[(id, name), (id, name), ...]}
result format: {[(id, name), (id, name), ...]}
@param cr: A database cursor
@param user: ID of the user currently logged in
@ -715,7 +701,7 @@ class account_journal(osv.osv):
return self.name_get(cr, user, ids, context=context)
def onchange_type(self, cr, uid, ids, type, currency):
data_pool = self.pool.get('ir.model.data')
obj_data = self.pool.get('ir.model.data')
user_pool = self.pool.get('res.users')
type_map = {
@ -737,8 +723,8 @@ class account_journal(osv.osv):
if type in ('cash', 'bank') and currency and user.company_id.currency_id.id != currency:
view_id = 'account_journal_bank_view_multi'
data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=',view_id)])
data = data_pool.browse(cr, uid, data_id[0])
data_id = obj_data.search(cr, uid, [('model','=','account.journal.view'), ('name','=',view_id)])
data = obj_data.browse(cr, uid, data_id[0])
res.update({
'centralisation':type == 'situation',
@ -924,7 +910,6 @@ class account_period(osv.osv):
return self.name_get(cr, user, ids, context=context)
def write(self, cr, uid, ids, vals, context={}):
obj=[]
if 'company_id' in vals:
move_lines = self.pool.get('account.move.line').search(cr, uid, [('period_id', 'in', ids)])
if move_lines:
@ -1029,7 +1014,7 @@ class account_move(osv.osv):
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
"""
Returns a list of tupples containing id, name, as internally it is called {def name_get}
result format : {[(id, name), (id, name), ...]}
result format: {[(id, name), (id, name), ...]}
@param cr: A database cursor
@param user: ID of the user currently logged in
@ -1059,7 +1044,9 @@ class account_move(osv.osv):
return self.name_get(cr, user, ids, context=context)
def name_get(self, cursor, user, ids, context=None):
if not len(ids):
if isinstance(ids, (int, long)):
ids = [ids]
if not ids:
return []
res = []
data_move = self.pool.get('account.move').browse(cursor,user,ids)
@ -1101,7 +1088,7 @@ class account_move(osv.osv):
if cond[1] in ['=like', 'like', 'not like', 'ilike', 'not ilike', 'in', 'not in', 'child_of']:
continue
cr.execute("select move_id from account_move_line group by move_id having sum(debit) %s %%s" % (cond[1]) ,(amount,))
cr.execute("select move_id from account_move_line group by move_id having sum(debit) %s %%s" % (cond[1]),(amount,))
res_ids = set(id[0] for id in cr.fetchall())
ids = ids and (ids & res_ids) or res_ids
if ids:
@ -1166,10 +1153,10 @@ class account_move(osv.osv):
context = {}
invoice = context.get('invoice', False)
valid_moves = self.validate(cr, uid, ids, context)
if not valid_moves:
raise osv.except_osv(_('Integrity Error !'), _('You cannot validate a non-balanced entry !\nMake sure you have configured Payment Term properly !\nIt should contain atleast one Payment Term Line with type "Balance" !'))
obj_sequence = self.pool.get('ir.sequence')
for move in self.browse(cr, uid, valid_moves):
if move.name =='/':
new_name = False
@ -1180,7 +1167,7 @@ class account_move(osv.osv):
else:
if journal.sequence_id:
c = {'fiscalyear_id': move.period_id.fiscalyear_id.id}
new_name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id, context=c)
new_name = obj_sequence.get_id(cr, uid, journal.sequence_id.id, context=c)
else:
raise osv.except_osv(_('Error'), _('No sequence defined on the journal !'))
@ -1191,7 +1178,7 @@ class account_move(osv.osv):
'SET state=%s '\
'WHERE id IN %s',
('posted', tuple(valid_moves),))
return True
def button_validate(self, cursor, user, ids, context=None):
@ -1212,7 +1199,7 @@ class account_move(osv.osv):
for line in self.browse(cr, uid, ids, context):
if not line.journal_id.update_posted:
raise osv.except_osv(_('Error !'), _('You can not modify a posted entry of this journal !\nYou should set the journal to allow cancelling entries if you want to do that.'))
if len(ids):
if ids:
cr.execute('UPDATE account_move '\
'SET state=%s '\
'WHERE id IN %s', ('draft', tuple(ids),))
@ -1280,6 +1267,7 @@ class account_move(osv.osv):
def unlink(self, cr, uid, ids, context={}, check=True):
toremove = []
obj_move_line = self.pool.get('account.move.line')
for move in self.browse(cr, uid, ids, context):
if move['state'] != 'draft':
raise osv.except_osv(_('UserError'),
@ -1288,8 +1276,8 @@ class account_move(osv.osv):
line_ids = map(lambda x: x.id, move.line_id)
context['journal_id'] = move.journal_id.id
context['period_id'] = move.period_id.id
self.pool.get('account.move.line')._update_check(cr, uid, line_ids, context)
self.pool.get('account.move.line').unlink(cr, uid, line_ids, context=context)
obj_move_line._update_check(cr, uid, line_ids, context)
obj_move_line.unlink(cr, uid, line_ids, context=context)
toremove.append(move.id)
result = super(account_move, self).unlink(cr, uid, toremove, context)
return result
@ -1363,12 +1351,13 @@ class account_move(osv.osv):
del context['__last_update']
valid_moves = [] #Maintains a list of moves which can be responsible to create analytic entries
obj_analytic_line = self.pool.get('account.analytic.line')
obj_move_line = self.pool.get('account.move.line')
for move in self.browse(cr, uid, ids, context):
# Unlink old analytic lines on move_lines
for obj_line in move.line_id:
for obj in obj_line.analytic_lines:
self.pool.get('account.analytic.line').unlink(cr,uid,obj.id)
obj_analytic_line.unlink(cr,uid,obj.id)
journal = move.journal_id
amount = 0
@ -1398,11 +1387,11 @@ class account_move(osv.osv):
# Check whether the move lines are confirmed
if not len(line_draft_ids):
if not line_draft_ids:
continue
# Update the move lines (set them as valid)
self.pool.get('account.move.line').write(cr, uid, line_draft_ids, {
obj_move_line.write(cr, uid, line_draft_ids, {
'journal_id': move.journal_id.id,
'period_id': move.period_id.id,
'state': 'valid'
@ -1422,7 +1411,7 @@ class account_move(osv.osv):
code = account[line.account_id.id][0]
amount = account[line.account_id.id][1] * (line.debit + line.credit)
if (code or amount) and not (line.tax_code_id or line.tax_amount):
self.pool.get('account.move.line').write(cr, uid, [line.id], {
obj_move_line.write(cr, uid, [line.id], {
'tax_code_id': code,
'tax_amount': amount
}, context, check=False)
@ -1438,20 +1427,20 @@ class account_move(osv.osv):
#
self._centralise(cr, uid, move, 'debit', context=context)
self._centralise(cr, uid, move, 'credit', context=context)
self.pool.get('account.move.line').write(cr, uid, line_draft_ids, {
obj_move_line.write(cr, uid, line_draft_ids, {
'state': 'valid'
}, context, check=False)
else:
# We can't validate it (it's unbalanced)
# Setting the lines as draft
self.pool.get('account.move.line').write(cr, uid, line_ids, {
obj_move_line.write(cr, uid, line_ids, {
'journal_id': move.journal_id.id,
'period_id': move.period_id.id,
'state': 'draft'
}, context, check=False)
# Create analytic lines for the valid moves
for record in valid_moves:
self.pool.get('account.move.line').create_analytic_lines(cr, uid, [line.id for line in record.line_id], context)
obj_move_line.create_analytic_lines(cr, uid, [line.id for line in record.line_id], context)
valid_moves = [move.id for move in valid_moves]
return len(valid_moves) > 0 and valid_moves or False
@ -1484,7 +1473,7 @@ class account_move_reconcile(osv.osv):
return True
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
if not ids:
return []
result = []
for r in self.browse(cr, uid, ids, context):
@ -1535,13 +1524,14 @@ class account_tax_code(osv.osv):
GROUP BY line.tax_code_id',
(parent_ids,) + where_params)
res=dict(cr.fetchall())
obj_precision = self.pool.get('decimal.precision')
for record in self.browse(cr, uid, ids, context):
def _rec_get(record):
amount = res.get(record.id, 0.0)
for rec in record.child_ids:
amount += _rec_get(rec) * rec.sign
return amount
res[record.id] = round(_rec_get(record), self.pool.get('decimal.precision').precision_get(cr, uid, 'Account'))
res[record.id] = round(_rec_get(record), obj_precision.precision_get(cr, uid, 'Account'))
return res
def _sum_year(self, cr, uid, ids, name, args, context=None):
@ -1574,7 +1564,7 @@ class account_tax_code(osv.osv):
period_id = context['period_id']
else:
period_id = self.pool.get('account.period').find(cr, uid)
if not len(period_id):
if not period_id:
return dict.fromkeys(ids, 0.0)
period_id = period_id[0]
return self._sum(cr, uid, ids, name, args, context,
@ -1608,7 +1598,9 @@ class account_tax_code(osv.osv):
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
if isinstance(ids, (int, long)):
ids = [ids]
if not ids:
return []
if isinstance(ids, (int, long)):
ids = [ids]
@ -1699,7 +1691,7 @@ class account_tax(osv.osv):
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
"""
Returns a list of tupples containing id, name, as internally it is called {def name_get}
result format : {[(id, name), (id, name), ...]}
result format: {[(id, name), (id, name), ...]}
@param cr: A database cursor
@param user: ID of the user currently logged in
@ -1741,7 +1733,7 @@ class account_tax(osv.osv):
return super(account_tax, self).search(cr, uid, args, offset, limit, order, context, count)
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
if not ids:
return []
res = []
for record in self.read(cr, uid, ids, ['description','name'], context=context):
@ -1756,8 +1748,8 @@ class account_tax(osv.osv):
return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
_defaults = {
'python_compute': '''# price_unit\n# address : res.partner.address object or False\n# product : product.product object or None\n# partner : res.partner object or None\n\nresult = price_unit * 0.10''',
'python_compute_inv': '''# price_unit\n# address : res.partner.address object or False\n# product : product.product object or False\n\nresult = price_unit * 0.10''',
'python_compute': '''# price_unit\n# address: res.partner.address object or False\n# product: product.product object or None\n# partner: res.partner object or None\n\nresult = price_unit * 0.10''',
'python_compute_inv': '''# price_unit\n# address: res.partner.address object or False\n# product: product.product object or False\n\nresult = price_unit * 0.10''',
'applicable_type': 'true',
'type': 'percent',
'amount': 0,
@ -1776,9 +1768,10 @@ class account_tax(osv.osv):
def _applicable(self, cr, uid, taxes, price_unit, address_id=None, product=None, partner=None):
res = []
obj_partener_address = self.pool.get('res.partner.address')
for tax in taxes:
if tax.applicable_type=='code':
localdict = {'price_unit':price_unit, 'address':self.pool.get('res.partner.address').browse(cr, uid, address_id), 'product':product, 'partner':partner}
localdict = {'price_unit':price_unit, 'address':obj_partener_address.browse(cr, uid, address_id), 'product':product, 'partner':partner}
exec tax.python_applicable in localdict
if localdict.get('result', False):
res.append(tax)
@ -1788,26 +1781,26 @@ class account_tax(osv.osv):
def _unit_compute(self, cr, uid, taxes, price_unit, address_id=None, product=None, partner=None, quantity=0):
taxes = self._applicable(cr, uid, taxes, price_unit, address_id, product, partner)
res = []
cur_price_unit=price_unit
obj_partener_address = self.pool.get('res.partner.address')
for tax in taxes:
# we compute the amount for the current tax object and append it to the result
data = {'id':tax.id,
'name':tax.description and tax.description + " - " + tax.name or tax.name,
'account_collected_id':tax.account_collected_id.id,
'account_paid_id':tax.account_paid_id.id,
'base_code_id': tax.base_code_id.id,
'ref_base_code_id': tax.ref_base_code_id.id,
'sequence': tax.sequence,
'base_sign': tax.base_sign,
'tax_sign': tax.tax_sign,
'ref_base_sign': tax.ref_base_sign,
'ref_tax_sign': tax.ref_tax_sign,
'price_unit': cur_price_unit,
'tax_code_id': tax.tax_code_id.id,
'ref_tax_code_id': tax.ref_tax_code_id.id,
'name':tax.description and tax.description + " - " + tax.name or tax.name,
'account_collected_id':tax.account_collected_id.id,
'account_paid_id':tax.account_paid_id.id,
'base_code_id': tax.base_code_id.id,
'ref_base_code_id': tax.ref_base_code_id.id,
'sequence': tax.sequence,
'base_sign': tax.base_sign,
'tax_sign': tax.tax_sign,
'ref_base_sign': tax.ref_base_sign,
'ref_tax_sign': tax.ref_tax_sign,
'price_unit': cur_price_unit,
'tax_code_id': tax.tax_code_id.id,
'ref_tax_code_id': tax.ref_tax_code_id.id,
}
res.append(data)
if tax.type=='percent':
@ -1819,7 +1812,7 @@ class account_tax(osv.osv):
data['tax_amount']=quantity
# data['amount'] = quantity
elif tax.type=='code':
address = address_id and self.pool.get('res.partner.address').browse(cr, uid, address_id) or None
address = address_id and obj_partener_address.browse(cr, uid, address_id) or None
localdict = {'price_unit':cur_price_unit, 'address':address, 'product':product, 'partner':partner}
exec tax.python_compute in localdict
amount = localdict['result']
@ -1828,8 +1821,8 @@ class account_tax(osv.osv):
data['amount'] = cur_price_unit - reduce(lambda x,y: y.get('amount',0.0)+x, res, 0.0)
data['balance'] = cur_price_unit
amount2 = data['amount']
if len(tax.child_ids):
amount2 = data.get('amount', 0.0)
if tax.child_ids:
if tax.child_depend:
latest = res.pop()
amount = amount2
@ -1872,7 +1865,7 @@ class account_tax(osv.osv):
tex.append(tax)
tin = self.compute_inv(cr, uid, tin, price_unit, quantity, address_id=address_id, product=product, partner=partner)
for r in tin:
totalex -= r['amount']
totalex -= r.get('amount', 0.0)
totlex_qty = 0.0
try:
totlex_qty=totalex/quantity
@ -1880,7 +1873,7 @@ class account_tax(osv.osv):
pass
tex = self._compute(cr, uid, tex, totlex_qty, quantity, address_id=address_id, product=product, partner=partner)
for r in tex:
totalin += r['amount']
totalin += r.get('amount', 0.0)
return {
'total': totalex,
'total_included': totalin,
@ -1904,17 +1897,18 @@ class account_tax(osv.osv):
"""
res = self._unit_compute(cr, uid, taxes, price_unit, address_id, product, partner, quantity)
total = 0.0
precision_pool = self.pool.get('decimal.precision')
for r in res:
if r.get('balance',False):
r['amount'] = round(r['balance'] * quantity, self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')) - total
r['amount'] = round(r.get('balance', 0.0) * quantity, precision_pool.precision_get(cr, uid, 'Account')) - total
else:
r['amount'] = round(r['amount'] * quantity, self.pool.get('decimal.precision').precision_get(cr, uid, 'Account'))
r['amount'] = round(r.get('amount', 0.0) * quantity, precision_pool.precision_get(cr, uid, 'Account'))
total += r['amount']
return res
def _unit_compute_inv(self, cr, uid, taxes, price_unit, address_id=None, product=None, partner=None):
taxes = self._applicable(cr, uid, taxes, price_unit, address_id, product, partner)
obj_partener_address = self.pool.get('res.partner.address')
res = []
taxes.reverse()
cur_price_unit = price_unit
@ -1939,7 +1933,7 @@ class account_tax(osv.osv):
amount = tax.amount
elif tax.type=='code':
address = address_id and self.pool.get('res.partner.address').browse(cr, uid, address_id) or None
address = address_id and obj_partener_address.browse(cr, uid, address_id) or None
localdict = {'price_unit':cur_price_unit, 'address':address, 'product':product, 'partner':partner}
exec tax.python_compute_inv in localdict
amount = localdict['result']
@ -1969,7 +1963,7 @@ class account_tax(osv.osv):
'tax_code_id': tax.tax_code_id.id,
'ref_tax_code_id': tax.ref_tax_code_id.id,
})
if len(tax.child_ids):
if tax.child_ids:
if tax.child_depend:
del res[-1]
amount = price_unit
@ -1998,8 +1992,9 @@ class account_tax(osv.osv):
"""
res = self._unit_compute_inv(cr, uid, taxes, price_unit, address_id, product, partner=None)
total = 0.0
obj_precision = self.pool.get('decimal.precision')
for r in res:
prec = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
prec = obj_precision.precision_get(cr, uid, 'Account')
if r.get('balance',False):
r['amount'] = round(r['balance'] * quantity, prec) - total
else:
@ -2020,7 +2015,7 @@ class account_model(osv.osv):
'journal_id': fields.many2one('account.journal', 'Journal', required=True),
'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
'lines_id': fields.one2many('account.model.line', 'model_id', 'Model Entries'),
'legend' :fields.text('Legend', readonly=True, size=100),
'legend': fields.text('Legend', readonly=True, size=100),
}
_defaults = {
@ -2164,7 +2159,7 @@ class account_subscription(osv.osv):
break
if ok:
todone.append(sub.id)
if len(todone):
if todone:
self.write(cr, uid, todone, {'state':'done'})
return False
@ -2174,7 +2169,7 @@ class account_subscription(osv.osv):
for line in sub.lines_id:
if not line.move_id.id:
toremove.append(line.id)
if len(toremove):
if toremove:
self.pool.get('account.subscription.line').unlink(cr, uid, toremove)
self.write(cr, uid, ids, {'state':'draft'})
return False
@ -2209,11 +2204,12 @@ class account_subscription_line(osv.osv):
def move_create(self, cr, uid, ids, context=None):
tocheck = {}
all_moves = []
obj_model = self.pool.get('account.model')
for line in self.browse(cr, uid, ids, context=context):
datas = {
'date': line.date,
}
move_ids = self.pool.get('account.model').generate(cr, uid, [line.subscription_id.model_id.id], datas, context)
move_ids = obj_model.generate(cr, uid, [line.subscription_id.model_id.id], datas, context)
tocheck[line.subscription_id.id] = True
self.write(cr, uid, [line.id], {'move_id':move_ids[0]})
all_moves.extend(move_ids)
@ -2247,7 +2243,7 @@ class account_account_template(osv.osv):
('view','View'),
('consolidation','Consolidation'),
('liquidity','Liquidity'),
('other','Others'),
('other','Regular'),
('closed','Closed'),
], 'Internal Type', required=True,help="This type is used to differentiate types with "\
"special effects in OpenERP: view can not have entries, consolidation are accounts that "\
@ -2267,7 +2263,7 @@ class account_account_template(osv.osv):
_defaults = {
'reconcile': False,
'type' : 'view',
'type': 'view',
'nocreate': False,
}
@ -2278,7 +2274,7 @@ class account_account_template(osv.osv):
def name_get(self, cr, uid, ids, context={}):
if not len(ids):
if not ids:
return []
reads = self.read(cr, uid, ids, ['name','code'], context)
res = []
@ -2336,7 +2332,7 @@ class account_add_tmpl_wizard(osv.osv_memory):
'parent_id': data[0]['cparent_id'],
'company_id': company_id,
}
new_account = acc_obj.create(cr, uid, vals)
acc_obj.create(cr, uid, vals)
return {'type':'state', 'state': 'end' }
def action_cancel(self, cr, uid, ids, context=None):
@ -2356,7 +2352,7 @@ class account_tax_code_template(osv.osv):
'info': fields.text('Description'),
'parent_id': fields.many2one('account.tax.code.template', 'Parent Code', select=True),
'child_ids': fields.one2many('account.tax.code.template', 'parent_id', 'Child Codes'),
'sign': fields.float('Sign for parent', required=True),
'sign': fields.float('Sign For Parent', required=True),
'notprintable':fields.boolean("Not Printable in Invoice", help="Check this box if you don't want any VAT related to this Tax Code to appear on invoices"),
}
@ -2366,7 +2362,7 @@ class account_tax_code_template(osv.osv):
}
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
if not ids:
return []
if isinstance(ids, (int, long)):
ids = [ids]
@ -2398,7 +2394,7 @@ class account_chart_template(osv.osv):
'property_account_income_categ': fields.many2one('account.account.template','Income Category Account'),
'property_account_expense': fields.many2one('account.account.template','Expense Account on Product Template'),
'property_account_income': fields.many2one('account.account.template','Income Account on Product Template'),
'property_reserve_and_surplus_account': fields.many2one('account.account.template', 'Reserve and Profit/Loss Account', domain=[('type', '=', 'payable')] , 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 Profilt & Loss Report'),
'property_reserve_and_surplus_account': fields.many2one('account.account.template', 'Reserve and Profit/Loss Account', domain=[('type', '=', 'payable')], 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 Profilt & Loss Report'),
}
account_chart_template()
@ -2444,7 +2440,7 @@ class account_tax_template(osv.osv):
}
def name_get(self, cr, uid, ids, context={}):
if not len(ids):
if not ids:
return []
res = []
for record in self.read(cr, uid, ids, ['description','name'], context):
@ -2459,8 +2455,8 @@ class account_tax_template(osv.osv):
return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
_defaults = {
'python_compute': lambda *a: '''# price_unit\n# address : res.partner.address object or False\n# product : product.product object or None\n# partner : res.partner object or None\n\nresult = price_unit * 0.10''',
'python_compute_inv': lambda *a: '''# price_unit\n# address : res.partner.address object or False\n# product : product.product object or False\n\nresult = price_unit * 0.10''',
'python_compute': lambda *a: '''# price_unit\n# address: res.partner.address object or False\n# product: product.product object or None\n# partner: res.partner object or None\n\nresult = price_unit * 0.10''',
'python_compute_inv': lambda *a: '''# price_unit\n# address: res.partner.address object or False\n# product: product.product object or False\n\nresult = price_unit * 0.10''',
'applicable_type': 'true',
'type': 'percent',
'amount': 0,
@ -2477,14 +2473,14 @@ class account_tax_template(osv.osv):
account_tax_template()
# Fiscal Mapping Templates
# Fiscal Position Templates
class account_fiscal_position_template(osv.osv):
_name = 'account.fiscal.position.template'
_description = 'Template for Fiscal Mapping'
_description = 'Template for Fiscal Position'
_columns = {
'name': fields.char('Fiscal Mapping Template', size=64, translate=True, required=True),
'name': fields.char('Fiscal Position Template', size=64, translate=True, required=True),
'chart_template_id': fields.many2one('account.chart.template', 'Chart Template', required=True),
'account_ids': fields.one2many('account.fiscal.position.account.template', 'position_id', 'Account Mapping'),
'tax_ids': fields.one2many('account.fiscal.position.tax.template', 'position_id', 'Tax Mapping')
@ -2494,11 +2490,11 @@ account_fiscal_position_template()
class account_fiscal_position_tax_template(osv.osv):
_name = 'account.fiscal.position.tax.template'
_description = 'Template Tax Fiscal Mapping'
_description = 'Template Tax Fiscal Position'
_rec_name = 'position_id'
_columns = {
'position_id': fields.many2one('account.fiscal.position.template', 'Fiscal Mapping', required=True, ondelete='cascade'),
'position_id': fields.many2one('account.fiscal.position.template', 'Fiscal Position', required=True, ondelete='cascade'),
'tax_src_id': fields.many2one('account.tax.template', 'Tax Source', required=True),
'tax_dest_id': fields.many2one('account.tax.template', 'Replacement Tax')
}
@ -2564,9 +2560,9 @@ class wizard_multi_charts_accounts(osv.osv_memory):
obj_acc_template = self.pool.get('account.account.template')
obj_fiscal_position_template = self.pool.get('account.fiscal.position.template')
obj_fiscal_position = self.pool.get('account.fiscal.position')
data_pool = self.pool.get('ir.model.data')
obj_data = self.pool.get('ir.model.data')
analytic_journal_obj = self.pool.get('account.analytic.journal')
obj_tax_code = self.pool.get('account.tax.code')
# Creating Account
obj_acc_root = obj_multi.chart_template_id.account_root_id
tax_code_root_id = obj_multi.chart_template_id.tax_code_root_id.id
@ -2590,7 +2586,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
'company_id': company_id,
'sign': tax_code_template.sign,
}
new_tax_code = self.pool.get('account.tax.code').create(cr, uid, vals)
new_tax_code = obj_tax_code.create(cr, uid, vals)
#recording the new tax code to do the mapping
tax_code_template_ref[tax_code_template.id] = new_tax_code
@ -2674,8 +2670,8 @@ class wizard_multi_charts_accounts(osv.osv_memory):
# Creating Journals Sales and Purchase
vals_journal={}
data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_sp_journal_view')])
data = data_pool.browse(cr, uid, data_id[0])
data_id = obj_data.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_sp_journal_view')])
data = obj_data.browse(cr, uid, data_id[0])
view_id = data.res_id
seq_id = obj_sequence.search(cr, uid, [('name','=','Account Journal')])[0]
@ -2725,12 +2721,12 @@ class wizard_multi_charts_accounts(osv.osv_memory):
obj_journal.create(cr,uid,vals_journal)
# Bank Journals
data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view')])
data = data_pool.browse(cr, uid, data_id[0])
data_id = obj_data.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view')])
data = obj_data.browse(cr, uid, data_id[0])
view_id_cash = data.res_id
data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view_multi')])
data = data_pool.browse(cr, uid, data_id[0])
data_id = obj_data.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view_multi')])
data = obj_data.browse(cr, uid, data_id[0])
view_id_cur = data.res_id
ref_acc_bank = obj_multi.chart_template_id.bank_account_view_id
@ -2742,7 +2738,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
if ref_acc_bank.code:
try:
new_code = str(int(ref_acc_bank.code.ljust(dig,'0')) + current_num)
except Exception,e:
except:
new_code = str(ref_acc_bank.code.ljust(dig-len(str(current_num)),'0')) + str(current_num)
vals = {
'name': tmp,
@ -2819,30 +2815,31 @@ class wizard_multi_charts_accounts(osv.osv_memory):
fp_ids = obj_fiscal_position_template.search(cr, uid, [('chart_template_id', '=', obj_multi.chart_template_id.id)])
if fp_ids:
obj_tax_fp = self.pool.get('account.fiscal.position.tax')
obj_ac_fp = self.pool.get('account.fiscal.position.account')
for position in obj_fiscal_position_template.browse(cr, uid, fp_ids):
vals_fp = {
'company_id' : company_id,
'name' : position.name,
'company_id': company_id,
'name': position.name,
}
new_fp = obj_fiscal_position.create(cr, uid, vals_fp)
obj_tax_fp = self.pool.get('account.fiscal.position.tax')
obj_ac_fp = self.pool.get('account.fiscal.position.account')
for tax in position.tax_ids:
vals_tax = {
'tax_src_id' : tax_template_ref[tax.tax_src_id.id],
'tax_dest_id' : tax.tax_dest_id and tax_template_ref[tax.tax_dest_id.id] or False,
'position_id' : new_fp,
'tax_src_id': tax_template_ref[tax.tax_src_id.id],
'tax_dest_id': tax.tax_dest_id and tax_template_ref[tax.tax_dest_id.id] or False,
'position_id': new_fp,
}
obj_tax_fp.create(cr, uid, vals_tax)
for acc in position.account_ids:
vals_acc = {
'account_src_id' : acc_template_ref[acc.account_src_id.id],
'account_dest_id' : acc_template_ref[acc.account_dest_id.id],
'position_id' : new_fp,
'account_src_id': acc_template_ref[acc.account_src_id.id],
'account_dest_id': acc_template_ref[acc.account_dest_id.id],
'position_id': new_fp,
}
obj_ac_fp.create(cr, uid, vals_acc)
@ -2864,4 +2861,3 @@ class account_bank_accounts_wizard(osv.osv_memory):
account_bank_accounts_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -55,6 +55,7 @@ class account_bank_statement(osv.osv):
model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_account_statement_from_invoice')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
context.update({'statement_id': ids[0]})
return {
'name': _('Import Invoice'),
'context': context,
@ -242,6 +243,7 @@ class account_bank_statement(osv.osv):
account_id = st.journal_id.default_credit_account_id.id
else:
account_id = st.journal_id.default_debit_account_id.id
acc_cur = ((st_line.amount<=0) and st.journal_id.default_debit_account_id) or st_line.account_id
amount = res_currency_obj.compute(cr, uid, st.currency.id,
company_currency_id, st_line.amount, context=context,
@ -282,7 +284,7 @@ class account_bank_statement(osv.osv):
account=acc_cur)
val['amount_currency'] = amount_cur
move_line_id = account_move_line_obj.create(cr, uid, val , context=context)
move_line_id = account_move_line_obj.create(cr, uid, val, context=context)
torec.append(move_line_id)
# Fill the secondary amount/currency

View File

@ -143,6 +143,7 @@ class account_cash_statement(osv.osv):
res[statement.id] -= res_currency_obj.compute(cursor,
user, company_currency_id, currency_id,
line.credit, context=context)
if statement.state in ('draft', 'open'):
for line in statement.line_ids:
res[statement.id] += line.amount
@ -250,6 +251,12 @@ class account_cash_statement(osv.osv):
if self.pool.get('account.journal').browse(cr, uid, vals['journal_id']).type == 'cash':
open_close = self._get_cash_open_close_box_lines(cr, uid, context)
if vals.get('starting_details_ids',False):
for start in vals.get('starting_details_ids'):
dict_val = start[2]
for end in open_close['end']:
if end[2]['pieces'] == dict_val['pieces']:
end[2]['number'] += dict_val['number']
vals.update({
'ending_details_ids':open_close['start'],
'starting_details_ids':open_close['end']
@ -260,7 +267,7 @@ class account_cash_statement(osv.osv):
'starting_details_ids':False
})
res_id = super(account_cash_statement, self).create(cr, uid, vals, context=context)
#self.write(cr, uid, [res_id], {})
self.write(cr, uid, [res_id], {})
return res_id
def write(self, cr, uid, ids, vals, context=None):
@ -370,6 +377,14 @@ class account_cash_statement(osv.osv):
super(account_cash_statement, self).button_confirm_bank(cr, uid, ids, context=context)
return self.write(cr, uid, ids, {'closing_date':time.strftime("%Y-%m-%d %H:%M:%S")}, context=context)
def button_cancel(self, cr, uid, ids, context=None):
cash_box_line_pool = self.pool.get('account.cashbox.line')
super(account_cash_statement, self).button_cancel(cr, uid, ids, context=context)
for st in self.browse(cr, uid, ids, context):
for end in st.ending_details_ids:
cash_box_line_pool.write(cr, uid, [end.id], {'number':0})
return True
account_cash_statement()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -26,7 +26,7 @@
<group colspan="8">
<group colspan="4" height="450" width="600">
<field name="charts"/>
<group colspan="4">
<group colspan="4" groups="base.group_extended">
<separator col="4" colspan="4" string="Configure Fiscal Year"/>
<field name="company_id" colspan="4" widget="selection" groups="base.group_multi_company"/>
<field name="date_start" on_change="on_change_start_date(date_start)"/>
@ -34,24 +34,24 @@
<field name="period" colspan="4"/>
</group>
<group colspan="4" attrs="{'invisible':[('charts','!=','configurable')]}">
<separator col="4" colspan="4" string="Bank and Cost Account"/>
<field name="sale_tax" on_change="on_change_tax(sale_tax)" attrs="{'required':[('charts','=','configurable')]}"/>
<field name="purchase_tax" groups="base.group_extended"/>
</group>
<group colspan="4" attrs="{'invisible':[('charts','!=','configurable')]}">
<separator col="4" colspan="4" string="Bank and Cash Accounts"/>
<field colspan="4" mode="tree" height="200" name="bank_accounts_id" nolabel="1" widget="one2many_list">
<form string="">
<field name="acc_name"/>
<field name="account_type"/>
<field name="currency_id" widget="selection"/>
<field name="currency_id" widget="selection" groups="base.group_extended"/>
</form>
<tree editable="bottom" string="">
<field name="acc_name"/>
<field name="account_type"/>
<field name="currency_id" widget="selection"/>
<field name="currency_id" widget="selection" groups="base.group_extended"/>
</tree>
</field>
</group>
<group colspan="4" attrs="{'invisible':[('charts','!=','configurable')]}">
<field name="sale_tax" colspan="2" on_change="on_change_tax(sale_tax)"/>
<field name="purchase_tax" colspan="2" />
</group>
</group>
</group>
</data>

View File

@ -36,11 +36,11 @@
<field name="arch" type="xml">
<tree string="Invoice Line">
<field name="name"/>
<field name="account_id" groups="base.group_user"/>
<field name="account_id" groups="account.group_account_user"/>
<field name="quantity"/>
<field name="uos_id"/>
<field name="price_unit"/>
<field name="discount"/>
<field name="discount" groups="base.group_extended"/>
<field name="price_subtotal"/>
</tree>
</field>
@ -55,16 +55,14 @@
<notebook>
<page string="Line">
<field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, {'company_id': parent.company_id})"/>
<field name="uos_id" widget="selection" on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, {'company_id': parent.company_id})"/>
<field name="uos_id" on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, {'company_id': parent.company_id})"/>
<field name="quantity"/>
<field name="price_unit"/>
<field name="discount"/>
<field name="discount" groups="base.group_extended"/>
<field colspan="4" name="name"/>
<field colspan="4" name="origin" groups="base.group_extended"/>
<field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id" on_change="onchange_account_id(parent.fiscal_position,account_id)" groups="base.group_user"/>
<field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id" on_change="onchange_account_id(parent.fiscal_position,account_id)"/>
<field domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
<newline/>
<field name="price_subtotal"/>
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
<field colspan="4" name="invoice_line_tax_id" context="{'type':parent.type}" domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]"/>
</page>
@ -85,7 +83,7 @@
<field name="sequence"/>
<field name="manual"/>
<field name="name"/>
<field name="account_id" groups="base.group_user"/>
<field name="account_id" groups="base.group_account_user"/>
<field name="base"/>
<field name="amount"/>
</tree>
@ -100,7 +98,7 @@
<form string="Manual Invoice Taxes">
<field name="name"/>
<field name="sequence"/>
<field name="account_id" groups="base.group_user"/>
<field name="account_id"/>
<field name="manual"/>
<field name="amount"/>
<field name="base" readonly="0"/>
@ -148,7 +146,7 @@
<field name="type">form</field>
<field name="priority">2</field>
<field name="arch" type="xml">
<form string="Supplier invoice">
<form string="Supplier Invoice">
<group col="8" colspan="4">
<field name="journal_id" on_change="onchange_journal_id(journal_id)" widget="selection"/>
<field name="number" readonly="1"/>
@ -156,7 +154,7 @@
<field name="currency_id" on_change="onchange_currency_id(currency_id, company_id)" width="50"/>
<button name="%(action_account_change_currency)d" type="action" icon="terp-stock_effects-object-colorize" string="Change" attrs="{'invisible':[('state','!=','draft')]}" groups="account.group_account_user"/>
<newline/>
<field name="partner_id" domain="[('supplier','=', 1)]" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)" context="{'default_customer': 0}"/>
<field string="Supplier" name="partner_id" domain="[('supplier','=', 1)]" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)" context="{'default_customer': 0}"/>
<field domain="[('partner_id','=',partner_id)]" name="address_invoice_id"/>
<field name="fiscal_position" groups="base.group_extended" widget="selection"/>
<newline/>
@ -213,9 +211,9 @@
<group col="6" colspan="4">
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="terp-stock_effects-object-colorize"/>
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/>
<button name="invoice_open" states="draft,proforma2" string="Approve" icon="terp-camera_test"/>
<button name="%(action_account_invoice_refund)d" type='action' string='Refund' states='open,paid' icon="gtk-execute"/>
<button name="%(action_account_state_open)d" type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="base.group_no_one"/>
<button name="invoice_open" states="draft,proforma2" string="Approve" icon="terp-camera_test"/>
</group>
</group>
</page>
@ -236,14 +234,14 @@
<page string="Payments" groups="base.group_extended">
<field name="payment_ids" colspan="4" nolabel="1" >
<tree string="Payments">
<field name="date"/>
<field name="date" string="Payment Date"/>
<field name="ref"/>
<field name="name"/>
<field name="name" groups="base.group_extended"/>
<field name="journal_id"/>
<field name="debit"/>
<field name="credit"/>
<field name="amount_currency"/>
<field name="currency_id"/>
<field name="amount_currency" groups="base.group_extended"/>
<field name="currency_id" groups="base.group_extended"/>
</tree>
</field>
</page>
@ -265,7 +263,7 @@
<field name="currency_id" on_change="onchange_currency_id(currency_id, company_id)" width="50"/>
<button name="%(action_account_change_currency)d" type="action" icon="terp-stock_effects-object-colorize" string="Change" attrs="{'invisible':[('state','!=','draft')]}" groups="account.group_account_user"/>
<newline/>
<field name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)" groups="base.group_user"/>
<field string="Customer" name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)" groups="base.group_user"/>
<field domain="[('partner_id','=',partner_id)]" name="address_invoice_id"/>
<field name="fiscal_position" groups="base.group_extended" widget="selection"/>
<newline/>
@ -307,10 +305,10 @@
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/>
<button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object" icon="terp-stock_effects-object-colorize"/>
<button name="invoice_proforma2" states="draft" string="PRO-FORMA" icon="terp-gtk-media-pause" groups="account.group_account_user"/>
<button name="invoice_open" states="draft,proforma2" string="Create" icon="terp-camera_test"/>
<button name="%(action_account_invoice_refund)d" type='action' string='Refund' states='open,paid' icon="gtk-execute"/>
<button name='%(action_account_state_open)d' type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="base.group_no_one"/>
<button name="invoice_proforma2" states="draft" string="PRO-FORMA" icon="terp-gtk-media-pause" groups="account.group_account_user"/>
<button name="invoice_open" states="draft,proforma2" string="Validate" icon="gtk-go-forward"/>
</group>
</group>
</page>
@ -355,15 +353,15 @@
<field name="arch" type="xml">
<search string="Search Invoice">
<group col="10" colspan="4">
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Invoices"/>
<filter icon="terp-gtk-media-pause" string="Proforma" domain="[('state','=','proforma2')]" help="Proforma Invoices"/>
<filter icon="terp-camera_test" string="Invoices" domain="[('state','not in',['draft','cancel'])]" help="Proforma/Open/Paid Invoices"/>
<filter name="draft" icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Invoices"/>
<filter name="proforma" icon="terp-gtk-media-pause" string="Proforma" domain="[('state','=','proforma2')]" help="Proforma Invoices"/>
<filter name="invoices" icon="terp-camera_test" string="Invoices" domain="[('state','not in',['draft','cancel'])]" help="Proforma/Open/Paid Invoices"/>
<separator orientation="vertical"/>
<filter name="unpaid" icon="terp-dolar_ok!" string="Unpaid" domain="[('state','=','open')]" help="Unpaid Invoices"/>
<separator orientation="vertical"/>
<field name="number"/>
<field name="partner_id"/>
<field name="user_id" select="1" default="uid" widget="selection" string="Salesman">
<field name="user_id" select="1" widget="selection" string="Salesman">
<filter domain="[('user_id','=',uid)]" help="My invoices" icon="terp-personal" separator="1"/>
</field>
<field name="origin"/>
@ -451,7 +449,7 @@
<menuitem action="action_invoice_tree1" id="menu_action_invoice_tree1" parent="menu_finance_receivables"/>
<record id="action_invoice_tree2" model="ir.actions.act_window">
<field name="name">Vendor Invoices</field>
<field name="name">Supplier Invoices</field>
<field name="res_model">account.invoice</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
@ -459,7 +457,7 @@
<field name="domain">[('type','=','in_invoice')]</field>
<field name="context">{'type':'in_invoice', 'journal_type': 'purchase'}</field>
<field name="search_view_id" ref="view_account_invoice_filter"/>
<field name="help">Proposal for vendor invoices are usually automatically generate by OpenERP, following a procurement order or a production order for instance. To consult and to check for, or to manually create a customer invoice, use this menu. You can review, confirm or cancel, pay or refund an invoice from the view from of the invoices.</field>
<field name="help">Proposal for supplier invoices are usually automatically generate by OpenERP, following a procurement order or a production order for instance. To consult and to check for, or to manually create a customer invoice, use this menu. You can review, confirm or cancel, pay or refund an invoice from the view from of the invoices.</field>
</record>
<menuitem action="action_invoice_tree2" id="menu_action_invoice_tree2" parent="menu_finance_payables"/>
@ -490,7 +488,7 @@
<menuitem action="action_invoice_tree3" id="menu_action_invoice_tree3" parent="menu_finance_receivables"/>
<record id="action_invoice_tree4" model="ir.actions.act_window">
<field name="name">Vendor Refunds</field>
<field name="name">Supplier Refunds</field>
<field name="res_model">account.invoice</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
@ -515,14 +513,16 @@
domain="[('account_id.reconcile', '=', True)]"
context="{'search_default_unreconciled':True,'search_default_partner_id':[partner_id]}"
id="act_account_invoice_account_move_unreconciled"
groups="base.group_extended"
name="Items to Reconcile"
res_model="account.move.line"
src_model="account.invoice"/>
<act_window
context="{'search_default_move_id':move_id}"
context="{'search_default_move_id':move_id, 'search_default_unreconciled':False,}"
id="act_account_invoice_account_move_invoice_link"
name="Invoice Items"
groups="base.group_extended"
res_model="account.move.line"
src_model="account.invoice"/>

View File

@ -2,47 +2,49 @@
<openerp>
<data>
<menuitem icon="terp-account" id="menu_finance" name="Accounting" sequence="13"/>
<menuitem id="menu_finance_receivables" name="Customers" parent="menu_finance" sequence="1" groups="group_account_user,group_account_manager"/>
<menuitem id="menu_finance_payables" name="Vendors" parent="menu_finance" sequence="2" groups="group_account_user,group_account_manager"/>
<menuitem id="menu_finance_bank_and_cash" name="Bank and Cash" parent="menu_finance" sequence="3"/>
<menuitem id="menu_finance_periodical_processing" name="Periodical Processing" parent="menu_finance" sequence="8" groups="group_account_user,group_account_manager,group_account_invoice"/>
<menuitem icon="terp-account" id="menu_finance" name="Accounting" sequence="13"
groups="group_account_user,group_account_manager,group_account_invoice"/>
<menuitem id="menu_finance_receivables" name="Customers" parent="menu_finance" sequence="1"/>
<menuitem id="menu_finance_payables" name="Suppliers" parent="menu_finance" sequence="2"/>
<menuitem id="menu_finance_bank_and_cash" name="Bank and Cash" parent="menu_finance" sequence="3"
groups="group_account_user"/>
<menuitem id="menu_finance_periodical_processing" name="Periodical Processing" parent="menu_finance" sequence="8" groups="group_account_user"/>
<!-- This menu is used in account_code module -->
<menuitem id="menu_account_pp_statements" name="Statements" parent="menu_finance_periodical_processing" sequence="12"/>
<menuitem id="periodical_processing_journal_entries_validation" name="Draft Entries" parent="menu_finance_periodical_processing" groups="group_account_user,group_account_manager"/>
<menuitem id="periodical_processing_journal_entries_validation" name="Draft Entries" parent="menu_finance_periodical_processing"/>
<menuitem id="periodical_processing_reconciliation" name="Reconciliation" parent="menu_finance_periodical_processing"/>
<menuitem id="periodical_processing_invoicing" name="Invoicing" parent="menu_finance_periodical_processing"/>
<menuitem id="menu_finance_charts" name="Charts" parent="menu_finance" sequence="5"/>
<menuitem id="menu_finance_reporting" name="Reporting" parent="account.menu_finance" sequence="12" groups="group_account_manager,group_account_user"/>
<menuitem id="menu_finance_reporting_budgets" name="Budgets" parent="menu_finance_reporting"/>
<menuitem id="menu_finance_reporting" name="Reporting" parent="account.menu_finance" sequence="12"/>
<menuitem id="menu_finance_reporting_budgets" name="Budgets" parent="menu_finance_reporting" groups="group_account_user"/>
<menuitem id="menu_finance_legal_statement" name="Legal Reports" parent="menu_finance_reporting"/>
<menuitem id="menu_finance_management_belgian_reports" name="Belgian Reports" parent="menu_finance_reporting"/>
<menuitem id="menu_finance_configuration" name="Configuration" parent="menu_finance" sequence="13" groups="group_account_manager"/>
<menuitem id="menu_finance_accounting" name="Financial Accounting" parent="menu_finance_configuration" groups="group_account_manager"/>
<menuitem id="menu_analytic_accounting" name="Analytic Accounting" parent="menu_finance_configuration" groups="group_account_manager"/>
<menuitem id="menu_finance_accounting" name="Financial Accounting" parent="menu_finance_configuration"/>
<menuitem id="menu_analytic_accounting" name="Analytic Accounting" parent="menu_finance_configuration"/>
<menuitem id="menu_analytic" parent="menu_analytic_accounting" name="Accounts" groups="analytic.group_analytic_accounting"/>
<menuitem id="menu_low_level" name="Low Level" parent="menu_finance_accounting" groups="base.group_extended"/>
<menuitem id="menu_configuration_misc" name="Miscellaneous" parent="menu_finance_configuration" sequence="30" groups="group_account_manager"/>
<menuitem id="base.menu_action_currency_form" parent="menu_configuration_misc" sequence="20"/>
<menuitem id="menu_finance_generic_reporting" name="Generic Reporting" parent="menu_finance_reporting" sequence="100" groups="group_account_manager"/>
<menuitem id="menu_finance_entries" name="Accounting" parent="menu_finance" sequence="4"
groups="group_account_user,group_account_manager"/>
<menuitem id="menu_finance_generic_reporting" name="Generic Reporting" parent="menu_finance_reporting" sequence="100"/>
<menuitem id="menu_finance_entries" name="Journal Entries" parent="menu_finance" sequence="4" groups="group_account_user"/>
<menuitem id="account.menu_finance_recurrent_entries" name="Recurring Entries" parent="menu_finance_periodical_processing" sequence="15" groups="base.group_extended"/>
<menuitem id="menu_account_end_year_treatments" name="End of Period" parent="menu_finance_periodical_processing" groups="group_account_user,group_account_manager" sequence="25"/>
<menuitem id="menu_account_end_year_treatments" name="End of Period" parent="menu_finance_periodical_processing" groups="group_account_manager" sequence="25"/>
<menuitem id="menu_finance_periodical_processing_billing" name="Billing" parent="menu_finance_periodical_processing" sequence="35"/>
<menuitem id="menu_finance_statistic_report_statement" name="Statistic Reports" parent="menu_finance_reporting" sequence="300" groups="account.group_account_manager"/>
<menuitem id="menu_finance_statistic_report_statement" name="Statistic Reports" parent="menu_finance_reporting" sequence="300"/>
<menuitem
parent="account.menu_finance_legal_statement"
id="final_accounting_reports"
name="Accounting Reports"/>
parent="account.menu_finance_legal_statement"
id="final_accounting_reports"
name="Accounting Reports"/>
<menuitem
parent="account.menu_finance_legal_statement"
id="menu_journals_report"
name="Journals"/>
parent="account.menu_finance_legal_statement"
id="menu_journals_report"
groups="group_account_user"
name="Journals"/>
</data>
</openerp>

View File

@ -56,7 +56,7 @@ class account_move_line(osv.osv):
where_move_lines_by_date = ''
if context.get('date_from', False) and context.get('date_to', False):
if initital_bal:
if initial_bal:
where_move_lines_by_date = " AND " +obj+".move_id in ( select id from account_move where date < '"+context['date_from']+"')"
else:
where_move_lines_by_date = " AND " +obj+".move_id in ( select id from account_move where date >= '" +context['date_from']+"' AND date <= '"+context['date_to']+"')"
@ -65,17 +65,27 @@ class account_move_line(osv.osv):
if state.lower() not in ['all']:
where_move_state= " AND "+obj+".move_id in (select id from account_move where account_move.state = '"+state+"')"
if context.get('period_from', False) and context.get('periof_from', False) and not context.get('periods', False):
if context.get('period_from', False) and context.get('period_to', False) and not context.get('periods', False):
if initial_bal:
period_company_id = period_obj.browse(cr, uid, data['form']['period_from'], context=context).company_id.id
first_period = self.pool.get('account.period').search(cr, uid, [('company_id', '=', period_company_id)], order='date_start', limit=1)[0]
context['periods'] = period_obj.build_ctx_periods(cr, uid, first_period, data['form']['period_from'])
period_company_id = fiscalperiod_obj.browse(cr, uid, context['period_from'], context=context).company_id.id
first_period = fiscalperiod_obj.search(cr, uid, [('company_id', '=', period_company_id)], order='date_start', limit=1)[0]
context['periods'] = fiscalperiod_obj.build_ctx_periods(cr, uid, first_period, context['period_from'])
else:
context['periods'] = period_obj.build_ctx_periods(cr, uid, data['form']['period_from'], data['form']['period_to'])
context['periods'] = fiscalperiod_obj.build_ctx_periods(cr, uid, context['period_from'], context['period_to'])
if context.get('periods', False):
ids = ','.join([str(x) for x in context['periods']])
query = obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) AND id in (%s)) %s %s" % (fiscalyear_clause, ids, where_move_state, where_move_lines_by_date)
if initial_bal:
query = obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) %s %s)" % (fiscalyear_clause, where_move_state, where_move_lines_by_date)
period_ids = fiscalperiod_obj.search(cr, uid, [('id', 'in', context['periods'])], order='date_start', limit=1)
if period_ids and period_ids[0]:
first_period = fiscalperiod_obj.browse(cr, uid, period_ids[0], context=context)
# Find the old periods where date start of those periods less then Start period
periods = fiscalperiod_obj.search(cr, uid, [('date_start', '<', first_period.date_start)])
periods = ','.join([str(x) for x in periods])
if periods:
query = obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) OR id in (%s)) %s %s" % (fiscalyear_clause, periods, where_move_state, where_move_lines_by_date)
else:
ids = ','.join([str(x) for x in context['periods']])
query = obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) AND id in (%s)) %s %s" % (fiscalyear_clause, ids, where_move_state, where_move_lines_by_date)
else:
query = obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) %s %s)" % (fiscalyear_clause,where_move_state,where_move_lines_by_date)
@ -88,40 +98,6 @@ class account_move_line(osv.osv):
query += company_clause
if context.get('period_manner','') == 'created':
#the query have to be build with no reference to periods but thanks to the creation date
if context.get('periods',False):
#if one or more period are given, use them
fiscalperiod_ids = fiscalperiod_obj.search(cr, uid, [('id','in',context['periods'])])
else:
fiscalperiod_ids = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id','in',fiscalyear_ids)])
#remove from the old query the clause related to the period selection
res = ''
count = 1
clause_list = query.split('AND')
ref_string = ' '+obj+'.period_id in'
for clause in clause_list:
if count != 1 and not clause.startswith(ref_string):
res += "AND"
if not clause.startswith(ref_string):
res += clause
count += 1
#add to 'res' a new clause containing the creation date criterion
count = 1
res += " AND ("
periods = self.pool.get('account.period').read(cr, uid, p_ids, ['date_start','date_stop'])
for period in periods:
if count != 1:
res += " OR "
#creation date criterion: the creation date of the move_line has to be
# between the date_start and the date_stop of the selected periods
res += "("+obj+".create_date between to_date('" + period['date_start'] + "','yyyy-mm-dd') and to_date('" + period['date_stop'] + "','yyyy-mm-dd'))"
count += 1
res += ")"
return res
return query
def default_get(self, cr, uid, fields, context={}):
@ -929,7 +905,6 @@ class account_move_line(osv.osv):
fld = sorted(fld, key=itemgetter(1))
widths = {
'ref': 50,
'statement_id': 50,
'state': 60,
'tax_code_id': 50,

View File

@ -9,13 +9,13 @@
<report auto="False" id="account_central_journal" model="account.journal.period" name="account.central.journal" rml="account/report/account_central_journal.rml" string="Central Journals" header="False"/>
<report auto="False" id="account_general_journal" model="account.journal.period" name="account.general.journal" rml="account/report/account_general_journal.rml" string="General Journals" header="False"/>
<report auto="False" id="account_journal" model="account.journal.period" name="account.journal.period.print" rml="account/report/account_journal.rml" string="Journals" header="False"/>
<report auto="False" id="account_overdue" model="res.partner" name="account.overdue" rml="account/report/overdue.rml" string="Overdue Payments"/>
<report auto="False" id="account_overdue" model="res.partner" name="account.overdue" rml="account/report/account_print_overdue.rml" string="Overdue Payments"/>
<report
auto="False"
id="account_invoices"
model="account.invoice"
name="account.invoice"
rml="account/report/invoice.rml"
rml="account/report/account_print_invoice.rml"
string="Invoices"
attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/',''))"
attachment_use="1"/>
@ -30,14 +30,14 @@
menu="False"
model="account.tax.code"
name="account.vat.declaration"
rml="account/report/tax_report.rml"
rml="account/report/account_tax_report.rml"
string="Taxes Report"/>
<report id="report_account_voucher_new"
string="Print Voucher"
model="account.move"
name="account.move.voucher"
rml="account/report/voucher_print.rml"
rml="account/report/account_voucher_print.rml"
auto="False"
header = "False"
menu="True"/>
@ -45,6 +45,7 @@
<menuitem
id="menu_tax_report"
name="Taxes"
groups="group_account_user"
parent="account.menu_finance_generic_reporting" sequence="3"/>
<report id="account_account_balance_landscape"

View File

@ -347,10 +347,10 @@
<field name="arch" type="xml">
<tree string="Search Account Journal">
<group>
<filter domain="['|', ('type', '=', 'sale'), ('type', '=', 'sale_refund')]" string="Customer Journals" icon="terp-sale"/>
<filter domain="['|', ('type', '=', 'purchase'), ('type', '=', 'purchase_refund')]" string="Vendor Journals" icon="terp-purchase"/>
<filter domain="['|', ('type', '=', 'cash'), ('type', '=', 'bank')]" string="Liquidity Journals" icon="terp-dolar"/>
<filter domain="['|', ('type', '=', 'general'), ('type', '=', 'situation')]" string="Global Journals" icon="terp-stock"/>
<filter domain="['|', ('type', '=', 'sale'), ('type', '=', 'sale_refund')]" string="Sale" icon="terp-sale"/>
<filter domain="['|', ('type', '=', 'purchase'), ('type', '=', 'purchase_refund')]" string="Purchase" icon="terp-purchase"/>
<filter domain="['|', ('type', '=', 'cash'), ('type', '=', 'bank')]" string="Liquidity" icon="terp-dolar"/>
<filter domain="['|', ('type', '=', 'general'), ('type', '=', 'situation')]" string="Others" icon="terp-stock"/>
<separator orientation="vertical"/>
<field name="code"/>
<field name="name"/>
@ -820,13 +820,10 @@
<field name="arch" type="xml">
<search string="Search Taxes">
<group col="10" colspan="4">
<separator orientation="vertical"/>
<field name="name"/>
<field name="description"/>
</group>
<newline/>
<group expand="0" string="Group By...">
</group>
</search>
</field>
</record>
@ -902,13 +899,6 @@
<field name="help">Chart of Taxes is a tree view reflecting the structure of the Tax Cases (or tax codes) and shows the current tax situation. The tax chart represents the amount of each area of the tax declaration for your country. Its presented in a hierarchical structure, which can be modified to fit your needs.</field>
</record>
<!--
<menuitem
action="action_tax_code_tree"
id="menu_action_tax_code_tree"
parent="menu_finance_charts"
sequence="12"/> --> <!-- move to wizard -->
<!--
Entries lines
-->
@ -1392,6 +1382,7 @@
action="action_move_journal_line"
id="menu_action_move_journal_line_form"
parent="account.menu_finance_entries"
groups="group_account_user"
sequence="5"/>
<record id="action_move_line_form" model="ir.actions.act_window">
@ -1431,8 +1422,6 @@
<field name="act_window_id" ref="action_move_line_search"/>
</record>
<menuitem id="menu_finance_charts" name="Charts" parent="account.menu_finance" sequence="4"/>
<record id="view_bank_statement_reconcile_form" model="ir.ui.view">
<field name="name">account.bank.statement.form</field>
<field name="model">account.bank.statement</field>
@ -1505,8 +1494,8 @@
<menuitem
name="Manual Reconcilication" icon="STOCK_EXECUTE"
action="action_account_manual_reconcile"
name="Manual Reconcilication" icon="STOCK_EXECUTE"
action="action_account_manual_reconcile"
id="menu_manual_reconcile"
parent="account.periodical_processing_reconciliation"/>
@ -1568,7 +1557,7 @@
<field name="sequence"/>
<field name="name"/>
<field name="account_id"/>
<field name="analytic_account_id"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
<field name="partner_id"/>
<field name="debit"/>
<field name="credit"/>
@ -1587,7 +1576,7 @@
<field colspan="4" name="name" select="1"/>
<field name="sequence"/>
<field name="account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="analytic_account_id"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
<field name="partner_id"/>
<field name="debit" select="1"/>
<field name="credit" select="1"/>
@ -1658,7 +1647,9 @@
<field name="view_mode">tree,form,search</field>
<field name="search_view_id" ref="view_model_search"/>
</record>
<menuitem action="action_model_form" id="menu_action_model_form" sequence="5" parent="account.menu_configuration_misc" groups="base.group_extended"/>
<menuitem
action="action_model_form" id="menu_action_model_form" sequence="5"
parent="account.menu_configuration_misc" groups="base.group_extended"/>
<!--
# Payment Terms
@ -1744,7 +1735,9 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="action_payment_term_form" id="menu_action_payment_term_form" parent="menu_configuration_misc"/>
<menuitem action="action_payment_term_form"
id="menu_action_payment_term_form" parent="menu_configuration_misc"
groups="group_account_manager"/>
<!--
# Account Subscriptions
@ -1856,7 +1849,11 @@
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_subscription_search"/>
</record>
<menuitem name="Define Recurring Entries" action="action_subscription_form" id="menu_action_subscription_form" sequence="1" parent="account.menu_finance_recurrent_entries"/>
<menuitem
name="Define Recurring Entries" action="action_subscription_form"
groups="base.group_extended"
id="menu_action_subscription_form" sequence="1"
parent="account.menu_finance_recurrent_entries"/>
<record id="action_subscription_form_running" model="ir.actions.act_window">
<field name="name">Running Subscriptions</field>
@ -2078,7 +2075,6 @@
<field name="view_mode">tree,form,search</field>
</record>
<menuitem action="action_account_template_form" id="menu_action_account_template_form" parent="account_template_accounts"/>
<!-- Chart of Accounts Templates -->
@ -2371,7 +2367,9 @@
<field name="target">new</field>
</record>
<menuitem name="New Company Financial Setting" parent="account.account_template_folder" action="account.action_account_configuration_installer" id="menu_wizard"/>
<menuitem name="New Company Financial Setting" parent="account.account_template_folder"
groups="group_account_manager"
action="account.action_account_configuration_installer" id="menu_wizard"/>
<record id="account_account_graph" model="ir.ui.view">
<field name="name">account.account.graph</field>
@ -2385,14 +2383,14 @@
</field>
</record>
<!-- Fiscal Mapping Templates -->
<!-- Fiscal Position Templates -->
<record id="view_account_position_template_form" model="ir.ui.view">
<field name="name">account.fiscal.position.template.form</field>
<field name="model">account.fiscal.position.template</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Fiscal Mapping Template">
<form string="Fiscal Position Template">
<field name="name" select="1"/>
<field name="chart_template_id"/>
<newline/>
@ -2424,14 +2422,14 @@
<field name="model">account.fiscal.position.template</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Fiscal Mapping">
<tree string="Fiscal Position">
<field name="name"/>
</tree>
</field>
</record>
<record id="action_account_fiscal_position_template_form" model="ir.actions.act_window">
<field name="name">Fiscal Mapping Templates</field>
<field name="name">Fiscal Position Templates</field>
<field name="res_model">account.fiscal.position.template</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
@ -2609,7 +2607,8 @@
<field name="view_id" ref="account_cash_statement_graph"/>
<field name="act_window_id" ref="action_view_bank_statement_tree"/>
</record>
<menuitem action="action_view_bank_statement_tree" id="journal_cash_move_lines" parent="menu_finance_bank_and_cash"/>
<menuitem action="action_view_bank_statement_tree" id="journal_cash_move_lines" parent="menu_finance_bank_and_cash"
groups="group_account_user"/>
</data>
</openerp>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem id="next_id_22" name="Partner Accounts" parent="menu_finance_generic_reporting" sequence="1"/>
<menuitem id="next_id_22" name="Partners" parent="menu_finance_generic_reporting" sequence="1"/>
</data>
</openerp>

View File

@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-09-29 11:28+0000\n"
"PO-Revision-Date: 2010-10-09 14:32+0000\n"
"Last-Translator: OpenERP Administrators <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: 2010-09-30 04:39+0000\n"
"X-Launchpad-Export-Date: 2010-10-10 04:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@ -40,7 +40,7 @@ msgstr "تشفير المدخلات"
#. module: account
#: model:ir.actions.todo,note:account.config_wizard_account_base_setup_form
msgid "Specify The Message for the Overdue Payment Report."
msgstr ""
msgstr "تحديد الرسالة لتقرير الدفع المتأخر"
#. module: account
#: model:process.transition,name:account.process_transition_confirmstatementfromdraft0
@ -55,17 +55,17 @@ msgstr "أصل"
#. module: account
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
msgstr "اسم النموذج غير صالح في تعريف العمل."
#. module: account
#: help:account.journal,currency:0
msgid "The currency used to enter statement"
msgstr ""
msgstr "العملة المستعملة لإدخال البيان"
#. module: account
#: wizard_view:account_use_models,init_form:0
msgid "Select Message"
msgstr "أختر رسالة"
msgstr "اختر رسالة"
#. module: account
#: help:product.category,property_account_income_categ:0
@ -73,28 +73,29 @@ msgid ""
"This account will be used to value incoming stock for the current product "
"category"
msgstr ""
"سيتم استخدام هذا الحساب لتقييم المؤن الواردة بالنسبة لفئة المنتج الحالي"
#. module: account
#: help:account.invoice,period_id:0
msgid "Keep empty to use the period of the validation(invoice) date."
msgstr ""
msgstr "الإبقاء فارغ لاستخدام فترة تاريخ المصادقة (الفاتورة)"
#. module: account
#: wizard_view:account.automatic.reconcile,reconcile:0
msgid "Reconciliation result"
msgstr ""
msgstr "نتيجة التسوية"
#. module: account
#: model:ir.actions.act_window,name:account.act_account_acount_move_line_open_unreconciled
msgid "Unreconciled entries"
msgstr "مدخلات لم يتم تسويتها"
msgstr "إدخالات لم يتم تسويتها"
#. module: account
#: field:account.invoice.tax,base_code_id:0
#: field:account.tax,base_code_id:0
#: field:account.tax.template,base_code_id:0
msgid "Base Code"
msgstr ""
msgstr "رمز الأساس"
#. module: account
#: view:account.account:0
@ -115,12 +116,12 @@ msgstr "أصل"
#. module: account
#: selection:account.move,type:0
msgid "Journal Voucher"
msgstr ""
msgstr "قسيمة الدفتر"
#. module: account
#: field:account.invoice,residual:0
msgid "Residual"
msgstr ""
msgstr "متبقي"
#. module: account
#: field:account.tax,base_sign:0
@ -128,18 +129,18 @@ msgstr ""
#: field:account.tax.template,base_sign:0
#: field:account.tax.template,ref_base_sign:0
msgid "Base Code Sign"
msgstr ""
msgstr "علامة رمز الأساس"
#. module: account
#: model:ir.actions.wizard,name:account.wizard_unreconcile_select
#: model:ir.ui.menu,name:account.menu_unreconcile_select
msgid "Unreconcile entries"
msgstr ""
msgstr "إلغاء تسوية الإدخالات"
#. module: account
#: constraint:account.period:0
msgid "Error ! The duration of the Period(s) is/are invalid. "
msgstr ""
msgstr "خظأ! إن مدة الفترة أو الفترات غير صالحة "
#. module: account
#: view:account.bank.statement.reconcile:0
@ -149,17 +150,17 @@ msgstr ""
#: model:ir.actions.act_window,name:account.action_move_line_form
#: model:ir.ui.menu,name:account.menu_action_move_line_form
msgid "Entries"
msgstr "مُدخلات"
msgstr "إدخالات"
#. module: account
#: selection:account.move.line,centralisation:0
msgid "Debit Centralisation"
msgstr ""
msgstr "تمركز المدين"
#. module: account
#: model:ir.actions.wizard,name:account.wizard_invoice_state_confirm
msgid "Confirm draft invoices"
msgstr ""
msgstr "تثبيت مشاريع الفواتير"
#. module: account
#: help:account.payment.term.line,days2:0
@ -168,11 +169,14 @@ msgid ""
"positive, it gives the day of the next month. Set 0 for net days (otherwise "
"it's based on the beginning of the month)."
msgstr ""
"يوم الشهر، إدخال -1 من أجل آخر يوم من الشهر الحالي. إذا كان إيجابيا فسيعطي "
"اليوم من الشهر القادم. إدخال 0 من أجل أيام صافية (وإلا فإنه يستند إلى بداية "
"الشهر)."
#. module: account
#: view:account.move:0
msgid "Total Credit"
msgstr ""
msgstr "مجموع المدين"
#. module: account
#: field:account.config.wizard,charts:0
@ -190,39 +194,39 @@ msgstr ""
#: rml:account.third_party_ledger:0
#: rml:account.third_party_ledger_other:0
msgid "Entry label"
msgstr ""
msgstr "تسمية المدخل"
#. module: account
#: model:ir.model,name:account.model_account_model_line
msgid "Account Model Entries"
msgstr ""
msgstr "إدخالات نماذج الحسابات"
#. module: account
#: field:account.tax.code,sum_period:0
msgid "Period Sum"
msgstr ""
msgstr "مجموع الفترة"
#. module: account
#: view:account.tax:0
#: view:account.tax.template:0
msgid "Compute Code (if type=code)"
msgstr ""
msgstr "رمز الحساب (إذا كان النوع = الرمز)"
#. module: account
#: view:account.move:0
#: view:account.move.line:0
msgid "Account Entry Line"
msgstr ""
msgstr "خط إدخال الحساب"
#. module: account
#: wizard_view:account.aged.trial.balance,init:0
msgid "Aged Trial Balance"
msgstr ""
msgstr "ميزان المراجعة القديم"
#. module: account
#: model:ir.ui.menu,name:account.menu_finance_recurrent_entries
msgid "Recurrent Entries"
msgstr ""
msgstr "إدخالات متكررة"
#. module: account
#: field:account.analytic.line,amount:0
@ -235,19 +239,19 @@ msgstr ""
#: field:account.tax.template,amount:0
#: xsl:account.transfer:0
msgid "Amount"
msgstr ""
msgstr "المبلغ"
#. module: account
#: model:ir.actions.report.xml,name:account.account_3rdparty_ledger
#: model:ir.actions.wizard,name:account.wizard_third_party_ledger
#: model:ir.ui.menu,name:account.menu_third_party_ledger
msgid "Partner Ledger"
msgstr ""
msgstr "دفتر الشركاء"
#. module: account
#: field:product.template,supplier_taxes_id:0
msgid "Supplier Taxes"
msgstr ""
msgstr "ضرائب المورد"
#. module: account
#: view:account.move:0

View File

@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-09-29 10:39+0000\n"
"Last-Translator: OpenERP Administrators <Unknown>\n"
"PO-Revision-Date: 2010-10-10 10:37+0000\n"
"Last-Translator: Ferdinand @ ChriCar <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: 2010-09-30 04:40+0000\n"
"X-Launchpad-Export-Date: 2010-10-11 04:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@ -630,7 +630,7 @@ msgstr "(frei lassen um aktuelle Einstellung zu verwenden)"
#. module: account
#: model:ir.model,name:account.model_account_fiscal_position_account
msgid "Accounts Fiscal Mapping"
msgstr ""
msgstr "Konten Steuer Umschlüsselung"
#. module: account
#: field:account.analytic.account,contact_id:0
@ -1030,7 +1030,7 @@ msgstr "Nettosumme:"
#: model:ir.model,name:account.model_account_fiscal_position
#: field:res.partner,property_account_position:0
msgid "Fiscal Mapping"
msgstr ""
msgstr "Steuer Umschlüsselung"
#. module: account
#: field:account.analytic.line,product_uom_id:0
@ -1052,7 +1052,7 @@ msgstr "(Sub-)"
#. module: account
#: model:ir.model,name:account.model_account_fiscal_position_tax
msgid "Taxes Fiscal Mapping"
msgstr ""
msgstr "Steuern Umschlüsselung"
#. module: account
#: model:ir.actions.act_window,name:account.action_invoice_tree2_new
@ -1141,7 +1141,7 @@ msgstr "Neues Analytisches Konto"
#: model:ir.actions.act_window,name:account.action_account_fiscal_position_template_form
#: model:ir.ui.menu,name:account.menu_action_account_fiscal_position_form_template
msgid "Fiscal Mapping Templates"
msgstr ""
msgstr "Steuer Umschlüsselung Vorlagen"
#. module: account
#: rml:account.invoice:0
@ -1173,7 +1173,7 @@ msgstr "optionaler Betrag in anderer Währung"
#: view:account.fiscal.position.template:0
#: field:account.fiscal.position.template,name:0
msgid "Fiscal Mapping Template"
msgstr ""
msgstr "Steuer Umschlüsselung Vorlage"
#. module: account
#: field:account.payment.term,line_ids:0
@ -1244,7 +1244,7 @@ msgstr "Betriebl. Währung"
#. module: account
#: model:ir.model,name:account.model_account_fiscal_position_account_template
msgid "Template Account Fiscal Mapping"
msgstr ""
msgstr "Konten Steuerumschlüsselung Vorlagen"
#. module: account
#: field:account.analytic.account,parent_id:0
@ -1828,6 +1828,7 @@ msgid ""
"The fiscal mapping will determine taxes and the accounts used for the "
"partner."
msgstr ""
"Die Steuerumschlüsselung legt Steuern und Konten für diesen PArtner fest."
#. module: account
#: rml:account.analytic.account.cost_ledger:0
@ -2102,7 +2103,7 @@ msgstr "Prozess Abrechnung von Kundenaufträgen"
#. module: account
#: rml:account.invoice:0
msgid "Fiscal Mapping Remark :"
msgstr ""
msgstr "Steuer Umschlüsselung Anmerkung:"
#. module: account
#: wizard_field:account.fiscalyear.close,init,period_id:0
@ -3701,7 +3702,7 @@ msgstr "Sequenzer"
#. module: account
#: model:ir.model,name:account.model_account_fiscal_position_template
msgid "Template for Fiscal Mapping"
msgstr ""
msgstr "Steuerumschlüsselung Vorlage"
#. module: account
#: view:account.bank.statement:0
@ -3808,7 +3809,7 @@ msgstr "Entwurf Rechnungen"
#. module: account
#: model:ir.model,name:account.model_account_fiscal_position_tax_template
msgid "Template Tax Fiscal Mapping"
msgstr ""
msgstr "Steuer Umschlüsselung Vorlage"
#. module: account
#: rml:account.invoice:0
@ -6007,7 +6008,7 @@ msgstr "Zahlungsbedingung"
#: model:ir.actions.act_window,name:account.action_account_fiscal_position_form
#: model:ir.ui.menu,name:account.menu_action_account_fiscal_position_form
msgid "Fiscal Mappings"
msgstr ""
msgstr "Steuer Umschlüsselung"
#. module: account
#: model:process.process,name:account.process_process_statementprocess0

View File

@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-09-29 08:55+0000\n"
"Last-Translator: OpenERP Administrators <Unknown>\n"
"PO-Revision-Date: 2010-10-11 04:27+0000\n"
"Last-Translator: sugi <Unknown>\n"
"Language-Team: Mongolian <mn@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: 2010-09-30 04:41+0000\n"
"X-Launchpad-Export-Date: 2010-10-11 04:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@ -4537,22 +4537,22 @@ msgstr "Төлөв байдал"
#: model:process.node,name:account.process_node_accountingentries0
#: model:process.node,name:account.process_node_supplieraccountingentries0
msgid "Accounting Entries"
msgstr ""
msgstr "Дансны бичилт"
#. module: account
#: model:ir.actions.act_window,name:account.act_account_partner_account_move_unreconciled
msgid "Receivables & Payables"
msgstr ""
msgstr "Авлагын данс болон төлбөр"
#. module: account
#: rml:account.general.ledger:0
msgid "General Ledger -"
msgstr ""
msgstr "Ерөнхий дэвтэр"
#. module: account
#: field:report.hr.timesheet.invoice.journal,quantity:0
msgid "Quantities"
msgstr ""
msgstr "Тоо хэмжээ"
#. module: account
#: field:account.analytic.account,date_start:0
@ -4579,7 +4579,7 @@ msgstr "Бичигдсэн журналын бичилтийн тоо"
#: model:process.transition,name:account.process_transition_suppliervalidentries0
#: model:process.transition,name:account.process_transition_validentries0
msgid "Valid Entries"
msgstr ""
msgstr "Хүчинтэй бичилт"
#. module: account
#: model:ir.actions.wizard,name:account.wizard_account_use_model
@ -4605,7 +4605,7 @@ msgstr "Огноогоор"
#: model:ir.actions.act_window,name:account.action_invoice_tree4
#: model:ir.ui.menu,name:account.menu_action_invoice_tree4
msgid "Supplier Refunds"
msgstr ""
msgstr "Нийлүүлэгчид бүцааж төлөх"
#. module: account
#: help:account.model.line,date:0
@ -4615,7 +4615,7 @@ msgstr ""
#. module: account
#: wizard_button:account.invoice.refund,init,modify_invoice:0
msgid "Modify Invoice"
msgstr ""
msgstr "Нэхэмжлэл засварлах"
#. module: account
#: view:res.partner:0
@ -4699,7 +4699,7 @@ msgstr "Компани"
#. module: account
#: rml:account.general.ledger:0
msgid "Crebit"
msgstr ""
msgstr "Орлого"
#. module: account
#: selection:account.subscription,state:0
@ -4733,7 +4733,7 @@ msgstr ""
#. module: account
#: selection:account.automatic.reconcile,init,power:0
msgid "4"
msgstr ""
msgstr "4"
#. module: account
#: model:ir.actions.act_window,name:account.action_account_fiscalyear_form
@ -4756,23 +4756,23 @@ msgstr ""
#. module: account
#: xsl:account.transfer:0
msgid "Change"
msgstr ""
msgstr "Солих"
#. module: account
#: field:account.journal.period,icon:0
msgid "Icon"
msgstr ""
msgstr "Дүрс"
#. module: account
#: model:ir.model,name:account.model_account_journal_period
msgid "Journal - Period"
msgstr ""
msgstr "Журналын мөчлөг"
#. module: account
#: wizard_field:account.move.line.reconcile,init_full,credit:0
#: wizard_field:account.move.line.reconcile,init_partial,credit:0
msgid "Credit amount"
msgstr ""
msgstr "Орлогын хэмжээ"
#. module: account
#: view:account.fiscalyear:0
@ -4782,7 +4782,7 @@ msgstr "Сарын мөчлөг үүсгэх"
#. module: account
#: wizard_button:account.aged.trial.balance,init,print:0
msgid "Print Aged Trial Balance"
msgstr ""
msgstr "Насжилтын баланс хэвлэх"
#. module: account
#: field:account.analytic.line,ref:0
@ -4802,7 +4802,7 @@ msgstr "Нэхэмжлэх хаяг"
#. module: account
#: rml:account.analytic.account.analytic.check:0
msgid "General Credit"
msgstr ""
msgstr "Ерөнхий орлого"
#. module: account
#: help:account.journal,centralisation:0
@ -4831,7 +4831,7 @@ msgstr "Төлбөрийн огноо"
#. module: account
#: rml:account.journal.period.print:0
msgid "A/c No."
msgstr ""
msgstr "А/к дугаар"
#. module: account
#: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree_month
@ -4854,17 +4854,17 @@ msgstr "Тулгагдаагүй бичилтийг нээх"
#: field:account.bank.statement.reconcile,statement_line:0
#: model:ir.model,name:account.model_account_bank_statement_line
msgid "Bank Statement Line"
msgstr ""
msgstr "Банкны мэдэгдлийн мөр"
#. module: account
#: wizard_button:account.automatic.reconcile,reconcile,end:0
msgid "OK"
msgstr ""
msgstr "Тийм"
#. module: account
#: model:process.node,name:account.process_node_supplierinvoiceinvoice0
msgid "Control Invoice"
msgstr ""
msgstr "Нэхэмжлэлийн удирдлага"
#. module: account
#: selection:account.account,type:0
@ -4899,12 +4899,12 @@ msgstr "НӨАТ:"
#: rml:account.general.journal:0
#: rml:account.invoice:0
msgid "Total:"
msgstr ""
msgstr "Нийт:"
#. module: account
#: model:ir.model,name:account.model_account_analytic_journal
msgid "account.analytic.journal"
msgstr ""
msgstr "Аналитик дансны журнал"
#. module: account
#: view:account.fiscal.position:0
@ -5533,7 +5533,7 @@ msgstr "Тэнцэл"
#. module: account
#: rml:account.invoice:0
msgid "Refund"
msgstr ""
msgstr "Буцааж төлөх"
#. module: account
#: model:ir.model,name:account.model_account_invoice_tax
@ -5600,7 +5600,7 @@ msgstr "Хаах"
#. module: account
#: field:account.bank.statement.line,move_ids:0
msgid "Moves"
msgstr ""
msgstr "Шилжүүлэх"
#. module: account
#: selection:account.invoice,state:0
@ -5649,7 +5649,7 @@ msgstr ""
#: wizard_field:account.analytic.account.chart,init,to_date:0
#: wizard_field:account.analytic.line,init,to_date:0
msgid "To"
msgstr ""
msgstr "Хүртэл"
#. module: account
#: model:ir.actions.act_window,name:account.action_account_analytic_journal_open_form
@ -5669,7 +5669,7 @@ msgstr ""
#. module: account
#: selection:account.move,type:0
msgid "Journal Sale"
msgstr ""
msgstr "Хувалдан авалтын журнал"
#. module: account
#: wizard_field:account.fiscalyear.close,init,fy_id:0
@ -5769,7 +5769,7 @@ msgstr "Ангилалын код"
#. module: account
#: selection:account.automatic.reconcile,init,power:0
msgid "5"
msgstr ""
msgstr "5"
#. module: account
#: field:product.category,property_account_income_categ:0
@ -5797,7 +5797,7 @@ msgstr "Дансны модел"
#: view:account.invoice:0
#: model:ir.actions.act_window,name:account.act_account_analytic_account_2_account_invoice_line
msgid "Invoice lines"
msgstr ""
msgstr "Нэхэмжлэлийн мөр"
#. module: account
#: selection:account.bank.statement.line,type:0
@ -5807,7 +5807,7 @@ msgstr "Худалдан авагч"
#. module: account
#: field:account.subscription,period_type:0
msgid "Period Type"
msgstr ""
msgstr "Мөчлөгийн төрөл"
#. module: account
#: view:product.category:0
@ -5827,7 +5827,7 @@ msgstr "Гүйлгээг эрэмбэлэх"
#. module: account
#: rml:account.journal.period.print:0
msgid "Print Journal -"
msgstr ""
msgstr "Журнал хэвлэх"
#. module: account
#: field:account.bank.accounts.wizard,bank_account_id:0
@ -5840,7 +5840,7 @@ msgstr "Банкны данс"
#: model:ir.actions.act_window,name:account.action_model_form
#: model:ir.ui.menu,name:account.menu_action_model_form
msgid "Models Definition"
msgstr ""
msgstr "Модел тодорхойлох"
#. module: account
#: model:account.account.type,name:account.account_type_cash_moves
@ -5899,7 +5899,7 @@ msgstr ""
#. module: account
#: field:account.subscription.line,move_id:0
msgid "Entry"
msgstr ""
msgstr "Бичилт"
#. module: account
#: model:process.node,note:account.process_node_paidinvoice0
@ -5961,7 +5961,7 @@ msgstr "Бүтээгдэхүүний загвар дээрх зарлагын д
#. module: account
#: rml:account.analytic.account.analytic.check:0
msgid "General Debit"
msgstr ""
msgstr "Ерөнхий орлого"
#. module: account
#: field:account.analytic.account,code:0
@ -5988,12 +5988,12 @@ msgstr "Төлбөрийн нөхцөл"
#: model:ir.actions.act_window,name:account.action_account_fiscal_position_form
#: model:ir.ui.menu,name:account.menu_action_account_fiscal_position_form
msgid "Fiscal Mappings"
msgstr ""
msgstr "Санхүүгийн зурагжуулалт"
#. module: account
#: model:process.process,name:account.process_process_statementprocess0
msgid "Statement Process"
msgstr ""
msgstr "Бримтын үйл явц"
#. module: account
#: model:ir.model,name:account.model_account_bank_statement_reconcile
@ -6049,12 +6049,12 @@ msgstr ""
#. module: account
#: view:board.board:0
msgid "Analytic accounts to close"
msgstr ""
msgstr "Аналитик данс хаах"
#. module: account
#: view:board.board:0
msgid "Draft invoices"
msgstr ""
msgstr "Ноорог нэхэмжлэл"
#. module: account
#: model:ir.actions.act_window,name:account.open_board_account
@ -6066,33 +6066,33 @@ msgstr ""
#: view:board.board:0
#: model:ir.actions.act_window,name:account.act_my_account
msgid "Accounts to invoice"
msgstr ""
msgstr "Дансны нэхэмжлэл"
#. module: account
#: view:board.board:0
#: model:ir.actions.act_window,name:account.action_account_analytic_line_to_invoice
msgid "Costs to invoice"
msgstr ""
msgstr "Үнийн нэхэмжлэл"
#. module: account
#: view:board.board:0
msgid "Aged receivables"
msgstr ""
msgstr "Насжилтын авлагын данс"
#. module: account
#: model:ir.module.module,shortdesc:account.module_meta_information
msgid "Board for accountant"
msgstr ""
msgstr "Нягтлан бодохын самбар"
#. module: account
#: model:ir.actions.act_window,name:account.action_aged_income
msgid "Income Accounts"
msgstr ""
msgstr "Орлогын данс"
#. module: account
#: view:board.board:0
msgid "My indicators"
msgstr ""
msgstr "Эдийн засгийн үзүүлэлт"
#. module: account
#: view:board.board:0
@ -6112,7 +6112,7 @@ msgstr ""
#. module: account
#: selection:account.balance.account.balance.report,init,account_choice:0
msgid "All accounts"
msgstr ""
msgstr "Бүх данс"
#. module: account
#: wizard_field:account.balance.account.balance.report,init,period_manner:0
@ -6123,23 +6123,23 @@ msgstr ""
#: wizard_view:account.balance.account.balance.report,backtoinit:0
#: wizard_view:account.balance.account.balance.report,zero_years:0
msgid "Notification"
msgstr ""
msgstr "Мэдэгдэл"
#. module: account
#: selection:account.balance.account.balance.report,init,period_manner:0
msgid "Financial Period"
msgstr ""
msgstr "Санхүүгийн мөчлөг"
#. module: account
#: model:ir.actions.report.xml,name:account.account_account_balance
#: model:ir.actions.report.xml,name:account.account_account_balance_landscape
msgid "Account balance"
msgstr ""
msgstr "Санхүүгтйн тэнцэл"
#. module: account
#: wizard_view:account.balance.account.balance.report,init:0
msgid "Select Period(s)"
msgstr ""
msgstr "Мөчлөг сонгох"
#. module: account
#: selection:account.balance.account.balance.report,init,compare_pattern:0
@ -6202,7 +6202,7 @@ msgstr ""
#: rml:account.account.balance.landscape:0
#: rml:account.balance.account.balance:0
msgid "Total :"
msgstr ""
msgstr "Нийт:"
#. module: account
#: wizard_field:account.balance.account.balance.report,init,format_perc:0
@ -6217,17 +6217,17 @@ msgstr "Мөчлөг сонгох"
#. module: account
#: wizard_view:account.balance.account.balance.report,init:0
msgid "Report Options"
msgstr ""
msgstr "Тайлангийн сонголт"
#. module: account
#: selection:account.balance.account.balance.report,init,compare_pattern:0
msgid "Don't Compare"
msgstr ""
msgstr "Харицуулахгүй"
#. module: account
#: wizard_field:account.balance.account.balance.report,init,account_choice:0
msgid "Show Accounts"
msgstr ""
msgstr "Дансыг харуулах"
#. module: account
#: wizard_view:account.balance.account.balance.report,backtoinit:0
@ -6243,7 +6243,7 @@ msgstr ""
#: rml:account.account.balance.landscape:0
#: rml:account.balance.account.balance:0
msgid "Year :"
msgstr ""
msgstr "Жил:"
#. module: account
#: wizard_view:account.balance.account.balance.report,backtoinit:0
@ -6301,7 +6301,7 @@ msgstr ""
#. module: account
#: field:report.aged.receivable,name:0
msgid "Month Range"
msgstr ""
msgstr "Сарын хязгаарлалт"
#. module: account
#: model:ir.actions.act_window,name:report_account.action_view_created_invoice_dashboard
@ -6316,12 +6316,12 @@ msgstr ""
#. module: account
#: view:report.invoice.created:0
msgid "Total Amount"
msgstr ""
msgstr "Нийт хэмжээ"
#. module: account
#: view:report.account.receivable:0
msgid "Accounts by type"
msgstr ""
msgstr "Дансны төрлөөр"
#. module: account
#: model:ir.model,name:report_account.model_report_aged_receivable
@ -6331,12 +6331,12 @@ msgstr ""
#. module: account
#: model:ir.model,name:report_account.model_report_account_receivable
msgid "Receivable accounts"
msgstr ""
msgstr "Авлагын данс"
#. module: account
#: field:temp.range,name:0
msgid "Range"
msgstr ""
msgstr "Хязгаар"
#. module: account
#: model:ir.module.module,description:report_account.module_meta_information
@ -6346,7 +6346,7 @@ msgstr ""
#. module: account
#: model:ir.module.module,shortdesc:report_account.module_meta_information
msgid "Account Reporting - Reporting"
msgstr ""
msgstr "Санхүүгийн тайлан-Тайлан"
#. module: account
#: model:ir.actions.act_window,name:report_account.action_account_receivable_graph
@ -6357,18 +6357,18 @@ msgstr ""
#. module: account
#: field:report.account.receivable,name:0
msgid "Week of Year"
msgstr ""
msgstr "Жилийн долоо хоног"
#. module: account
#: field:report.invoice.created,create_date:0
msgid "Create Date"
msgstr ""
msgstr "Үүсгэх огноо"
#. module: account
#: model:ir.actions.act_window,name:report_account.action_aged_receivable_graph
#: view:report.aged.receivable:0
msgid "Aged Receivable"
msgstr ""
msgstr "Насжилтын авлага"
#. module: account
#: view:report.invoice.created:0

View File

@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-09-29 10:16+0000\n"
"Last-Translator: OpenERP Administrators <Unknown>\n"
"PO-Revision-Date: 2010-10-08 07:35+0000\n"
"Last-Translator: Anders Eriksson (Mobila System) <ae@mobilasystem.se>\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: 2010-09-30 04:42+0000\n"
"X-Launchpad-Export-Date: 2010-10-09 12:13+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@ -26,6 +26,12 @@ msgstr "Internt namn"
msgid "Account Tax Code"
msgstr "Konto, skattekod"
#. module: account
#: model:ir.actions.act_window,name:account.action_invoice_tree9
#: model:ir.ui.menu,name:account.menu_action_invoice_tree9
msgid "Unpaid Supplier Invoices"
msgstr "Obetalda leverantörsfakturor"
#. module: account
#: model:ir.ui.menu,name:account.menu_finance_entries
msgid "Entries Encoding"

View File

@ -61,7 +61,7 @@ class account_installer(osv.osv_memory):
'date_stop': fields.date('End Date', required=True),
'period':fields.selection([('month','Monthly'), ('3months','3 Monthly')],
'Periods', 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', 'Your Bank and Cash Accounts',required=True),
'sale_tax':fields.float('Sale Tax(%)'),
'purchase_tax':fields.float('Purchase Tax(%)'),
'company_id': fields.many2one('res.company', 'Company'),
@ -124,6 +124,8 @@ class account_installer(osv.osv_memory):
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
obj_multi = self.pool.get('account.chart.template').browse(cr, uid, id)
record = self.browse(cr, uid, ids, context=context)[0]
if context is None:
context = {}
company_id = self.browse(cr, uid, ids, context)[0].company_id
@ -239,7 +241,6 @@ class account_installer(osv.osv_memory):
view_id_cash = self.pool.get('account.journal.view').search(cr,uid,[('name','=','Bank/Cash Journal View')])[0] #why fixed name here?
view_id_cur = self.pool.get('account.journal.view').search(cr,uid,[('name','=','Bank/Cash Journal (Multi-Currency) View')])[0] #Why Fixed name here?
ref_acc_bank = obj_multi.bank_account_view_id
cash_result = mod_obj._get_id(cr, uid, 'account', 'conf_account_type_cash')
cash_type_id = mod_obj.read(cr, uid, [cash_result], ['res_id'])[0]['res_id']
@ -250,7 +251,7 @@ class account_installer(osv.osv_memory):
check_result = mod_obj._get_id(cr, uid, 'account', 'conf_account_type_chk')
check_type_id = mod_obj.read(cr, uid, [check_result], ['res_id'])[0]['res_id']
record = self.browse(cr, uid, ids, context=context)[0]
# record = self.browse(cr, uid, ids, context=context)[0]
code_cnt = 1
vals_seq = {
'name': _('Bank Journal '),
@ -443,7 +444,6 @@ class account_installer(osv.osv_memory):
# Bank Journals
view_id_cash = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal View')])[0] #TOFIX: Why put fixed name ?
view_id_cur = self.pool.get('account.journal.view').search(cr, uid, [('name','=','Bank/Cash Journal (Multi-Currency) View')])[0] #TOFIX: why put fixed name?
ref_acc_bank = obj_multi.bank_account_view_id
#create the properties
@ -485,8 +485,8 @@ class account_installer(osv.osv_memory):
for position in obj_fiscal_position_template.browse(cr, uid, fp_ids):
vals_fp = {
'company_id' : company_id.id,
'name' : position.name,
'company_id': company_id.id,
'name': position.name,
}
new_fp = obj_fiscal_position.create(cr, uid, vals_fp)
@ -495,17 +495,17 @@ class account_installer(osv.osv_memory):
for tax in position.tax_ids:
vals_tax = {
'tax_src_id' : tax_template_ref[tax.tax_src_id.id],
'tax_dest_id' : tax.tax_dest_id and tax_template_ref[tax.tax_dest_id.id] or False,
'position_id' : new_fp,
'tax_src_id': tax_template_ref[tax.tax_src_id.id],
'tax_dest_id': tax.tax_dest_id and tax_template_ref[tax.tax_dest_id.id] or False,
'position_id': new_fp,
}
obj_tax_fp.create(cr, uid, vals_tax)
for acc in position.account_ids:
vals_acc = {
'account_src_id' : acc_template_ref[acc.account_src_id.id],
'account_dest_id' : acc_template_ref[acc.account_dest_id.id],
'position_id' : new_fp,
'account_src_id': acc_template_ref[acc.account_src_id.id],
'account_dest_id': acc_template_ref[acc.account_dest_id.id],
'position_id': new_fp,
}
obj_ac_fp.create(cr, uid, vals_acc)
@ -646,7 +646,7 @@ class account_installer(osv.osv_memory):
obj_acc.write(cr, uid, default_account_ids, {'tax_ids':[(6,0,[purchase_tax])]})
tax_val.update({'supplier_taxes_id':[(6,0,[purchase_tax])]})
default_tax.append(('supplier_taxes_id',purchase_tax))
if len(tax_val):
if tax_val:
product_ids = obj_product.search(cr, uid, [])
for product in obj_product.browse(cr, uid, product_ids):
obj_product.write(cr, uid, product.id, tax_val)

View File

@ -20,14 +20,12 @@
##############################################################################
import time
from operator import itemgetter
import decimal_precision as dp
from lxml import etree
import decimal_precision as dp
import netsvc
from osv import fields, osv, orm
import pooler
from tools import config
from tools.translate import _
class account_invoice(osv.osv):
@ -148,7 +146,7 @@ class account_invoice(osv.osv):
res[id] = []
if not invoice.move_id:
continue
data_lines = invoice.move_id.line_id
data_lines = [x for x in invoice.move_id.line_id if x.account_id.id == invoice.account_id.id]
partial_ids = []
for line in data_lines:
ids_line = []
@ -253,7 +251,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('Date Invoiced', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',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)]}, help="Keep empty to use the current date"),
'date_due': fields.date('Due Date', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',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."),
@ -317,7 +315,7 @@ class account_invoice(osv.osv):
'payment_ids': fields.function(_compute_lines, method=True, relation='account.move.line', type="many2many", string='Payments'),
'move_name': fields.char('Journal Entry', size=64, readonly=True, states={'draft':[('readonly',False)]}),
'user_id': fields.many2one('res.users', 'Salesman', readonly=True, states={'draft':[('readonly',False)]}),
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Mapping', readonly=True, states={'draft':[('readonly',False)]})
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True, states={'draft':[('readonly',False)]})
}
_defaults = {
'type': _get_type,
@ -349,6 +347,16 @@ class account_invoice(osv.osv):
if field == 'journal_id':
journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', type)], context=context, limit=None, name_get_uid=1)
res['fields'][field]['selection'] = journal_select
if view_type == 'tree':
doc = etree.XML(res['arch'])
nodes = doc.xpath("//field[@name='partner_id']")
partner_string = 'Customer'
if context.get('type', 'out_invoice') in ('in_invoice', 'in_refund'):
partner_string = _('Supplier')
for node in nodes:
node.set('string', partner_string)
res['arch'] = etree.tostring(doc)
return res
def create(self, cr, uid, vals, context=None):
@ -536,7 +544,7 @@ class account_invoice(osv.osv):
if not result_id:
raise osv.except_osv(_('Configuration Error !'),
_('Can not find account chart for this company in invoice line account, Please Create account.'))
r_id = self.pool.get('account.invoice.line').write(cr, uid, [line.id], {'account_id': result_id[0]})
self.pool.get('account.invoice.line').write(cr, uid, [line.id], {'account_id': result_id[0]})
else:
if invoice_line:
for inv_line in invoice_line:
@ -587,16 +595,6 @@ class account_invoice(osv.osv):
wf_service.trg_create(uid, 'account.invoice', inv_id, cr)
return True
def finalize_invoice_move_lines(self, cr, uid, invoice_browse, move_lines):
"""finalize_invoice_move_lines(cr, uid, invoice, move_lines) -> move_lines
Hook method to be overridden in additional modules to verify and possibly alter the
move lines to be created by an invoice, for special cases.
:param invoice_browse: browsable record of the invoice that is generating the move lines
:param move_lines: list of dictionaries with the account.move.lines (as for create())
:return: the (possibly updated) final move_lines to create for this invoice
"""
return move_lines
# Workflow stuff
#################
@ -817,7 +815,6 @@ class account_invoice(osv.osv):
self.write(cr, uid, [inv.id], {'date_invoice':time.strftime('%Y-%m-%d')})
company_currency = inv.company_id.currency_id.id
# create the analytical lines
line_ids = self.read(cr, uid, [inv.id], ['invoice_line'])[0]['invoice_line']
# one move line per invoice line
iml = self._get_analytic_lines(cr, uid, inv.id)
# check if taxes are all computed
@ -1390,8 +1387,6 @@ class account_invoice_line(osv.osv):
if a:
result['account_id'] = a
taxep = None
tax_obj = self.pool.get('account.tax')
if type in ('out_invoice', 'out_refund'):
taxes = res.taxes_id and res.taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a).tax_ids or False)
tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes)
@ -1444,13 +1439,10 @@ class account_invoice_line(osv.osv):
def move_line_get(self, cr, uid, invoice_id, context=None):
res = []
tax_grouped = {}
tax_obj = self.pool.get('account.tax')
cur_obj = self.pool.get('res.currency')
ait_obj = self.pool.get('account.invoice.tax')
inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id)
company_currency = inv.company_id.currency_id.id
cur = inv.currency_id
for line in inv.invoice_line:
mres = self.move_line_get_item(cr, uid, line, context)

View File

@ -21,13 +21,12 @@
from operator import itemgetter
from osv import fields, osv
import ir
class account_fiscal_position(osv.osv):
_name = 'account.fiscal.position'
_description = 'Fiscal Mapping'
_description = 'Fiscal Position'
_columns = {
'name': fields.char('Fiscal Mapping', size=64, translate=True, required=True),
'name': fields.char('Fiscal Position', size=64, translate=True, required=True),
'company_id': fields.many2one('res.company', 'Company'),
'account_ids': fields.one2many('account.fiscal.position.account', 'position_id', 'Account Mapping'),
'tax_ids': fields.one2many('account.fiscal.position.tax', 'position_id', 'Tax Mapping'),
@ -64,10 +63,10 @@ account_fiscal_position()
class account_fiscal_position_tax(osv.osv):
_name = 'account.fiscal.position.tax'
_description = 'Taxes Fiscal Mapping'
_description = 'Taxes Fiscal Position'
_rec_name = 'position_id'
_columns = {
'position_id': fields.many2one('account.fiscal.position', 'Fiscal Mapping', required=True, ondelete='cascade'),
'position_id': fields.many2one('account.fiscal.position', 'Fiscal Position', required=True, ondelete='cascade'),
'tax_src_id': fields.many2one('account.tax', 'Tax Source', required=True),
'tax_dest_id': fields.many2one('account.tax', 'Replacement Tax')
}
@ -76,10 +75,10 @@ account_fiscal_position_tax()
class account_fiscal_position_account(osv.osv):
_name = 'account.fiscal.position.account'
_description = 'Accounts Fiscal Mapping'
_description = 'Accounts Fiscal Position'
_rec_name = 'position_id'
_columns = {
'position_id': fields.many2one('account.fiscal.position', 'Fiscal Mapping', required=True, ondelete='cascade'),
'position_id': fields.many2one('account.fiscal.position', 'Fiscal Position', required=True, ondelete='cascade'),
'account_src_id': fields.many2one('account.account', 'Account Source', domain=[('type','<>','view')], required=True),
'account_dest_id': fields.many2one('account.account', 'Account Destination', domain=[('type','<>','view')], required=True)
}
@ -102,10 +101,6 @@ class res_partner(osv.osv):
GROUP BY l.partner_id, a.type
""",
(tuple(ids),))
tinvert = {
'credit': 'receivable',
'debit': 'payable'
}
maps = {'receivable':'credit', 'payable':'debit' }
res = {}
for id in ids:
@ -172,10 +167,10 @@ class res_partner(osv.osv):
'account.fiscal.position',
type='many2one',
relation='account.fiscal.position',
string="Fiscal Mapping",
string="Fiscal Position",
method=True,
view_load=True,
help="The fiscal Mapping will determine taxes and the accounts used for the partner.",
help="The fiscal position will determine taxes and the accounts used for the partner.",
),
'property_payment_term': fields.property(
'account.payment.term',
@ -187,7 +182,7 @@ class res_partner(osv.osv):
help="This payment term will be used instead of the default one for the current partner"),
'ref_companies': fields.one2many('res.company', 'partner_id',
'Companies that refers to partner'),
'last_reconciliation_date': fields.datetime('Last Reconciliation Date', help='Date on which the partner accounting entries were reconciled last time')
'last_reconciliation_date': fields.datetime('Latest Reconciliation Date', help='Date on which the partner accounting entries were reconciled last time')
}
res_partner()

View File

@ -7,7 +7,7 @@
<field name="model">account.fiscal.position</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Fiscal Mapping">
<form string="Fiscal Position">
<field name="name" select="1"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<separator string="Mapping" colspan="4"/>
@ -42,7 +42,7 @@
<field name="model">account.fiscal.position</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Fiscal Mapping">
<tree string="Fiscal Position">
<field name="name"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</tree>
@ -50,7 +50,7 @@
</record>
<record id="action_account_fiscal_position_form" model="ir.actions.act_window">
<field name="name">Fiscal Mappings</field>
<field name="name">Fiscal Positions</field>
<field name="res_model">account.fiscal.position</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
@ -143,7 +143,7 @@
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<field name="credit_limit" position="after">
<field name="last_reconciliation_date"/>
<field name="last_reconciliation_date" groups="base.group_extended"/>
</field>
</field>
</record>

View File

@ -83,7 +83,6 @@
</record>
<record id="process_node_reconciliation0" model="process.node">
<field name="menu_id" ref="account.menu_eaction_account_moves_all"/>
<field name="model_id" ref="account.model_account_move_reconcile"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Reconciliation&quot;&quot;&quot;" name="name"/>
@ -105,7 +104,6 @@
</record>
<record id="process_node_accountingstatemententries0" model="process.node">
<field name="menu_id" ref="account.menu_eaction_account_moves_all"/>
<field name="model_id" ref="account.model_account_move_line"/>
<field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Bank Statement&quot;&quot;&quot;" name="name"/>

View File

@ -72,7 +72,6 @@
</record>
<record id="process_node_supplierpaymentorder0" model="process.node">
<field name="menu_id" ref="account.menu_eaction_account_moves_all"/>
<field name="model_id" ref="account.model_account_move_line"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Payment Order&quot;&quot;&quot;" name="name"/>
@ -83,7 +82,6 @@
</record>
<record id="process_node_supplierreconciliation0" model="process.node">
<field name="menu_id" ref="account.menu_eaction_account_moves_all"/>
<field name="model_id" ref="account.model_account_move_reconcile"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Reconciliation&quot;&quot;&quot;" name="name"/>

View File

@ -100,14 +100,14 @@ class account_analytic_balance(report_sxw.rml_parse):
ids = self.acc_data_dict[account_id]
query_params = (tuple(ids), date1, date2)
if option == "credit" :
if option == "credit":
self.cr.execute("SELECT COALESCE(-sum(amount),0.0) FROM account_analytic_line \
WHERE account_id IN %s AND date>=%s AND date<=%s AND amount<0",query_params)
elif option == "debit" :
elif option == "debit":
self.cr.execute("SELECT COALESCE(sum(amount),0.0) FROM account_analytic_line \
WHERE account_id IN %s\
AND date>=%s AND date<=%s AND amount>0",query_params)
elif option == "quantity" :
elif option == "quantity":
self.cr.execute("SELECT COALESCE(sum(unit_amount),0.0) FROM account_analytic_line \
WHERE account_id IN %s\
AND date>=%s AND date<=%s",query_params)
@ -120,7 +120,7 @@ class account_analytic_balance(report_sxw.rml_parse):
def _sum_all(self, accounts, date1, date2, option):
ids = map(lambda x: x['id'], accounts)
if not len(ids):
if not ids:
return 0.0
if not self.acc_sum_list:
@ -129,15 +129,15 @@ class account_analytic_balance(report_sxw.rml_parse):
self.acc_sum_list = ids2
else:
ids2 = self.acc_sum_list
query_params = (tuple(ids2), date1, date2)
if option == "debit" :
if option == "debit":
self.cr.execute("SELECT COALESCE(sum(amount),0.0) FROM account_analytic_line \
WHERE account_id IN %s AND date>=%s AND date<=%s AND amount>0",query_params)
elif option == "credit" :
elif option == "credit":
self.cr.execute("SELECT COALESCE(-sum(amount),0.0) FROM account_analytic_line \
WHERE account_id IN %s AND date>=%s AND date<=%s AND amount<0",query_params)
elif option == "quantity" :
elif option == "quantity":
self.cr.execute("SELECT COALESCE(sum(unit_amount),0.0) FROM account_analytic_line \
WHERE account_id IN %s AND date>=%s AND date<=%s",query_params)
return self.cr.fetchone()[0] or 0.0

View File

@ -40,9 +40,9 @@ class account_analytic_chart(osv.osv_memory):
result = act_obj.read(cr, uid, [id], context=context)[0]
data = self.read(cr, uid, ids, [])[0]
if data['from_date']:
result_context.update({'from_date' : data['from_date']})
result_context.update({'from_date': data['from_date']})
if data['to_date']:
result_context.update({'to_date' : data['to_date']})
result_context.update({'to_date': data['to_date']})
result['context'] = str(result_context)
return result

View File

@ -2,44 +2,44 @@
<openerp>
<data>
<record id="account_analytic_invert_balance_view" model="ir.ui.view">
<field name="name">Account Analytic Inverted Balance</field>
<field name="model">account.analytic.inverted.balance</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Select Period">
<group colspan="4" col="6">
<field name="date1"/>
<field name="date2"/>
</group>
<separator colspan="4"/>
<group colspan="4" col="6">
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="check_report" string="Print" type="object" icon="gtk-print"/>
</group>
</form>
</field>
</record>
<record id="account_analytic_invert_balance_view" model="ir.ui.view">
<field name="name">Account Analytic Inverted Balance</field>
<field name="model">account.analytic.inverted.balance</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Select Period">
<group colspan="4" col="6">
<field name="date1"/>
<field name="date2"/>
</group>
<separator colspan="4"/>
<group colspan="4" col="6">
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="check_report" string="Print" type="object" icon="gtk-print"/>
</group>
</form>
</field>
</record>
<record id="action_account_analytic_invert_balance" model="ir.actions.act_window">
<field name="name">Inverted Analytic Balance</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.analytic.inverted.balance</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="account_analytic_invert_balance_view"/>
<field name="target">new</field>
</record>
<record id="action_account_analytic_invert_balance" model="ir.actions.act_window">
<field name="name">Inverted Analytic Balance</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.analytic.inverted.balance</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="account_analytic_invert_balance_view"/>
<field name="target">new</field>
</record>
<record model="ir.values" id="account_analytic_invert_balance_values">
<field name="model_id" ref="analytic.model_account_analytic_account" />
<field name="object" eval="1" />
<field name="name">Account Analytic Inverted Balance</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_invert_balance'))" />
<field name="key">action</field>
<field name="model">account.analytic.account</field>
</record>
<record model="ir.values" id="account_analytic_invert_balance_values">
<field name="model_id" ref="analytic.model_account_analytic_account" />
<field name="object" eval="1" />
<field name="name">Account Analytic Inverted Balance</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_analytic_invert_balance'))" />
<field name="key">action</field>
<field name="model">account.analytic.account</field>
</record>
</data>
</openerp>
</openerp>

View File

@ -26,17 +26,21 @@ import account_balance
import account_partner_balance
import account_general_ledger
import account_partner_ledger
import invoice
import overdue
#import invoice
import account_print_invoice
#import overdue
import account_print_overdue
import account_aged_partner_balance
import tax_report
#import tax_report
import account_tax_report
import account_tax_code
import account_balance_landscape
import account_invoice_report
import account_report
import account_entries_report
import account_analytic_entries_report
import voucher_print
#import voucher_print
import account_voucher_print
import account_balance_sheet
import account_profit_loss

View File

@ -43,6 +43,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
'get_partners':self._get_partners,
'get_account': self._get_account,
'get_fiscalyear': self._get_fiscalyear,
'get_target_move': self._get_target_move,
})
def set_context(self, objects, data, ids, report_type=None):
@ -78,6 +79,8 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
#
# Build a string like (1,2,3) for easy use in SQL query
partner_ids = [x['id'] for x in partners]
if not partner_ids:
return []
# This dictionary will store the debit-credit for all partners, using partner_id as key.
move_state = ['draft','posted']
if self.target_move == 'posted':

View File

@ -132,7 +132,7 @@
<para style="terp_tblheader_General_Centre">Analysis Direction</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Printing Date</para>
<para style="terp_tblheader_General_Centre">Target Moves</para>
</td>
</tr>
<tr>
@ -155,7 +155,7 @@
<para style="terp_default_Centre_8">[[ data['form']['direction_selection'] ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time = True)]]</para>
<para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para>
</td>
</tr>
</blockTable>
@ -168,22 +168,22 @@
<para style="terp_tblheader_Details">Partners</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ data['form']['direction_selection'] == 'future' and 'Due' or 'Not due' ]]<font size="8.0">([[ company.currency_id.code ]])</font></para>
<para style="terp_tblheader_Details_Right">[[ data['form']['direction_selection'] == 'future' and 'Due' or 'Not due' ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ data['form']['4']['name'] ]]<font size="8.0">([[ company.currency_id.code ]])</font></para>
<para style="terp_tblheader_Details_Right">[[ data['form']['4']['name'] ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ data['form']['3']['name'] ]]<font size="8.0">([[ company.currency_id.code ]])</font></para>
<para style="terp_tblheader_Details_Right">[[ data['form']['3']['name'] ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ data['form']['2']['name'] ]]<font size="8.0">([[ company.currency_id.code ]])</font></para>
<para style="terp_tblheader_Details_Right">[[ data['form']['2']['name'] ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ data['form']['1']['name'] ]]<font size="8.0">([[ company.currency_id.code ]])</font></para>
<para style="terp_tblheader_Details_Right">[[ data['form']['1']['name'] ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ data['form']['0']['name'] ]]<font size="8.0">([[ company.currency_id.code ]])</font></para>
<para style="terp_tblheader_Details_Right">[[ data['form']['0']['name'] ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Total</para>

View File

@ -38,7 +38,7 @@ class analytic_entries_report(osv.osv):
'partner_id': fields.many2one('res.partner', 'Partner'),
'company_id': fields.many2one('res.company', 'Company', required=True),
'currency_id': fields.many2one('res.currency', 'Currency', required=True),
'account_id': fields.many2one('account.analytic.account', 'Account', required=True),
'account_id': fields.many2one('account.analytic.account', 'Account', required=False),
'general_account_id': fields.many2one('account.account', 'General Account', required=True),
'journal_id': fields.many2one('account.analytic.journal', 'Journal', required=True),
'move_id': fields.many2one('account.move.line', 'Move', required=True),

View File

@ -16,7 +16,7 @@
<field name="partner_id" invisible="1"/>
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
<field name="currency_id" invisible="1"/>
<field name="account_id" invisible="1"/>
<field name="account_id" invisible="1" groups="analytic.group_analytic_accounting"/>
<field name="general_account_id" invisible="1"/>
<field name="journal_id" invisible="1"/>
<field name="product_id" invisible="1"/>
@ -49,7 +49,7 @@
help="Analytic Entries during last 7 days"/>
<separator orientation="vertical"/>
<field name="date" />
<field name="account_id" />
<field name="account_id" groups="analytic.group_analytic_accounting"/>
<field name="product_id" />
<field name="user_id">
<filter icon="terp-personal" domain="[('user_id','=',uid)]" help="My Entries"/>
@ -63,7 +63,7 @@
<field name="journal_id" widget="selection"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="account_id"/>
<field name="account_id" groups="analytic.group_analytic_accounting"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<newline/>
@ -72,7 +72,7 @@
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}"/>
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
<filter string="Account" name="Account" icon="terp-folder-green" context="{'group_by':'account_id'}"/>
<filter string="Account" name="Account" icon="terp-folder-green" context="{'group_by':'account_id'}" groups="analytic.group_analytic_accounting"/>
<filter string="General Account" icon="terp-folder-green" context="{'group_by':'general_account_id'}"/>
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
<separator orientation="vertical"/>
@ -108,7 +108,10 @@
<field name="help">A tool search lets you know statistics on your analytics records that match your needs.</field>
</record>
<menuitem action="action_analytic_entries_report" id="menu_action_analytic_entries_report" parent="account.menu_finance_statistic_report_statement" sequence="4"/>
<menuitem action="action_analytic_entries_report"
id="menu_action_analytic_entries_report"
groups="analytic.group_analytic_accounting"
parent="account.menu_finance_statistic_report_statement" sequence="4"/>
</data>
</openerp>

View File

@ -47,6 +47,7 @@ class account_balance(report_sxw.rml_parse, common_report_header):
'get_journal': self._get_journal,
'get_start_date':self._get_start_date,
'get_end_date':self._get_end_date,
'get_target_move': self._get_target_move,
})
self.context = context

View File

@ -223,7 +223,7 @@
<para style="terp_tblheader_General_Centre">Filter By <font>[[ get_filter(data)!='No Filter' and get_filter(data) ]]</font> </para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Printing Date</para>
<para style="terp_tblheader_General_Centre">Target Moves</para>
</td>
</tr>
<tr>
@ -273,7 +273,7 @@
</blockTable>
</td>
<td>
<para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time = True)]]</para>
<para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para>
</td>
</tr>
</blockTable>

View File

@ -38,12 +38,12 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header):
self.result_temp = []
self.localcontext.update({
'time': time,
'get_lines' : self.get_lines,
'get_lines_another' : self.get_lines_another,
'get_lines': self.get_lines,
'get_lines_another': self.get_lines_another,
'get_company': self._get_company,
'get_currency': self._get_currency,
'sum_dr' : self.sum_dr,
'sum_cr' : self.sum_cr,
'sum_dr': self.sum_dr,
'sum_cr': self.sum_cr,
'get_data':self.get_data,
'get_pl_balance':self.get_pl_balance,
'get_fiscalyear': self._get_fiscalyear,
@ -56,13 +56,13 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header):
'get_start_date':self._get_start_date,
'get_end_date':self._get_end_date,
'get_company':self._get_company,
'get_target_move': self._get_target_move,
})
self.context = context
def sum_dr(self):
if self.res_bl['type'] == 'Net Profit':
self.result_sum_dr += self.res_bl['balance']
self.result_sum_dr += self.res_bl['balance']*-1
return self.result_sum_dr
def sum_cr(self):
@ -92,7 +92,7 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header):
ctx = self.context.copy()
ctx['fiscalyear'] = data['form'].get('fiscalyear_id', False)
if data['form']['filter'] == 'filter_period' :
if data['form']['filter'] == 'filter_period':
ctx['periods'] = data['form'].get('periods', False)
elif data['form']['filter'] == 'filter_date':
ctx['date_from'] = data['form'].get('date_from', False)
@ -110,8 +110,8 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header):
else:
self.res_bl['type'] = 'Net Loss'
pl_dict = {
'code' : False,
'name' : self.res_bl['type'],
'code': False,
'name': self.res_bl['type'],
'level': False,
'balance':self.res_bl['balance'],
}
@ -120,18 +120,18 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header):
for account in accounts:
if (account.user_type.report_type) and (account.user_type.report_type == typ):
account_dict = {
'id' : account.id,
'code' : account.code,
'name' : account.name,
'id': account.id,
'code': account.code,
'name': account.name,
'level': account.level,
'balance':account.balance,
}
if typ == 'liability' and account.type <> 'view' and (account.debit <> account.credit):
self.result_sum_dr += abs(account.debit - account.credit)
self.result_sum_dr += account.balance
if typ == 'asset' and account.type <> 'view' and (account.debit <> account.credit):
self.result_sum_cr += abs(account.debit - account.credit)
self.result_sum_cr += account.balance
if data['form']['display_account'] == 'bal_movement':
if account.credit > 0 or account.debit > 0 or account.balance > 0 :
if account.credit > 0 or account.debit > 0 or account.balance > 0:
accounts_temp.append(account_dict)
elif data['form']['display_account'] == 'bal_solde':
if account.balance != 0:
@ -150,12 +150,12 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header):
for i in range(0,max(len(cal_list['liability']),len(cal_list['asset']))):
if i < len(cal_list['liability']) and i < len(cal_list['asset']):
temp={
'code' : cal_list['liability'][i]['code'],
'name' : cal_list['liability'][i]['name'],
'code': cal_list['liability'][i]['code'],
'name': cal_list['liability'][i]['name'],
'level': cal_list['liability'][i]['level'],
'balance':cal_list['liability'][i]['balance'],
'code1' : cal_list['asset'][i]['code'],
'name1' : cal_list['asset'][i]['name'],
'code1': cal_list['asset'][i]['code'],
'name1': cal_list['asset'][i]['name'],
'level1': cal_list['asset'][i]['level'],
'balance1':cal_list['asset'][i]['balance'],
}
@ -163,24 +163,24 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header):
else:
if i < len(cal_list['asset']):
temp={
'code' : '',
'name' : '',
'code': '',
'name': '',
'level': False,
'balance':False,
'code1' : cal_list['asset'][i]['code'],
'name1' : cal_list['asset'][i]['name'],
'code1': cal_list['asset'][i]['code'],
'name1': cal_list['asset'][i]['name'],
'level1': cal_list['asset'][i]['level'],
'balance1':cal_list['asset'][i]['balance'],
}
self.result_temp.append(temp)
if i < len(cal_list['liability']):
temp={
'code' : cal_list['liability'][i]['code'],
'name' : cal_list['liability'][i]['name'],
'code': cal_list['liability'][i]['code'],
'name': cal_list['liability'][i]['name'],
'level': cal_list['liability'][i]['level'],
'balance':cal_list['liability'][i]['balance'],
'code1' : '',
'name1' : '',
'code1': '',
'name1': '',
'level1': False,
'balance1':False,
}

View File

@ -159,7 +159,7 @@
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
<td><para style="terp_tblheader_General_Centre">Filter By <font>[[ get_filter(data)!='No Filter' and '' or removeParentNode('font') ]]</font></para></td>
<td><para style="terp_tblheader_General_Centre">Display Account</para></td>
<td><para style="terp_tblheader_General_Centre">Printing Date</para></td>
<td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
</tr>
<tr>
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
@ -187,7 +187,7 @@
</blockTable>
</td>
<td><para style="terp_default_Centre_8">[[ (data['form']['display_account']=='bal_all' and 'All') or (data['form']['display_account']=='bal_movement' and 'With movements') or 'With balance is not equal to 0']]</para></td>
<td><para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time = True) ]] </para></td>
<td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
</tr>
</blockTable>
<para style="Standard">

View File

@ -158,7 +158,7 @@
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
<td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]</para></td>
<td><para style="terp_tblheader_General_Centre">Display Account</para></td>
<td><para style="terp_tblheader_General_Centre">Printing Date</para></td>
<td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
</tr>
<tr>
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
@ -186,7 +186,7 @@
</blockTable>
</td>
<td><para style="terp_default_Centre_8">[[ (data['form']['display_account']=='bal_all' and 'All') or (data['form']['display_account']=='bal_movement' and 'With movements') or 'With balance is not equal to 0']]</para></td>
<td><para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time = True) ]] </para></td>
<td><para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para></td>
</tr>
</blockTable>
<para style="Standard">

View File

@ -48,12 +48,14 @@ class journal_print(report_sxw.rml_parse, common_report_header):
'get_start_date':self._get_start_date,
'get_end_date':self._get_end_date,
'display_currency':self._display_currency,
'get_target_move': self._get_target_move,
})
def set_context(self, objects, data, ids, report_type=None):
obj_move = self.pool.get('account.move.line')
new_ids = ids
self.query_get_clause = ''
self.target_move = data['form'].get('target_move', 'all')
if (data['model'] == 'ir.ui.menu'):
new_ids = 'active_ids' in data['form'] and data['form']['active_ids'] or []
self.query_get_clause = 'AND '
@ -66,7 +68,14 @@ class journal_print(report_sxw.rml_parse, common_report_header):
return super(journal_print, self).set_context(objects, data, ids, report_type=report_type)
def lines(self, period_id, journal_id):
self.cr.execute('SELECT a.currency_id ,a.code, a.name, c.code AS currency_code,l.currency_id ,l.amount_currency ,SUM(debit) AS debit, SUM(credit) AS credit from account_move_line l LEFT JOIN account_account a ON (l.account_id=a.id) LEFT JOIN res_currency c on (l.currency_id=c.id)WHERE l.period_id=%s AND l.journal_id=%s '+self.query_get_clause+' GROUP BY a.id, a.code, a.name,l.amount_currency,c.code , a.currency_id,l.currency_id', (period_id, journal_id))
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted']
self.cr.execute('SELECT a.currency_id ,a.code, a.name, c.code AS currency_code,l.currency_id ,l.amount_currency ,SUM(debit) AS debit, SUM(credit) AS credit \
from account_move_line l \
LEFT JOIN account_move am ON (l.move_id=am.id) \
LEFT JOIN account_account a ON (l.account_id=a.id) \
LEFT JOIN res_currency c on (l.currency_id=c.id) WHERE am.state IN %s AND l.period_id=%s AND l.journal_id=%s '+self.query_get_clause+' GROUP BY a.id, a.code, a.name,l.amount_currency,c.code , a.currency_id,l.currency_id', (tuple(move_state), period_id, journal_id))
return self.cr.dictfetchall()
def _set_get_account_currency_code(self, account_id):

View File

@ -240,7 +240,7 @@
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
<td><para style="terp_tblheader_General_Centre">Journal</para></td>
<td><para style="terp_tblheader_General_Centre">Filter By [[get_filter(data)!='No Filter' and get_filter(data) ]]</para></td>
<td><para style="terp_tblheader_General_Centre">Printing Date</para></td>
<td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
</tr>
<tr>
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
@ -268,7 +268,7 @@
</tr>
</blockTable>
</td>
<td><para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time = True) ]] </para></td>
<td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
</tr>
</blockTable>
<para style="P9">

View File

@ -117,6 +117,9 @@
<field name="context">{'group_by':[], 'search_default_usertype':1, 'search_default_thisyear':1, 'group_by_no_leaf':1}</field>
<field name="help">A tool search lets you know statistics on your different financial accounts that match your needs.</field>
</record>
<menuitem action="action_account_entries_report_all" id="menu_action_account_entries_report_all" parent="account.menu_finance_statistic_report_statement" sequence="2"/>
<menuitem action="action_account_entries_report_all" id="menu_action_account_entries_report_all"
parent="account.menu_finance_statistic_report_statement"
groups="group_account_manager"
sequence="2"/>
</data>
</openerp>

View File

@ -49,13 +49,15 @@ class journal_print(report_sxw.rml_parse, common_report_header):
'get_journal': self._get_journal,
'get_start_date':self._get_start_date,
'get_end_date':self._get_end_date,
'display_currency':self._display_currency
'display_currency':self._display_currency,
'get_target_move': self._get_target_move,
})
def set_context(self, objects, data, ids, report_type=None):
obj_move = self.pool.get('account.move.line')
new_ids = ids
self.query_get_clause = ''
self.target_move = data['form'].get('target_move', 'all')
if (data['model'] == 'ir.ui.menu'):
new_ids = 'active_ids' in data['form'] and data['form']['active_ids'] or []
self.query_get_clause = 'AND '
@ -82,14 +84,18 @@ class journal_print(report_sxw.rml_parse, common_report_header):
def lines(self, period_id):
if not self.journal_ids:
return []
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted']
self.cr.execute('SELECT j.code, j.name, l.amount_currency,c.code AS currency_code,l.currency_id , '
'SUM(l.debit) AS debit, SUM(l.credit) AS credit '
'FROM account_move_line l '
'LEFT JOIN account_move am ON (l.move_id=am.id) '
'LEFT JOIN account_journal j ON (l.journal_id=j.id) '
'LEFT JOIN res_currency c on (l.currency_id=c.id)'
'WHERE period_id=%s AND journal_id IN %s ' + self.query_get_clause + ' '
'GROUP BY j.id, j.code, j.name, l.amount_currency,c.code, l.currency_id ',
(period_id, tuple(self.journal_ids)))
'WHERE am.state IN %s AND l.period_id=%s AND l.journal_id IN %s ' + self.query_get_clause + ' '
'GROUP BY j.id, j.code, j.name, l.amount_currency, c.code, l.currency_id ',
(tuple(move_state), period_id, tuple(self.journal_ids)))
return self.cr.dictfetchall()
def _set_get_account_currency_code(self, account_id):
@ -124,10 +130,14 @@ class journal_print(report_sxw.rml_parse, common_report_header):
journals = self.journal_ids
if not journals:
return 0.0
self.cr.execute('SELECT SUM(debit) FROM account_move_line l '
'WHERE period_id=%s AND journal_id IN %s ' + self.query_get_clause + ' ' \
'AND state<>\'draft\'',
(period_id, tuple(journals)))
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted']
self.cr.execute('SELECT SUM(l.debit) FROM account_move_line l '
'LEFT JOIN account_move am ON (l.move_id=am.id) '
'WHERE am.state IN %s AND l.period_id=%s AND l.journal_id IN %s ' + self.query_get_clause + ' ' \
'AND l.state<>\'draft\'',
(tuple(move_state), period_id, tuple(journals)))
return self.cr.fetchone()[0] or 0.0
def _sum_credit_period(self, period_id, journal_id=None):
@ -135,12 +145,16 @@ class journal_print(report_sxw.rml_parse, common_report_header):
journals = [journal_id]
else:
journals = self.journal_ids
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted']
if not journals:
return 0.0
self.cr.execute('SELECT SUM(credit) FROM account_move_line l '
'WHERE period_id=%s AND journal_id IN %s '+ self.query_get_clause + ' ' \
'AND state<>\'draft\'',
(period_id, tuple(journals)))
self.cr.execute('SELECT SUM(l.credit) FROM account_move_line l '
'LEFT JOIN account_move am ON (l.move_id=am.id) '
'WHERE am.state IN %s AND l.period_id=%s AND l.journal_id IN %s '+ self.query_get_clause + ' ' \
'AND l.state<>\'draft\'',
(tuple(move_state), period_id, tuple(journals)))
return self.cr.fetchone()[0] or 0.0
report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml', parser=journal_print, header='internal')

View File

@ -226,7 +226,7 @@
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
<td><para style="terp_tblheader_General_Centre">Journals</para></td>
<td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]</para></td>
<td><para style="terp_tblheader_General_Centre">Printing Date</para></td>
<td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
</tr>
<tr>
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
@ -254,7 +254,7 @@
</tr>
</blockTable>
</td>
<td><para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time = True) ]] </para></td>
<td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
</tr>
</blockTable>

View File

@ -87,6 +87,7 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
'get_sortby': self._get_sortby,
'get_start_date':self._get_start_date,
'get_end_date':self._get_end_date,
'get_target_move': self._get_target_move,
})
self.context = context

View File

@ -196,7 +196,7 @@
<td><para style="terp_tblheader_General_Centre">Display Account </para></td>
<td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]</para></td>
<td><para style="terp_tblheader_General_Centre">Entries Sorted By</para></td>
<td><para style="terp_tblheader_General_Centre">Printing Date</para></td>
<td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
</tr>
<tr>
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
@ -226,7 +226,7 @@
</blockTable>
</td>
<td><para style="terp_default_Centre_8">[[ get_sortby(data) ]]</para></td>
<td><para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time = True) ]] </para></td>
<td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
</tr>
</blockTable>

View File

@ -199,7 +199,7 @@
<td><para style="terp_tblheader_General_Centre">Display Account</para></td>
<td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]</para></td>
<td><para style="terp_tblheader_General_Centre">Entries Sorted By</para></td>
<td><para style="terp_tblheader_General_Centre">Printing Date</para></td>
<td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
</tr>
<tr>
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
@ -230,7 +230,7 @@
</blockTable>
</td>
<td><para style="terp_default_Centre_8">[[ get_sortby(data) ]]</para></td>
<td><para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time = True) ]] </para></td>
<td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
</tr>
</blockTable>
<para style="terp_default_8">
@ -328,7 +328,7 @@
<td><para style="Standard"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_credit_account(o), digits=get_digits(dp=Account)) ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]</u></para></td>
<td><para style="P9b"><u>[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</u></para></td>
</tr>
</blockTable>

View File

@ -39,7 +39,7 @@ class account_invoice_report(osv.osv):
'uom_name': fields.char('Default UoM', size=128, readonly=True),
'payment_term': fields.many2one('account.payment.term', 'Payment Term', readonly=True),
'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], readonly=True),
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Mapping', readonly=True),
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True),
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
'categ_id': fields.many2one('product.category','Category of Product', readonly=True),
'journal_id': fields.many2one('account.journal', 'Journal', readonly=True),

View File

@ -78,14 +78,14 @@
domain="['|', ('type','=','out_invoice'),('type','=','out_refund')]"
help="Customer Invoices And Refunds"/>
<filter icon="terp-purchase"
string="Vendor"
string="supplier"
separator="1"
domain="['|', ('type','=','in_invoice'),('type','=','in_refund')]"
help="Vendor Invoices And Refunds"/>
help="Supplier Invoices And Refunds"/>
<separator orientation="vertical"/>
<filter icon="terp-dolar" string="Invoice"
domain="['|', ('type','=','out_invoice'),('type','=','in_invoice')]"
help="Customer And Vendor Invoices"/>
help="Customer And Supplier Invoices"/>
<filter icon="terp-dolar_ok!"
string="Refund"
separator="1"
@ -94,7 +94,7 @@
<separator orientation="vertical"/>
<field name="partner_id"/>
<field name="user_id" />
<field name="date" string="Date Invoiced"/>
<field name="date" string="Invoice Date"/>
<field name="categ_id" />
</group>
<newline/>

View File

@ -49,6 +49,7 @@ class journal_print(report_sxw.rml_parse, common_report_header):
'get_end_date':self._get_end_date,
'display_currency':self._display_currency,
'get_sortby': self._get_sortby,
'get_target_move': self._get_target_move,
})
def set_context(self, objects, data, ids, report_type=None):

View File

@ -208,7 +208,7 @@
<td><para style="terp_tblheader_General_Centre">Journal</para></td>
<td><para style="terp_tblheader_General_Centre">Filters By </para></td>
<td><para style="terp_tblheader_General_Centre">Entries Sorted By</para></td>
<td><para style="terp_tblheader_General_Centre">Printing Date</para></td>
<td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
</tr>
<tr>
<td><para style="terp_default_Centre_8">[[ get_account(data) or '' ]]</para></td>
@ -237,7 +237,7 @@
</blockTable>
</td>
<td><para style="terp_default_Centre_8">[[ get_sortby(data) ]]</para></td>
<td><para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time = True) ]] </para></td>
<td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
</tr>
</blockTable>
<para style="P9">

View File

@ -49,6 +49,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
'get_start_period': self.get_start_period,
'get_end_period': self.get_end_period,
'get_partners':self._get_partners,
'get_target_move': self._get_target_move,
})
def set_context(self, objects, data, ids, report_type=None):

View File

@ -189,7 +189,7 @@
<td><para style="terp_tblheader_General_Centre">Journals</para></td>
<td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]</para></td>
<td><para style="terp_tblheader_General_Centre">Partner's</para></td>
<td><para style="terp_tblheader_General_Centre">Printing Date</para></td>
<td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
</tr>
<tr>
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
@ -219,7 +219,7 @@
</blockTable>
</td>
<td> <para style="terp_default_Centre_9">[[ get_partners() ]]</para></td>
<td><para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time = True) ]] </para></td>
<td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
</tr>
</blockTable>

View File

@ -35,10 +35,10 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
'lines': self.lines,
'sum_debit_partner': self._sum_debit_partner,
'sum_credit_partner': self._sum_credit_partner,
'sum_debit': self._sum_debit,
'sum_credit': self._sum_credit,
# 'sum_debit': self._sum_debit,
# 'sum_credit': self._sum_credit,
'get_currency': self._get_currency,
'comma_me' : self.comma_me,
'comma_me': self.comma_me,
'get_start_period': self.get_start_period,
'get_end_period': self.get_end_period,
'get_account': self._get_account,
@ -53,6 +53,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
'get_intial_balance':self._get_intial_balance,
'display_initial_balance':self._display_initial_balance,
'display_currency':self._display_currency,
'get_target_move': self._get_target_move,
})
def set_context(self, objects, data, ids, report_type=None):
@ -102,7 +103,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
"AND " + self.query +" " \
"AND l.account_id IN %s " \
" " + PARTNER_REQUEST + " " \
"AND account.active " ,
"AND account.active ",
(tuple(move_state), tuple(self.account_ids),))
res = self.cr.dictfetchall()
@ -114,9 +115,9 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
return super(third_party_ledger, self).set_context(objects, data, new_ids, report_type)
def comma_me(self, amount):
if type(amount) is float :
if type(amount) is float:
amount = str('%.2f'%amount)
else :
else:
amount = str(amount)
if (amount == '0'):
return ' '
@ -184,10 +185,29 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
move_state = ['posted']
result_tmp = 0.0
if self.reconcil :
result_init = 0.0
if self.reconcil:
RECONCILE_TAG = " "
else:
RECONCILE_TAG = "AND reconcile_id IS NULL"
if self.initial_balance:
self.cr.execute(
"SELECT sum(debit) " \
"FROM account_move_line AS l, " \
"account_move AS m "
"WHERE partner_id = %s" \
"AND m.id = l.move_id " \
"AND m.state IN %s "
"AND account_id IN %s" \
" " + RECONCILE_TAG + " " \
"AND " + self.init_query + " ",
(partner.id, tuple(move_state), tuple(self.account_ids)))
contemp = self.cr.fetchone()
if contemp != None:
result_init = contemp[0] or 0.0
else:
result_init = result_tmp + 0.0
self.cr.execute(
"SELECT sum(debit) " \
"FROM account_move_line AS l, " \
@ -197,7 +217,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
"AND m.state IN %s "
"AND account_id IN %s" \
" " + RECONCILE_TAG + " " \
"AND " + self.query + " " ,
"AND " + self.query + " ",
(partner.id, tuple(move_state), tuple(self.account_ids),))
contemp = self.cr.fetchone()
@ -205,7 +225,8 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
result_tmp = contemp[0] or 0.0
else:
result_tmp = result_tmp + 0.0
return result_tmp
return result_tmp + result_init
def _sum_credit_partner(self, partner):
move_state = ['draft','posted']
@ -213,10 +234,29 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
move_state = ['posted']
result_tmp = 0.0
if self.reconcil :
result_init = 0.0
if self.reconcil:
RECONCILE_TAG = " "
else:
RECONCILE_TAG = "AND reconcile_id IS NULL"
if self.initial_balance:
self.cr.execute(
"SELECT sum(credit) " \
"FROM account_move_line AS l, " \
"account_move AS m "
"WHERE partner_id = %s" \
"AND m.id = l.move_id " \
"AND m.state IN %s "
"AND account_id IN %s" \
" " + RECONCILE_TAG + " " \
"AND " + self.init_query + " ",
(partner.id, tuple(move_state), tuple(self.account_ids)))
contemp = self.cr.fetchone()
if contemp != None:
result_init = contemp[0] or 0.0
else:
result_init = result_tmp + 0.0
self.cr.execute(
"SELECT sum(credit) " \
"FROM account_move_line AS l, " \
@ -226,115 +266,115 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
"AND m.state IN %s "
"AND account_id IN %s" \
" " + RECONCILE_TAG + " " \
"AND " + self.query + " " ,
"AND " + self.query + " ",
(partner.id, tuple(move_state), tuple(self.account_ids),))
contemp = self.cr.fetchone()
if contemp != None:
result_tmp = contemp[0] or 0.0
else:
result_tmp = result_tmp + 0.0
return result_tmp
def _sum_debit(self):
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted']
if not self.ids:
return 0.0
result_tmp = 0.0
result_init = 0.0
if self.reconcil :
RECONCILE_TAG = " "
else:
RECONCILE_TAG = "AND reconcile_id IS NULL"
if self.initial_balance:
self.cr.execute(
"SELECT sum(debit) " \
"FROM account_move_line AS l, " \
"account_move AS m "
"WHERE partner_id IN %s" \
"AND m.id = l.move_id " \
"AND m.state IN %s "
"AND account_id IN %s" \
"AND reconcile_id IS NULL " \
"AND " + self.init_query + " ",
(tuple(self.partner_ids), tuple(move_state), tuple(self.account_ids)))
contemp = self.cr.fetchone()
if contemp != None:
result_init = contemp[0] or 0.0
else:
result_init = result_tmp + 0.0
self.cr.execute(
"SELECT sum(debit) " \
"FROM account_move_line AS l, " \
"account_move AS m "
"WHERE partner_id IN %s" \
"AND m.id = l.move_id " \
"AND m.state IN %s "
"AND account_id IN %s" \
" " + RECONCILE_TAG + " " \
"AND " + self.query + " " ,
(tuple(self.partner_ids), tuple(move_state) ,tuple(self.account_ids),))
contemp = self.cr.fetchone()
if contemp != None:
result_tmp = contemp[0] or 0.0
else:
result_tmp = result_tmp + 0.0
return result_tmp + result_init
def _sum_credit(self):
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted']
if not self.ids:
return 0.0
result_tmp = 0.0
result_init = 0.0
if self.reconcil :
RECONCILE_TAG = " "
else:
RECONCILE_TAG = "AND reconcile_id IS NULL"
if self.initial_balance:
self.cr.execute(
"SELECT sum(credit) " \
"FROM account_move_line AS l, " \
"account_move AS m "
"WHERE partner_id IN %s" \
"AND m.id = l.move_id " \
"AND m.state IN %s "
"AND account_id IN %s" \
"AND reconcile_id IS NULL " \
"AND " + self.init_query + " ",
(tuple(self.partner_ids), tuple(move_state), tuple(self.account_ids)))
contemp = self.cr.fetchone()
if contemp != None:
result_init = contemp[0] or 0.0
else:
result_init = result_tmp + 0.0
self.cr.execute(
"SELECT sum(credit) " \
"FROM account_move_line AS l, " \
"account_move AS m "
"WHERE partner_id IN %s" \
"AND m.id = l.move_id " \
"AND m.state IN %s "
"AND account_id IN %s" \
" " + RECONCILE_TAG + " " \
"AND " + self.query + " " ,
(tuple(self.partner_ids), tuple(move_state), tuple(self.account_ids),))
contemp = self.cr.fetchone()
if contemp != None:
result_tmp = contemp[0] or 0.0
else:
result_tmp = result_tmp + 0.0
return result_tmp + result_init
# code is deprecated
# def _sum_debit(self):
# move_state = ['draft','posted']
# if self.target_move == 'posted':
# move_state = ['posted']
#
# if not self.ids:
# return 0.0
# result_tmp = 0.0
# result_init = 0.0
# if self.reconcil :
# RECONCILE_TAG = " "
# else:
# RECONCILE_TAG = "AND reconcile_id IS NULL"
# if self.initial_balance:
# self.cr.execute(
# "SELECT sum(debit) " \
# "FROM account_move_line AS l, " \
# "account_move AS m "
# "WHERE partner_id IN %s" \
# "AND m.id = l.move_id " \
# "AND m.state IN %s "
# "AND account_id IN %s" \
# "AND reconcile_id IS NULL " \
# "AND " + self.init_query + " ",
# (tuple(self.partner_ids), tuple(move_state), tuple(self.account_ids)))
# contemp = self.cr.fetchone()
# if contemp != None:
# result_init = contemp[0] or 0.0
# else:
# result_init = result_tmp + 0.0
#
# self.cr.execute(
# "SELECT sum(debit) " \
# "FROM account_move_line AS l, " \
# "account_move AS m "
# "WHERE partner_id IN %s" \
# "AND m.id = l.move_id " \
# "AND m.state IN %s "
# "AND account_id IN %s" \
# " " + RECONCILE_TAG + " " \
# "AND " + self.query + " " ,
# (tuple(self.partner_ids), tuple(move_state) ,tuple(self.account_ids),))
# contemp = self.cr.fetchone()
# if contemp != None:
# result_tmp = contemp[0] or 0.0
# else:
# result_tmp = result_tmp + 0.0
# return result_tmp + result_init
#
# def _sum_credit(self):
# move_state = ['draft','posted']
# if self.target_move == 'posted':
# move_state = ['posted']
#
# if not self.ids:
# return 0.0
# result_tmp = 0.0
# result_init = 0.0
# if self.reconcil :
# RECONCILE_TAG = " "
# else:
# RECONCILE_TAG = "AND reconcile_id IS NULL"
# if self.initial_balance:
# self.cr.execute(
# "SELECT sum(credit) " \
# "FROM account_move_line AS l, " \
# "account_move AS m "
# "WHERE partner_id IN %s" \
# "AND m.id = l.move_id " \
# "AND m.state IN %s "
# "AND account_id IN %s" \
# "AND reconcile_id IS NULL " \
# "AND " + self.init_query + " ",
# (tuple(self.partner_ids), tuple(move_state), tuple(self.account_ids)))
# contemp = self.cr.fetchone()
# if contemp != None:
# result_init = contemp[0] or 0.0
# else:
# result_init = result_tmp + 0.0
#
# self.cr.execute(
# "SELECT sum(credit) " \
# "FROM account_move_line AS l, " \
# "account_move AS m "
# "WHERE partner_id IN %s" \
# "AND m.id = l.move_id " \
# "AND m.state IN %s "
# "AND account_id IN %s" \
# " " + RECONCILE_TAG + " " \
# "AND " + self.query + " " ,
# (tuple(self.partner_ids), tuple(move_state), tuple(self.account_ids),))
# contemp = self.cr.fetchone()
# if contemp != None:
# result_tmp = contemp[0] or 0.0
# else:
# result_tmp = result_tmp + 0.0
# return result_tmp + result_init
def _get_partners(self):
if self.result_selection == 'customer':
return 'Receivable Accounts'
@ -361,7 +401,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
return False
def _display_currency(self, data):
if self.amount_currency :
if self.amount_currency:
return True
return False

View File

@ -37,7 +37,7 @@
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="0,-2"/>
</blockTableStyle>
<blockTableStyle id="Table2_header">
<blockAlignment value="LEFT"/>
@ -86,7 +86,7 @@
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="6,-1" stop="6,-1"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="7,-1" stop="7,-1"/>
</blockTableStyle>
<blockTableStyle id="Table3_header">
<blockTableStyle id="Table3_header">
<blockAlignment value="LEFT"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
</blockTableStyle>
@ -106,8 +106,7 @@
<blockTableStyle id="Table6">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="0,-2"/>
</blockTableStyle>
<blockTableStyle id="Table5">
<blockAlignment value="LEFT"/>
@ -168,6 +167,7 @@
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Left_9" fontName="Helvetica" fontSize="8.3" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0" />
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_Bold_Right_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
@ -225,43 +225,43 @@
<para style="P3">[[ repeatIn(objects, 'p') ]] [[ setLang(p.lang) ]]</para>
<blockTable colWidths="80.0,80.0,80.0,130.0,70.0,80.0" style="Table2_header">
<tr>
<td><para style="terp_tblheader_General_Centre">Chart of Account </para></td>
<td><para style="terp_tblheader_General_Centre">Chart of Account </para></td>
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
<td><para style="terp_tblheader_General_Centre">Journal</para></td>
<td><para style="terp_tblheader_General_Centre">Journal</para></td>
<td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]</para></td>
<td><para style="terp_tblheader_General_Centre">Partner's</para></td>
<td><para style="terp_tblheader_General_Centre">Printing Date</para></td>
<td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
</tr>
<tr>
<td><para style="terp_default_Centre_8">[[ get_account(data) or '' ]]</para></td>
<tr>
<td><para style="terp_default_Centre_8">[[ get_account(data) or '' ]]</para></td>
<td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
<td><para style="terp_default_Centre_8">[[', '.join([ lt or '' for lt in get_journal(data) ]) ]]</para></td>
<td><para style="terp_default_Centre_8">[[', '.join([ lt or '' for lt in get_journal(data) ]) ]]</para></td>
<td><para style="terp_default_Centre_8">[[ get_filter(data)=='No Filter' and get_filter(data) or removeParentNode('para') ]] </para>
<blockTable colWidths="60.0,60.0" style="Table3_header">[[ get_filter(data)=='Date' or removeParentNode('blockTable') ]]
<tr>
<td><para style="terp_tblheader_General_Centre">Start Date</para></td>
<td><para style="terp_tblheader_General_Centre">End Date</para></td>
</tr>
<tr>
<td><para style="terp_default_Centre_8">[[ formatLang(get_start_date(data),date=True) ]]</para></td>
<td><para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para></td>
</tr>
</blockTable>
<blockTable colWidths="65.0,65.0" style="Table3_header">[[ get_filter(data)=='Periods' or removeParentNode('blockTable') ]]
<tr>
<td><para style="terp_tblheader_General_Centre">Start Period</para></td>
<td><para style="terp_tblheader_General_Centre">End Period</para></td>
</tr>
<tr>
<td><para style="terp_default_Centre_8">[[ get_start_period(data) or removeParentNode('para') ]]</para></td>
<td><para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para></td>
</tr>
</blockTable>
</td>
<td><para style="terp_default_Centre_8">[[ get_partners() ]]</para></td>
<td><para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time = True) ]] </para></td>
</tr>
</blockTable>
<blockTable colWidths="60.0,60.0" style="Table3_header">[[ get_filter(data)=='Date' or removeParentNode('blockTable') ]]
<tr>
<td><para style="terp_tblheader_General_Centre">Start Date</para></td>
<td><para style="terp_tblheader_General_Centre">End Date</para></td>
</tr>
<tr>
<td><para style="terp_default_Centre_8">[[ formatLang(get_start_date(data),date=True) ]]</para></td>
<td><para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para></td>
</tr>
</blockTable>
<blockTable colWidths="65.0,65.0" style="Table3_header">[[ get_filter(data)=='Periods' or removeParentNode('blockTable') ]]
<tr>
<td><para style="terp_tblheader_General_Centre">Start Period</para></td>
<td><para style="terp_tblheader_General_Centre">End Period</para></td>
</tr>
<tr>
<td><para style="terp_default_Centre_8">[[ get_start_period(data) or removeParentNode('para') ]]</para></td>
<td><para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para></td>
</tr>
</blockTable>
</td>
<td><para style="terp_default_Centre_8">[[ get_partners() ]]</para></td>
<td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
</tr>
</blockTable>
<para style="P4">
<font color="white"> </font>
</para>
@ -328,8 +328,8 @@
</td>
</tr>
<tr>
<td>[[ data['form']['initial_balance'] or removeParentNode('tr') ]]
<para style="P2">Initial Balance</para>
<td>[[ data['form']['initial_balance'] or removeParentNode('tr') ]]
<para style="terp_default_Left_9">Initial Balance</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][0])]]</para>
@ -439,7 +439,7 @@
</tr>
<tr>
<td>[[display_initial_balance(data) or removeParentNode('tr') ]]
<para style="P2">Initial Balance</para>
<para style="terp_default_Left_9">Initial Balance</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][0]) ]]</para>
@ -450,7 +450,7 @@
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]</para>
</td>
<td>
<td>
<para style="P5"></para>
</td>
</tr>

View File

@ -188,12 +188,12 @@
<blockTableStyle id="Table9">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table10">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table_header">
<blockAlignment value="LEFT"/>
@ -222,7 +222,7 @@
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0, 0" stop="0,-2"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
@ -261,7 +261,7 @@
<blockTableStyle id="Table6">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="0,-2"/>
</blockTableStyle>
<blockTableStyle id="Table7">
<blockAlignment value="LEFT"/>
@ -320,13 +320,14 @@
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Left_9" fontName="Helvetica" fontSize="8.3" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0" />
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_Bold_Right_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Table index 1" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica"/>
<paraStyle name="Table" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Table index heading" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="16.0" leading="20" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Right_1" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_1" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<images/>
</stylesheet>
<story>
@ -368,7 +369,7 @@
<para style="P9">Partner's</para>
</td>
<td>
<para style="P9">Printing Date</para>
<para style="P9">Target Moves</para>
</td>
</tr>
<tr>
@ -421,7 +422,7 @@
<para style="terp_default_Centre_8">[[ get_partners() ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time = True) ]]</para>
<para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para>
</td>
</tr>
</blockTable>
@ -459,8 +460,8 @@
</td>
</tr>
</blockTable>
<section>
<para style="P3">[[ repeatIn(objects, 'p') ]] [[ setLang(p.lang) ]]</para>
<section>
<para style="P3">[[ repeatIn(objects, 'p') ]] [[ setLang(p.lang) ]]</para>
<blockTable colWidths="349.0,60.0,60.0,60.0" style="Table2">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
<tr>
@ -479,7 +480,7 @@
</tr>
<tr>
<td>[[ display_initial_balance(data) or removeParentNode('tr') ]]
<para style="P2">Initial Balance</para>
<para style="terp_default_Left_9">Initial Balance</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][0])]]</para>
@ -581,7 +582,7 @@
</tr>
<tr>
<td>[[ data['form']['initial_balance'] or removeParentNode('tr') ]]
<para style="P2">Initial Balance</para>
<para style="terp_default_Left_9">Initial Balance</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][0]) ]]</para>
@ -592,7 +593,7 @@
<td>
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]</para>
</td>
<td>
<td>
<para style="terp_default_Right_9"></para>
</td>
</tr>

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,7 +15,7 @@
# 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/>.
#
##############################################################################
@ -31,7 +31,7 @@ class account_invoice(report_sxw.rml_parse):
report_sxw.report_sxw(
'report.account.invoice',
'account.invoice',
'addons/account/report/invoice.rml',
'addons/account/report/account_print_invoice.rml',
parser=account_invoice
)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -362,7 +362,7 @@
<blockTable colWidths="120.0,410.0" style="Table1">
<tr>
<td>
<para style="terp_default_Bold_9">Fiscal Mapping Remark : </para>
<para style="terp_default_Bold_9">Fiscal Position: </para>
</td>
<td>
<para style="terp_default_9">[[ (o.fiscal_position.note and format(o.fiscal_position and o.fiscal_position.note)) or removeParentNode('blockTable') ]]</para>

View File

@ -90,7 +90,7 @@ class Overdue(report_sxw.rml_parse):
return message
report_sxw.report_sxw('report.account.overdue', 'res.partner',
'addons/account/report/overdue.rml', parser=Overdue)
'addons/account/report/account_print_overdue.rml', parser=Overdue)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -156,7 +156,7 @@
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
<td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]</para></td>
<td><para style="terp_tblheader_General_Centre">Display Account</para></td>
<td><para style="terp_tblheader_General_Centre">Printing Date</para></td>
<td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
</tr>
<tr>
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
@ -184,7 +184,7 @@
</blockTable>
</td>
<td><para style="terp_default_Centre_8">[[ (data['form']['display_account']=='bal_all' and 'All') or (data['form']['display_account']=='bal_movement' and 'With movements') or 'With balance is not equal to 0']]</para></td>
<td><para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time = True) ]] </para></td>
<td><para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para></td>
</tr>
</blockTable>
<para style="Standard">

View File

@ -36,13 +36,13 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
self.result_temp = []
self.localcontext.update( {
'time': time,
'get_lines' : self.get_lines,
'get_lines_another' : self.get_lines_another,
'get_lines': self.get_lines,
'get_lines_another': self.get_lines_another,
'get_currency': self._get_currency,
'get_data': self.get_data,
'sum_dr' : self.sum_dr,
'sum_cr' : self.sum_cr,
'final_result' : self.final_result,
'sum_dr': self.sum_dr,
'sum_cr': self.sum_cr,
'final_result': self.final_result,
'get_fiscalyear': self._get_fiscalyear,
'get_account': self._get_account,
'get_start_period': self.get_start_period,
@ -53,6 +53,7 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
'get_start_date':self._get_start_date,
'get_end_date':self._get_end_date,
'get_company':self._get_company,
'get_target_move': self._get_target_move,
})
self.context = context
@ -85,7 +86,7 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
ctx = self.context.copy()
ctx['fiscalyear'] = data['form'].get('fiscalyear_id', False)
if data['form']['filter'] == 'filter_period' :
if data['form']['filter'] == 'filter_period':
ctx['periods'] = data['form'].get('periods', False)
elif data['form']['filter'] == 'filter_date':
ctx['date_from'] = data['form'].get('date_from', False)
@ -105,7 +106,7 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
if typ == 'income' and account.type <> 'view' and (account.debit <> account.credit):
self.result_sum_cr += abs(account.debit - account.credit)
if data['form']['display_account'] == 'bal_movement':
if account.credit > 0 or account.debit > 0 or account.balance > 0 :
if account.credit > 0 or account.debit > 0 or account.balance > 0:
accounts_temp.append(account)
elif data['form']['display_account'] == 'bal_solde':
if account.balance != 0:
@ -125,12 +126,12 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
for i in range(0,max(len(cal_list['expense']),len(cal_list['income']))):
if i < len(cal_list['expense']) and i < len(cal_list['income']):
temp={
'code' : cal_list['expense'][i].code,
'name' : cal_list['expense'][i].name,
'code': cal_list['expense'][i].code,
'name': cal_list['expense'][i].name,
'level': cal_list['expense'][i].level,
'balance':cal_list['expense'][i].balance,
'code1' : cal_list['income'][i].code,
'name1' : cal_list['income'][i].name,
'code1': cal_list['income'][i].code,
'name1': cal_list['income'][i].name,
'level1': cal_list['income'][i].level,
'balance1':cal_list['income'][i].balance,
}
@ -138,24 +139,24 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
else:
if i < len(cal_list['income']):
temp={
'code' : '',
'name' : '',
'code': '',
'name': '',
'level': False,
'balance':False,
'code1' : cal_list['income'][i].code,
'name1' : cal_list['income'][i].name,
'code1': cal_list['income'][i].code,
'name1': cal_list['income'][i].name,
'level1': cal_list['income'][i].level,
'balance1':cal_list['income'][i].balance,
}
self.result_temp.append(temp)
if i < len(cal_list['expense']):
temp={
'code' : cal_list['expense'][i].code,
'name' : cal_list['expense'][i].name,
'code': cal_list['expense'][i].code,
'name': cal_list['expense'][i].name,
'level': cal_list['expense'][i].level,
'balance':cal_list['expense'][i].balance,
'code1' : '',
'name1' : '',
'code1': '',
'name1': '',
'level1': False,
'balance1':False,
}

View File

@ -157,7 +157,7 @@
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
<td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]</para></td>
<td><para style="terp_tblheader_General_Centre">Display Account</para></td>
<td><para style="terp_tblheader_General_Centre">Printing Date</para></td>
<td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
</tr>
<tr>
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
@ -185,7 +185,7 @@
</blockTable>
</td>
<td><para style="terp_default_Centre_8">[[ (data['form']['display_account']=='bal_all' and 'All') or (data['form']['display_account']=='bal_movement' and 'With movements') or 'With balance is not equal to 0']]</para></td>
<td><para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'), date_time = True) ]] </para></td>
<td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
</tr>
</blockTable>
<para style="Standard">

View File

@ -165,7 +165,7 @@ class report_invoice_created(osv.osv):
'amount_untaxed': fields.float('Untaxed', readonly=True),
'amount_total': fields.float('Total', readonly=True),
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
'date_invoice': fields.date('Date Invoiced', readonly=True),
'date_invoice': fields.date('Invoice Date', readonly=True),
'date_due': fields.date('Due Date', readonly=True),
'residual': fields.float('Residual', readonly=True),
'state': fields.selection([

View File

@ -0,0 +1,220 @@
# -*- 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/>.
#
##############################################################################
import time
import copy
import rml_parse
from report import report_sxw
class tax_report(rml_parse.rml_parse):
_name = 'report.account.vat.declaration'
def __init__(self, cr, uid, name, context={}):
super(tax_report, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'get_period': self._get_period,
'get_codes': self._get_codes,
'get_general': self._get_general,
'get_company': self._get_company,
'get_currency': self._get_currency,
'get_lines': self._get_lines,
})
def _get_lines(self, based_on, period_list, company_id=False, parent=False, level=0, context={}):
res = self._get_codes(based_on, company_id, parent, level, period_list, context=context)
if period_list:
res = self._add_codes(based_on, res, period_list, context=context)
else:
self.cr.execute ("select id from account_fiscalyear")
fy = self.cr.fetchall()
self.cr.execute ("select id from account_period where fiscalyear_id = %s",(fy[0][0],))
periods = self.cr.fetchall()
for p in periods:
period_list.append(p[0])
res = self._add_codes(based_on, res, period_list, context=context)
i = 0
top_result = []
while i < len(res):
res_dict = { 'code': res[i][1].code,
'name': res[i][1].name,
'debit': 0,
'credit': 0,
'tax_amount': res[i][1].sum_period,
'type': 1,
'level': res[i][0],
'pos': 0
}
top_result.append(res_dict)
res_general = self._get_general(res[i][1].id, period_list, company_id, based_on, context=context)
ind_general = 0
while ind_general < len(res_general):
res_general[ind_general]['type'] = 2
res_general[ind_general]['pos'] = 0
res_general[ind_general]['level'] = res_dict['level']
top_result.append(res_general[ind_general])
ind_general+=1
i+=1
return top_result
#return array_result
def _get_period(self, period_id, context={}):
return self.pool.get('account.period').browse(self.cr, self.uid, period_id, context=context).name
def _get_general(self, tax_code_id, period_list,company_id, based_on, context={}):
res=[]
obj_account = self.pool.get('account.account')
periods_ids = tuple(period_list)
if based_on == 'payments':
self.cr.execute('SELECT SUM(line.tax_amount) AS tax_amount, \
SUM(line.debit) AS debit, \
SUM(line.credit) AS credit, \
COUNT(*) AS count, \
account.id AS account_id, \
account.name AS name, \
account.code AS code \
FROM account_move_line AS line, \
account_account AS account, \
account_move AS move \
LEFT JOIN account_invoice invoice ON \
(invoice.move_id = move.id) \
WHERE line.state<>%s \
AND line.tax_code_id = %s \
AND line.account_id = account.id \
AND account.company_id = %s \
AND move.id = line.move_id \
AND line.period_id IN %s \
AND ((invoice.state = %s) \
OR (invoice.id IS NULL)) \
GROUP BY account.id,account.name,account.code', ('draft', tax_code_id,
company_id, periods_ids, 'paid',))
else:
self.cr.execute('SELECT SUM(line.tax_amount) AS tax_amount, \
SUM(line.debit) AS debit, \
SUM(line.credit) AS credit, \
COUNT(*) AS count, \
account.id AS account_id, \
account.name AS name, \
account.code AS code \
FROM account_move_line AS line, \
account_account AS account \
WHERE line.state <> %s \
AND line.tax_code_id = %s \
AND line.account_id = account.id \
AND account.company_id = %s \
AND line.period_id IN %s\
AND account.active \
GROUP BY account.id,account.name,account.code', ('draft', tax_code_id,
company_id, periods_ids,))
res = self.cr.dictfetchall()
i = 0
while i<len(res):
res[i]['account'] = obj_account.browse(self.cr, self.uid, res[i]['account_id'], context=context)
i+=1
return res
def _get_codes(self, based_on, company_id, parent=False, level=0, period_list=[], context={}):
obj_tc = self.pool.get('account.tax.code')
ids = obj_tc.search(self.cr, self.uid, [('parent_id','=',parent),('company_id','=',company_id)], context=context)
res = []
for code in obj_tc.browse(self.cr, self.uid, ids, {'based_on': based_on}):
res.append(('.'*2*level, code))
res += self._get_codes(based_on, company_id, code.id, level+1, context=context)
return res
def _add_codes(self, based_on, account_list=[], period_list=[], context={}):
res = []
obj_tc = self.pool.get('account.tax.code')
for account in account_list:
ids = obj_tc.search(self.cr, self.uid, [('id','=', account[1].id)], context=context)
sum_tax_add = 0
for period_ind in period_list:
for code in obj_tc.browse(self.cr, self.uid, ids, {'period_id':period_ind,'based_on': based_on}):
sum_tax_add = sum_tax_add + code.sum_period
code.sum_period = sum_tax_add
res.append((account[0], code))
return res
def _get_company(self, form, context={}):
obj_company = self.pool.get('res.company')
return obj_company.browse(self.cr, self.uid, form['company_id'], context=context).name
def _get_currency(self, form, context={}):
obj_company = self.pool.get('res.company')
return obj_company.browse(self.cr, self.uid, form['company_id'], context=context).currency_id.name
def sort_result(self, accounts, context={}):
# On boucle sur notre rapport
result_accounts = []
ind=0
old_level=0
while ind<len(accounts):
#
account_elem = accounts[ind]
#
#
# we will now check if the level is lower than the previous level, in this case we will make a subtotal
if (account_elem['level'] < old_level):
bcl_current_level = old_level
bcl_rup_ind = ind - 1
while (bcl_current_level >= int(accounts[bcl_rup_ind]['level']) and bcl_rup_ind >= 0 ):
tot_elem = copy.copy(accounts[bcl_rup_ind], context=context)
res_tot = { 'code': accounts[bcl_rup_ind]['code'],
'name': '',
'debit': 0,
'credit': 0,
'tax_amount': accounts[bcl_rup_ind]['tax_amount'],
'type': accounts[bcl_rup_ind]['type'],
'level': 0,
'pos': 0
}
if res_tot['type'] == 1:
# on change le type pour afficher le total
res_tot['type'] = 2
result_accounts.append(res_tot)
bcl_current_level = accounts[bcl_rup_ind]['level']
bcl_rup_ind -= 1
old_level = account_elem['level']
result_accounts.append(account_elem)
ind+=1
return result_accounts
report_sxw.report_sxw('report.account.vat.declaration', 'account.tax.code',
'addons/account/report/account_tax_report.rml', parser=tax_report, header="internal")
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,7 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
@ -21,27 +21,25 @@
##############################################################################
import time
from report import report_sxw
from tools import amount_to_text_en
class report_voucher_move(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(report_voucher_move, self).__init__(cr, uid, name, context)
def __init__(self, cr, uid, name, context=None):
super(report_voucher_move, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'convert':self.convert,
'get_title': self.get_title,
'debit':self.debit,
'credit':self.credit,
#'get_ref' : self._get_ref
})
self.user=uid
self.user = uid
def convert(self, amount):
user_id = self.pool.get('res.users').browse(self.cr, self.user, [self.user])[0]
cur = user_id.company_id.currency_id.name
amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur);
return amt_en
user_id = self.pool.get('res.users').browse(self.cr, self.user, [self.user])[0]
return amount_to_text_en.amount_to_text(amount, 'en', user_id.company_id.currency_id.name)
def get_title(self, voucher):
title = ''
@ -49,22 +47,24 @@ class report_voucher_move(report_sxw.rml_parse):
type = voucher.journal_id.type
title = type[0].swapcase() + type[1:] + " Voucher"
return title
def debit(self, move_ids):
debit = 0.0
for move in move_ids:
debit +=move.debit
return debit
def credit(self, move_ids):
credit = 0.0
for move in move_ids:
credit +=move.credit
return credit
report_sxw.report_sxw(
'report.account.move.voucher',
'account.move',
'addons/account/report/voucher_print.rml',
'addons/account/report/account_voucher_print.rml',
parser=report_voucher_move,header="external"
)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -60,6 +60,13 @@ class common_report_header(object):
return data['form']['date_from']
return ''
def _get_target_move(self, data):
if data.get('form', False) and data['form'].get('target_move', False):
if data['form']['target_move'] == 'all':
return 'All Entries'
return 'All Posted Entries'
return ''
def _get_end_date(self, data):
if data.get('form', False) and data['form'].get('date_to', False):
return data['form']['date_to']

View File

@ -1,220 +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/>.
#
##############################################################################
import time
import copy
import rml_parse
from report import report_sxw
class tax_report(rml_parse.rml_parse):
_name = 'report.account.vat.declaration'
def __init__(self, cr, uid, name, context={}):
super(tax_report, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'get_period': self._get_period,
'get_codes': self._get_codes,
'get_general': self._get_general,
'get_company': self._get_company,
'get_currency': self._get_currency,
'get_lines' : self._get_lines,
})
def _get_lines(self, based_on, period_list, company_id=False, parent=False, level=0, context={}):
res = self._get_codes(based_on, company_id, parent, level, period_list, context=context)
if period_list:
res = self._add_codes(based_on, res, period_list, context=context)
else :
self.cr.execute ("select id from account_fiscalyear")
fy = self.cr.fetchall()
self.cr.execute ("select id from account_period where fiscalyear_id = %s",(fy[0][0],))
periods = self.cr.fetchall()
for p in periods :
period_list.append(p[0])
res = self._add_codes(based_on, res, period_list, context=context)
i = 0
top_result = []
while i < len(res):
res_dict = { 'code' : res[i][1].code,
'name' : res[i][1].name,
'debit' : 0,
'credit' : 0,
'tax_amount' : res[i][1].sum_period,
'type' : 1,
'level' : res[i][0],
'pos' : 0
}
top_result.append(res_dict)
res_general = self._get_general(res[i][1].id, period_list, company_id, based_on, context=context)
ind_general = 0
while ind_general < len(res_general) :
res_general[ind_general]['type'] = 2
res_general[ind_general]['pos'] = 0
res_general[ind_general]['level'] = res_dict['level']
top_result.append(res_general[ind_general])
ind_general+=1
i+=1
return top_result
#return array_result
def _get_period(self, period_id, context={}):
return self.pool.get('account.period').browse(self.cr, self.uid, period_id, context=context).name
def _get_general(self, tax_code_id, period_list ,company_id, based_on, context={}):
res=[]
obj_account = self.pool.get('account.account')
periods_ids = tuple(period_list)
if based_on == 'payments':
self.cr.execute('SELECT SUM(line.tax_amount) AS tax_amount, \
SUM(line.debit) AS debit, \
SUM(line.credit) AS credit, \
COUNT(*) AS count, \
account.id AS account_id, \
account.name AS name, \
account.code AS code \
FROM account_move_line AS line, \
account_account AS account, \
account_move AS move \
LEFT JOIN account_invoice invoice ON \
(invoice.move_id = move.id) \
WHERE line.state<>%s \
AND line.tax_code_id = %s \
AND line.account_id = account.id \
AND account.company_id = %s \
AND move.id = line.move_id \
AND line.period_id IN %s \
AND ((invoice.state = %s) \
OR (invoice.id IS NULL)) \
GROUP BY account.id,account.name,account.code', ('draft', tax_code_id,
company_id, periods_ids, 'paid',))
else :
self.cr.execute('SELECT SUM(line.tax_amount) AS tax_amount, \
SUM(line.debit) AS debit, \
SUM(line.credit) AS credit, \
COUNT(*) AS count, \
account.id AS account_id, \
account.name AS name, \
account.code AS code \
FROM account_move_line AS line, \
account_account AS account \
WHERE line.state <> %s \
AND line.tax_code_id = %s \
AND line.account_id = account.id \
AND account.company_id = %s \
AND line.period_id IN %s\
AND account.active \
GROUP BY account.id,account.name,account.code', ('draft', tax_code_id,
company_id, periods_ids,))
res = self.cr.dictfetchall()
i = 0
while i<len(res):
res[i]['account'] = obj_account.browse(self.cr, self.uid, res[i]['account_id'], context=context)
i+=1
return res
def _get_codes(self, based_on, company_id, parent=False, level=0, period_list=[], context={}):
obj_tc = self.pool.get('account.tax.code')
ids = obj_tc.search(self.cr, self.uid, [('parent_id','=',parent),('company_id','=',company_id)], context=context)
res = []
for code in obj_tc.browse(self.cr, self.uid, ids, {'based_on': based_on}):
res.append(('.'*2*level, code))
res += self._get_codes(based_on, company_id, code.id, level+1, context=context)
return res
def _add_codes(self, based_on, account_list=[], period_list=[], context={}):
res = []
obj_tc = self.pool.get('account.tax.code')
for account in account_list:
ids = obj_tc.search(self.cr, self.uid, [('id','=', account[1].id)], context=context)
sum_tax_add = 0
for period_ind in period_list:
for code in obj_tc.browse(self.cr, self.uid, ids, {'period_id':period_ind,'based_on': based_on}):
sum_tax_add = sum_tax_add + code.sum_period
code.sum_period = sum_tax_add
res.append((account[0], code))
return res
def _get_company(self, form, context={}):
obj_company = self.pool.get('res.company')
return obj_company.browse(self.cr, self.uid, form['company_id'], context=context).name
def _get_currency(self, form, context={}):
obj_company = self.pool.get('res.company')
return obj_company.browse(self.cr, self.uid, form['company_id'], context=context).currency_id.name
def sort_result(self, accounts, context={}):
# On boucle sur notre rapport
result_accounts = []
ind=0
old_level=0
while ind<len(accounts):
#
account_elem = accounts[ind]
#
#
# we will now check if the level is lower than the previous level, in this case we will make a subtotal
if (account_elem['level'] < old_level):
bcl_current_level = old_level
bcl_rup_ind = ind - 1
while (bcl_current_level >= int(accounts[bcl_rup_ind]['level']) and bcl_rup_ind >= 0 ):
tot_elem = copy.copy(accounts[bcl_rup_ind], context=context)
res_tot = { 'code' : accounts[bcl_rup_ind]['code'],
'name' : '',
'debit' : 0,
'credit' : 0,
'tax_amount' : accounts[bcl_rup_ind]['tax_amount'],
'type' : accounts[bcl_rup_ind]['type'],
'level' : 0,
'pos' : 0
}
if res_tot['type'] == 1:
# on change le type pour afficher le total
res_tot['type'] = 2
result_accounts.append(res_tot)
bcl_current_level = accounts[bcl_rup_ind]['level']
bcl_rup_ind -= 1
old_level = account_elem['level']
result_accounts.append(account_elem)
ind+=1
return result_accounts
report_sxw.report_sxw('report.account.vat.declaration', 'account.tax.code',
'addons/account/report/tax_report.rml', parser=tax_report, header="internal")
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -5,150 +5,13 @@
<field name="name">Accounting / Invoice</field>
</record>
<record id="group_account_user" model="res.groups">
<record id="group_account_user" model="res.groups" context="{'noadmin':True}">
<field name="name">Accounting / Accountant</field>
</record>
<record id="group_account_manager" model="res.groups">
<record id="group_account_manager" model="res.groups" context="{'noadmin':True}">
<field name="name">Accounting / Manager</field>
</record>
<record id="menu_finance_reporting" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager'), ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
</record>
<record id="menu_finance_legal_statement" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_finance_receivables" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_invoice'),ref('group_account_manager'),ref('group_account_user')])]" name="groups_id"/>
</record>
<record id="menu_finance_payables" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_invoice'), ref('group_account_user'),ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_finance_charts" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_user'), ref('group_account_manager'), ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
</record>
<record id="menu_eaction_account_moves_sale" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_user'),ref('group_account_invoice')])]" name="groups_id"/>
</record>
<record id="menu_eaction_account_moves_purchase" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_user'),ref('group_account_invoice')])]" name="groups_id"/>
</record>
<record id="menu_action_invoice_tree1" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_user'),ref('group_account_invoice'),ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_action_invoice_tree2" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_user'),ref('group_account_invoice'),ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_action_invoice_tree3" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_user'),ref('group_account_invoice'),ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_action_invoice_tree4" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_user'),ref('group_account_invoice'),ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_finance_bank_and_cash" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_user'),ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_action_account_tree2" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_user'),ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_finance_entries" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_user')])]" name="groups_id"/>
</record>
<record id="menu_action_move_journal_line_form" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_user'),ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_eaction_account_moves_all" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_user')])]" name="groups_id"/>
</record>
<record id="menu_dashboard_acc" model="ir.ui.menu">
<field eval="[(6, 0, [ref('group_account_user')])]" name="groups_id"/>
</record>
<record id="final_accounting_reports" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager'), ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
</record>
<record id="menu_journals_report" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_action_tax_code_tree" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_user'),ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_finance_periodical_processing" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_user')])]" name="groups_id"/>
</record>
<record id="menu_general_ledger" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_general_Balance_report" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_account_bs_report" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_account_pl_report" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_tax_report" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="next_id_22" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_action_account_invoice_report_all" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_action_account_entries_report_all" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_finance_statistic_report_statement" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager')])]" name="groups_id"/>
</record>
<record id="menu_finance_generic_reporting" model="ir.ui.menu">
<field eval="[(6,0,[ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
</record>
<!--record id="menu_finance_configuration" model="ir.ui.menu">
<field eval="[(6,0,[ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
</record-->
<record id="menu_finance_entries" model="ir.ui.menu">
<field eval="[(6,0,[ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
</record>
<!--record id="menu_analytic_accounting" model="ir.ui.menu">
<field eval="[(6,0,[ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
</record-->
<record id="account_move_comp_rule" model="ir.rule">
<field name="name">Account Entry</field>
<field ref="model_account_move" name="model_id"/>

View File

@ -20,14 +20,16 @@
"access_account_tax","account.tax","model_account_tax","account.group_account_invoice",1,0,0,0
"access_account_model","account.model","model_account_model","account.group_account_user",1,1,1,1
"access_account_model_line","account.model.line","model_account_model_line","account.group_account_user",1,1,1,1
"access_account_model_manager","account.model","model_account_model","account.group_account_manager",1,1,1,1
"access_account_model_line_manager","account.model.line","model_account_model_line","account.group_account_manager",1,1,1,1
"access_account_subscription","account.subscription","model_account_subscription","account.group_account_user",1,1,1,1
"access_account_subscription_line","account.subscription.line","model_account_subscription_line","account.group_account_user",1,1,1,1
"access_account_subscription_manager","account.subscription manager","model_account_subscription","account.group_account_manager",1,0,0,0
"access_account_subscription_line_manager","account.subscription.line manager","model_account_subscription_line","account.group_account_manager",1,0,0,0
"access_account_account_template","account.account.template","model_account_account_template","account.group_account_manager",1,0,0,0
"access_account_tax_code_template","account.tax.code.template","model_account_tax_code_template","account.group_account_manager",1,0,0,0
"access_account_account_template","account.account.template","model_account_account_template","account.group_account_manager",1,1,1,1
"access_account_tax_code_template","account.tax.code.template","model_account_tax_code_template","account.group_account_manager",1,1,1,1
"access_account_chart_template","account.chart.template","model_account_chart_template","account.group_account_manager",1,1,1,1
"access_account_tax_template","account.tax.template","model_account_tax_template","account.group_account_manager",1,0,0,0
"access_account_tax_template","account.tax.template","model_account_tax_template","account.group_account_manager",1,1,1,1
"access_account_bank_statement","account.bank.statement","model_account_bank_statement","account.group_account_user",1,0,0,0
"access_account_bank_statement_line","account.bank.statement.line","model_account_bank_statement_line","account.group_account_user",1,0,0,0
"access_account_analytic_line","account.analytic.line","model_account_analytic_line","account.group_account_user",1,1,1,1
@ -41,22 +43,22 @@
"access_account_move_line_uinvoice","account.move.line invoice","model_account_move_line","account.group_account_invoice",1,1,1,1
"access_account_move_reconcile_uinvoice","account.move.reconcile","model_account_move_reconcile","account.group_account_invoice",1,1,1,1
"access_account_journal_period_uinvoice","account.journal.period","model_account_journal_period","account.group_account_invoice",1,1,1,1
"access_account_payment_term_manager","account.payment.term","model_account_payment_term","account.group_account_manager",1,0,0,0
"access_account_payment_term_manager","account.payment.term","model_account_payment_term","account.group_account_manager",1,1,1,1
"access_account_payment_term_line_manager","account.payment.term.line","model_account_payment_term_line","account.group_account_manager",1,0,0,0
"access_account_account_type_manager","account.account.type","model_account_account_type","account.group_account_manager",1,0,0,0
"access_account_tax_manager","account.tax","model_account_tax","account.group_account_manager",1,0,0,0
"access_account_account_manager","account.account","model_account_account","account.group_account_manager",1,0,0,0
"access_account_journal_view_manager","account.journal.view","model_account_journal_view","account.group_account_manager",1,0,0,0
"access_account_account_type_manager","account.account.type","model_account_account_type","account.group_account_manager",1,1,1,1
"access_account_tax_manager","account.tax","model_account_tax","account.group_account_manager",1,1,1,1
"access_account_account_manager","account.account","model_account_account","account.group_account_manager",1,1,1,1
"access_account_journal_view_manager","account.journal.view","model_account_journal_view","account.group_account_manager",1,1,1,1
"access_account_journal_column_manager","account.journal.column","model_account_journal_column","account.group_account_manager",1,0,0,0
"access_account_journal_manager","account.journal","model_account_journal","account.group_account_manager",1,0,0,0
"access_account_journal_manager","account.journal","model_account_journal","account.group_account_manager",1,1,1,1
"access_account_journal_invoice","account.journal invoice","model_account_journal","account.group_account_invoice",1,0,0,0
"access_account_period_manager","account.period","model_account_period","account.group_account_manager",1,0,0,0
"access_account_period_manager","account.period","model_account_period","account.group_account_manager",1,1,1,1
"access_account_period_invoice","account.period invoice","model_account_period","account.group_account_invoice",1,0,0,0
"access_account_tax_code_manager","account.tax.code","model_account_tax_code","account.group_account_manager",1,0,0,0
"access_account_tax_code_manager","account.tax.code","model_account_tax_code","account.group_account_manager",1,1,1,1
"access_account_invoice_group_invoice","account.invoice group invoice","model_account_invoice","account.group_account_invoice",1,1,1,1
"access_account_analytic_account_manager","account.analytic.account","analytic.model_account_analytic_account","account.group_account_manager",1,0,0,0
"access_account_analytic_journal_manager","account.analytic.journal","model_account_analytic_journal","account.group_account_manager",1,0,0,0
"access_account_fiscalyear","account.fiscalyear","model_account_fiscalyear","account.group_account_manager",1,0,0,0
"access_account_analytic_account_manager","account.analytic.account","analytic.model_account_analytic_account","account.group_account_manager",1,1,1,1
"access_account_analytic_journal_manager","account.analytic.journal","model_account_analytic_journal","account.group_account_manager",1,1,1,1
"access_account_fiscalyear","account.fiscalyear","model_account_fiscalyear","account.group_account_manager",1,1,1,1
"access_account_fiscalyear_user","account.fiscalyear.user","model_account_fiscalyear","account.group_account_user",1,0,0,0
"access_account_fiscalyear_invoice","account.fiscalyear.invoice","model_account_fiscalyear","account.group_account_invoice",1,0,0,0
"access_account_fiscalyear_partner_manager","account.fiscalyear.partnermanager","model_account_fiscalyear","base.group_partner_manager",1,0,0,0
@ -68,13 +70,13 @@
"access_account_payment_term_line_partner_manager","account.payment.term.line partner manager","model_account_payment_term_line","base.group_user",1,0,0,0
"access_account_account_product_manager","account.account product manager","model_account_account","product.group_product_manager",1,0,0,0
"access_account_journal_product_manager","account.journal product manager","model_account_journal","product.group_product_manager",1,0,0,0
"access_account_fiscal_position_product_manager","account.fiscal.position account.manager","model_account_fiscal_position","account.group_account_manager",1,0,0,0
"access_account_fiscal_position_product_manager","account.fiscal.position account.manager","model_account_fiscal_position","account.group_account_manager",1,1,1,1
"access_account_fiscal_position_tax_product_manager","account.fiscal.position.tax account.manager","model_account_fiscal_position_tax","account.group_account_manager",1,0,0,0
"access_account_fiscal_position_account_product_manager","account.fiscal.position account.manager","model_account_fiscal_position_account","account.group_account_manager",1,0,0,0
"access_account_fiscal_position","account.fiscal.position all","model_account_fiscal_position","base.group_user",1,0,0,0
"access_account_fiscal_position_tax","account.fiscal.position.tax all","model_account_fiscal_position_tax","base.group_user",1,0,0,0
"access_account_fiscal_position_account","account.fiscal.position all","model_account_fiscal_position_account","base.group_user",1,0,0,0
"access_account_fiscal_position_template","account.fiscal.position.template","model_account_fiscal_position_template","account.group_account_manager",1,0,0,0
"access_account_fiscal_position_template","account.fiscal.position.template","model_account_fiscal_position_template","account.group_account_manager",1,1,1,1
"access_account_fiscal_position_tax_template","account.fiscal.position.tax.template","model_account_fiscal_position_tax_template","account.group_account_manager",1,0,0,0
"access_account_fiscal_position_account_template","account.fiscal.position.account.template","model_account_fiscal_position_account_template","account.group_account_manager",1,0,0,0
"access_account_sequence_fiscal_year","account.sequence.fiscalyear","model_account_sequence_fiscalyear","account.group_account_user",1,1,1,1
@ -149,8 +151,3 @@
"access_report_account_receivable_invoice","report.account.receivable.invoice","model_report_account_receivable","account.group_account_invoice",1,1,1,1
"access_report_account_receivable_user","report.account.receivable.user","model_report_account_receivable","account.group_account_user",1,1,1,1
"access_account_sequence_fiscal_year_invoice","account.sequence.fiscalyear invoice","model_account_sequence_fiscalyear","account.group_account_invoice",1,1,1,1
"access_account_analytic_journal_analytic_accounting","account.analytic.journal","model_account_analytic_journal","analytic.group_analytic_accounting",1,1,1,1
"access_account_account_analytic_accounting","account.account","model_account_account","analytic.group_analytic_accounting",1,0,0,0
"access_product_product_analytic_accounting","product.product","product.model_product_product","analytic.group_analytic_accounting",1,0,0,0
"access_product_category_analytic_accounting","product.category","product.model_product_category","analytic.group_analytic_accounting",1,0,0,0
"access_product_template_analytic_accounting","product.template","product.model_product_template","analytic.group_analytic_accounting",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
20 access_account_tax account.tax model_account_tax account.group_account_invoice 1 0 0 0
21 access_account_model account.model model_account_model account.group_account_user 1 1 1 1
22 access_account_model_line account.model.line model_account_model_line account.group_account_user 1 1 1 1
23 access_account_model_manager account.model model_account_model account.group_account_manager 1 1 1 1
24 access_account_model_line_manager account.model.line model_account_model_line account.group_account_manager 1 1 1 1
25 access_account_subscription account.subscription model_account_subscription account.group_account_user 1 1 1 1
26 access_account_subscription_line account.subscription.line model_account_subscription_line account.group_account_user 1 1 1 1
27 access_account_subscription_manager account.subscription manager model_account_subscription account.group_account_manager 1 0 0 0
28 access_account_subscription_line_manager account.subscription.line manager model_account_subscription_line account.group_account_manager 1 0 0 0
29 access_account_account_template account.account.template model_account_account_template account.group_account_manager 1 0 1 0 1 0 1
30 access_account_tax_code_template account.tax.code.template model_account_tax_code_template account.group_account_manager 1 0 1 0 1 0 1
31 access_account_chart_template account.chart.template model_account_chart_template account.group_account_manager 1 1 1 1
32 access_account_tax_template account.tax.template model_account_tax_template account.group_account_manager 1 0 1 0 1 0 1
33 access_account_bank_statement account.bank.statement model_account_bank_statement account.group_account_user 1 0 0 0
34 access_account_bank_statement_line account.bank.statement.line model_account_bank_statement_line account.group_account_user 1 0 0 0
35 access_account_analytic_line account.analytic.line model_account_analytic_line account.group_account_user 1 1 1 1
43 access_account_move_line_uinvoice account.move.line invoice model_account_move_line account.group_account_invoice 1 1 1 1
44 access_account_move_reconcile_uinvoice account.move.reconcile model_account_move_reconcile account.group_account_invoice 1 1 1 1
45 access_account_journal_period_uinvoice account.journal.period model_account_journal_period account.group_account_invoice 1 1 1 1
46 access_account_payment_term_manager account.payment.term model_account_payment_term account.group_account_manager 1 0 1 0 1 0 1
47 access_account_payment_term_line_manager account.payment.term.line model_account_payment_term_line account.group_account_manager 1 0 0 0
48 access_account_account_type_manager account.account.type model_account_account_type account.group_account_manager 1 0 1 0 1 0 1
49 access_account_tax_manager account.tax model_account_tax account.group_account_manager 1 0 1 0 1 0 1
50 access_account_account_manager account.account model_account_account account.group_account_manager 1 0 1 0 1 0 1
51 access_account_journal_view_manager account.journal.view model_account_journal_view account.group_account_manager 1 0 1 0 1 0 1
52 access_account_journal_column_manager account.journal.column model_account_journal_column account.group_account_manager 1 0 0 0
53 access_account_journal_manager account.journal model_account_journal account.group_account_manager 1 0 1 0 1 0 1
54 access_account_journal_invoice account.journal invoice model_account_journal account.group_account_invoice 1 0 0 0
55 access_account_period_manager account.period model_account_period account.group_account_manager 1 0 1 0 1 0 1
56 access_account_period_invoice account.period invoice model_account_period account.group_account_invoice 1 0 0 0
57 access_account_tax_code_manager account.tax.code model_account_tax_code account.group_account_manager 1 0 1 0 1 0 1
58 access_account_invoice_group_invoice account.invoice group invoice model_account_invoice account.group_account_invoice 1 1 1 1
59 access_account_analytic_account_manager account.analytic.account analytic.model_account_analytic_account account.group_account_manager 1 0 1 0 1 0 1
60 access_account_analytic_journal_manager account.analytic.journal model_account_analytic_journal account.group_account_manager 1 0 1 0 1 0 1
61 access_account_fiscalyear account.fiscalyear model_account_fiscalyear account.group_account_manager 1 0 1 0 1 0 1
62 access_account_fiscalyear_user account.fiscalyear.user model_account_fiscalyear account.group_account_user 1 0 0 0
63 access_account_fiscalyear_invoice account.fiscalyear.invoice model_account_fiscalyear account.group_account_invoice 1 0 0 0
64 access_account_fiscalyear_partner_manager account.fiscalyear.partnermanager model_account_fiscalyear base.group_partner_manager 1 0 0 0
70 access_account_payment_term_line_partner_manager account.payment.term.line partner manager model_account_payment_term_line base.group_user 1 0 0 0
71 access_account_account_product_manager account.account product manager model_account_account product.group_product_manager 1 0 0 0
72 access_account_journal_product_manager account.journal product manager model_account_journal product.group_product_manager 1 0 0 0
73 access_account_fiscal_position_product_manager account.fiscal.position account.manager model_account_fiscal_position account.group_account_manager 1 0 1 0 1 0 1
74 access_account_fiscal_position_tax_product_manager account.fiscal.position.tax account.manager model_account_fiscal_position_tax account.group_account_manager 1 0 0 0
75 access_account_fiscal_position_account_product_manager account.fiscal.position account.manager model_account_fiscal_position_account account.group_account_manager 1 0 0 0
76 access_account_fiscal_position account.fiscal.position all model_account_fiscal_position base.group_user 1 0 0 0
77 access_account_fiscal_position_tax account.fiscal.position.tax all model_account_fiscal_position_tax base.group_user 1 0 0 0
78 access_account_fiscal_position_account account.fiscal.position all model_account_fiscal_position_account base.group_user 1 0 0 0
79 access_account_fiscal_position_template account.fiscal.position.template model_account_fiscal_position_template account.group_account_manager 1 0 1 0 1 0 1
80 access_account_fiscal_position_tax_template account.fiscal.position.tax.template model_account_fiscal_position_tax_template account.group_account_manager 1 0 0 0
81 access_account_fiscal_position_account_template account.fiscal.position.account.template model_account_fiscal_position_account_template account.group_account_manager 1 0 0 0
82 access_account_sequence_fiscal_year account.sequence.fiscalyear model_account_sequence_fiscalyear account.group_account_user 1 1 1 1
151 access_report_account_receivable_invoice report.account.receivable.invoice model_report_account_receivable account.group_account_invoice 1 1 1 1
152 access_report_account_receivable_user report.account.receivable.user model_report_account_receivable account.group_account_user 1 1 1 1
153 access_account_sequence_fiscal_year_invoice account.sequence.fiscalyear invoice model_account_sequence_fiscalyear account.group_account_invoice 1 1 1 1
access_account_analytic_journal_analytic_accounting account.analytic.journal model_account_analytic_journal analytic.group_analytic_accounting 1 1 1 1
access_account_account_analytic_accounting account.account model_account_account analytic.group_analytic_accounting 1 0 0 0
access_product_product_analytic_accounting product.product product.model_product_product analytic.group_analytic_accounting 1 0 0 0
access_product_category_analytic_accounting product.category product.model_product_category analytic.group_analytic_accounting 1 0 0 0
access_product_template_analytic_accounting product.template product.model_product_template analytic.group_analytic_accounting 1 0 0 0

View File

@ -21,7 +21,6 @@
import time
import netsvc
from osv import osv, fields
from tools.translate import _
@ -150,12 +149,12 @@ class account_automatic_reconcile(osv.osv_memory):
for account_id in form['account_ids']:
params = (account_id,)
if not allow_write_off:
query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL
AND state <> 'draft' GROUP BY partner_id
query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL
AND state <> 'draft' GROUP BY partner_id
HAVING ABS(SUM(debit-credit)) = 0.0 AND count(*)>0"""
else:
query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL
AND state <> 'draft' GROUP BY partner_id
query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL
AND state <> 'draft' GROUP BY partner_id
HAVING ABS(SUM(debit-credit)) < %s AND count(*)>0"""
params += (max_amount,)
# reconcile automatically all transactions from partners whose balance is 0

View File

@ -202,14 +202,11 @@ class account_invoice_refund(osv.osv_memory):
inv_obj.write(cr, uid, [inv_id], data['value'])
created_inv.append(inv_id)
if inv.type == 'out_invoice':
xml_id = 'action_invoice_tree1'
elif inv.type == 'in_invoice':
xml_id = 'action_invoice_tree2'
elif inv.type == 'out_refund':
if inv.type in ('out_invoice', 'out_refund'):
xml_id = 'action_invoice_tree3'
else:
xml_id = 'action_invoice_tree4'
result = mod_obj._get_id(cr, uid, 'account', xml_id)
id = mod_obj.read(cr, uid, result, ['res_id'], context=context)['res_id']
result = act_obj.read(cr, uid, id, context=context)

View File

@ -43,7 +43,7 @@ class account_move_journal(osv.osv_memory):
"""
journal_id = False
journal_pool = self.pool.get('account.journal')
if context.get('journal_type', False):
jids = journal_pool.search(cr, uid, [('type','=', context.get('journal_type'))])
@ -52,7 +52,7 @@ class account_move_journal(osv.osv_memory):
journal_id = jids[0]
return journal_id
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
"""
Returns views and fields for current model where view will depend on {view_type}.
@ -62,7 +62,7 @@ class account_move_journal(osv.osv_memory):
@param view_type: defines a view type. it can be one of (form, tree, graph, calender, gantt, search, mdx)
@param context: context arguments, like lang, time zone
@param toolbar: contains a list of reports, wizards, and links related to current model
@return: Returns a dict that contains definition for fields, views, and toolbars
"""
@ -115,47 +115,47 @@ class account_move_journal(osv.osv_memory):
@param ids: account move journals ID or list of IDs
@return: dictionary of Open action move line window on given period and Journal/Payment Mode
"""
period_pool = self.pool.get('account.journal.period')
data_pool = self.pool.get('ir.model.data')
journal_pool = self.pool.get('account.journal')
if context is None:
context = {}
journal_id = self._get_journal(cr, uid, context)
period_id = self._get_period(cr, uid, context)
name = _("Journal Items")
if journal_id:
ids = period_pool.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)], context=context)
if not len(ids):
if not ids:
journal = journal_pool.browse(cr, uid, journal_id)
period = self.pool.get('account.period').browse(cr, uid, period_id)
name = journal.name
state = period.state
if state == 'done':
raise osv.except_osv(_('UserError'), _('This period is already closed !'))
company = period.company_id.id
res = {
'name': name,
'period_id': period_id,
'journal_id': journal_id,
'name': name,
'period_id': period_id,
'journal_id': journal_id,
'company_id': company
}
period_pool.create(cr, uid, res,context=context)
ids = period_pool.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)],context=context)
period = period_pool.browse(cr, uid, ids[0], context=context)
name = (period.journal_id.code or '') + ':' + (period.period_id.code or '')
result = data_pool._get_id(cr, uid, 'account', 'view_account_move_line_filter')
res_id = data_pool.browse(cr, uid, result, context=context).res_id
return {
'name': name,
'view_type': 'form',
@ -166,7 +166,7 @@ class account_move_journal(osv.osv_memory):
'type': 'ir.actions.act_window',
'search_view_id': res_id
}
account_move_journal()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -21,17 +21,8 @@
<field name="context">{'journal_type':'sale','view_mode':False}</field>
<field name="target">new</field>
</record>
<menuitem action="action_account_moves_sale" sequence="16" id="menu_eaction_account_moves_sale" parent="menu_finance_receivables" icon="STOCK_JUSTIFY_FILL" groups="group_account_user,group_account_manager"/>
<!-- <record id="action_account_moves_purchase_refund" model="ir.actions.act_window">-->
<!-- <field name="name">Journal Refund Items</field>-->
<!-- <field name="res_model">account.move.journal</field>-->
<!-- <field name="view_type">form</field>-->
<!-- <field name="view_id" ref="view_account_move_journal_form"/>-->
<!-- <field name="context">{'journal_type':'purchase_refund'}</field>-->
<!-- <field name="target">new</field>-->
<!-- </record>-->
<!-- <menuitem action="action_account_moves_purchase_refund" sequence="5" id="menu_eaction_account_moves_purchase_refund" parent="menu_finance_receivables" icon="STOCK_JUSTIFY_FILL"/>-->
<menuitem action="action_account_moves_sale" sequence="16" id="menu_eaction_account_moves_sale"
parent="menu_finance_receivables" icon="STOCK_JUSTIFY_FILL" groups="group_account_user,group_account_manager"/>
<record id="action_account_moves_purchase" model="ir.actions.act_window">
<field name="name">Journal Items</field>
@ -48,16 +39,6 @@
sequence="16"
groups="group_account_user,group_account_manager"/>
<!-- <record id="action_account_moves_sale_refund" model="ir.actions.act_window">-->
<!-- <field name="name">Journal Refund Items</field>-->
<!-- <field name="res_model">account.move.journal</field>-->
<!-- <field name="view_type">form</field>-->
<!-- <field name="view_id" ref="view_account_move_journal_form"/>-->
<!-- <field name="context">{'journal_type':'sale_refund'}</field>-->
<!-- <field name="target">new</field>-->
<!-- </record>-->
<!-- <menuitem action="action_account_moves_sale_refund" sequence="5" id="menu_eaction_account_moves_sale_refund" parent="menu_finance_payables" icon="STOCK_JUSTIFY_FILL"/>-->
<record id="action_account_moves_bank" model="ir.actions.act_window">
<field name="name">Journal Items</field>
<field name="res_model">account.move.journal</field>

View File

@ -58,8 +58,7 @@
<field name="writeoff_acc_id" domain="[('type', '&lt;&gt;', 'view')]"/>
<field name="date_p"/>
<field name="comment"/>
<separator string="Analytic" colspan="4"/>
<field name="analytic_id"/>
<field name="analytic_id" groups="analytic.group_analytic_accounting"/>
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>

View File

@ -21,21 +21,15 @@
from lxml import etree
from osv import osv, fields
from osv import osv
class account_balance_report(osv.osv_memory):
_inherit = "account.common.account.report"
_name = 'account.balance.report'
_description = 'Trial Balance Report'
_columns = {
'target_move': fields.selection([('all', 'All Entries'),
('posted', 'All Posted Entries')], 'Target Moves', required=True),
}
_defaults = {
'journal_ids': [],
'target_move': 'all'
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
@ -51,7 +45,6 @@ class account_balance_report(osv.osv_memory):
def _print_report(self, cr, uid, ids, data, context=None):
data = self.pre_print_report(cr, uid, ids, data, context=context)
data['form'].update(self.read(cr, uid, ids, ['target_move'])[0])
return {'type': 'ir.actions.report.xml', 'report_name': 'account.account.balance', 'datas': data}
account_balance_report()

View File

@ -9,9 +9,8 @@
<field name="type">form</field>
<field name="inherit_id" ref="account_common_report_view" />
<field name="arch" type="xml">
<field name="fiscalyear_id" position="after">
<field name="target_move" position="after">
<field name="display_account"/>
<field name="target_move"/>
<newline/>
</field>
</field>

View File

@ -40,7 +40,7 @@ class account_aged_trial_balance(osv.osv_memory):
}
_defaults = {
'period_length': 30,
'date_from' : time.strftime('%Y-%m-%d'),
'date_from': time.strftime('%Y-%m-%d'),
'direction_selection': 'past',
}
@ -84,7 +84,7 @@ class account_aged_trial_balance(osv.osv_memory):
for i in range(5):
stop = start + relativedelta(days=period_length)
res[str(5-(i+1))] = {
'name' : (i!=4 and str((i) * period_length)+'-' + str((i+1) * period_length) or ('+'+str(4 * period_length))),
'name': (i!=4 and str((i) * period_length)+'-' + str((i+1) * period_length) or ('+'+str(4 * period_length))),
'start': start.strftime('%Y-%m-%d'),
'stop': (i!=4 and stop.strftime('%Y-%m-%d') or False),
}

View File

@ -17,7 +17,6 @@
<newline/>
<field name="result_selection"/>
<field name="direction_selection"/>
<field name="target_move"/>
<field name="journal_ids"/>
<newline/>
<separator colspan="4"/>

View File

@ -36,14 +36,11 @@ class account_bs_report(osv.osv_memory):
'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 trasfering Profit/Loss(If It is Profit : Amount will be added, Loss : Amount will be duducted.), Which is calculated from Profilt & Loss Report', domain = [('type','=','payable')]),
'target_move': fields.selection([('all', 'All Entries'),
('posted', 'All Posted Entries')], 'Target Moves', required=True),
}
_defaults={
'display_type': True,
'journal_ids': [],
'target_move': 'all',
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
@ -65,7 +62,7 @@ class account_bs_report(osv.osv_memory):
if not account.company_id.property_reserve_and_surplus_account:
raise osv.except_osv(_('Warning'),_('Please define the Reserve and Profit/Loss account for current user company !'))
data['form']['reserve_account_id'] = account.company_id.property_reserve_and_surplus_account.id
data['form'].update(self.read(cr, uid, ids, ['display_type','target_move'])[0])
data['form'].update(self.read(cr, uid, ids, ['display_type'])[0])
if data['form']['display_type']:
return {
'type': 'ir.actions.report.xml',

View File

@ -8,9 +8,8 @@
<field name="type">form</field>
<field name="inherit_id" ref="account.account_common_report_view" />
<field name="arch" type="xml">
<field name="fiscalyear_id" position="after">
<field name="target_move" position="after">
<field name="display_account"/>
<field name="target_move"/>
<field name="display_type"/>
<field name="reserve_account_id" required="0" invisible="1"/>
<newline/>
@ -31,6 +30,7 @@
<menuitem icon="STOCK_PRINT"
name="Balance Sheet"
action="action_account_bs_report"
groups="group_account_user"
id="menu_account_bs_report"
parent="final_accounting_reports"/>

View File

@ -18,7 +18,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import osv, fields
from osv import osv
class account_central_journal(osv.osv_memory):
_name = 'account.central.journal'

View File

@ -8,7 +8,7 @@
<field name="inherit_id" ref="account_common_report_view" />
<field name="type">form</field>
<field name="arch" type="xml">
<field name="fiscalyear_id" position="after">
<field name="target_move" position="after">
<field name="amount_currency"/>
<newline/>
</field>

View File

@ -40,7 +40,10 @@ class account_common_report(osv.osv_memory):
'journal_ids': fields.many2many('account.journal', 'account_common_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
'date_from': fields.date("Start Date"),
'date_to': fields.date("End Date"),
}
'target_move': fields.selection([('all', 'All Entries'),
('posted', 'All Posted Entries')], 'Target Moves', required=True),
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
mod_obj = self.pool.get('ir.model.data')
@ -101,6 +104,7 @@ class account_common_report(osv.osv_memory):
'journal_ids': _get_all_journal,
'filter': 'filter_no',
'chart_account_id': _get_account,
'target_move': 'all',
}
def _build_contexts(self, cr, uid, ids, data, context=None):
@ -118,7 +122,8 @@ class account_common_report(osv.osv_memory):
elif data['form']['filter'] == 'filter_period':
if not data['form']['period_from'] or not data['form']['period_to']:
raise osv.except_osv(_('Error'),_('Select a starting and an ending period'))
result['periods'] = period_obj.build_ctx_periods(cr, uid, data['form']['period_from'], data['form']['period_to'])
result['period_from'] = data['form']['period_from']
result['period_to'] = data['form']['period_to']
return result
def _print_report(self, cr, uid, ids, data, context=None):
@ -131,7 +136,7 @@ class account_common_report(osv.osv_memory):
data = {}
data['ids'] = context.get('active_ids', [])
data['model'] = context.get('active_model', 'ir.ui.menu')
data['form'] = self.read(cr, uid, ids, ['date_from', 'date_to', 'fiscalyear_id', 'journal_ids', 'period_from', 'period_to', 'filter', 'chart_account_id'])[0]
data['form'] = self.read(cr, uid, ids, ['date_from', 'date_to', 'fiscalyear_id', 'journal_ids', 'period_from', 'period_to', 'filter', 'chart_account_id', 'target_move'])[0]
used_context = self._build_contexts(cr, uid, ids, data, context=context)
data['form']['periods'] = used_context.get('periods', False) and used_context['periods'] or []
data['form']['used_context'] = used_context

View File

@ -30,19 +30,16 @@ class account_common_partner_report(osv.osv_memory):
('supplier','Payable Accounts'),
('customer_supplier' ,'Receivable and Payable Accounts')],
"Partner's", required=True),
'target_move': fields.selection([('all', 'All Entries'),
('posted', 'All Posted Entries')], 'Target Moves', required=True),
}
_defaults = {
'result_selection': 'customer',
'target_move': 'all'
}
def pre_print_report(self, cr, uid, ids, data, context=None):
if context is None:
context = {}
data['form'].update(self.read(cr, uid, ids, ['result_selection', 'target_move'])[0])
data['form'].update(self.read(cr, uid, ids, ['result_selection'])[0])
return data
account_common_partner_report()

View File

@ -10,6 +10,7 @@
<form string="Report Options">
<field name="chart_account_id" widget='selection'/>
<field name="fiscalyear_id"/>
<field name="target_move"/>
<notebook tabpos="up" colspan="4">
<page string="Filters" name="filters">
<field name="filter" on_change="onchange_filter(filter, fiscalyear_id)" colspan="4"/>

View File

@ -8,7 +8,7 @@
<field name="type">form</field>
<field name="inherit_id" ref="account_common_report_view" />
<field name="arch" type="xml">
<field name="fiscalyear_id" position="after">
<field name="target_move" position="after">
<field name="amount_currency"/>
<newline/>
</field>

View File

@ -32,15 +32,12 @@ class account_report_general_ledger(osv.osv_memory):
help='It adds initial balance row on report which display previous sum amount of debit/credit/balance'),
'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),
'target_move': fields.selection([('all', 'All Entries'),
('posted', 'All Posted Entries')], 'Target Moves', required=True),
}
_defaults = {
'landscape': True,
'amount_currency': True,
'sortby': 'sort_date',
'initial_balance': False,
'target_move': 'all',
}
def onchange_fiscalyear(self, cr, uid, ids, fiscalyear=False, context=None):
@ -53,7 +50,7 @@ class account_report_general_ledger(osv.osv_memory):
if context is None:
context = {}
data = self.pre_print_report(cr, uid, ids, data, context=context)
data['form'].update(self.read(cr, uid, ids, ['landscape', 'initial_balance', 'amount_currency', 'sortby', 'target_move'])[0])
data['form'].update(self.read(cr, uid, ids, ['landscape', 'initial_balance', 'amount_currency', 'sortby'])[0])
if not data['form']['fiscalyear_id']:# GTK client problem onchange does not consider in save record
data['form'].update({'initial_balance': False})
if data['form']['landscape']:

View File

@ -8,9 +8,8 @@
<field name="type">form</field>
<field name="inherit_id" ref="account_common_report_view" />
<field name="arch" type="xml">
<field name="fiscalyear_id" position="after">
<field name="target_move" position="after">
<field name="display_account"/>
<field name="target_move"/>
<field name="sortby"/>
<field name="landscape"/>
<field name="initial_balance" attrs="{'readonly':[('fiscalyear_id','=', False)]}"/>
@ -57,6 +56,7 @@
name="General Ledger"
parent="account.final_accounting_reports"
action="action_account_general_ledger_menu"
groups="group_account_manager"
id="menu_general_ledger"
/>

View File

@ -29,8 +29,6 @@ class account_partner_balance(osv.osv_memory):
_name = 'account.partner.balance'
_description = 'Print Account Partner Balance'
_columns = {
# 'initial_balance': fields.boolean('Include Initial Balances'
# ,help='It adds initial balance row on report which display previous sum amount of debit/credit/balance'),
'display_partner': fields.selection([('non-zero_balance', 'With balance is not equal to 0'), ('all', 'All Partners')]
,'Display Partners'),
}

View File

@ -8,11 +8,9 @@
<field name="type">form</field>
<field name="inherit_id" ref="account_common_report_view" />
<field name="arch" type="xml">
<field name="fiscalyear_id" position="after">
<field name="target_move" position="after">
<field name="result_selection"/>
<!-- <field name="initial_balance"/> -->
<field name="display_partner"/>
<field name="target_move"/>
<newline/>
</field>
</field>

View File

@ -8,9 +8,8 @@
<field name="type">form</field>
<field name="inherit_id" ref="account_common_report_view" />
<field name="arch" type="xml">
<field name="fiscalyear_id" position="after">
<field name="target_move" position="after">
<field name="result_selection"/>
<field name="target_move"/>
<field name="initial_balance"/>
<field name="reconcil"/>
<field name="amount_currency"/>
@ -35,6 +34,7 @@
<menuitem icon="STOCK_PRINT"
name="Partner Ledger"
action="action_account_partner_ledger"
groups="group_account_manager"
id="menu_account_partner_ledger"
parent="account.next_id_22"/>

View File

@ -30,19 +30,16 @@ class account_print_journal(osv.osv_memory):
'sort_selection': fields.selection([('date', 'Date'),
('ref', 'Reference Number'),],
'Entries Sorted By', required=True),
'target_move': fields.selection([('all', 'All Entries'),
('posted', 'All Posted Entries')], 'Target Moves', required=True)
}
_defaults = {
'sort_selection': 'date',
'target_move': 'all'
}
def _print_report(self, cr, uid, ids, data, context=None):
if context is None:
context = {}
data = self.pre_print_report(cr, uid, ids, data, context=context)
data['form'].update(self.read(cr, uid, ids, ['sort_selection','target_move'])[0])
data['form'].update(self.read(cr, uid, ids, ['sort_selection'])[0])
return {'type': 'ir.actions.report.xml', 'report_name': 'account.journal.period.print', 'datas': data}
account_print_journal()

View File

@ -8,9 +8,8 @@
<field name="type">form</field>
<field name="inherit_id" ref="account_common_report_view" />
<field name="arch" type="xml">
<field name="fiscalyear_id" position="after">
<field name="target_move" position="after">
<field name="sort_selection"/>
<field name="target_move"/>
<field name="amount_currency"/>
<newline/>
</field>

View File

@ -37,6 +37,7 @@ class account_pl_report(osv.osv_memory):
_defaults = {
'display_type': True,
'journal_ids': [],
'target_move': False
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
@ -44,6 +45,10 @@ class account_pl_report(osv.osv_memory):
res = super(account_pl_report, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
doc = etree.XML(res['arch'])
nodes = doc.xpath("//field[@name='journal_ids']")
for node in nodes:
node.set('readonly', '1')
node.set('required', '0')
nodes = doc.xpath("//field[@name='target_move']")
for node in nodes:
node.set('readonly', '1')
node.set('required', '0')

View File

@ -34,12 +34,13 @@
<field name="target">new</field>
</record>
<menuitem
icon="STOCK_INDENT"
<menuitem
icon="STOCK_INDENT"
action="action_account_tax_chart"
id="menu_action_tax_code_tree"
parent="menu_finance_charts"
groups="group_account_user"
sequence="12"/>
</data>
</data>
</openerp>

View File

@ -10,7 +10,7 @@
<form string="Select Period">
<field name="company_id" groups="base.group_multi_company" widget='selection'/>
<newline/>
<field name="based_on"/>
<field name="based_on" invisible="1"/>
<newline/>
<separator string="Select Period(s)" colspan="4"/>
<field name="periods" nolabel="1" colspan="2"/>

View File

@ -23,19 +23,18 @@
"version" : "1.1",
"author" : "OpenERP SA",
"category": 'Generic Modules/Accounting',
"description": """Account Accountant: This module makes the account as an Invoicing system but not an
accounting one.
"description": """
Give access to the admin user to all accounting features like the journal
items and the chart of accounts.
""",
'website': 'http://www.openerp.com',
'init_xml': [],
"depends" : ["account"],
'update_xml': [
'account_security.xml',
],
'demo_xml': [
],
'test': [
'security/account_security.xml',
],
'demo_xml': [ ],
'test': [ ],
'installable': True,
'active': False,
'certificate': '',

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
</data>
</openerp>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="base.user_admin" model="res.users">
<field name="groups_ids" eval="[(4, ref('account.group_account_manager')),(4, ref('account.group_account_user'))]"/>
</record>
</data>
</openerp>

View File

@ -8,7 +8,7 @@
<field name="arch" type="xml">
<tree string="Analytic Defaults">
<field name="sequence"/>
<field name="analytic_id" required="1" domain="[('parent_id','!=',False)]"/>
<field name="analytic_id" required="0" domain="[('parent_id','!=',False)]" groups="analytic.group_analytic_accounting"/>
<field name="product_id"/>
<field name="partner_id"/>
<field name="user_id"/>
@ -25,7 +25,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Analytic Defaults">
<field name="analytic_id" required="1" domain="[('parent_id','!=',False)]"/>
<field name="analytic_id" required="1" domain="[('parent_id','!=',False)]" groups="analytic.group_analytic_accounting"/>
<field name="sequence"/>
<separator string="Conditions" colspan="4"/>
<field name="product_id"/>
@ -44,7 +44,7 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Accounts">
<field name="analytic_id"/>
<field name="analytic_id" groups="analytic.group_analytic_accounting"/>
<field name="product_id"/>
<field name="partner_id"/>
<field name="user_id"/>
@ -60,7 +60,7 @@
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_account_analytic_default_form_search"/>
</record>
<act_window
name="Entries"
id="act_account_acount_move_line_open"
@ -68,7 +68,7 @@
src_model="account.account"
context="{'search_default_account_id': [active_id]}"
/>
<menuitem
action="action_analytic_default_list"
id="menu_analytic_default_list"

View File

@ -64,7 +64,7 @@ class account_analytic_plan_line(osv.osv):
'plan_id':fields.many2one('account.analytic.plan','Analytic Plan'),
'name': fields.char('Plan Name', size=64, required=True, select=True),
'sequence':fields.integer('Sequence'),
'root_analytic_id': fields.many2one('account.analytic.account','Root Account',help="Root account of this plan.",required=True),
'root_analytic_id': fields.many2one('account.analytic.account','Root Account',help="Root account of this plan.",required=False),
'min_required': fields.float('Minimum Allowed (%)'),
'max_required': fields.float('Maximum Allowed (%)'),
}
@ -326,7 +326,7 @@ class account_move_line(osv.osv):
'journal_id': line.journal_id.analytic_journal_id.id,
'ref': line.ref,
}
ali_id=analytic_line_obj.create(cr, uid, al_vals, context=context)
analytic_line_obj.create(cr, uid, al_vals, context=context)
return True
account_move_line()

View File

@ -140,7 +140,7 @@
<field name="arch" type="xml">
<form string="Analytic Distribution Line">
<field name="plan_id"/>
<field name="analytic_account_id" groups="base.group_extended"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
<field name="rate"/>
</form>
</field>
@ -153,7 +153,7 @@
<field name="arch" type="xml">
<tree string="Analytic Distribution Lines">
<field name="plan_id" select="1"/>
<field name="analytic_account_id" select="1" groups="base.group_extended"/>
<field name="analytic_account_id" select="1" groups="analytic.group_analytic_accounting"/>
<field name="rate"/>
</tree>
</field>
@ -210,7 +210,7 @@
<form string="Analytic Plan Line">
<field name="name"/>
<field name="sequence"/>
<field name="root_analytic_id"/>
<field name="root_analytic_id" groups="analytic.group_analytic_accounting"/>
<newline/>
<field name="min_required"/>
<field name="max_required"/>
@ -226,7 +226,7 @@
<tree string="Analytic Plan Lines">
<field name="name" select="1"/>
<field name="sequence"/>
<field name="root_analytic_id"/>
<field name="root_analytic_id" groups="analytic.group_analytic_accounting"/>
<field name="min_required"/>
<field name="max_required"/>
</tree>

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