[MERGE] Merged with lp:~trunk-dev-addons2

bzr revid: ron@tinyerp.com-20101013110719-rk9mb03k7mfsk8fq
This commit is contained in:
ron@tinyerp.com
2010-10-13 16:37:19 +05:30
995 changed files with 36201 additions and 16357 deletions
+4 -5
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"
@@ -120,7 +120,6 @@ module named account_voucher.
'project/analytic_account_demo.xml',
'demo/account_minimal.xml',
'account_unit_test.xml',
'board_account_demo.xml',
],
'test': [
'test/account_customer_invoice.yml',
+140 -145
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':
@@ -280,7 +278,7 @@ class account_account(osv.osv):
# ON l.account_id = tmp.id
# or make _get_children_and_consol return a query and join on that
request = ("SELECT l.account_id as id, " +\
' , '.join(map(mapping.__getitem__, field_names)) +
', '.join(map(mapping.__getitem__, field_names)) +
" FROM account_move_line l" \
" WHERE l.account_id IN %s " \
+ filters +
@@ -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',
@@ -852,7 +838,7 @@ class account_period(osv.osv):
'date_start': fields.date('Start of Period', required=True, states={'done':[('readonly',True)]}),
'date_stop': fields.date('End of Period', required=True, states={'done':[('readonly',True)]}),
'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year', required=True, states={'done':[('readonly',True)]}, select=True),
'state': fields.selection([('draft','Draft'), ('done','Done')], 'State', readonly=True,
'state': fields.selection([('draft','Open'), ('done','Closed')], 'State', readonly=True,
help='When monthly periods are created. The state is \'Draft\'. At the end of monthly period it is in \'Done\' state.'),
'company_id': fields.related('fiscalyear_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True)
}
@@ -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:
@@ -1162,32 +1149,36 @@ class account_move(osv.osv):
]
def post(self, cr, uid, ids, context=None):
if context is None:
context = {}
invoice = context.get('invoice', False)
valid_moves = self.validate(cr, uid, ids, context)
if valid_moves:
for move in self.browse(cr, uid, valid_moves):
if move.name =='/':
new_name = False
journal = move.journal_id
if invoice and invoice.internal_number:
new_name = invoice.internal_number
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
journal = move.journal_id
if invoice and invoice.internal_number:
new_name = invoice.internal_number
else:
if journal.sequence_id:
c = {'fiscalyear_id': move.period_id.fiscalyear_id.id}
new_name = obj_sequence.get_id(cr, uid, journal.sequence_id.id, context=c)
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)
else:
raise osv.except_osv(_('Error'), _('No sequence defined in the journal !'))
raise osv.except_osv(_('Error'), _('No sequence defined on the journal !'))
if new_name:
self.write(cr, uid, [move.id], {'name':new_name})
if new_name:
self.write(cr, uid, [move.id], {'name':new_name})
cr.execute('UPDATE account_move '\
'SET state=%s '\
'WHERE id IN %s',
('posted', tuple(valid_moves),))
cr.execute('UPDATE account_move '\
'SET state=%s '\
'WHERE id IN %s',
('posted', tuple(valid_moves),))
else:
raise osv.except_osv(_('Integrity Error !'), _('You can not validate a non-balanced entry !\nMake sure you have configured Payment Term properly !\nIt should contain atleast one Payment Term Line with type "Balance" !'))
return True
def button_validate(self, cursor, user, ids, context=None):
@@ -1208,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),))
@@ -1276,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'),
@@ -1284,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
@@ -1359,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
@@ -1394,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'
@@ -1418,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)
@@ -1434,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
@@ -1480,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):
@@ -1531,20 +1524,21 @@ 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):
if context is None:
context = {}
move_state = ('posted', )
if context.get('state', False) == 'all':
if context.get('state', 'all') == 'all':
move_state = ('draft', 'posted', )
if context.get('fiscalyear_id', False):
fiscalyear_id = context['fiscalyear_id']
@@ -1570,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,
@@ -1604,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]
@@ -1654,11 +1650,11 @@ class account_tax(osv.osv):
_columns = {
'name': fields.char('Tax Name', size=64, required=True, translate=True, help="This name will be displayed on reports"),
'sequence': fields.integer('Sequence', required=True, help="The sequence field is used to order the tax lines from the lowest sequences to the higher ones. The order is important if you have a tax with several tax children. In this case, the evaluation order is important."),
'amount': fields.float('Amount', required=True, digits=(14,4), help="For Tax Type percent enter % ratio between 0-1."),
'amount': fields.float('Amount', required=True, digits_compute=dp.get_precision('Account'), help="For taxes of type percentage, enter % ratio between 0-1."),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the tax without removing it."),
'type': fields.selection( [('percent','Percent'), ('fixed','Fixed'), ('none','None'), ('code','Python Code'),('balance','Balance')], 'Tax Type', required=True,
'type': fields.selection( [('percent','Percentage'), ('fixed','Fixed Amount'), ('none','None'), ('code','Python Code'), ('balance','Balance')], 'Tax Type', required=True,
help="The computation method for the tax amount."),
'applicable_type': fields.selection( [('true','True'), ('code','Python Code')], 'Applicable Type', required=True,
'applicable_type': fields.selection( [('true','Always'), ('code','Given by Python Code')], 'Applicability', required=True,
help="If not applicable (computed through a Python code), the tax won't appear on the invoice."),
'domain':fields.char('Domain', size=32, help="This field is only used if you develop your own module allowing developers to create specific taxes in a custom domain."),
'account_collected_id':fields.many2one('account.account', 'Invoice Tax Account'),
@@ -1669,7 +1665,6 @@ class account_tax(osv.osv):
'python_compute':fields.text('Python Code'),
'python_compute_inv':fields.text('Python Code (reverse)'),
'python_applicable':fields.text('Python Code'),
'tax_group': fields.selection([('vat','VAT'),('other','Other')], 'Tax Group', help="If a default tax is given in the partner it only overrides taxes from accounts (or products) in the same group."),
#
# Fields used for the VAT declaration
@@ -1696,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
@@ -1738,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):
@@ -1753,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,
@@ -1762,7 +1757,6 @@ class account_tax(osv.osv):
'active': 1,
'type_tax_use': 'all',
'sequence': 1,
'tax_group': 'vat',
'ref_tax_sign': 1,
'ref_base_sign': 1,
'tax_sign': 1,
@@ -1774,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)
@@ -1786,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':
@@ -1817,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']
@@ -1826,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
@@ -1870,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
@@ -1878,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,
@@ -1902,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
@@ -1937,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']
@@ -1967,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
@@ -1996,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:
@@ -2018,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 = {
@@ -2162,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
@@ -2172,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
@@ -2207,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)
@@ -2245,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 "\
@@ -2265,7 +2263,7 @@ class account_account_template(osv.osv):
_defaults = {
'reconcile': False,
'type' : 'view',
'type': 'view',
'nocreate': False,
}
@@ -2276,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 = []
@@ -2334,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):
@@ -2354,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"),
}
@@ -2364,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]
@@ -2396,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()
@@ -2421,7 +2419,6 @@ class account_tax_template(osv.osv):
'python_compute':fields.text('Python Code'),
'python_compute_inv':fields.text('Python Code (reverse)'),
'python_applicable':fields.text('Python Code'),
'tax_group': fields.selection([('vat','VAT'),('other','Other')], 'Tax Group', help="If a default tax if given in the partner it only override taxes from account (or product) of the same group."),
#
# Fields used for the VAT declaration
@@ -2443,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):
@@ -2458,13 +2455,12 @@ 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,
'sequence': 1,
'tax_group': 'vat',
'ref_tax_sign': 1,
'ref_base_sign': 1,
'tax_sign': 1,
@@ -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
@@ -2609,7 +2605,6 @@ class wizard_multi_charts_accounts(osv.osv_memory):
'python_compute': tax.python_compute,
'python_compute_inv': tax.python_compute_inv,
'python_applicable': tax.python_applicable,
'tax_group':tax.tax_group,
'base_code_id': tax.base_code_id and ((tax.base_code_id.id in tax_code_template_ref) and tax_code_template_ref[tax.base_code_id.id]) or False,
'tax_code_id': tax.tax_code_id and ((tax.tax_code_id.id in tax_code_template_ref) and tax_code_template_ref[tax.tax_code_id.id]) or False,
'base_sign': tax.base_sign,
@@ -2675,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]
@@ -2726,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
@@ -2743,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,
@@ -2820,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)
@@ -2865,4 +2861,3 @@ class account_bank_accounts_wizard(osv.osv_memory):
account_bank_accounts_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+34 -15
View File
@@ -31,12 +31,12 @@ class account_analytic_line(osv.osv):
_inherit = 'account.analytic.line'
_description = 'Analytic Line'
_columns = {
'product_uom_id' : fields.many2one('product.uom', 'UoM'),
'product_id' : fields.many2one('product.product', 'Product'),
'general_account_id' : fields.many2one('account.account', 'General Account', required=True, ondelete='cascade'),
'move_id' : fields.many2one('account.move.line', 'Move Line', ondelete='cascade', select=True),
'journal_id' : fields.many2one('account.analytic.journal', 'Analytic Journal', required=True, ondelete='cascade', select=True),
'code' : fields.char('Code', size=8),
'product_uom_id': fields.many2one('product.uom', 'UoM'),
'product_id': fields.many2one('product.product', 'Product'),
'general_account_id': fields.many2one('account.account', 'General Account', required=True, ondelete='cascade'),
'move_id': fields.many2one('account.move.line', 'Move Line', ondelete='cascade', select=True),
'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal', required=True, ondelete='cascade', select=True),
'code': fields.char('Code', size=8),
'ref': fields.char('Ref.', size=64),
'currency_id': fields.related('move_id', 'currency_id', type='many2one', relation='res.currency', string='Account currency', store=True, help="The related account currency if not equal to the company one.", readonly=True),
'amount_currency': fields.related('move_id', 'amount_currency', type='float', string='Amount currency', store=True, help="The amount expressed in the related account currency if not equal to the company one.", readonly=True),
@@ -75,6 +75,9 @@ class account_analytic_line(osv.osv):
unit=False, journal_id=False, context=None):
if context==None:
context={}
if not journal_id:
j_ids = self.pool.get('account.analytic.journal').search(cr, uid, [('type','=','purchase')])
j_id = j_ids and j_ids[0] or False
if not journal_id or not prod_id:
return {}
product_obj = self.pool.get('product.product')
@@ -85,8 +88,8 @@ class account_analytic_line(osv.osv):
company_id = j_id.company_id.id
result = 0.0
is_purchase = False
if j_id.type == 'purchase':
if j_id.type <> 'sale':
a = prod.product_tmpl_id.property_account_expense.id
if not a:
a = prod.categ_id.property_account_expense_categ.id
@@ -109,13 +112,29 @@ class account_analytic_line(osv.osv):
(prod.name, prod_id,))
amount_unit = prod.price_get('list_price', context)[prod_id]
prec = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
amount = amount_unit * quantity or 1.0
result = round(amount, prec)
if is_purchase:
result *= -1
return {
'value': {
if not company_id:
company_id=company_obj._company_default_get(cr, uid, 'account.analytic.line', context)
flag = False
# Compute based on pricetype
product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','standard_price')], context)
pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context)[0]
if journal_id:
journal = analytic_journal_obj.browse(cr, uid, journal_id)
if journal.type == 'sale':
product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','list_price')], context)
if product_price_type_ids:
pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context)[0]
# Take the company currency as the reference one
if pricetype.field == 'list_price':
flag = True
amount_unit = prod.price_get(pricetype.field, context)[prod.id]
amount = amount_unit*unit_amount or 1.0
prec = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
amount = amount_unit*unit_amount or 1.0
result = round(amount, prec)
if not flag:
result *= -1
return {'value': {
'amount': result,
'general_account_id': a,
}
+5 -5
View File
@@ -21,9 +21,7 @@
import time
import netsvc
from osv import fields, osv
from tools.misc import currency
from tools.translate import _
import decimal_precision as dp
@@ -55,6 +53,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,
@@ -222,11 +221,11 @@ class account_bank_statement(osv.osv):
account_move_line_obj = self.pool.get('account.move.line')
account_analytic_line_obj = self.pool.get('account.analytic.line')
account_bank_statement_line_obj = self.pool.get('account.bank.statement.line')
st_line = account_bank_statement_line_obj.browse(cr, uid, st_line_id, context)
st = st_line.statement_id
context.update({'date': st_line.date})
move_id = account_move_obj.create(cr, uid, {
'journal_id': st.journal_id.id,
'period_id': st.period_id.id,
@@ -242,6 +241,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 +282,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
@@ -501,4 +501,4 @@ class account_bank_statement_line(osv.osv):
account_bank_statement_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+22 -18
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
@@ -150,15 +151,14 @@ class account_cash_statement(osv.osv):
res[r] = round(res[r], 2)
return res
def _get_company(self, cr, uid, context={}):
def _get_company(self, cr, uid, context=None):
user_pool = self.pool.get('res.users')
company_pool = self.pool.get('res.company')
user = user_pool.browse(cr, uid, uid, context)
company_id = user.company_id and user.company_id.id
user = user_pool.browse(cr, uid, uid, context=context)
company_id = user.company_id
if not company_id:
company_id = company_pool.search(cr, uid, [])[0]
return company_id
company_id = company_pool.search(cr, uid, [])
return company_id and company_id[0] or False
def _get_cash_open_box_lines(self, cr, uid, context={}):
res = []
@@ -228,7 +228,7 @@ class account_cash_statement(osv.osv):
'balance_end_cash': fields.function(_balance_end_cash, method=True, store=True, string='Balance', help="Closing balance based on cashBox"),
'starting_details_ids': fields.one2many('account.cashbox.line', 'starting_id', string='Opening Cashbox'),
'ending_details_ids': fields.one2many('account.cashbox.line', 'ending_id', string='Closing Cashbox'),
'name': fields.char('Name', size=64, required=True, states={'draft': [('readonly', False)]}, readonly=True, help='if you give the Name other then / , its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself'),
'name': fields.char('Name', size=64, required=True, states={'draft': [('readonly', False)]}, readonly=True, help='if you give the Name other then /, its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself'),
'user_id':fields.many2one('res.users', 'Responsible', required=False),
}
_defaults = {
@@ -247,9 +247,15 @@ class account_cash_statement(osv.osv):
open_jrnl = self.search(cr, uid, sql)
if open_jrnl:
raise osv.except_osv('Error', _('You can not have two open register for the same journal'))
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 +266,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,16 +376,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={}):
done = []
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):
ids = []
for line in st.line_ids:
ids += [x.id for x in line.move_ids]
self.pool.get('account.move').unlink(cr, uid, ids, context)
done.append(st.id)
self.write(cr, uid, done, {'state':'draft'}, context=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:
+1 -1
View File
@@ -6,8 +6,8 @@
<field name="name">Close a Period</field>
<field name="res_model">account.period</field>
<field name="view_type">form</field>
<field name="domain">[('state','=','draft')]</field>
<field name="view_id" ref="view_account_period_tree"/>
<field name="context">{'search_default_draft': 1}</field>
<field name="help"> After closing a period, you will no longer be able to post entries to the period once it has been closed.</field>
</record>
<menuitem
+9 -9
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="">
<tree editable="bottom" string="Your bank and cash accounts">
<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>
+28 -28
View File
@@ -35,11 +35,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>
@@ -54,16 +54,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>
@@ -84,7 +82,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>
@@ -99,7 +97,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"/>
@@ -147,7 +145,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"/>
@@ -155,7 +153,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/>
@@ -210,11 +208,11 @@
<field name="state"/>
<field name="residual"/>
<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_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="terp-stock_effects-object-colorize"/>
<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>
@@ -235,14 +233,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>
@@ -264,7 +262,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/>
@@ -306,10 +304,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>
@@ -354,15 +352,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"/>
@@ -452,7 +450,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>
@@ -460,7 +458,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"/>
@@ -491,7 +489,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>
@@ -516,14 +514,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"/>
+26 -24
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,base.group_system"/>
<menuitem id="menu_finance_payables" name="Vendors" parent="menu_finance" sequence="2" groups="group_account_user,group_account_manager,base.group_system"/>
<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,base.group_system,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,base.group_system"/>
<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" groups="base.group_system"/>
<menuitem id="menu_finance_reporting" name="Reporting" parent="account.menu_finance" sequence="12" groups="base.group_system,group_account_manager,group_account_user"/>
<menuitem id="menu_finance_reporting_budgets" name="Budgets" parent="menu_finance_reporting"/>
<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"/>
<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="base.group_system"/>
<menuitem id="menu_finance_accounting" name="Financial Accounting" parent="menu_finance_configuration" groups="base.group_system"/>
<menuitem id="menu_analytic_accounting" name="Analytic Accounting" parent="menu_finance_configuration" groups="base.group_system"/>
<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"/>
<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="base.group_system"/>
<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="base.group_system,group_account_manager"/>
<menuitem id="menu_finance_entries" name="Accounting" parent="menu_finance" sequence="4"
groups="group_account_user,group_account_manager,base.group_system"/>
<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,base.group_system" 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>
+63 -59
View File
@@ -36,12 +36,18 @@ class account_move_line(osv.osv):
fiscalperiod_obj = self.pool.get('account.period')
fiscalyear_ids = []
fiscalperiod_ids = []
if not context.get('fiscalyear', False) and not context.get('empty_fy_allow', False):
initial_bal = context.get('initial_bal', False)
company_clause = ""
if context.get('company_id', False):
company_clause = " AND " +obj+".company_id = %s" % context.get('company_id', False)
if not context.get('fiscalyear', False):
fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('state', '=', 'draft')])
elif context.get('empty_fy_allow', False):
fiscalyear_ids = context['fiscalyear']
else:
fiscalyear_ids = [context['fiscalyear']]
if initial_bal:
fiscalyear_date_start = fiscalyear_obj.read(cr, uid, context['fiscalyear'], ['date_start'])['date_start']
fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('date_stop', '<', fiscalyear_date_start), ('state', '=', 'draft')], context=context)
else:
fiscalyear_ids = [context['fiscalyear']]
fiscalyear_clause = (','.join([str(x) for x in fiscalyear_ids])) or '0'
state = context.get('state',False)
@@ -50,15 +56,36 @@ class account_move_line(osv.osv):
where_move_lines_by_date = ''
if context.get('date_from', False) and context.get('date_to', False):
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']+"')"
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']+"')"
if state:
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('period_to', False) and not context.get('periods', False):
if initial_bal:
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'] = 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)
@@ -69,41 +96,7 @@ class account_move_line(osv.osv):
child_ids = self.pool.get('account.account')._get_children_and_consol(cr, uid, [context['chart_account_id']], context=context)
query += ' AND '+obj+'.account_id in (%s)' % ','.join(map(str, child_ids))
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
query += company_clause
return query
@@ -309,15 +302,27 @@ class account_move_line(osv.osv):
ml = self.browse(cr, uid, id, context)
return map(lambda x: x.id, ml.move_id.line_id)
# TODO: this is false, it does not uses draft and closed periods
def _balance(self, cr, uid, ids, prop, unknow_none, unknow_dict):
res={}
# TODO group the foreach in sql
for id in ids:
cr.execute('SELECT date,account_id FROM account_move_line WHERE id=%s', (id,))
dt, acc = cr.fetchone()
cr.execute('SELECT SUM(debit-credit) FROM account_move_line WHERE account_id=%s AND (date<%s OR (date=%s AND id<=%s))', (acc,dt,dt,id))
res[id] = cr.fetchone()[0]
def _balance(self, cr, uid, ids, name, arg, context=None):
if context is None:
context = {}
c = context.copy()
c['initital_bal'] = True
sql = [
"""select l2.id, sum(l1.debit-l1.credit) from account_move_line l1, account_move_line l2""",
"""where l2.account_id=l1.account_id""",
"""and""",
"""l1.id<=l2.id""",
"""and""",
"""l2.id in %s""",
"""and""",
self._query_get(cr, uid, obj='l1', context=c),
""" group by l2.id""",
]
cr.execute('\n'.join(sql), [tuple(ids)])
res = dict(cr.fetchall())
return res
def _invoice(self, cursor, user, ids, name, arg, context=None):
@@ -344,7 +349,7 @@ class account_move_line(osv.osv):
return res
def name_get(self, cr, uid, ids, context={}):
if not len(ids):
if not ids:
return []
result = []
for line in self.browse(cr, uid, ids, context):
@@ -358,18 +363,18 @@ class account_move_line(osv.osv):
if context is None:
context = {}
if not len(args):
if not args:
return []
where = ' and '.join(map(lambda x: '(abs(sum(debit-credit))'+x[1]+str(x[2])+')',args))
cursor.execute('select id, sum(debit-credit) from account_move_line \
group by id, debit, credit having '+where)
res = cursor.fetchall()
if not len(res):
if not res:
return [('id', '=', '0')]
return [('id', 'in', [x[0] for x in res])]
def _invoice_search(self, cursor, user, obj, name, args, context):
if not len(args):
if not args:
return []
invoice_obj = self.pool.get('account.invoice')
@@ -402,7 +407,7 @@ class account_move_line(osv.osv):
qu2 += x[2]
else:
qu1.append(' (False)')
if len(qu1):
if qu1:
qu1 = ' AND' + ' AND'.join(qu1)
else:
qu1 = ''
@@ -410,7 +415,7 @@ class account_move_line(osv.osv):
'FROM account_move_line l, account_invoice i ' \
'WHERE l.move_id = i.move_id ' + qu1, qu2)
res = cursor.fetchall()
if not len(res):
if not res:
return [('id', '=', '0')]
return [('id', 'in', [x[0] for x in res])]
@@ -900,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,
@@ -985,7 +989,7 @@ class account_move_line(osv.osv):
part_rec_ids = [rec['reconcile_partial_id'][0] for rec in part_recs]
unlink_ids += rec_ids
unlink_ids += part_rec_ids
if len(unlink_ids):
if unlink_ids:
obj_move_rec.unlink(cr, uid, unlink_ids)
return True
+5 -4
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"
+8 -1
View File
@@ -14,6 +14,13 @@
<field name="name">Test invoice 1</field>
<field name="address_contact_id" ref="base.res_partner_address_tang"/>
</record>
<record id="test_tax_line" model="account.invoice.tax">
<field name="name">Test Tax</field>
<field name="base">5.00</field>
<field name="amount">100.00</field>
<field name="account_id" ref="account.ova"/>
<field name="invoice_id" ref="test_invoice_1"/>
</record>
<record id="test_invoice_1_line_1" model="account.invoice.line">
<field name="name">Basic computer with Dvorak keyboard and left-handed mouse</field>
<field name="invoice_id" ref="test_invoice_1"/>
@@ -27,7 +34,7 @@
<field name="price_unit">800</field>
<field name="quantity">2</field>
<field name="account_id" ref="account.a_sale"/>
</record>
</record>
<assert id="test_invoice_1" model="account.invoice" string="The currency unit of Test invoice 1 is EUR">
<test expr="currency_id.code">EUR</test>
+99 -103
View File
@@ -129,7 +129,7 @@
<field name="arch" type="xml">
<search string="Search Period">
<group>
<filter string="Draft" name="draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
<filter string="To Close" name="draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="code"/>
@@ -236,6 +236,17 @@
</tree>
</field>
</record>
<record id="view_treasory_graph" model="ir.ui.view">
<field name="name">account.treasory.graph</field>
<field name="model">account.account</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Treasory Analysis" type="bar">
<field name="name"/>
<field name="balance" operator="+"/>
</graph>
</field>
</record>
<record id="action_account_form" model="ir.actions.act_window">
<field name="name">Accounts</field>
<field name="res_model">account.account</field>
@@ -347,10 +358,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"/>
@@ -433,7 +444,7 @@
<menuitem action="action_account_journal_form" id="menu_action_account_journal_form" parent="account_account_menu"/>
<record id="view_account_bank_statement_filter" model="ir.ui.view">
<field name="name">account.bank.statement.select</field>
<field name="name">account.cash.statement.select</field>
<field name="model">account.bank.statement</field>
<field name="type">search</field>
<field name="arch" type="xml">
@@ -444,7 +455,7 @@
<separator orientation="vertical"/>
<field name="date"/>
<field name="name"/>
<field name="journal_id" widget='selection'/>
<field name="journal_id" widget='selection' domain="[('type', '=', 'cash')]" />
</group>
<newline/>
<group expand="0" string="Group By...">
@@ -471,8 +482,8 @@
<field name="balance_end_real"/>
<field name="balance_end" invisible="1"/>
<field name="state"/>
<button type="object" string="Confirm" name="button_confirm_bank" states="draft" icon="terp-camera_test"/>
<button type="object" string="Cancel" name="button_cancel" states="confirm" icon="gtk-cancel"/>
<button type="object" string="Confirm" name="button_confirm_bank" states="draft" icon="terp-camera_test"/>
</tree>
</field>
</record>
@@ -489,7 +500,7 @@
<field name="name"/>
<field name="date"/>
<field name="period_id"/>
<field name="journal_id" widget="selection"/>
<field name="journal_id" widget="selection" domain="[('type', '=', 'bank')]" />
</group>
<newline/>
<group expand="0" string="Group By...">
@@ -553,9 +564,9 @@
<group col="8" colspan="4">
<field name="state"/>
<field name="balance_end"/>
<button name="button_cancel" states="confirm" string="Cancel" type="object" icon="gtk-cancel"/>
<button name="button_dummy" states="draft" string="Compute" type="object" icon="terp-stock_format-scientific"/>
<button name="button_confirm_bank" states="draft" string="Confirm" type="object" icon="terp-camera_test"/>
<button name="button_cancel" states="confirm" string="Cancel" type="object" icon="gtk-cancel"/>
</group>
</form>
</field>
@@ -585,9 +596,9 @@
<group col="8" colspan="4">
<field name="state"/>
<field name="balance_end"/>
<button name="button_cancel" states="confirm" string="Cancel" type="object" icon="gtk-cancel"/>
<button name="button_dummy" states="draft" string="Compute" type="object" icon="terp-stock_format-scientific"/>
<button name="button_confirm_bank" states="draft" string="Confirm" type="object" icon="terp-camera_test"/>
<button name="button_cancel" states="confirm" string="Cancel" type="object" icon="gtk-cancel"/>
</group>
</form>
</field>
@@ -600,6 +611,7 @@
<field name="view_mode">tree,form,graph</field>
<field name="domain">[('journal_id.type', '=', 'bank')]</field>
<field name="context">{'journal_type':'bank'}</field>
<field name="search_view_id" ref="view_bank_statement_search"/>
</record>
<record model="ir.actions.act_window.view" id="action_bank_statement_tree_bank">
<field name="sequence" eval="1"/>
@@ -614,12 +626,13 @@
<field name="act_window_id" ref="action_bank_statement_tree"/>
</record>
<record id="action_bank_statement_periodic_tree" model="ir.actions.act_window">
<record id="action_bank_statement_periodic_tree" model="ir.actions.act_window">
<field name="name">Bank Statements</field>
<field name="res_model">account.bank.statement</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="domain">[('journal_id.type', '=', 'bank')]</field>
<field name="search_view_id" ref="view_bank_statement_search"/>
<field name="context">{'journal_type':'bank'}</field>
</record>
<record model="ir.actions.act_window.view" id="action_bank_statement_periodic_tree_bank">
@@ -808,7 +821,6 @@
<field name="name"/>
<field name="price_include" groups="base.group_extended"/>
<field name="description"/>
<field name="tax_group" invisible="1"/>
</tree>
</field>
</record>
@@ -819,16 +831,10 @@
<field name="arch" type="xml">
<search string="Search Taxes">
<group col="10" colspan="4">
<filter icon="terp-folder-blue" string="Vat Taxes" domain="[('tax_group','=','vat')]" help="Vat Taxes"/>
<filter icon="terp-folder-yellow" string="Other Taxes" domain="[('tax_group','=','other')]" help="Other Taxes"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="description"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Tax Group" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'tax_group'}"/>
</group>
</search>
</field>
</record>
@@ -841,52 +847,46 @@
<group colspan="4" col="6">
<field name="name" select="1"/>
<field name="description" select="1"/>
<field name="tax_group" select="1"/>
<field name="type"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="type_tax_use"/>
<field name="price_include"/>
<field name="active"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<notebook colspan="4">
<page string="Tax Definition" >
<group col="2" colspan="2">
<separator colspan="2" string=""/>
<field name="applicable_type"/>
<field name="type_tax_use"/>
<field groups="base.group_extended" name="domain"/>
<field groups="base.group_extended" name="sequence"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string=""/>
<field name="amount" attrs="{'readonly':[('type','in',('none', 'code'))]}"/>
<field groups="base.group_extended" name="child_depend"/>
<field groups="base.group_extended" name="price_include"/>
<field groups="base.group_extended" name="include_base_amount"/>
</group>
<field name="account_collected_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<label colspan="2" nolabel="1" string="Keep empty to use the income account"/>
<field name="account_paid_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<label colspan="2" nolabel="1" string="Keep empty to use the expense account"/>
<separator colspan="4" string="Child Taxes"/>
<field colspan="4" groups="base.group_extended" name="child_ids" nolabel="1"/>
</page>
<page string="Tax Declaration">
<separator colspan="4" string="Invoices"/>
<field name="base_code_id"/>
<field name="base_sign"/>
<field name="tax_code_id"/>
<field name="tax_sign"/>
<separator colspan="4" string="Credit Notes"/>
<field name="ref_base_code_id"/>
<field name="ref_base_sign"/>
<field name="ref_tax_code_id"/>
<field name="ref_tax_sign"/>
<group colspan="4" col="4">
<field name="type"/>
<field name="amount" attrs="{'readonly':[('type','in',('none', 'code', 'balance'))]}"/>
<separator colspan="4" string="Accounting Information"/>
<field name="account_collected_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<label colspan="2" nolabel="1" string="Keep empty to use the income account"/>
<field name="account_paid_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<label colspan="2" nolabel="1" string="Keep empty to use the expense account"/>
<separator colspan="4" string="Tax Declaration: Invoices"/>
<field name="base_code_id"/>
<field name="base_sign"/>
<field name="tax_code_id"/>
<field name="tax_sign"/>
<separator colspan="4" string="Tax Declaration: Credit Notes"/>
<field name="ref_base_code_id"/>
<field name="ref_base_sign"/>
<field name="ref_tax_code_id"/>
<field name="ref_tax_sign"/>
<separator groups="base.group_extended" colspan="4" string="Children Definition"/>
<field groups="base.group_extended" name="child_depend"/>
<field groups="base.group_extended" name="sequence"/>
<field groups="base.group_extended" name="include_base_amount"/>
<field groups="base.group_extended" colspan="4" name="child_ids"/>
</group>
</page>
<page groups="base.group_extended" string="Special Computation">
<separator colspan="4" string="Compute Code (if type=code)"/>
<field colspan="4" name="python_compute" nolabel="1" attrs="{'readonly':[('type','!=','code')],'required':[('type','=','code')]}"/>
<separator colspan="4" string="Applicability Options"/>
<field name="applicable_type"/>
<field name="domain"/>
<separator colspan="4" string="Applicable Code (if type=code)"/>
<field colspan="4" name="python_applicable" nolabel="1" attrs="{'readonly':[('applicable_type','=','true')], 'required':[('applicable_type','=','code')]}"/>
<separator colspan="4" string="Compute Code (if type=code)"/>
<field colspan="4" name="python_compute" nolabel="1" attrs="{'readonly':[('type','!=','code')],'required':[('type','=','code')]}"/>
</page>
</notebook>
</form>
@@ -910,13 +910,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. It’s 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
-->
@@ -1154,7 +1147,7 @@
id="menu_action_account_moves_all"
parent="account.menu_finance_entries"
sequence="1"
groups="group_account_user,group_account_manager,base.group_system"
groups="group_account_user,group_account_manager"
/>
<record id="action_move_line_select" model="ir.actions.act_window">
@@ -1341,8 +1334,8 @@
<field name="narration" colspan="4" nolabel="1" height="50"/>
<group col="4" colspan="4">
<field name="state" select="1"/>
<button name="button_validate" states="draft" string="Approve" type="object" icon="terp-camera_test"/>
<button name="button_cancel" states="posted" string="Cancel" type="object" icon="gtk-cancel"/>
<button name="button_validate" states="draft" string="Approve" type="object" icon="terp-camera_test"/>
</group>
</page>
</notebook>
@@ -1400,6 +1393,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">
@@ -1418,10 +1412,6 @@
res_model="account.move.line"
src_model="account.move"/>
<record id="account.act_account_move_to_account_move_line_open" model="ir.actions.act_window">
<field eval="[(6,0,[ref('account.group_accounting_accountant')])]" name="groups_id"/>
</record>
<record id="action_move_line_search" model="ir.actions.act_window">
<field name="name">Journal Items</field>
<field name="type">ir.actions.act_window</field>
@@ -1443,8 +1433,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>
@@ -1493,9 +1481,9 @@
<group col="7" colspan="4">
<field name="state"/>
<field name="balance_end"/>
<button name="button_cancel" states="confirm" string="Cancel" type="object" icon="gtk-cancel"/>
<button name="button_dummy" states="draft" string="Compute" icon="terp-stock_format-scientific"/>
<button name="button_confirm" states="draft" string="Confirm" type="object" icon="terp-camera_test"/>
<button name="button_cancel" states="confirm" string="Cancel" type="object" icon="gtk-cancel"/>
</group>
</form>
</field>
@@ -1505,6 +1493,7 @@
<field name="res_model">account.bank.statement</field>
<field name="view_type">form</field>
<field name="view_mode">form,tree</field>
<field name="search_view_id" ref="view_bank_statement_search"/>
<field name="view_id" ref="view_bank_statement_reconcile_form"/>
</record>
@@ -1516,8 +1505,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"/>
@@ -1579,7 +1568,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"/>
@@ -1598,7 +1587,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"/>
@@ -1646,17 +1635,17 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Journal Entry Model">
<group>
<filter string="Sale" icon="terp-sale" domain="[('journal_id.type', '=', 'sale')]"/>
<filter string="Purchase" icon="terp-purchase" domain="[('journal_id.type', '=', 'purchase')]"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="journal_id"/>
<field name="company_id" groups="base.group_multi_company"/>
<group>
<filter string="Sale" icon="terp-sale" domain="[('journal_id.type', '=', 'sale')]"/>
<filter string="Purchase" icon="terp-purchase" domain="[('journal_id.type', '=', 'purchase')]"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="journal_id" widget="selection"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
</group>
</search>
</field>
@@ -1669,7 +1658,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
@@ -1755,7 +1746,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
@@ -1800,7 +1793,7 @@
</field>
</record>
<record id="view_subscription_search" model="ir.ui.view">
<record id="view_subscription_search" model="ir.ui.view">
<field name="name">account.subscription.search</field>
<field name="model">account.subscription</field>
<field name="type">search</field>
@@ -1867,7 +1860,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>
@@ -2089,7 +2086,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 -->
@@ -2184,7 +2180,6 @@
<field name="description"/>
<newline/>
<field name="chart_template_id"/>
<field name="tax_group"/>
<field name="type"/>
<field name="type_tax_use"/>
</group>
@@ -2248,8 +2243,6 @@
<filter icon="terp-sale" string="Sale" domain="[('type_tax_use','=','sale')]" help="Taxes used in Sales"/>
<filter icon="terp-purchase" string="Purchase" domain="[('type_tax_use','=','purchase')]" help="Taxes used in Purchases"/>
<separator orientation="vertical"/>
<filter icon="terp-folder-blue" string="Vat Taxes" domain="[('tax_group','=','vat')]" help="Vat Taxes"/>
<filter icon="terp-folder-yellow" string="Other Taxes" domain="[('tax_group','=','other')]" help="Other Taxes"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="description"/>
@@ -2355,7 +2348,7 @@
<group string="res_config_contents" position="replace">
<field name="company_id" widget="selection"/>
<field name ="code_digits" />
<field name="chart_template_id"/>
<field name="chart_template_id" widget="selection"/>
<field name ="seq_journal" />
<field colspan="4" mode="tree" name="bank_accounts_id"
nolabel="1" widget="one2many_list">
@@ -2385,7 +2378,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>
@@ -2399,14 +2394,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/>
@@ -2438,14 +2433,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>
@@ -2471,9 +2466,9 @@
<field name="balance_end_real"/>
<field name="balance_end"/>
<field name="state"/>
<button type="object" string="Cancel" name="button_cancel" states="confirm" icon="gtk-cancel"/>
<button type="object" string="Open" name="button_open" states="draft" icon="terp-camera_test"/>
<button type="object" string="Confirm" name="button_confirm_bank" states="open" icon="terp-gtk-go-back-rtl"/>
<button type="object" string="Cancel" name="button_cancel" states="confirm" icon="gtk-cancel"/>
</tree>
</field>
</record>
@@ -2575,9 +2570,9 @@
</group>
<group col="8" colspan="4">
<field name="state" colspan="4"/>
<button name="button_cancel" states="confirm,open" string="Cancel" icon="terp-gtk-stop" type="object" groups="base.group_extended"/>
<button name="button_confirm_cash" states="open" string="Close CashBox" icon="terp-dialog-close" type="object"/>
<button name="button_open" states="draft" string="Open CashBox" icon="terp-document-new" type="object"/>
<button name="button_cancel" states="confirm,open" string="Cancel" icon="terp-gtk-stop" type="object" groups="base.group_extended"/>
</group>
</form>
</field>
@@ -2595,7 +2590,7 @@
</field>
</record>
<record id="action_view_bank_statement_tree" model="ir.actions.act_window">
<field name="name">Cash Register</field>
<field name="name">Cash Registers</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.bank.statement</field>
<field name="view_type">form</field>
@@ -2623,7 +2618,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>
+1 -1
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>
-13
View File
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<!--
Administrator shortcut
Demo user startup menu
-->
<record id="base.user_root" model="res.users">
<field name="action_id" ref="open_board_account"/>
</record>
</data>
</openerp>
+21 -4
View File
@@ -20,7 +20,22 @@
<field name="view_mode">graph,tree</field>
<field name="domain">[('type','=','income')]</field>
</record>
<record id="action_company_analysis_tree" model="ir.actions.act_window">
<field name="name">Company Analysis</field>
<field name="res_model">account.entries.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'group_by':['user_type'], 'group_by_no_leaf':1}</field>
<field name="view_id" ref="account.view_company_analysis_tree"/>
</record>
<record id="action_treasory_graph" model="ir.actions.act_window">
<field name="name">Treasory</field>
<field name="res_model">account.account</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="domain">[('type','=','liquidity')]</field>
<field name="view_id" ref="account.view_treasory_graph"/>
</record>
<record id="board_account_form" model="ir.ui.view">
<field name="name">board.account.form</field>
<field name="model">board.board</field>
@@ -30,10 +45,12 @@
<hpaned>
<child1>
<action colspan="4" height="160" width="400" name="%(account.action_invoice_tree1)d" string="Draft Customer Invoices" domain="[('state','=','draft'),('type','=','out_invoice')]"/>
<action colspan="4" height="160" width="400" name="%(action_company_analysis_tree)d" string="Company Analysis" />
</child1>
<child2>
<action colspan="4" height="220" name="%(action_treasory_graph)d" string="Treasory"/>
<action colspan="4" height="220" name="%(action_aged_receivable)d" string="Aged receivables"/>
<action colspan="4" height="220" name="%(action_aged_income)d" string="Aged income"/>
<!-- <action colspan="4" height="220" name="%(action_aged_income)d" string="Aged income"/> -->
</child2>
</hpaned>
</form>
@@ -49,8 +66,8 @@
<field name="view_id" ref="board_account_form"/>
</record>
<menuitem id="menu_dashboard_acc" name="Dashboard" sequence="2" parent="account.menu_finance_reporting" groups="group_account_user,group_account_manager,base.group_system"/>
<menuitem id="menu_dashboard_acc" name="Dashboard" sequence="2" parent="account.menu_finance_reporting" groups="group_account_user,group_account_manager"/>
<menuitem action="open_board_account" icon="terp-graph" id="menu_board_account" parent="menu_dashboard_acc" sequence="1"/>
<menuitem icon="terp-account" id="account.menu_finance" name="Accounting" sequence="13" action="open_board_account"/>
</data>
</openerp>
+2 -1
View File
@@ -24,7 +24,7 @@ from osv import fields, osv
class res_company(osv.osv):
_inherit = "res.company"
_columns = {
'overdue_msg' : fields.text('Overdue Payments Message', translate=True),
'overdue_msg': fields.text('Overdue Payments Message', translate=True),
'property_reserve_and_surplus_account': fields.property(
'account.account',
type='many2one',
@@ -41,6 +41,7 @@ class res_company(osv.osv):
out after this mail was sent, please consider the present one as \
void. Do not hesitate to contact our accounting department'
}
res_company()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+33 -29
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
+14 -13
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-11 07:18+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-12 04:51+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
+70 -70
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"
"PO-Revision-Date: 2010-10-11 07:18+0000\n"
"Last-Translator: OpenERP Administrators <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-12 04:51+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@@ -1983,7 +1983,7 @@ msgstr "Шилжүүлэлт"
#. module: account
#: rml:account.overdue:0
msgid "Li."
msgstr ""
msgstr "Ли."
#. module: account
#: wizard_view:account.chart,init:0
@@ -2262,7 +2262,7 @@ msgstr "Дансны мод"
#. module: account
#: model:account.journal,name:account.check_journal
msgid "x Checks Journal"
msgstr ""
msgstr "x Чекийн журнал"
#. module: account
#: model:ir.actions.wizard,name:account.wizard_generate_subscription
@@ -4413,7 +4413,7 @@ msgstr "Батлагдсан"
#: view:account.tax:0
#: view:account.tax.template:0
msgid "Credit Notes"
msgstr ""
msgstr "Орлогын тэмдэглэл"
#. module: account
#: field:account.config.wizard,date2:0
@@ -4430,12 +4430,12 @@ msgstr "Нээлтийн бичилтийг цуцлах"
#. module: account
#: model:process.transition,name:account.process_transition_invoicemanually0
msgid "Manually statement"
msgstr ""
msgstr "Гараар үүсгэсэн тайлан"
#. module: account
#: field:account.payment.term.line,days2:0
msgid "Day of the Month"
msgstr ""
msgstr "Сарын өдөр"
#. module: account
#: field:account.analytic.journal,line_ids:0
@@ -4493,12 +4493,12 @@ msgstr ""
#. module: account
#: wizard_view:account.wizard_paid_open,init:0
msgid "Open Invoice"
msgstr ""
msgstr "Нэхэмжлэл нээх"
#. module: account
#: model:process.node,note:account.process_node_draftstatement0
msgid "Set starting and ending balance for control"
msgstr ""
msgstr "Балансын удирдлагын эхлэл төгсгөлийг тохируулах"
#. module: account
#: wizard_view:account.wizard_paid_open,init:0
@@ -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
+2 -2
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:28+0000\n"
"PO-Revision-Date: 2010-09-30 06:57+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:40+0000\n"
"X-Launchpad-Export-Date: 2010-10-01 08:47+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
+54 -54
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 08:13+0000\n"
"PO-Revision-Date: 2010-10-04 06:51+0000\n"
"Last-Translator: Chertykov Denis <chertykov@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-09-30 04:41+0000\n"
"X-Launchpad-Export-Date: 2010-10-05 04:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@@ -2116,7 +2116,7 @@ msgstr "дней"
#. module: account
#: selection:account.aged.trial.balance,init,direction_selection:0
msgid "Past"
msgstr ""
msgstr "Прошлые"
#. module: account
#: field:account.analytic.account,company_currency_id:0
@@ -2267,7 +2267,7 @@ msgstr "Создать проводки подписки"
#. module: account
#: wizard_field:account.fiscalyear.close,init,journal_id:0
msgid "Opening Entries Journal"
msgstr ""
msgstr "Открытие журнала проводок"
#. module: account
#: view:account.config.wizard:0
@@ -3839,7 +3839,7 @@ msgstr ""
#: model:ir.actions.act_window,name:account.action_wizard_company_setup_form
#: view:wizard.company.setup:0
msgid "Overdue Payment Report Message"
msgstr ""
msgstr "Сообщение о просроченном платеже"
#. module: account
#: selection:account.tax,tax_group:0
@@ -3894,12 +3894,12 @@ msgstr "Финансовые журналы"
#: selection:account.partner.balance.report,init,state:0
#: selection:account.third_party_ledger.report,init,state:0
msgid "By Period"
msgstr ""
msgstr "По периоду"
#. module: account
#: help:account.invoice,date_invoice:0
msgid "Keep empty to use the current date"
msgstr ""
msgstr "Оставьте пустым для текущей даты"
#. module: account
#: rml:account.overdue:0
@@ -3909,7 +3909,7 @@ msgstr "."
#. module: account
#: field:account.analytic.account,quantity_max:0
msgid "Maximum Quantity"
msgstr ""
msgstr "Максимальное количество"
#. module: account
#: field:account.period,name:0
@@ -3932,7 +3932,7 @@ msgstr "Группы"
#. module: account
#: rml:account.analytic.account.quantity_cost_ledger:0
msgid "Code/Date"
msgstr ""
msgstr "Код/Дата"
#. module: account
#: field:account.account,active:0
@@ -3953,7 +3953,7 @@ msgstr ""
#. module: account
#: view:account.chart.template:0
msgid "Properties"
msgstr ""
msgstr "Параметры"
#. module: account
#: view:res.partner:0
@@ -3973,7 +3973,7 @@ msgstr ""
#. module: account
#: wizard_field:account.vat.declaration,init,based_on:0
msgid "Base on"
msgstr ""
msgstr "Основан на"
#. module: account
#: selection:account.move,type:0
@@ -4365,7 +4365,7 @@ msgstr ""
#: field:account.config.wizard,date2:0
#: field:account.fiscalyear,date_stop:0
msgid "End Date"
msgstr ""
msgstr "Дата окончания"
#. module: account
#: model:ir.actions.wizard,name:account.wizard_open_closed_fiscalyear
@@ -4381,7 +4381,7 @@ msgstr ""
#. module: account
#: field:account.payment.term.line,days2:0
msgid "Day of the Month"
msgstr ""
msgstr "День месяца"
#. module: account
#: field:account.analytic.journal,line_ids:0
@@ -4542,7 +4542,7 @@ msgstr "Разрегить сверку"
#: selection:account.partner.balance.report,init,state:0
#: selection:account.third_party_ledger.report,init,state:0
msgid "By Date"
msgstr ""
msgstr "По дате"
#. module: account
#: model:ir.actions.act_window,name:account.action_invoice_tree4
@@ -4558,7 +4558,7 @@ msgstr "Дата сгенерированных проводок"
#. module: account
#: wizard_button:account.invoice.refund,init,modify_invoice:0
msgid "Modify Invoice"
msgstr ""
msgstr "Изменить счет"
#. module: account
#: view:res.partner:0
@@ -4568,7 +4568,7 @@ msgstr "Настройки бухгалтерского учета для кон
#. module: account
#: view:account.analytic.account:0
msgid "Analytic Account Statistics"
msgstr ""
msgstr "Статистика счета аналитики"
#. module: account
#: view:wizard.multi.charts.accounts:0
@@ -4598,12 +4598,12 @@ msgstr ""
#. module: account
#: wizard_field:account.aged.trial.balance,init,result_selection:0
msgid "Filter on Partners"
msgstr ""
msgstr "Фильтр по партнерам"
#. module: account
#: field:account.tax,price_include:0
msgid "Tax Included in Price"
msgstr ""
msgstr "Налог включен в цену"
#. module: account
#: model:ir.actions.act_window,name:account.action_account_analytic_journal_tree2
@@ -4684,7 +4684,7 @@ msgstr "Учетные годы"
#. module: account
#: model:process.node,note:account.process_node_importinvoice0
msgid "Import from invoices or payments"
msgstr ""
msgstr "Импорт из счетов или платежей"
#. module: account
#: model:ir.actions.wizard,name:account.wizard_reconcile_select
@@ -4741,7 +4741,7 @@ msgstr "Адрес выставления счета"
#. module: account
#: rml:account.analytic.account.analytic.check:0
msgid "General Credit"
msgstr ""
msgstr "Общий кредит"
#. module: account
#: help:account.journal,centralisation:0
@@ -4754,7 +4754,7 @@ msgstr ""
#. module: account
#: selection:account.invoice,state:0
msgid "Cancelled"
msgstr ""
msgstr "Отменено"
#. module: account
#: model:ir.actions.act_window,name:account.action_bank_statement_draft_tree
@@ -4765,7 +4765,7 @@ msgstr "Черновые выписки"
#. module: account
#: wizard_field:populate_statement_from_inv,init,date:0
msgid "Date payment"
msgstr ""
msgstr "Дата оплаты"
#. module: account
#: rml:account.journal.period.print:0
@@ -4782,7 +4782,7 @@ msgstr "Расходы и доходы по журналам (текущий м
#: selection:account.partner.balance.report,init,result_selection:0
#: selection:account.third_party_ledger.report,init,result_selection:0
msgid "Receivable Accounts"
msgstr ""
msgstr "Счета к получению"
#. module: account
#: wizard_button:account.move.line.unreconcile.select,init,open:0
@@ -4838,7 +4838,7 @@ 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
@@ -4893,7 +4893,7 @@ msgstr ""
#: field:account.bank.statement.reconcile,total_amount:0
#: field:account.bank.statement.reconcile,total_second_amount:0
msgid "Payment amount"
msgstr ""
msgstr "Сумма оплаты"
#. module: account
#: view:account.analytic.account:0
@@ -4940,7 +4940,7 @@ msgstr "Все месяцы"
#. module: account
#: wizard_field:account.invoice.refund,init,date:0
msgid "Operation date"
msgstr ""
msgstr "Дата операции"
#. module: account
#: field:account.invoice,invoice_line:0
@@ -4950,7 +4950,7 @@ msgstr "Позиции счета"
#. module: account
#: field:account.period,date_start:0
msgid "Start of Period"
msgstr ""
msgstr "Начало периода"
#. module: account
#: wizard_field:account.fiscalyear.close,init,report_name:0
@@ -5008,12 +5008,12 @@ msgstr ""
#. module: account
#: rml:account.account.balance:0
msgid "Account Balance -"
msgstr ""
msgstr "Баланс по счету -"
#. module: account
#: field:account.journal,group_invoice_lines:0
msgid "Group invoice lines"
msgstr ""
msgstr "Группировать позиции счета"
#. module: account
#: model:ir.ui.menu,name:account.menu_finance_configuration
@@ -5058,7 +5058,7 @@ msgstr ""
#: wizard_view:account.partner.balance.report,init:0
#: wizard_view:account.third_party_ledger.report,init:0
msgid "Select Date-Period"
msgstr ""
msgstr "Выбор даты-периода"
#. module: account
#: rml:account.analytic.account.inverted.balance:0
@@ -5069,7 +5069,7 @@ msgstr ""
#: model:process.node,name:account.process_node_paidinvoice0
#: model:process.node,name:account.process_node_supplierpaidinvoice0
msgid "Paid invoice"
msgstr ""
msgstr "Оплаченный счет"
#. module: account
#: view:account.tax:0
@@ -5099,7 +5099,7 @@ msgstr ""
#. module: account
#: model:ir.actions.wizard,name:account.wizard_populate_statement_from_inv
msgid "Import invoices"
msgstr ""
msgstr "Импорт счетов"
#. module: account
#: wizard_view:account.move.line.unreconcile,init:0
@@ -5143,7 +5143,7 @@ msgstr "Периоды подписки"
#. module: account
#: model:process.node,name:account.process_node_manually0
msgid "Manually"
msgstr ""
msgstr "Вручную"
#. module: account
#: view:account.invoice:0
@@ -5162,7 +5162,7 @@ msgstr "Счета"
#: selection:account.partner.balance.report,init,result_selection:0
#: selection:account.third_party_ledger.report,init,result_selection:0
msgid "Payable Accounts"
msgstr ""
msgstr "Кредиторская задолженность"
#. module: account
#: view:account.invoice.line:0
@@ -5183,12 +5183,12 @@ msgstr "Полный платеж"
#. module: account
#: selection:account.move,type:0
msgid "Journal Purchase"
msgstr ""
msgstr "Журнал покупок"
#. module: account
#: selection:account.move,type:0
msgid "Cash Receipt"
msgstr ""
msgstr "Денежное поступление"
#. module: account
#: field:account.fiscal.position.tax,tax_dest_id:0
@@ -5254,12 +5254,12 @@ msgstr ""
#: wizard_view:account.partner.balance.report,init:0
#: wizard_view:account.third_party_ledger.report,init:0
msgid "Date Filter"
msgstr ""
msgstr "Фильтр дат"
#. module: account
#: wizard_view:populate_statement_from_inv,init:0
msgid "Choose Journal and Payment Date"
msgstr ""
msgstr "Выбрать журнал и дату платежа"
#. module: account
#: selection:account.analytic.account,state:0
@@ -5288,7 +5288,7 @@ msgstr "Невыплаченные возвраты клиентам"
#. module: account
#: help:account.invoice,residual:0
msgid "Remaining amount due."
msgstr ""
msgstr "Оставшиеся суммы"
#. module: account
#: wizard_view:account.period.close,init:0
@@ -5304,7 +5304,7 @@ msgstr "Проформа"
#. module: account
#: field:account.move.reconcile,line_partial_ids:0
msgid "Partial Entry lines"
msgstr ""
msgstr "Частичная проводка"
#. module: account
#: help:account.move.line,statement_id:0
@@ -5319,7 +5319,7 @@ msgstr "Отчетный год"
#. module: account
#: wizard_button:account.analytic.line,init,open:0
msgid "Open Entries"
msgstr ""
msgstr "Открытые проводки"
#. module: account
#: selection:account.analytic.account,type:0
@@ -5344,7 +5344,7 @@ msgstr ""
#: rml:account.third_party_ledger_other:0
#: rml:account.vat.declaration:0
msgid "Page"
msgstr ""
msgstr "Страница"
#. module: account
#: view:account.move:0
@@ -5377,7 +5377,7 @@ msgstr "Сверенная сумма"
#. module: account
#: selection:account.account,currency_mode:0
msgid "At Date"
msgstr ""
msgstr "На дату"
#. module: account
#: help:account.move.line,tax_amount:0
@@ -5419,7 +5419,7 @@ msgstr ""
#. module: account
#: field:account.subscription,period_total:0
msgid "Number of Periods"
msgstr ""
msgstr "Количество периодов"
#. module: account
#: wizard_field:account.analytic.account.analytic.check.report,init,date2:0
@@ -5488,7 +5488,7 @@ msgstr ""
#. module: account
#: field:wizard.multi.charts.accounts,bank_accounts_id:0
msgid "Bank Accounts"
msgstr ""
msgstr "Банковские счета"
#. module: account
#: constraint:account.period:0
@@ -5500,7 +5500,7 @@ msgstr ""
#. module: account
#: help:account.journal,invoice_sequence_id:0
msgid "The sequence used for invoice numbers in this journal."
msgstr ""
msgstr "Последовательность используемая для нумерации счетов в этом журнале"
#. module: account
#: view:account.account:0
@@ -5549,7 +5549,7 @@ msgstr "Список счетов"
#: view:product.product:0
#: view:product.template:0
msgid "Sales Properties"
msgstr ""
msgstr "Свойства продаж"
#. module: account
#: rml:account.general.journal:0
@@ -5565,12 +5565,12 @@ msgstr "Книга расходов (только количество)"
#. module: account
#: wizard_view:account.move.validate,init:0
msgid "Validate Account Entries"
msgstr ""
msgstr "Утвердить проводки"
#. module: account
#: selection:account.print.journal.report,init,sort_selection:0
msgid "Reference Number"
msgstr ""
msgstr "Ссылка"
#. module: account
#: rml:account.overdue:0
@@ -5586,7 +5586,7 @@ msgstr ""
#. module: account
#: model:ir.actions.act_window,name:account.action_account_analytic_journal_open_form
msgid "Entries of Open Analytic Journals"
msgstr ""
msgstr "Проводки открытых журналов аналитики"
#. module: account
#: view:account.invoice.tax:0
@@ -5601,7 +5601,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
@@ -5624,12 +5624,12 @@ msgstr "Начало периода"
#. module: account
#: model:ir.ui.menu,name:account.account_template_folder
msgid "Templates"
msgstr ""
msgstr "Шаблоны"
#. module: account
#: wizard_button:account.vat.declaration,init,report:0
msgid "Print VAT Decl."
msgstr ""
msgstr "Печать декл. НДС"
#. module: account
#: model:ir.actions.report.xml,name:account.account_intracom
@@ -5682,7 +5682,7 @@ msgstr "Шаблоны для плана счетов"
#. module: account
#: view:account.config.wizard:0
msgid "Account Configure"
msgstr ""
msgstr "Настройка счета"
#. module: account
#: help:res.partner,property_account_payable:0
+9 -3
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"
+13 -14
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
@@ -170,7 +172,6 @@ class account_installer(osv.osv_memory):
'python_compute': tax.python_compute,
'python_compute_inv': tax.python_compute_inv,
'python_applicable': tax.python_applicable,
'tax_group':tax.tax_group,
'base_code_id': tax.base_code_id and ((tax.base_code_id.id in tax_code_template_ref) and tax_code_template_ref[tax.base_code_id.id]) or False,
'tax_code_id': tax.tax_code_id and ((tax.tax_code_id.id in tax_code_template_ref) and tax_code_template_ref[tax.tax_code_id.id]) or False,
'base_sign': tax.base_sign,
@@ -240,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']
@@ -251,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 '),
@@ -444,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
@@ -486,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)
@@ -496,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)
@@ -647,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)
+42 -46
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."),
@@ -304,7 +302,7 @@ class account_invoice(osv.osv):
}, help="The Journal Entry of the invoice have been totally reconciled with one or several Journal Entries of payment."),
'partner_bank_id': fields.many2one('res.partner.bank', 'Bank Account',
help='Bank Account Number, Company bank account if Invoice is customer or supplier refund, otherwise Partner bank account number.', readonly=True, states={'draft':[('readonly',False)]}),
'move_lines':fields.function(_get_lines , method=True, type='many2many', relation='account.move.line', string='Entry Lines'),
'move_lines':fields.function(_get_lines, method=True, type='many2many', relation='account.move.line', string='Entry Lines'),
'residual': fields.function(_amount_residual, method=True, digits_compute=dp.get_precision('Account'), string='Residual',
store={
'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 50),
@@ -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:
@@ -577,7 +585,7 @@ class account_invoice(osv.osv):
else:
val['currency_id'] = company.currency_id.id
return {'value' : val, 'domain': dom }
return {'value': val, 'domain': dom }
# go from canceled state to draft state
def action_cancel_draft(self, cr, uid, ids, *args):
@@ -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
#################
@@ -650,18 +648,19 @@ class account_invoice(osv.osv):
return ok
def button_reset_taxes(self, cr, uid, ids, context=None):
if not context:
if context is None:
context = {}
ctx = context.copy()
ait_obj = self.pool.get('account.invoice.tax')
for id in ids:
cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s", (id,))
partner = self.browse(cr, uid, id, context=context).partner_id
partner = self.browse(cr, uid, id, context=ctx).partner_id
if partner.lang:
context.update({'lang': partner.lang})
for taxe in ait_obj.compute(cr, uid, id, context=context).values():
ctx.update({'lang': partner.lang})
for taxe in ait_obj.compute(cr, uid, id, context=ctx).values():
ait_obj.create(cr, uid, taxe)
# Update the stored value (fields.function), so we write to trigger recompute
self.pool.get('account.invoice').write(cr, uid, ids, {'invoice_line':[]}, context=context)
self.pool.get('account.invoice').write(cr, uid, ids, {'invoice_line':[]}, context=ctx)
return True
def button_compute(self, cr, uid, ids, context=None, set_total=False):
@@ -816,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
@@ -900,7 +898,7 @@ class account_invoice(osv.osv):
'name': name,
'price': total,
'account_id': acc_id,
'date_maturity' : inv.date_due or False,
'date_maturity': inv.date_due or False,
'amount_currency': diff_currency_p \
and total_currency or False,
'currency_id': diff_currency_p \
@@ -911,7 +909,7 @@ class account_invoice(osv.osv):
date = inv.date_invoice or time.strftime('%Y-%m-%d')
part = inv.partner_id.id
line = map(lambda x:(0,0,self.line_get_convert(cr, uid, x, part, date, context={})) ,iml)
line = map(lambda x:(0,0,self.line_get_convert(cr, uid, x, part, date, context={})),iml)
line = self.group_lines(cr, uid, iml, line, inv)
@@ -934,7 +932,7 @@ class account_invoice(osv.osv):
period_id = inv.period_id and inv.period_id.id or False
if not period_id:
period_ids = self.pool.get('account.period').search(cr, uid, [('date_start','<=',inv.date_invoice or time.strftime('%Y-%m-%d')),('date_stop','>=',inv.date_invoice or time.strftime('%Y-%m-%d'))])
if len(period_ids):
if period_ids:
period_id = period_ids[0]
if period_id:
move['period_id'] = period_id
@@ -1020,7 +1018,7 @@ class account_invoice(osv.osv):
account_move_obj.unlink(cr, uid, [i['move_id'][0]])
if i['payment_ids']:
account_move_line_obj = self.pool.get('account.move.line')
pay_ids = account_move_line_obj.browse(cr, uid , i['payment_ids'])
pay_ids = account_move_line_obj.browse(cr, uid, i['payment_ids'])
for move_line in pay_ids:
if move_line.reconcile_partial_id and move_line.reconcile_partial_id.line_partial_ids:
raise osv.except_osv(_('Error !'), _('You cannot cancel the Invoice which is Partially Paid! You need to unreconcile concerned payment entries!'))
@@ -1045,7 +1043,7 @@ class account_invoice(osv.osv):
return True
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
if not ids:
return []
types = {
'out_invoice': 'CI: ',
@@ -1080,7 +1078,9 @@ class account_invoice(osv.osv):
def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None):
invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'address_contact_id', 'address_invoice_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id'])
obj_invoice_line = self.pool.get('account.invoice.line')
obj_invoice_tax = self.pool.get('account.invoice.tax')
obj_journal = self.pool.get('account.journal')
new_ids = []
for invoice in invoices:
del invoice['id']
@@ -1092,20 +1092,20 @@ class account_invoice(osv.osv):
'in_refund': 'in_invoice', # Supplier Refund
}
invoice_lines = self.pool.get('account.invoice.line').read(cr, uid, invoice['invoice_line'])
invoice_lines = obj_invoice_line.read(cr, uid, invoice['invoice_line'])
invoice_lines = self._refund_cleanup_lines(cr, uid, invoice_lines)
tax_lines = self.pool.get('account.invoice.tax').read(cr, uid, invoice['tax_line'])
tax_lines = obj_invoice_tax.read(cr, uid, invoice['tax_line'])
tax_lines = filter(lambda l: l['manual'], tax_lines)
tax_lines = self._refund_cleanup_lines(cr, uid, tax_lines)
if journal_id:
refund_journal_ids = [journal_id]
elif invoice['type'] == 'in_invoice':
refund_journal_ids = self.pool.get('account.journal').search(cr, uid, [('type','=','purchase_refund')])
refund_journal_ids = obj_journal.search(cr, uid, [('type','=','purchase_refund')])
else:
refund_journal_ids = self.pool.get('account.journal').search(cr, uid, [('type','=','sale_refund')])
refund_journal_ids = obj_journal.search(cr, uid, [('type','=','sale_refund')])
if not date :
if not date:
date = time.strftime('%Y-%m-%d')
invoice.update({
'type': type_dict[invoice['type']],
@@ -1116,11 +1116,11 @@ class account_invoice(osv.osv):
'tax_line': tax_lines,
'journal_id': refund_journal_ids
})
if period_id :
if period_id:
invoice.update({
'period_id': period_id,
})
if description :
if description:
invoice.update({
'name': description,
})
@@ -1389,8 +1389,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)
@@ -1410,7 +1408,7 @@ class account_invoice_line(osv.osv):
result['uos_id'] = res.uom_id.id or uom or False
if result['uos_id']:
res2 = res.uom_id.category_id.id
if res2 :
if res2:
domain = {'uos_id':[('category_id','=',res2 )]}
result['categ_id'] = res.categ_id.id
@@ -1443,13 +1441,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)
@@ -1544,8 +1539,8 @@ class account_invoice_tax(osv.osv):
'tax_code_id': fields.many2one('account.tax.code', 'Tax Code', help="The tax basis of the tax declaration."),
'tax_amount': fields.float('Tax Code Amount', digits_compute=dp.get_precision('Account')),
'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True),
'factor_base' : fields.function(_count_factor, method=True, string='Multipication factor for Base code', type='float', multi="all"),
'factor_tax' : fields.function(_count_factor, method=True, string='Multipication factor Tax code', type='float', multi="all")
'factor_base': fields.function(_count_factor, method=True, string='Multipication factor for Base code', type='float', multi="all"),
'factor_tax': fields.function(_count_factor, method=True, string='Multipication factor Tax code', type='float', multi="all")
}
def base_change(self, cr, uid, ids, base, currency_id=False, company_id=False, date_invoice=False):
@@ -1621,6 +1616,7 @@ class account_invoice_tax(osv.osv):
tax_grouped[key]['tax_amount'] += val['tax_amount']
for t in tax_grouped.values():
t['base'] = cur_obj.round(cr, uid, cur, t['base'])
t['amount'] = cur_obj.round(cr, uid, cur, t['amount'])
t['base_amount'] = cur_obj.round(cr, uid, cur, t['base_amount'])
t['tax_amount'] = cur_obj.round(cr, uid, cur, t['tax_amount'])
+12 -17
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'),
@@ -52,7 +51,7 @@ class account_fiscal_position(osv.osv):
return result
def map_account(self, cr, uid, fposition_id, account_id, context={}):
if not fposition_id :
if not fposition_id:
return account_id
for pos in fposition_id.account_ids:
if pos.account_src_id.id == account_id:
@@ -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:
@@ -116,7 +111,7 @@ class res_partner(osv.osv):
return res
def _asset_difference_search(self, cr, uid, obj, name, type, args, context=None):
if not len(args):
if not args:
return []
having_values = tuple(map(itemgetter(2), args))
where = ' AND '.join(
@@ -133,7 +128,7 @@ class res_partner(osv.osv):
'GROUP BY partner_id HAVING '+where),
(type,) + having_values)
res = cr.fetchall()
if not len(res):
if not res:
return [('id','=','0')]
return [('id','in',map(itemgetter(0), res))]
@@ -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()
+4 -4
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>
@@ -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"/>
@@ -122,7 +120,6 @@
-->
<record id="process_transition_confirmstatementfromdraft0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Confirm statement&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The accountant confirms the statement.&quot;&quot;&quot;" name="note"/>
@@ -131,7 +128,6 @@
</record>
<record id="process_transition_analyticinvoice0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;From analytic accounts&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Analytic costs (timesheets, some purchased products, ...) come from analytic accounts. These generate draft invoices.&quot;&quot;&quot;" name="note"/>
@@ -140,7 +136,6 @@
</record>
<record id="process_transition_customerinvoice0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Validation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Draft invoices are checked, validated and printed.&quot;&quot;&quot;" name="note"/>
@@ -150,7 +145,6 @@
</record>
<record id="process_transition_validentries0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Validation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Accountant validates the accounting entries coming from the invoice.&quot;&quot;&quot;" name="note"/>
@@ -159,7 +153,6 @@
</record>
<record id="process_transition_entriesreconcile0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Accounting entries&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Accounting entries are the first input of the reconciliation.&quot;&quot;&quot;" name="note"/>
@@ -168,7 +161,6 @@
</record>
<record id="process_transition_statemententries0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Validation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Manual or automatic creation of payment entries according to the statements&quot;&quot;&quot;" name="note"/>
@@ -177,7 +169,6 @@
</record>
<record id="process_transition_paymentreconcile0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Payment entries&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Payment entries are the second input of the reconciliation.&quot;&quot;&quot;" name="note"/>
@@ -186,7 +177,6 @@
</record>
<record id="process_transition_reconcilepaid0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Payment&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;As soon as the reconciliation is done, the invoice can be paid.&quot;&quot;&quot;" name="note"/>
@@ -65,7 +65,6 @@
-->
<record id="process_transition_filestatement0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Automatic import of the bank statement&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Import of the statement in the system from an electronic file&quot;&quot;&quot;" name="note"/>
@@ -74,7 +73,6 @@
</record>
<record id="process_transition_invoicemanually0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Manual entry&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;A statement with manual entries becomes a draft statement.&quot;&quot;&quot;" name="note"/>
@@ -84,7 +82,6 @@
</record>
<record id="process_transition_invoiceimport0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Import from invoice or payment&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Import of the statement in the system from a supplier or customer invoice&quot;&quot;&quot;" name="note"/>
@@ -1,21 +1,21 @@
<?xml version="1.0" ?>
<openerp>
<data>
<!--
Process
<!--
Process
-->
<record id="process_process_supplierinvoiceprocess0" model="process.process">
<field eval="1" name="active"/>
<field name="model_id" ref="account.model_account_invoice"/>
<field eval="&quot;&quot;&quot;Supplier Invoice&quot;&quot;&quot;" name="name"/>
</record>
<!--
<!--
Process Node
-->
<record id="process_node_analyticcost0" model="process.node">
<field name="menu_id" ref="account.account_analytic_def_account"/>
<field name="model_id" ref="analytic.model_account_analytic_account"/>
@@ -26,7 +26,7 @@
<field eval="&quot;&quot;&quot;object.state in ('draft', 'open', 'pending', 'close')&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_supplierdraftinvoices0" model="process.node">
<field name="menu_id" ref="account.menu_action_invoice_tree2"/>
<field name="model_id" ref="account.model_account_invoice"/>
@@ -37,7 +37,7 @@
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_supplierinvoiceinvoice0" model="process.node">
<field name="menu_id" ref="account.menu_finance_payables"/>
<field name="model_id" ref="account.model_account_invoice"/>
@@ -48,7 +48,7 @@
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_supplierbankstatement0" model="process.node">
<field name="menu_id" ref="account.menu_bank_statement_tree"/>
<field name="model_id" ref="account.model_account_bank_statement"/>
@@ -60,7 +60,7 @@
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_supplieraccountingentries0" model="process.node">
<field name="menu_id" ref="account.menu_action_move_journal_line_form"/>
<field name="model_id" ref="account.model_account_move"/>
@@ -70,9 +70,8 @@
<field name="process_id" ref="process_process_supplierinvoiceprocess0"/>
<field eval="0" name="flow_start"/>
</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"/>
@@ -81,9 +80,8 @@
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</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"/>
@@ -92,7 +90,7 @@
<field eval="&quot;&quot;&quot;object.state=='valid'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_supplierpaidinvoice0" model="process.node">
<field name="menu_id" ref="account.menu_action_invoice_tree1"/>
<field name="model_id" ref="account.model_account_invoice"/>
@@ -103,22 +101,20 @@
<field eval="&quot;&quot;&quot;object.state=='paid'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<!--
<!--
Process Transition
-->
<record id="process_transition_supplieranalyticcost0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;From analytic accounts&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Analytic costs (timesheets, some purchased products, ...) come from analytic accounts. These generate draft supplier invoices.&quot;&quot;&quot;" name="note"/>
<field model="process.node" name="target_node_id" ref="process_node_supplierdraftinvoices0"/>
<field model="process.node" name="source_node_id" ref="process_node_analyticcost0"/>
</record>
<record id="process_transition_suppliercustomerinvoice0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Validation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Draft invoices are validated. &quot;&quot;&quot;" name="note"/>
@@ -126,51 +122,46 @@
<field model="process.node" name="source_node_id" ref="process_node_supplierdraftinvoices0"/>
<field eval="[(6,0,[ref('account.pro2_to_open')])]" name="transition_ids"/>
</record>
<record id="process_transition_suppliervalidentries0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Validation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Accountant validates the accounting entries coming from the invoice. &quot;&quot;&quot;" name="note"/>
<field model="process.node" name="target_node_id" ref="process_node_supplieraccountingentries0"/>
<field model="process.node" name="source_node_id" ref="process_node_supplierinvoiceinvoice0"/>
</record>
<record id="process_transition_supplierentriesreconcile0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Accounting entries&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Accounting entries are an input of the reconciliation.&quot;&quot;&quot;" name="note"/>
<field model="process.node" name="target_node_id" ref="process_node_supplierreconciliation0"/>
<field model="process.node" name="source_node_id" ref="process_node_supplieraccountingentries0"/>
</record>
<record id="process_transition_paymentorderbank0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Payment entries&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The payment order is sent to the bank.&quot;&quot;&quot;" name="note"/>
<field model="process.node" name="target_node_id" ref="process_node_supplierbankstatement0"/>
<field model="process.node" name="source_node_id" ref="process_node_supplierpaymentorder0"/>
</record>
<record id="process_transition_paymentorderreconcilation0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Validation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Bank statements are entered in the system.&quot;&quot;&quot;" name="note"/>
<field model="process.node" name="target_node_id" ref="process_node_supplierreconciliation0"/>
<field model="process.node" name="source_node_id" ref="process_node_supplierbankstatement0"/>
</record>
<record id="process_transition_supplierreconcilepaid0" model="process.transition">
<field eval="[(6,0,[])]" name="role_ids"/>
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;System payment&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;As soon as the reconciliation is done, the invoice's state turns to “done” (i.e. paid) in the system.&quot;&quot;&quot;" name="note"/>
<field model="process.node" name="target_node_id" ref="process_node_supplierpaidinvoice0"/>
<field model="process.node" name="source_node_id" ref="process_node_supplierreconciliation0"/>
</record>
</data>
</openerp>
+1 -1
View File
@@ -9,7 +9,7 @@
<field name="arch" type="xml">
<notebook position="inside">
<page string="Accounting">
<group groups="base.group_extended">
<group name="properties" groups="base.group_extended">
<separator string="Sales Properties" colspan="2"/>
<separator string="Purchase Properties" colspan="2"/>
<field name="property_account_income" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('sale_ok','=',0)]}" groups="base.group_extended"/>
@@ -198,7 +198,7 @@
<field name="parent_id" ref="analytic_project_1"/>
</record>
<record id="analytic_administratif" model="account.analytic.account">
<field name="name">Administratif</field>
<field name="name">Administrative</field>
<field name="code">1</field>
<field name="parent_id" ref="analytic_internal"/>
</record>
+2 -2
View File
@@ -28,8 +28,8 @@ from osv import osv
class account_analytic_journal(osv.osv):
_name = 'account.analytic.journal'
_columns = {
'name' : fields.char('Journal name', size=64, required=True),
'code' : fields.char('Journal code', size=8),
'name' : fields.char('Journal Name', size=64, required=True),
'code' : fields.char('Journal Code', size=8),
'active' : fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the analytic journal without removing it."),
'type': fields.selection([('sale','Sale'), ('purchase','Purchase'), ('cash','Cash'), ('general','General'), ('situation','Situation')], 'Type', size=32, required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type."),
'line_ids' : fields.one2many('account.analytic.line', 'journal_id', 'Lines'),
+29 -29
View File
@@ -172,19 +172,17 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree editable="top" string="Analytic Entries">
<field name="date" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
<field name="date"/>
<field name="ref" invisible="context.get('to_invoice', False)"/>
<field name="name"/>
<field name="journal_id"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total quantity"/>
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
<field domain="[('type','=','normal')]" name="account_id" groups="base.group_extended"/>
<field invisible="True" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)"/>
<field name="amount" sum="Total amount"/>
<field name="general_account_id"/>
<field name="ref"/>
<field name="currency_id" />
<field name="amount_currency" />
<field name="company_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" groups="base.group_multi_company"/>
<field name="journal_id" invisible="context.get('to_invoice', False)"/>
<field name="amount" sum="Total" invisible="context.get('to_invoice', False)"/>
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)" invisible="not context.get('to_invoice', False)"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" sum="Total Quantity" invisible="not context.get('to_invoice', False)"/>
<field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" invisible="not context.get('to_invoice', False)"/>
<field domain="[('type','=','normal')]" name="account_id"/>
<field name="general_account_id" invisible="context.get('to_invoice', False)"/>
<field name="user_id" invisible="1" />
</tree>
</field>
</record>
@@ -195,22 +193,24 @@
<field name="arch" type="xml">
<search string="Search Analytic Lines">
<group col='6' colspan='4'>
<filter string="Sales" domain="[('journal_id.type','=','sale')]" icon="terp-sale" help="Analytic Journal Items related to a sale journal."/>
<filter string="Purchases" domain="[('journal_id.type','=','purchase')]" icon="terp-purchase" help="Analytic Journal Items related to a purchase journal."/>
<filter name="sales" string="Sales" domain="[('journal_id.type','=','sale')]" icon="terp-sale" help="Analytic Journal Items related to a sale journal."/>
<filter name="purchases" string="Purchases" domain="[('journal_id.type','=','purchase')]" icon="terp-purchase" help="Analytic Journal Items related to a purchase journal."/>
<filter name="others" string="Others" domain="[('journal_id.type','in',('cash','general','situation')]" icon="terp-folder-orange"/>
<separator orientation="vertical"/>
<filter icon="terp-go-today" string="Overdue Accounts" domain="[('account_id.date','&lt;',time.strftime('%%Y-%%m-%%d'))]" help="Analytic Journal Items related to accounts having a past deadline."/>
<separator orientation="vertical"/>
<field name="date" select="1"/>
<field name="name" select="1"/>
<field name="account_id" select="1"/>
<field name="user_id" widget="selection"/>
<field name="date"/>
<field name="name"/>
<field name="account_id"/>
<field name="user_id">
<filter string="My Entries" domain="[('user_id','=',uid)]" icon="terp-personal"/>
</field>
</group>
<newline/>
<group string="Group By..." expand="0">
<filter string="Analytic Account" context="{'group_by':'account_id'}" groups="base.group_extended" icon="terp-folder-blue"/>
<filter string="Analytic Journal" context="{'group_by':'journal_id'}" icon="terp-folder-orange"/>
<filter string="Account" context="{'group_by':'account_id'}" groups="base.group_extended" icon="terp-folder-blue"/>
<filter string="Journal" context="{'group_by':'journal_id'}" icon="terp-folder-orange"/>
<filter string="User" context="{'group_by':'user_id'}" icon="terp-personal"/>
<separator orientation="vertical"/>
<filter string="General Account" context="{'group_by':'general_account_id'}" icon="terp-folder-green"/>
<filter string="Fin.Account" context="{'group_by':'general_account_id'}" icon="terp-folder-green"/>
<separator orientation="vertical"/>
<filter string="Product" context="{'group_by':'product_id'}" icon="terp-accessories-archiver"/>
</group>
@@ -431,13 +431,13 @@
</field>
</record>
<act_window
<act_window
context="{'search_default_account_id': [active_id], 'search_default_user_id': False}"
id="act_acc_analytic_acc_5_report_hr_timesheet_invoice_journal"
name="All Analytic Entries"
res_model="account.analytic.line"
src_model="account.analytic.account"
view_mode="tree,form"
id="act_acc_analytic_acc_5_report_hr_timesheet_invoice_journal"
name="All Analytic Entries"
res_model="account.analytic.line"
src_model="account.analytic.account"
view_mode="tree,form"
view_type="form"/>
<record id="view_account_journal_1" model="ir.ui.view">
@@ -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)
@@ -119,25 +119,25 @@ class account_analytic_balance(report_sxw.rml_parse):
return (debit-credit)
def _sum_all(self, accounts, date1, date2, option):
account_analytic_obj = self.pool.get('account.analytic.account')
ids = map(lambda x: x['id'], accounts)
if not len(ids):
if not ids:
return 0.0
if not self.acc_sum_list:
account_analytic_obj = self.pool.get('account.analytic.account')
ids2 = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', ids)])
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
@@ -280,7 +280,7 @@
<para style="terp_default_9">[[ move_a.code ]]</para>
</td>
<td>
<para style="terp_default_9">[[ move_a.name ]] asgfas</para>
<para style="terp_default_9">[[ move_a.name ]] </para>
</td>
<td>
<para style="terp_default_9">[[ move_a.account_id.code ]] - [[ move_a.account_id.name ]]</para>
+2 -2
View File
@@ -91,14 +91,14 @@ class account_analytic_cost_ledger(report_sxw.rml_parse):
def _sum_debit(self, accounts, date1, date2):
ids = map(lambda x: x.id, accounts)
if not len(ids):
if not ids:
return 0.0
self.cr.execute("SELECT sum(amount) FROM account_analytic_line WHERE account_id IN %s AND date>=%s AND date<=%s AND amount>0", (tuple(ids), date1, date2,))
return self.cr.fetchone()[0] or 0.0
def _sum_credit(self, accounts, date1, date2):
ids = map(lambda x: x.id, accounts)
if not len(ids):
if not ids:
return 0.0
self.cr.execute("SELECT -sum(amount) FROM account_analytic_line WHERE account_id IN %s AND date>=%s AND date<=%s AND amount<0", (tuple(ids),date1, date2,))
return self.cr.fetchone()[0] or 0.0
+14 -32
View File
@@ -181,13 +181,10 @@
<para style="terp_tblheader_Details_Right">Credit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Balance</para>
<para style="terp_tblheader_Details_Centre">Balance</para>
</td>
</tr>
</blockTable>
<para style="terp_default_2">
<font color="white"> </font>
</para>
<blockTable colWidths="62.0,250.0,57.0,56.0,57.0" style="Table_Grant_Total">
<tr>
<td>
@@ -199,21 +196,18 @@
</para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]]</para>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]] </para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (sum_credit(objects,data['form']['date1'],data['form']['date2'])) ]]</para>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (sum_credit(objects,data['form']['date1'],data['form']['date2'])) ]] </para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (sum_balance(objects,data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_2">
<font color="white"> </font>
</para>
<section>
<para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
<para style="terp_default_2">[[ repeatIn(objects,'o') ]]</para>
<blockTable colWidths="62.0,249.0,57.0,57.0,57.0" style="Table_Account_Detail">
<tr>
<td>
@@ -223,21 +217,18 @@
<para style="terp_default_Bold_9">[[ o.complete_name ]]</para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (account_sum_debit(o.id,data['form']['date1'],data['form']['date2'])) ]]</para>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (account_sum_debit(o.id,data['form']['date1'],data['form']['date2'])) ]] </para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (account_sum_credit(o.id,data['form']['date1'],data['form']['date2'])) ]]</para>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (account_sum_credit(o.id,data['form']['date1'],data['form']['date2'])) ]] </para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang (account_sum_balance(o.id,data['form']['date1'],data['form']['date2']))]] [[ company.currency_id.symbol ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_2">
<font color="white"> </font>
</para>
<section>
<para style="Standard">[[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2']),'move_g') ]]</para>
<para style="terp_default_2">[[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2']),'move_g') ]]</para>
<blockTable colWidths="62.0,249.0,58.0,56.0,57.0" style="Table_Move_Line_Detail">
<tr>
<td>
@@ -247,21 +238,18 @@
<para style="terp_default_Bold_9">[[ move_g['name'] ]]</para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang( move_g['debit']) ]]</para>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang( move_g['debit']) ]] </para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang( move_g['credit']) ]]</para>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang( move_g['credit']) ]] </para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U">[[ formatLang( move_g['balance']) ]] [[ company.currency_id.symbol ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_2">
<font color="white"> </font>
</para>
<section>
<para style="terp_default_9">[[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2']),'move_a') ]]</para>
<para style="terp_default_2">[[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2']),'move_a') ]]</para>
<blockTable colWidths="60.0,46.0,204.0,59.0,55.0,58.0" style="Table_Move_Line_Content">
<tr>
<td>
@@ -274,13 +262,13 @@
<para style="terp_default_9_Italic">[[ move_a['name'] ]]</para>
</td>
<td>
<para style="terp_default_9_italic_Rignt">[[ formatLang( move_a['debit'] )]]</para>
<para style="terp_default_9_italic_Rignt">[[ formatLang( move_a['debit'] )]] </para>
</td>
<td>
<para style="terp_default_9_italic_Rignt">[[ formatLang( move_a['credit']) ]]</para>
<para style="terp_default_9_italic_Rignt">[[ formatLang( move_a['credit']) ]] </para>
</td>
<td>
<para style="terp_default_9_italic_Rignt">[[ formatLang( move_a['balance']) ]]</para>
<para style="terp_default_9_italic_Rignt">[[ formatLang( move_a['balance']) ]] [[ company.currency_id.symbol]]</para>
</td>
</tr>
</blockTable>
@@ -288,13 +276,7 @@
<font color="white"> </font>
</para>
</section>
<para style="terp_default_8">
<font color="white"> </font>
</para>
</section>
</section>
<para style="terp_default_8">
<font color="white"> </font>
</para>
</story>
</document>
</document>
@@ -102,7 +102,7 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse):
def _sum_quantity(self, accounts, date1, date2, journals):
ids = map(lambda x: x.id, accounts)
if not len(ids):
if not ids:
return 0.0
if not journals:
self.cr.execute("SELECT sum(unit_amount) \
@@ -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
@@ -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>
+8 -4
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
@@ -30,7 +30,6 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
def __init__(self, cr, uid, name, context):
super(aged_trial_report, self).__init__(cr, uid, name, context=context)
self.query_line = ''
self.total_account = []
self.localcontext.update({
'time': time,
@@ -44,10 +43,12 @@ 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):
self.query = data['form'].get('query_line', '')
obj_move = self.pool.get('account.move.line')
self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {}))
self.direction_selection = data['form'].get('direction_selection', 'past')
self.target_move = data['form'].get('target_move', 'all')
self.date_from = data['form'].get('date_from', time.strftime('%Y-%m-%d'))
@@ -61,7 +62,6 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
def _get_lines(self, form):
res = []
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
self.cr.execute('SELECT DISTINCT res_partner.id AS id,\
res_partner.name AS name \
FROM res_partner,account_move_line AS l, account_account\
@@ -70,7 +70,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
AND (l.partner_id=res_partner.id)\
AND ' + self.query + ' \
ORDER BY res_partner.name' , (self.date_from,))
ORDER BY res_partner.name', (self.date_from,))
partners = self.cr.dictfetchall()
## mise a 0 du total
for i in range(7):
@@ -78,6 +78,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':
@@ -94,7 +96,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
AND ' + self.query + '\
AND account_account.active\
GROUP BY partner_id ' , (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids), self.date_from))
GROUP BY partner_id ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids), self.date_from))
t = self.cr.fetchall()
for i in t:
totals[i[0]] = i[1]
@@ -129,7 +131,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
AND '+ self.query + '\
AND account_account.active\
GROUP BY l.partner_id' , (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids), self.date_from))
GROUP BY l.partner_id', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids), self.date_from))
t = self.cr.fetchall()
for i in t:
future_past[i[0]] = i[1]
@@ -138,7 +140,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
# Each history will contain : history[1] = {'<partner_id>': <partner_debit-credit>}
history = []
for i in range(5):
args_list = (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids) ,self.date_from,)
args_list = (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids),self.date_from,)
dates_query = '(COALESCE(l.date_maturity,l.date)'
if form[str(i)]['start'] and form[str(i)]['stop']:
dates_query += ' BETWEEN %s AND %s)'
@@ -151,7 +153,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
args_list += (form[str(i)]['stop'],)
self.cr.execute('SELECT l.partner_id, SUM(l.debit-l.credit)\
FROM account_move_line AS l, account_account , account_move am \
FROM account_move_line AS l, account_account, account_move am \
WHERE (l.account_id = account_account.id) AND (l.move_id=am.id)\
AND (am.state IN %s)\
AND (account_account.type IN %s)\
@@ -161,7 +163,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
AND '+ self.query + '\
AND account_account.active\
AND ' + dates_query + '\
GROUP BY l.partner_id' , args_list)
GROUP BY l.partner_id', args_list)
t = self.cr.fetchall()
d = {}
for i in t:
@@ -216,7 +218,6 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
def _get_lines_with_out_partner(self, form):
res = []
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted']
@@ -226,7 +227,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
self.total_account.append(0)
totals = {}
self.cr.execute('SELECT SUM(l.debit-l.credit) \
FROM account_move_line AS l, account_account , account_move am \
FROM account_move_line AS l, account_account, account_move am \
WHERE (l.account_id = account_account.id) AND (l.move_id=am.id)\
AND (am.state IN %s)\
AND (l.partner_id IS NULL)\
@@ -234,7 +235,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
AND ((l.reconcile_id IS NULL) \
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
AND ' + self.query + '\
AND account_account.active ' ,(tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from))
AND account_account.active ',(tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from))
t = self.cr.fetchall()
for i in t:
totals['Unknown Partner'] = i[0]
@@ -265,7 +266,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
AND ((l.reconcile_id IS NULL)\
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
AND '+ self.query + '\
AND account_account.active ' , (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from))
AND account_account.active ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from))
t = self.cr.fetchall()
for i in t:
future_past['Unknown Partner'] = i[0]
@@ -285,7 +286,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
args_list += (form[str(i)]['stop'],)
self.cr.execute('SELECT SUM(l.debit-l.credit)\
FROM account_move_line AS l, account_account , account_move am \
FROM account_move_line AS l, account_account, account_move am \
WHERE (l.account_id = account_account.id) AND (l.move_id=am.id)\
AND (am.state IN %s)\
AND (account_account.type IN %s)\
@@ -295,7 +296,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
AND '+ self.query + '\
AND account_account.active\
AND ' + dates_query + '\
GROUP BY l.partner_id' , args_list)
GROUP BY l.partner_id', args_list)
t = self.cr.fetchall()
d = {}
for i in t:
@@ -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>
@@ -33,12 +33,12 @@ class analytic_entries_report(osv.osv):
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
'user_id' : fields.many2one('res.users', 'User',readonly=True),
'user_id': fields.many2one('res.users', 'User',readonly=True),
'name': fields.char('Description', size=64, readonly=True),
'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),
@@ -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,13 +49,31 @@
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"/>
</field>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
<filter string="Partner" icon="terp-partner" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical"/>
<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"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
<filter string="Product UOM" icon="terp-mrp" context="{'group_by':'product_uom_id'}"/>
<separator orientation="vertical" groups="base.group_multi_company"/>
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
<filter string="Month" name="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="currency_id" widget="selection"/>
<field name="general_account_id" widget="selection"/>
@@ -63,26 +81,9 @@
<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/>
<group expand="1" string="Group By...">
<filter string="User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
<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="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"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
<filter string="Product UOM" icon="terp-mrp" context="{'group_by':'product_uom_id'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
<filter string="Month" name="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
</search>
</field>
</record>
@@ -108,7 +109,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>
+2 -1
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
@@ -85,7 +86,7 @@ class account_balance(report_sxw.rml_parse, common_report_header):
self.sum_debit += account_rec['debit']
self.sum_credit += account_rec['credit']
if disp_acc == 'bal_movement':
if res['credit'] > 0 or res['debit'] > 0 or res['balance'] > 0 :
if res['credit'] > 0 or res['debit'] > 0 or res['balance'] > 0:
self.result_acc.append(res)
elif disp_acc == 'bal_solde':
if res['balance'] != 0:
+2 -2
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>
@@ -139,7 +139,7 @@ class account_balance_landscape(rml_parse.rml_parse):
ctx['state'] = form['context'].get('state','all')
tmp = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx.copy())
if len(tmp):
if tmp:
accounts.append(tmp)
merged_accounts=zip(*accounts)
@@ -198,7 +198,7 @@ class account_balance_landscape(rml_parse.rml_parse):
ctx['state'] = form['context'].get('state','all')
tmp1 = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx.copy())
if len(tmp1):
if tmp1:
accounts.append(tmp1)
if level==1: #if parent is called,done is not empty when called again.
+27 -27
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,
}
@@ -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">
@@ -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">
@@ -233,7 +233,7 @@
<para style="terp_default_9"><font color="white">[[ '. '*(a['level']-1) ]]</font><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]</font></para>
</td>
<td>
<para style="terp_default_Right_9"><font>[[ a['level1']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font><font>[[ formatLang(abs(a['balance'])) ]] [[ company.currency_id.symbol ]]</font></para>
<para style="terp_default_Right_9"><font>[[ a['level1']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font><font>[[(a['code'] and a['name']) and formatLang(abs(a['balance'])) or removeParentNode('font')]] [[ company.currency_id.symbol ]]</font></para>
</td>
</tr>
</blockTable>
@@ -48,15 +48,18 @@ 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 '
self.query_get_clause += data['form']['query_line'] or ''
self.query_get_clause += obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {}))
objects = self.pool.get('account.journal.period').browse(self.cr, self.uid, new_ids)
if new_ids:
self.cr.execute('SELECT period_id, journal_id FROM account_journal_period WHERE id IN %s', (tuple(new_ids),))
@@ -65,7 +68,15 @@ 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):
@@ -81,12 +92,12 @@ class journal_print(report_sxw.rml_parse, common_report_header):
def _get_account(self, data):
if data['model'] == 'account.journal.period':
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).company_id.name
return super(journal_print ,self)._get_account(data)
return super(journal_print,self)._get_account(data)
def _get_fiscalyear(self, data):
if data['model'] == 'account.journal.period':
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).fiscalyear_id.name
return super(journal_print ,self)._get_fiscalyear(data)
return super(journal_print,self)._get_fiscalyear(data)
def _display_currency(self, data):
if data['model'] == 'account.journal.period':
@@ -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">
@@ -283,7 +283,7 @@
<td><para style="terp_tblheader_Details_Right">Balance</para></td>
</tr>
</blockTable>
<blockTable colWidths="50.0,250.0,70.0,70.0,70.0,50.0" style="Table_Account_detail_Title_Currency">[[ display_currency(data) or removeParentNode('blockTable') ]]
<blockTable colWidths="50.0,220.0,70.0,70.0,70.0,80.0" style="Table_Account_detail_Title_Currency">[[ display_currency(data) or removeParentNode('blockTable') ]]
<tr>
<td><para style="terp_tblheader_Details">A/C No.</para></td>
<td><para style="terp_tblheader_Details">Account Name</para></td>
@@ -295,16 +295,16 @@
</blockTable>
<blockTable colWidths="50.0,300.0,70.0,70.0,70.0" style="Table_Final_Total">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
<tr>
<td><para style="terp_default_Bold_9">Total<font size="8.0">([[ company.currency_id.code]])</font>:</para></td>
<td><para style="terp_default_Bold_9">Total:</para></td>
<td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_debit(o.period_id.id, o.journal_id.id)) ]] </para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)) ]] </para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)-sum_debit(o.period_id.id, o.journal_id.id) ) ]] [[ company.currency_id.symbol ]]</para></td>
</tr>
</blockTable>
<blockTable colWidths="50.0,250.0,70.0,70.0,70.0,50.0" style="Table_Final_Total_currency">[[ display_currency(data) or removeParentNode('blockTable') ]]
<blockTable colWidths="50.0,220.0,70.0,70.0,70.0,80.0" style="Table_Final_Total_currency">[[ display_currency(data) or removeParentNode('blockTable') ]]
<tr>
<td><para style="terp_default_Bold_9">Total:([[ company.currency_id.code]])</para></td>
<td><para style="terp_default_Bold_9">Total:</para></td>
<td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_debit(o.period_id.id, o.journal_id.id)) ]]</para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)) ]]</para></td>
@@ -323,19 +323,17 @@
<td><para style="terp_default_Right_9">[[ formatLang(line['credit']-line['debit']) ]] [[ company.currency_id.symbol ]]</para></td>
</tr>
</blockTable>
<blockTable colWidths="50.0,250.0,70.0,70.0,70.0,50.0" style="Table_Journal_Line_Content_currency">[[ display_currency(data) or removeParentNode('blockTable') ]]
<blockTable colWidths="50.0,220.0,70.0,70.0,70.0,80.0" style="Table_Journal_Line_Content_currency">[[ display_currency(data) or removeParentNode('blockTable') ]]
<tr>
<td><para style="terp_default_9">[[ line['code'] ]]</para></td>
<td><para style="terp_default_9">[[ line['name'] ]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['debit']) ]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['credit'])]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['credit']-line['debit']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Right_9">[[ line['currency_id'] and formatLang(line['amount_currency'] or '') ]] [[ line['currency_id'] and line['currency_code'] or '']]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['credit']-line['debit']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Right_9"><font>[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]</font></para></td>
</tr>
</blockTable>
</section>
<para style="P9">
<font color="white"> </font>
</para>
</story>
</document>
@@ -55,7 +55,7 @@ class account_entries_report(osv.osv):
'move_line_state': fields.selection([('draft','Unbalanced'), ('valid','Valid')], 'State of Move Line', readonly=True),
'reconcile_id': fields.many2one('account.move.reconcile', readonly=True),
'partner_id': fields.many2one('res.partner','Partner', readonly=True),
'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
'quantity': fields.float('Products Quantity', digits=(16,2), readonly=True),
'user_type': fields.many2one('account.account.type', 'Account Type', readonly=True),
'type': fields.selection([
@@ -48,6 +48,19 @@
</graph>
</field>
</record>
<record id="view_company_analysis_tree" model="ir.ui.view">
<field name="name">account.company.analysis.tree</field>
<field name="model">account.entries.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Company Analysis" >
<field name="user_type"/>
<field name="debit" />
<field name="credit" />
<field name="balance" />
</tree>
</field>
</record>
<record id="view_account_entries_report_search" model="ir.ui.view">
<field name="name">account.entries.report.search</field>
<field name="model">account.entries.report</field>
@@ -117,6 +130,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>
@@ -49,16 +49,19 @@ 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 '
self.query_get_clause += data['form']['query_line'] or ''
self.query_get_clause += obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {}))
objects = self.pool.get('account.journal.period').browse(self.cr, self.uid, new_ids)
if new_ids:
self.cr.execute('SELECT period_id, journal_id FROM account_journal_period WHERE id IN %s', (tuple(new_ids),))
@@ -81,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):
@@ -123,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):
@@ -134,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')
@@ -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>
@@ -270,7 +270,7 @@
<td><para style="terp_tblheader_Details_Right">Balance</para></td>
</tr>
<tr>
<td><para style="terp_default_Bold_9">Total:([[ company.currency_id.code]])</para></td>
<td><para style="terp_default_Bold_9">Total:</para></td>
<td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit()) ]] </para></td>
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit()) ]]</para></td>
@@ -373,7 +373,7 @@
<td><para style="terp_default_Right_9">[[ formatLang(line['debit'] )]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['credit']) ]]</para></td>
<td><para style="terp_default_Right_9">[[ formatLang(line['credit']-line['debit'] ) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="terp_default_Right_9">[[ line['currency_id'] and formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]</para></td>
<td><para style="terp_default_Right_9"><font>[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]</font></para></td>
</tr>
</blockTable>
</section>
@@ -38,9 +38,12 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
def set_context(self, objects, data, ids, report_type=None):
new_ids = ids
obj_move = self.pool.get('account.move.line')
self.sortby = data['form'].get('sortby', 'sort_date')
self.query = data['form'].get('query_line', '')
self.init_query = data['form']['initial_bal_query']
self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context',{}))
ctx2 = data['form'].get('used_context',{}).copy()
ctx2.update({'initial_bal': True})
self.init_query = obj_move._query_get(self.cr, self.uid, obj='l', context=ctx2)
self.init_balance = data['form']['initial_balance']
self.display_account = data['form']['display_account']
self.target_move = data['form'].get('target_move', 'all')
@@ -84,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
@@ -97,7 +101,7 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
FROM account_move_line l \
WHERE l.account_id = %s AND %s '%(account.id, self.init_query))
sum_currency += self.cr.fetchone()[0] or 0.0
return str(sum_currency)
return sum_currency
def get_children_accounts(self, account):
res = []
@@ -113,15 +117,15 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
sold_account = self._sum_balance_account(child_account)
self.sold_accounts[child_account.id] = sold_account
if self.display_account == 'bal_movement':
if child_account.type != 'view' and num_entry <> 0 :
if child_account.type != 'view' and num_entry <> 0:
res.append(child_account)
elif self.display_account == 'bal_solde':
if child_account.type != 'view' and num_entry <> 0 :
if child_account.type != 'view' and num_entry <> 0:
if ( sold_account <> 0.0):
res.append(child_account)
else:
res.append(child_account)
if not len(res):
if not res:
return [account]
return res
@@ -157,7 +161,7 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
else:
sql_sort='l.date'
sql = """
SELECT l.id AS lid, l.date AS ldate, j.code AS lcode, l.amount_currency,l.ref AS lref, l.name AS lname, COALESCE(l.debit,0) AS debit, COALESCE(l.credit,0) AS credit, l.period_id AS lperiod_id, l.partner_id AS lpartner_id,
SELECT l.id AS lid, l.date AS ldate, j.code AS lcode, l.currency_id,l.amount_currency,l.ref AS lref, l.name AS lname, COALESCE(l.debit,0) AS debit, COALESCE(l.credit,0) AS credit, l.period_id AS lperiod_id, l.partner_id AS lpartner_id,
m.name AS move_name, m.id AS mmove_id,
c.symbol AS currency_code,
i.id AS invoice_id, i.type AS invoice_type, i.number AS invoice_number,
@@ -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>
@@ -334,7 +334,7 @@
<td><para style="P4">[[ formatLang(line['debit']) ]]</para></td>
<td><para style="P4">[[ formatLang(line['credit']) ]]</para></td>
<td><para style="P4">[[ formatLang(line['progress']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4">[[ formatLang(line['amount_currency'] or '') ]] [[ line['currency_code'] or '']]</para></td>
<td><para style="P4"><font>[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']]</font></para></td>
</tr>
</blockTable>
</section>
@@ -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">
@@ -263,13 +263,13 @@
<tr>
<td>
<blockTable colWidths="404.0,335.0,79,73.5,72.5,79.00" style="Table5">
<tr>
<tr>
<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)) ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o)) ]]</u></para></td>
<td><para style="P9b"><u>[[formatLang(sum_balance_account(o)) ]] [[ company.currency_id.symbol ]]</u></para></td>
<td><para style="P9b"><u>[[ o.currency_id and sum_currency_amount_account(o) +o.currency_id.code or '' ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_debit_account(o), dp='Account') ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_credit_account(o), dp='Account') ]]</u></para></td>
<td><para style="P9b"><u>[[ formatLang(sum_balance_account(o), dp='Account') ]] [[ company.currency_id.symbol ]]</u></para></td>
<td><para style="P9b"><u>[[ o.currency_id and formatLang(sum_currency_amount_account(o), dp='Account') + o.currency_id.code or '' ]]</u></para></td>
</tr>
</blockTable>
</td>
@@ -292,10 +292,10 @@
<td><para style="P2_content">[[ line['move'] ]]</para></td>
<td><para style="P3_content">[[ line['lname'] ]]</para></td>
<td><para style="P3_content_center">[[ strip_name(line['line_corresp'].replace(', ',','),40) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['debit']) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['credit']) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['progress']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['amount_currency'] or '')]] [[ line['currency_code'] or '' ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['debit'], dp='Account') ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['credit'], dp='Account') ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['progress'], dp='Account') ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4_content"><font>[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']]</font></para></td>
</tr>
</blockTable>
@@ -327,9 +327,9 @@
<tr>
<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)) ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o)) ]]</u></para></td>
<td><para style="P9b"><u>[[formatLang(sum_balance_account(o)) ]] [[ company.currency_id.symbol ]]</u></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><para style="P9b"><u>[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</u></para></td>
</tr>
</blockTable>
</td>
@@ -352,9 +352,9 @@
<td><para style="P2_content">[[ line['move'] ]]</para></td>
<td><para style="P3_content">[[ line['lname'] ]]</para></td>
<td><para style="P3_content_center">[[ strip_name(line['line_corresp'],15) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['debit']) ]] </para></td>
<td><para style="P4_content">[[ formatLang(line['credit']) ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['progress']) ]] [[ company.currency_id.symbol ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['debit'], dp='Account') ]] </para></td>
<td><para style="P4_content">[[ formatLang(line['credit'], dp='Account') ]]</para></td>
<td><para style="P4_content">[[ formatLang(line['progress'], dp='Account') ]] [[ company.currency_id.symbol ]]</para></td>
</tr>
</blockTable>
@@ -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),
@@ -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/>
+7 -5
View File
@@ -49,16 +49,18 @@ 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):
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 = data['form'].get('active_ids', [])
self.query_get_clause = 'AND '
self.query_get_clause += data['form'].get('query_line', '')
self.query_get_clause += obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {}))
self.sort_selection = data['form'].get('sort_selection', 'date')
objects = self.pool.get('account.journal.period').browse(self.cr, self.uid, new_ids)
if new_ids:
@@ -82,7 +84,7 @@ class journal_print(report_sxw.rml_parse, common_report_header):
if self.target_move == 'posted':
move_state = ['posted']
self.cr.execute('SELECT SUM(debit) FROM account_move_line l , account_move am '
self.cr.execute('SELECT SUM(debit) FROM account_move_line l, account_move am '
'WHERE l.move_id=am.id AND am.state IN %s AND l.period_id IN %s AND l.journal_id IN %s ' + self.query_get_clause + ' ',
(tuple(move_state), tuple(period_id), tuple(journal_id)))
return self.cr.fetchone()[0] or 0.0
@@ -119,7 +121,7 @@ class journal_print(report_sxw.rml_parse, common_report_header):
if self.target_move == 'posted':
move_state = ['posted']
self.cr.execute('SELECT l.id FROM account_move_line l, account_move am WHERE l.move_id=am.id AND am.state IN %s AND l.period_id=%s AND l.journal_id IN %s ' + self.query_get_clause + ' ORDER BY l.'+ self.sort_selection + '' ,(tuple(move_state), period_id, tuple(journal_id) ))
self.cr.execute('SELECT l.id FROM account_move_line l, account_move am WHERE l.move_id=am.id AND am.state IN %s AND l.period_id=%s AND l.journal_id IN %s ' + self.query_get_clause + ' ORDER BY l.'+ self.sort_selection + '',(tuple(move_state), period_id, tuple(journal_id) ))
ids = map(lambda x: x[0], self.cr.fetchall())
return obj_mline.browse(self.cr, self.uid, ids)
@@ -136,12 +138,12 @@ class journal_print(report_sxw.rml_parse, common_report_header):
def _get_fiscalyear(self, data):
if data['model'] == 'account.journal.period':
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).fiscalyear_id.name
return super(journal_print ,self)._get_fiscalyear(data)
return super(journal_print, self)._get_fiscalyear(data)
def _get_account(self, data):
if data['model'] == 'account.journal.period':
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).company_id.name
return super(journal_print ,self)._get_account(data)
return super(journal_print, self)._get_account(data)
def _display_currency(self, data):
if data['model'] == 'account.journal.period':
+2 -2
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">
@@ -22,6 +22,7 @@
import time
import re
import copy
from tools.translate import _
from report import report_sxw
from common_report_header import common_report_header
@@ -48,12 +49,13 @@ 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):
self.display_partner = data['form'].get('display_partner', 'non-zero_balance')
self.query = data['form'].get('query_line', '')
self.init_query = data['form'].get('initial_bal_query', '')
obj_move = self.pool.get('account.move.line')
self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {}))
self.result_selection = data['form'].get('result_selection')
self.target_move = data['form'].get('target_move', 'all')
@@ -81,7 +83,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
full_account = []
result_tmp = 0.0
self.cr.execute(
"SELECT p.ref,l.account_id,ac.name AS account_name,ac.code AS code ,p.name, sum(debit) AS debit, sum(credit) AS credit, " \
"SELECT p.ref,l.account_id,ac.name AS account_name,ac.code AS code,p.name, sum(debit) AS debit, sum(credit) AS credit, " \
"CASE WHEN sum(debit) > sum(credit) " \
"THEN sum(debit) - sum(credit) " \
"ELSE 0 " \
@@ -116,7 +118,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
for rec in full_account:
if not rec.get('name', False):
rec.update({'name': _('Unknown Partner')})
## We will now compute Total
subtotal_row = self._add_subtotal(full_account)
return subtotal_row
@@ -141,8 +143,8 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
new_header['ref'] = ''
new_header['name'] = r['account_name']
new_header['code'] = r['code']
new_header['debit'] = r['debit']
new_header['credit'] = r['credit']
new_header['debit'] = r['debit']
new_header['credit'] = r['credit']
new_header['scredit'] = tot_scredit
new_header['sdebit'] = tot_sdebit
new_header['enlitige'] = tot_enlitige
@@ -252,7 +254,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
"JOIN account_move am ON (am.id = l.move_id)" \
"WHERE l.account_id IN %s" \
"AND am.state IN %s" \
"AND " + self.query + "" ,
"AND " + self.query + "",
(tuple(self.account_ids), tuple(move_state)))
temp_res = float(self.cr.fetchone()[0] or 0.0)
return temp_res
@@ -271,7 +273,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
"JOIN account_move am ON (am.id = l.move_id)" \
"WHERE l.account_id IN %s" \
"AND am.state IN %s" \
"AND " + self.query + "" ,
"AND " + self.query + "",
(tuple(self.account_ids), tuple(move_state)))
temp_res = float(self.cr.fetchone()[0] or 0.0)
return temp_res
@@ -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>
+155 -112
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,11 +53,15 @@ 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):
self.query = data['form'].get('query_line', '')
self.init_query = data['form'].get('initial_bal_query', '')
obj_move = self.pool.get('account.move.line')
self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {}))
ctx2 = data['form'].get('used_context',{}).copy()
ctx2.update({'initial_bal': True})
self.init_query = obj_move._query_get(self.cr, self.uid, obj='l', context=ctx2)
self.reconcil = data['form'].get('reconcil', True)
self.initial_balance = data['form'].get('initial_balance', True)
self.result_selection = data['form'].get('result_selection', 'customer')
@@ -99,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()
@@ -111,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 ' '
@@ -181,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, " \
@@ -194,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()
@@ -202,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']
@@ -210,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, " \
@@ -223,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'
@@ -358,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
@@ -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>
@@ -289,7 +289,7 @@
<para style="terp_tblheader_Details">Ref.</para>
</td>
<td>
<para style="terp_tblheader_Details">A/c No.- Name</para>
<para style="terp_tblheader_Details">Account</para>
</td>
<td>
<para style="terp_tblheader_Details">Entry Label</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>
@@ -359,7 +359,7 @@
<para style="P3">[[ line['move_name'] ]]</para>
</td>
<td>
<para style="P3">[[ line['a_code'] ]] - [[ line['a_name'] ]]</para>
<para style="P3">[[ line['a_code'] ]]</para>
</td>
<td>
<para style="P3">[[ line['ref'] ]] - [[ line['name'] ]]</para>
@@ -391,7 +391,7 @@
<para style="terp_tblheader_Details">Ref.</para>
</td>
<td>
<para style="terp_tblheader_Details">A/c No.- Name</para>
<para style="terp_tblheader_Details">Account</para>
</td>
<td>
<para style="terp_tblheader_Details">Entry Label</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>
@@ -472,7 +472,7 @@
<para style="P3">[[ line['move_name'] ]]</para>
</td>
<td>
<para style="P3">[[ line['a_code'] ]] - [[ line['a_name'] ]]</para>
<para style="P3">[[ line['a_code'] ]]</para>
</td>
<td>
<para style="P3">[[ (line['ref'] or '') + ' ' + line['name'] ]]</para>
@@ -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>
@@ -443,7 +444,7 @@
<para style="terp_tblheader_Details">Ref.</para>
</td>
<td>
<para style="terp_tblheader_Details">A/c No.- Name</para>
<para style="terp_tblheader_Details">Account</para>
</td>
<td>
<para style="terp_tblheader_Details">Entry Label</para>
@@ -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>
@@ -506,7 +507,7 @@
<para style="P3">[[ line['move_name'] ]]</para>
</td>
<td>
<para style="P3">[[ line['a_code'] ]] - [[ line['a_name'] ]]</para>
<para style="P3">[[ line['a_code'] ]]</para>
</td>
<td>
<para style="P3">[[ (line['ref'] or '') + ' ' + line['name'] ]]</para>
@@ -536,7 +537,7 @@
<para style="terp_tblheader_Details">Ref.</para>
</td>
<td>
<para style="terp_tblheader_Details">A/c No.- Name</para>
<para style="terp_tblheader_Details">Account</para>
</td>
<td>
<para style="terp_tblheader_Details">Entry Label</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>
@@ -611,7 +612,7 @@
<para style="P3">[[ line['move_name'] ]]</para>
</td>
<td>
<para style="P3">[[ line['a_code'] ]] - [[ line['a_name'] ]]</para>
<para style="P3">[[ line['a_code'] ]]</para>
</td>
<td>
<para style="P3">[[ (line['ref'] or '') + ' ' + line['name'] ]]</para>
@@ -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:
@@ -232,10 +232,10 @@
<para style="terp_default_Right_9">[[ formatLang(l.price_unit) ]][[ o.currency_id.symbol ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(l.discount) ]] </para>
<para style="terp_default_Right_9">[[ formatLang(l.discount, digits=get_digits(dp='Account')) ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(l.price_subtotal) ]] [[ o.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(l.price_subtotal, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]]</para>
</td>
</tr>
<tr>
@@ -294,7 +294,7 @@
<para style="terp_default_9">Taxes:</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(o.amount_tax) ]] [[ o.currency_id.symbol ]]</para>
<para style="terp_default_Right_9">[[ formatLang(o.amount_tax, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]]</para>
</td>
</tr>
<tr>
@@ -338,7 +338,7 @@
<para style="terp_default_8">[[ t.name ]]</para>
</td>
<td>
<para style="terp_default_Right_8">[[ formatLang(t.base) ]] [[ o.currency_id.symbol ]]</para>
<para style="terp_default_Right_8">[[ formatLang(t.base, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]]</para>
</td>
<td>
<para style="terp_default_Right_8">[[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount) ]] [[ o.currency_id.symbol ]]</para>
@@ -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>
@@ -373,4 +373,4 @@
<font color="white"> </font>
</para>
</story>
</document>
</document>
@@ -30,11 +30,11 @@ class Overdue(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(Overdue, self).__init__(cr, uid, name, context=context)
self.localcontext.update( {
'time' : time,
'adr_get' : self._adr_get,
'getLines' : self._lines_get,
'tel_get' : self._tel_get,
'message' : self._message,
'time': time,
'adr_get': self._adr_get,
'getLines': self._lines_get,
'tel_get': self._tel_get,
'message': self._message,
})
self.context = context
def _adr_get(self, partner, type):
@@ -47,10 +47,10 @@ class Overdue(report_sxw.rml_parse):
'name': False,
'street': False,
'street2': False,
'city' : False,
'zip' : False,
'city': False,
'zip': False,
'state_id':False,
'country_id' : False,
'country_id': False,
}
if adr_id:
result = res_partner_address.read(self.cr, self.uid, [adr_id], context=self.context.copy())
@@ -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:
@@ -46,11 +46,13 @@
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="5,0" stop="5,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,1" stop="1,1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,1" stop="2,1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,1" stop="3,1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="4,1" stop="4,1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="5,1" stop="5,1"/>
</blockTableStyle>
<blockTableStyle id="Table4">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
@@ -116,7 +118,7 @@
</para>
<para style="terp_default_9">Document: Customer account statement</para>
<para style="terp_default_9">Date: [[ formatLang(time.strftime('%Y-%m-%d'),date=True) ]]</para>
<para style="terp_default_9">Customer Ref: [[ o.ref or '' ]]</para>
<para style="terp_default_9">Customer Ref: [[ o.ref or ' ']]</para>
<para style="terp_default_9">
<font color="white"> </font>
</para>
@@ -181,10 +183,10 @@
<para style="terp_default_Centre_9">[[ line['date_maturity'] and formatLang(line['date_maturity'],date=True) or '' ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]]</para>
<para style="terp_default_Right_9">[[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]] </para>
<para style="terp_default_Right_9">[[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((line['date_maturity'] &lt; time.strftime('%Y-%m-%d'))) and formatLang(line['debit'] - line['credit']) ]] [[ company.currency_id.symbol ]]</para>
@@ -195,7 +197,7 @@
</tr>
</blockTable>
</section>
<blockTable colWidths="247.0,65.0,59.0,56.0,66.0,17.0" style="Table2">
<blockTable colWidths="244.0,71.0,56.0,56.0,66.0,17.0" style="Table2">
<tr>
<td>
<para style="terp_default_8">
@@ -206,7 +208,7 @@
<para style="terp_default_Bold_9">Sub-Total : </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]]</para>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] </para>
@@ -220,6 +222,8 @@
</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="250.0,66.0,62.0,131.0" style="Table4">
<tr>
<td>
<para style="terp_default_8">
@@ -230,25 +234,21 @@
<para style="terp_default_Bold_9">Balance : </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.symbol ]]</para>
<para style="terp_tblheader_Details_Right">[[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.symbol ]]</para>
</td>
<td>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_9">
<para style="terp_default_8">
<font color="white"> </font>
</para>
</td>
</tr>
</blockTable>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="terp_default_9">Total amount due: [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.symbol ]].</para>
<para style="terp_default_8">
<font color="white"> </font>
@@ -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">
@@ -240,7 +240,7 @@
</para>
</td>
<td>
<para style="terp_default_Right_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font><font>[[ formatLang(abs(a['balance1'])) ]] [[ company.currency_id.symbol ]]</font></para>
<para style="terp_default_Right_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font><font>[[(a['code1'] and a['name1']) and formatLang(abs(a['balance1'])) or removeParentNode('font') ]] [[ company.currency_id.symbol ]]</font></para>
</td>
</tr>
</blockTable>
+20 -19
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,
}
@@ -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">
+1 -1
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([
+219
View File
@@ -0,0 +1,219 @@
# -*- 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 ):
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:
@@ -104,7 +104,7 @@
</stylesheet>
<story>
<para style="P2">Taxes</para>
<para style="P2">Tax Statement</para>
<blockTable colWidths="340.0,55.0,55.0,90.0" style="Table2" repeatRows="1">
<tr>
<td><para style="P12">Tax Name</para></td>
@@ -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:
@@ -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']
+5 -7
View File
@@ -21,12 +21,10 @@
from report import report_sxw
import xml.dom.minidom
import os, time
import time
import osv
import re
import tools
import pooler
import re
import sys
@@ -36,17 +34,17 @@ class rml_parse(report_sxw.rml_parse):
self.localcontext.update({
'comma_me': self.comma_me,
'format_date': self._get_and_change_date_format_for_swiss,
'strip_name' : self._strip_name,
'explode_name' : self._explode_name,
'strip_name': self._strip_name,
'explode_name': self._explode_name,
})
def comma_me(self,amount):
#print "#" + str(amount) + "#"
if not amount:
amount = 0.0
if type(amount) is float :
if type(amount) is float:
amount = str('%.2f'%amount)
else :
else:
amount = str(amount)
if (amount == '0'):
return ' '
-220
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:
+2 -144
View File
@@ -5,155 +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 model="res.groups" id="group_accounting_accountant">
<field name="name">Accounting / Accountant and 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'),ref('base.group_system')])]" 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'),ref('base.group_system')])]" 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'),ref('base.group_system')])]" 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'),ref('base.group_system')])]" 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'),ref('base.group_system')])]" 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'),ref('base.group_system')])]" 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'),ref('base.group_system')])]" 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'),ref('base.group_system')])]" 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('base.group_system'), 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'),ref('base.group_system')])]" 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'),ref('base.group_system')])]" 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'),ref('base.group_system')])]" name="groups_id"/>
</record>
<record id="menu_general_Balance_report" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager'),ref('base.group_system')])]" name="groups_id"/>
</record>
<record id="menu_account_bs_report" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager'),ref('base.group_system')])]" name="groups_id"/>
</record>
<record id="menu_account_pl_report" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager'),ref('base.group_system')])]" name="groups_id"/>
</record>
<record id="menu_tax_report" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager'),ref('base.group_system')])]" name="groups_id"/>
</record>
<record id="next_id_22" model="ir.ui.menu">
<field eval="[(6,0,[ref('group_account_manager'),ref('base.group_system')])]" 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"/>
+18 -66
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,53 +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_invoice_accounting_accountant","account.invoice","model_account_invoice","account.group_accounting_accountant",1,1,1,1
"access_account_invoice_line_accounting_accountant","account.invoice.line","model_account_invoice_line","account.group_accounting_accountant",1,1,1,1
"access_res_partner_accounting_accountant","res.partner","base.model_res_partner","account.group_accounting_accountant",1,1,1,1
"access_account_account_accounting_accountant","account.account","model_account_account","account.group_accounting_accountant",1,0,0,0
"access_account_account_type_accounting_accountant","account.type","model_account_account_type","account.group_accounting_accountant",1,0,0,0
"access_account_tax_accounting_accountant","account.tax","model_account_tax","account.group_accounting_accountant",1,0,0,0
"access_account_tax_code_accounting_accountant","account.tax.code","model_account_tax_code","account.group_accounting_accountant",1,0,0,0
"access_account_invoice_tax_accounting_accountant","account.invoice.tax","model_account_invoice_tax","account.group_accounting_accountant",1,0,0,0
"access_res_partner_address_accounting_accountant","res.partner.address","base.model_res_partner_address","account.group_accounting_accountant",1,1,1,1
"access_account_move_accounting_accountant","account.move","model_account_move","account.group_accounting_accountant",1,1,1,1
"access_account_move_line_accounting_accountant","account.move.line","model_account_move_line","account.group_accounting_accountant",1,1,1,1
"access_res_partner_bank_accounting_accountant","res.partner.bank","base.model_res_partner_bank","account.group_accounting_accountant",1,0,0,0
"access_res_partner_event_accounting_accountant","res.partner.event","base.model_res_partner_event","account.group_accounting_accountant",1,0,0,0
"access_res_currency_rate_accounting_accountant","res.currency.rate","base.model_res_currency_rate","account.group_accounting_accountant",1,1,0,0
"access_res_currency_accounting_accountant","res.currency","base.model_res_currency","account.group_accounting_accountant",1,1,0,0
"access_product_template_accounting_accountant","product.template","product.model_product_template","account.group_accounting_accountant",1,0,0,0
"access_product_product_accounting_accountant","product.product","product.model_product_product","account.group_accounting_accountant",1,0,0,0
"access_product_category_accounting_accountant","product.category","product.model_product_category","account.group_accounting_accountant",1,0,0,0
"access_product_pricelist_accounting_accountant","product.pricelist","product.model_product_pricelist","account.group_accounting_accountant",1,0,0,0
"access_product_pricelist_version_accounting_accountant","product.pricelist.version","product.model_product_pricelist_version","account.group_accounting_accountant",1,0,0,0
"access_product_pricelist_item_accounting_accountant","product.pricelist.item","product.model_product_pricelist_item","account.group_accounting_accountant",1,0,0,0
"access_account_payment_term_accounting_accountant","account.payment.term","model_account_payment_term","account.group_accounting_accountant",1,0,0,0
"access_res_payterm_accounting_accountant","res.payterm","base.model_res_payterm","account.group_accounting_accountant",1,0,0,0
"access_account_payment_term_line_accounting_accountant","account.payment.term.line","model_account_payment_term_line","account.group_accounting_accountant",1,0,0,0
"access_account_journal_accounting_accountant","account.journal","model_account_journal","account.group_accounting_accountant",1,0,0,0
"access_account_fiscalyear_accounting_accountant","account.fiscalyear","model_account_fiscalyear","account.group_accounting_accountant",1,0,0,0
"access_account_period_accounting_accountant","account.period","model_account_period","account.group_accounting_accountant",1,0,0,0
"access_account_move_reconcile_accounting_accountant","account.move.reconcile","model_account_move_reconcile","account.group_accounting_accountant",1,1,1,1
"access_account_tax_code_accounting_accountant","account.tax.code","model_account_tax_code","account.group_accounting_accountant",1,0,0,0
"access_account_bank_statement_accounting_accountant","account.bank.statement","model_account_bank_statement","account.group_accounting_accountant",1,1,1,1
"access_account_cashbox_line_accounting_accountant","account.cashbox.line","model_account_cashbox_line","account.group_accounting_accountant",1,1,1,1
"access_account_bank_statement_line_accounting_accountant","account.bank.statement.line","model_account_bank_statement_line","account.group_accounting_accountant",1,1,1,1
"access_account_invoice_report_accounting_accountant","account.invoice.report","model_account_invoice_report","account.group_accounting_accountant",1,0,0,0
"access_report_account_receivable_accounting_accountant","report.account.receivable","model_report_account_receivable","account.group_accounting_accountant",1,0,0,0
"access_temp_range_accounting_accountant","temp.range","model_temp_range","account.group_accounting_accountant",1,0,0,0
"access_report_aged_receivable_accounting_accountant","report.aged.receivable","model_report_aged_receivable","account.group_accounting_accountant",1,0,0,0
"access_report_invoice_created_accounting_accountant","report.invoice.created","model_report_invoice_created","account.group_accounting_accountant",1,0,0,0
"access_account_entries_report_accounting_accountant","account.entries.report","model_account_entries_report","account.group_accounting_accountant",1,0,0,0
"access_account_invoice_report_accounting_accountant","account.invoice.report","model_account_invoice_report","account.group_accounting_accountant",1,0,0,0
"access_account_journal_view_accounting_accountant","account.journal.view","model_account_journal_view","account.group_accounting_accountant",1,0,0,0
"access_account_journal_period_accounting_accountant","account.journal.period","model_account_journal_period","account.group_accounting_accountant",1,1,1,1
"access_account_journal_column_accounting_accountant","account.journal.column","model_account_journal_column","account.group_accounting_accountant",1,1,1,1
"access_account_analytic_account_accounting_accountant","account.analytic.account","analytic.model_account_analytic_account","account.group_accounting_accountant",1,0,0,0
"access_account_analytic_line_accounting_accountant","account.analytic.line","analytic.model_account_analytic_line","account.group_accounting_accountant",1,0,0,0
"access_account_analytic_journal_accounting_accountant","account.analytic.journal","model_account_analytic_journal","account.group_accounting_accountant",1,0,0,0
"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_invoice_accounting_accountant account.invoice model_account_invoice account.group_accounting_accountant 1 1 1 1
access_account_invoice_line_accounting_accountant account.invoice.line model_account_invoice_line account.group_accounting_accountant 1 1 1 1
access_res_partner_accounting_accountant res.partner base.model_res_partner account.group_accounting_accountant 1 1 1 1
access_account_account_accounting_accountant account.account model_account_account account.group_accounting_accountant 1 0 0 0
access_account_account_type_accounting_accountant account.type model_account_account_type account.group_accounting_accountant 1 0 0 0
access_account_tax_accounting_accountant account.tax model_account_tax account.group_accounting_accountant 1 0 0 0
access_account_tax_code_accounting_accountant account.tax.code model_account_tax_code account.group_accounting_accountant 1 0 0 0
access_account_invoice_tax_accounting_accountant account.invoice.tax model_account_invoice_tax account.group_accounting_accountant 1 0 0 0
access_res_partner_address_accounting_accountant res.partner.address base.model_res_partner_address account.group_accounting_accountant 1 1 1 1
access_account_move_accounting_accountant account.move model_account_move account.group_accounting_accountant 1 1 1 1
access_account_move_line_accounting_accountant account.move.line model_account_move_line account.group_accounting_accountant 1 1 1 1
access_res_partner_bank_accounting_accountant res.partner.bank base.model_res_partner_bank account.group_accounting_accountant 1 0 0 0
access_res_partner_event_accounting_accountant res.partner.event base.model_res_partner_event account.group_accounting_accountant 1 0 0 0
access_res_currency_rate_accounting_accountant res.currency.rate base.model_res_currency_rate account.group_accounting_accountant 1 1 0 0
access_res_currency_accounting_accountant res.currency base.model_res_currency account.group_accounting_accountant 1 1 0 0
access_product_template_accounting_accountant product.template product.model_product_template account.group_accounting_accountant 1 0 0 0
access_product_product_accounting_accountant product.product product.model_product_product account.group_accounting_accountant 1 0 0 0
access_product_category_accounting_accountant product.category product.model_product_category account.group_accounting_accountant 1 0 0 0
access_product_pricelist_accounting_accountant product.pricelist product.model_product_pricelist account.group_accounting_accountant 1 0 0 0
access_product_pricelist_version_accounting_accountant product.pricelist.version product.model_product_pricelist_version account.group_accounting_accountant 1 0 0 0
access_product_pricelist_item_accounting_accountant product.pricelist.item product.model_product_pricelist_item account.group_accounting_accountant 1 0 0 0
access_account_payment_term_accounting_accountant account.payment.term model_account_payment_term account.group_accounting_accountant 1 0 0 0
access_res_payterm_accounting_accountant res.payterm base.model_res_payterm account.group_accounting_accountant 1 0 0 0
access_account_payment_term_line_accounting_accountant account.payment.term.line model_account_payment_term_line account.group_accounting_accountant 1 0 0 0
access_account_journal_accounting_accountant account.journal model_account_journal account.group_accounting_accountant 1 0 0 0
access_account_fiscalyear_accounting_accountant account.fiscalyear model_account_fiscalyear account.group_accounting_accountant 1 0 0 0
access_account_period_accounting_accountant account.period model_account_period account.group_accounting_accountant 1 0 0 0
access_account_move_reconcile_accounting_accountant account.move.reconcile model_account_move_reconcile account.group_accounting_accountant 1 1 1 1
access_account_tax_code_accounting_accountant account.tax.code model_account_tax_code account.group_accounting_accountant 1 0 0 0
access_account_bank_statement_accounting_accountant account.bank.statement model_account_bank_statement account.group_accounting_accountant 1 1 1 1
access_account_cashbox_line_accounting_accountant account.cashbox.line model_account_cashbox_line account.group_accounting_accountant 1 1 1 1
access_account_bank_statement_line_accounting_accountant account.bank.statement.line model_account_bank_statement_line account.group_accounting_accountant 1 1 1 1
access_account_invoice_report_accounting_accountant account.invoice.report model_account_invoice_report account.group_accounting_accountant 1 0 0 0
access_report_account_receivable_accounting_accountant report.account.receivable model_report_account_receivable account.group_accounting_accountant 1 0 0 0
access_temp_range_accounting_accountant temp.range model_temp_range account.group_accounting_accountant 1 0 0 0
access_report_aged_receivable_accounting_accountant report.aged.receivable model_report_aged_receivable account.group_accounting_accountant 1 0 0 0
access_report_invoice_created_accounting_accountant report.invoice.created model_report_invoice_created account.group_accounting_accountant 1 0 0 0
access_account_entries_report_accounting_accountant account.entries.report model_account_entries_report account.group_accounting_accountant 1 0 0 0
access_account_invoice_report_accounting_accountant account.invoice.report model_account_invoice_report account.group_accounting_accountant 1 0 0 0
access_account_journal_view_accounting_accountant account.journal.view model_account_journal_view account.group_accounting_accountant 1 0 0 0
access_account_journal_period_accounting_accountant account.journal.period model_account_journal_period account.group_accounting_accountant 1 1 1 1
access_account_journal_column_accounting_accountant account.journal.column model_account_journal_column account.group_accounting_accountant 1 1 1 1
access_account_analytic_account_accounting_accountant account.analytic.account analytic.model_account_analytic_account account.group_accounting_accountant 1 0 0 0
access_account_analytic_line_accounting_accountant account.analytic.line analytic.model_account_analytic_line account.group_accounting_accountant 1 0 0 0
access_account_analytic_journal_accounting_accountant account.analytic.journal model_account_analytic_journal account.group_accounting_accountant 1 0 0 0
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
+2 -2
View File
@@ -43,13 +43,13 @@ ir_sequence_fiscalyear()
class ir_sequence(osv.osv):
_inherit = 'ir.sequence'
_columns = {
'fiscal_ids' : fields.one2many('account.sequence.fiscalyear',
'fiscal_ids': fields.one2many('account.sequence.fiscalyear',
'sequence_main_id', 'Sequences')
}
def get_id(self, cr, uid, sequence_id, test='id', context=None):
if context is None:
context = {}
cr.execute('select id from ir_sequence where '
cr.execute('select id from ir_sequence where '
+ test + '=%s and active=%s', (sequence_id, True,))
res = cr.dictfetchone()
if res:
+37 -32
View File
@@ -1,6 +1,6 @@
-
In order to test the PDF reports defined on an invoice, we will print an Invoice Report
-
-
!python {model: account.invoice}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.test_invoice_1')], {}, {})
@@ -9,7 +9,7 @@
-
In order to test the PDF reports defined on a partner, we will print the Overdue Report
-
-
!python {model: res.partner}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.account.overdue').create(cr, uid, [ref('base.res_partner_asus'),ref('base.res_partner_agrolait'),ref('base.res_partner_c2c')], {}, {})
@@ -18,7 +18,7 @@
-
In order to test the PDF reports defined on Account Move, we will print the Voucher Report
-
-
!python {model: account.move}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.account.move.voucher').create(cr, uid, [ref('account.account_move_0')], {}, {})
@@ -30,28 +30,30 @@
-
!record {model: account.tax.code, id: account_tax_code_0}:
name : Tax Code Test
sign : 10.00
-
Print Tax Code entries report
-
-
!python {model: account.tax.code}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.account.tax.code.entries').create(cr, uid, [ref('account_tax_code_0')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-tax-code-entries.'+format), 'wb+').write(data)
-
Print Vat Declaration Report
-
!python {model: account.tax.code}: |
import netsvc, tools, os
data_dict = {'model': 'ir.ui.menu', 'form': {'based_on': 'invoices','company_id':ref('base.main_company'),'periods':[]}}
(data, format) = netsvc.LocalService('report.account.vat.declaration').create(cr, uid, [ref("account_tax_code_0")], data_dict, {})
(data, format) = netsvc.LocalService('report.account.vat.declaration').create(cr, uid, [ref("account_move_0")], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-vat-declaration.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on an invoice, we will print an invoice
-
-
!python {model: account.invoice}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.test_invoice_1')], {}, {})
@@ -65,6 +67,8 @@
import netsvc, tools, os, time
import datetime
from mx.DateTime import *
import warnings
warnings.filterwarnings('ignore',".*struct integer overflow masking is deprecated*")
start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d")))
start = DateTime(int(start.year), int(start.month), int(start.day))
res = {}
@@ -84,9 +88,9 @@
ctx['fiscalyear'] = fy_id
ctx['journal_ids'] = journal_ids
ctx['chart_account_id'] = ref('account.chart0')
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
data_dict = {'model': 'ir.ui.menu', 'form': {'chart_account_id':ref('account.chart0'),'initial_balance': 1, 'periods': period_list,'journal_ids':journal_ids, 'page_split': 0, 'date_from': time.strftime('%Y-%m-%d'), 'period_length': 30, 'amount_currency': 0,'query_line' : query_line, 'result_selection': 'customer','direction_selection': 'past','fiscalyear_id':fy_id}}
data_dict['form'].update(res)
(data, format) = netsvc.LocalService('report.account.aged_trial_balance').create(cr, uid, [], data_dict, {})
@@ -122,10 +126,10 @@
(data, format) = netsvc.LocalService('report.account.account.balance').create(cr, uid, [ref('account.bal'),ref('account.gpf')], data_dict, {'periods': []})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-account_balance-normal.'+format), 'wb+').write(data)
data_dict.update({'model': 'ir.ui.menu'})
data_dict['form'].update({'active_ids':[ref('account.bal'),ref('account.gpf')]})
(data, format) = netsvc.LocalService('report.account.account.balance').create(cr, uid, [], data_dict, {'periods': []})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-account_balance-normal-menu.'+format), 'wb+').write(data)
@@ -145,16 +149,16 @@
ctx['fiscalyear'] = fy_id
ctx['journal_ids'] = journal_ids
ctx['chart_account_id'] = ref('account.chart0')
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
data_dict = {'model': 'account.journal.period', 'id':journal_period_ids[0], 'form': {'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }}
(data, format) = netsvc.LocalService('report.account.central.journal').create(cr, uid, journal_period_ids, data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-central_journal.'+format), 'wb+').write(data)
data_dict.update({'model': 'ir.ui.menu'})
data_dict['form'].update({'active_ids':journal_period_ids})
(data, format) = netsvc.LocalService('report.account.central.journal').create(cr, uid, [], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-central_journal-menu.'+format), 'wb+').write(data)
@@ -167,13 +171,13 @@
period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context)
obj_move = self.pool.get('account.move.line')
ctx = {}
ctx['fiscalyear'] = fy_id
ctx['journal_ids'] = journal_ids
ctx['chart_account_id'] = ref('account.chart0')
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
data_dict = {'model': 'ir.ui.menu','id':journal_period_ids[0], 'form': {'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids, 'active_ids':journal_period_ids}}
(data, format) = netsvc.LocalService('report.account.general.journal').create(cr, uid, journal_period_ids, data_dict, {})
@@ -189,15 +193,15 @@
period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
acc_ids = [ref('account.bal'),ref('account.gpf')]
obj_move = self.pool.get('account.move.line')
ctx = {}
ctx['fiscalyear'] = fy_id
ctx['journal_ids'] = journal_ids
ctx['chart_account_id'] = ref('account.chart0')
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
data_dict = {'model': 'account.account', 'form': {'initial_balance': 1,'initial_bal_query': query_line,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','sortby': 'sort_date','amount_currency': 0,'landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }}
(data, format) = netsvc.LocalService('report.account.general.ledger').create(cr, uid, acc_ids, data_dict, {})
if tools.config['test_report_directory']:
@@ -217,15 +221,15 @@
period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
acc_ids = [ref('account.bal'),ref('account.gpf')]
obj_move = self.pool.get('account.move.line')
ctx = {}
ctx['fiscalyear'] = fy_id
ctx['journal_ids'] = journal_ids
ctx['chart_account_id'] = ref('account.chart0')
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
data_dict = {'model': 'account.account', 'form': {'initial_balance': 1,'initial_bal_query':query_line,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','sortby': 'sort_date','amount_currency': 0,'landscape':1,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }}
(data, format) = netsvc.LocalService('report.account.general.ledger_landscape').create(cr, uid, acc_ids, data_dict, {})
if tools.config['test_report_directory']:
@@ -252,17 +256,17 @@
ctx['fiscalyear'] = fy_id
ctx['journal_ids'] = journal_ids
ctx['chart_account_id'] = ref('account.chart0')
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
data_dict = {'model': 'account.journal.period', 'id':journal_period_ids[0], 'form': {'sort_selection': 'date','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }}
(data, format) = netsvc.LocalService('report.account.journal.period.print').create(cr, uid, journal_period_ids, data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-print_journal.'+format), 'wb+').write(data)
data_dict.update({'model': 'ir.ui.menu'})
data_dict['form'].update({'active_ids':journal_period_ids})
(data, format) = netsvc.LocalService('report.account.journal.period.print').create(cr, uid, [], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-print_journal-menu.'+format), 'wb+').write(data)
@@ -275,16 +279,17 @@
fy_id = ref('account.data_fiscalyear')
period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context)
obj_move = self.pool.get('account.move.line')
ctx = {}
ctx['fiscalyear'] = fy_id
ctx['journal_ids'] = journal_ids
ctx['chart_account_id'] = ref('account.chart0')
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
data_dict = {'model': 'ir.ui.menu', 'form': {'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'display_partner': 'non-zero_balance','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}}
(data, format) = netsvc.LocalService('report.account.partner.balance').create(cr, uid, [], data_dict, {})
data_dict = {'model': 'ir.ui.menu', 'form': {'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'active_ids':journal_period_ids,'display_partner': 'all','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}}
(data, format) = netsvc.LocalService('report.account.partner.balance').create(cr, uid, journal_period_ids, data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-partner_balance.'+format), 'wb+').write(data)
@@ -302,9 +307,9 @@
ctx['fiscalyear'] = fy_id
ctx['journal_ids'] = journal_ids
ctx['chart_account_id'] = ref('account.chart0')
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
data_dict = {'model': 'ir.ui.menu', 'form': {'initial_bal_query':query_line,'amount_currency': 0,'reconcil': True,'initial_balance':1,'page_split': True,'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'display_partner': 'non-zero_balance','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}}
(data, format) = netsvc.LocalService('report.account.third_party_ledger').create(cr, uid, [], data_dict, {})
if tools.config['test_report_directory']:
@@ -324,7 +329,7 @@
ctx['fiscalyear'] = fy_id
ctx['journal_ids'] = journal_ids
ctx['chart_account_id'] = ref('account.chart0')
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
data_dict = {'model': 'ir.ui.menu', 'form': {'initial_bal_query':query_line,'amount_currency': 0,'reconcil': True,'initial_balance':1,'page_split': False,'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'display_partner': 'non-zero_balance','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}}
(data, format) = netsvc.LocalService('report.account.third_party_ledger_other').create(cr, uid, [], data_dict, {})
@@ -1,3 +1,12 @@
-
Demo data for Account tax code
-
!record {model: account.tax.code, id: account_tax_code_0}:
name : Tax Code Test
sign : 1.00
-
-
In order to test the 'Validate Journal Entries' wizard in OpenERP, I created an account move
@@ -20,6 +29,7 @@
- journal_id: account.bank_journal
period_id: account.period_6
ref: '2010010'
tax_code_id: account_tax_code_0
tax_amount: 0.0
account_id: account.a_recv
amount_currency: 0.0
@@ -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
@@ -171,7 +170,7 @@ class account_automatic_reconcile(osv.osv_memory):
"AND reconcile_id IS NULL",
(account_id, partner_id))
line_ids = [id for (id,) in cr.fetchall()]
if len(line_ids):
if line_ids:
reconciled += len(line_ids)
if allow_write_off:
move_line_obj.reconcile(cr, uid, line_ids, 'auto', form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
@@ -200,7 +199,8 @@ class account_automatic_reconcile(osv.osv_memory):
"AND partner_id=%s " \
"AND reconcile_id IS NULL " \
"AND state <> 'draft' " \
"AND debit > 0",
"AND debit > 0 " \
"ORDER BY date_maturity",
(account_id, partner_id))
debits = cr.fetchall()
@@ -212,7 +212,8 @@ class account_automatic_reconcile(osv.osv_memory):
"AND partner_id=%s " \
"AND reconcile_id IS NULL " \
"AND state <> 'draft' " \
"AND credit > 0",
"AND credit > 0 " \
"ORDER BY date_maturity",
(account_id, partner_id))
credits = cr.fetchall()
@@ -8,29 +8,27 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Reconciliation">
<group width="660" height="430">
<separator string="Options" colspan="4"/>
<group>
<field name="account_ids" colspan="4" domain="[('reconcile','=',1)]"/>
<field name="date1"/>
<field name="date2"/>
<field name="power"/>
<field name="allow_write_off"/>
</group>
<newline/>
<group attrs="{'readonly':[('allow_write_off', '!=', True)]}">
<separator string="Write-Off Move" colspan="4"/>
<field name="max_amount"/>
<field name="writeoff_acc_id" attrs="{ 'required':[('allow_write_off', '=', True)]}"/>
<field name="journal_id" attrs="{ 'required':[('allow_write_off', '=', True)]}"/>
<field name="period_id" attrs="{ 'required':[('allow_write_off', '=', True)]}"/>
</group>
<separator string ="" colspan="4"/>
<group colspan="2" col="4">
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="reconcile" string="Reconcile" type="object" icon="terp-stock_effects-object-colorize"/>
</group>
<separator string="Options" colspan="4"/>
<group>
<field name="account_ids" colspan="4" domain="[('reconcile','=',1)]"/>
<field name="date1"/>
<field name="date2"/>
<field name="power"/>
<field name="allow_write_off"/>
</group>
<newline/>
<group attrs="{'readonly':[('allow_write_off', '!=', True)]}">
<separator string="Write-Off Move" colspan="4"/>
<field name="max_amount"/>
<field name="writeoff_acc_id" attrs="{ 'required':[('allow_write_off', '=', True)]}"/>
<field name="journal_id" attrs="{ 'required':[('allow_write_off', '=', True)]}"/>
<field name="period_id" attrs="{ 'required':[('allow_write_off', '=', True)]}"/>
</group>
<separator string ="" colspan="4"/>
<group colspan="2" col="4">
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="reconcile" string="Reconcile" type="object" icon="terp-stock_effects-object-colorize"/>
</group>
</form>
</field>
</record>
@@ -71,8 +71,8 @@ class account_change_currency(osv.osv_memory):
if old_rate <= 0:
raise osv.except_osv(_('Error'), _('Current currency is not confirured properly !'))
new_price = (line.price_unit / old_rate ) * rate
obj_inv_line.write(cr, uid, [line.id], {'price_unit' : new_price})
obj_inv.write(cr, uid, [invoice.id], {'currency_id' : new_currency}, context=context)
obj_inv_line.write(cr, uid, [line.id], {'price_unit': new_price})
obj_inv.write(cr, uid, [invoice.id], {'currency_id': new_currency}, context=context)
return {}
account_change_currency()
@@ -65,9 +65,9 @@ class account_fiscalyear_close(osv.osv_memory):
context = {}
fy_id = data[0]['fy_id']
cr.execute("SELECT id FROM account_period WHERE date_stop < (SELECT date_start FROM account_fiscalyear WHERE id = %s)" , (str(data[0]['fy2_id']),))
cr.execute("SELECT id FROM account_period WHERE date_stop < (SELECT date_start FROM account_fiscalyear WHERE id = %s)", (str(data[0]['fy2_id']),))
fy_period_set = ','.join(map(lambda id: str(id[0]), cr.fetchall()))
cr.execute("SELECT id FROM account_period WHERE date_start > (SELECT date_stop FROM account_fiscalyear WHERE id = %s)" , (str(fy_id),))
cr.execute("SELECT id FROM account_period WHERE date_start > (SELECT date_stop FROM account_fiscalyear WHERE id = %s)", (str(fy_id),))
fy2_period_set = ','.join(map(lambda id: str(id[0]), cr.fetchall()))
period = obj_acc_period.browse(cr, uid, data[0]['period_id'], context=context)
+13 -16
View File
@@ -100,7 +100,7 @@ class account_invoice_refund(osv.osv_memory):
raise osv.except_osv(_('Error !'), _('Can not %s draft/proforma/cancel invoice.') % (mode))
if inv.reconciled and mode in ('cancel', 'modify'):
raise osv.except_osv(_('Error !'), _('Can not %s invoice which is already reconciled, invoice should be unreconciled first. You can only Refund this invoice') % (mode))
if form['period'] :
if form['period']:
period = form['period']
else:
period = inv.period_id and inv.period_id.id or False
@@ -108,9 +108,9 @@ class account_invoice_refund(osv.osv_memory):
if not journal_id:
journal_id = inv.journal_id.id
if form['date'] :
if form['date']:
date = form['date']
if not form['period'] :
if not form['period']:
cr.execute("select name from ir_model_fields \
where model = 'account.period' \
and name = 'company_id'")
@@ -128,7 +128,7 @@ class account_invoice_refund(osv.osv_memory):
period = res[0]
else:
date = inv.date_invoice
if form['description'] :
if form['description']:
description = form['description']
else:
description = inv.name
@@ -147,18 +147,18 @@ class account_invoice_refund(osv.osv_memory):
if mode in ('cancel', 'modify'):
movelines = inv.move_id.line_id
to_reconcile_ids = {}
for line in movelines :
if line.account_id.id == inv.account_id.id :
for line in movelines:
if line.account_id.id == inv.account_id.id:
to_reconcile_ids[line.account_id.id] = [line.id]
if type(line.reconcile_id) != osv.orm.browse_null :
if type(line.reconcile_id) != osv.orm.browse_null:
reconcile_obj.unlink(cr, uid, line.reconcile_id.id)
wf_service.trg_validate(uid, 'account.invoice', \
refund.id, 'invoice_open', cr)
refund = inv_obj.browse(cr, uid, refund_id[0], context=context)
for tmpline in refund.move_id.line_id :
if tmpline.account_id.id == inv.account_id.id :
for tmpline in refund.move_id.line_id:
if tmpline.account_id.id == inv.account_id.id:
to_reconcile_ids[tmpline.account_id.id].append(tmpline.id)
for account in to_reconcile_ids :
for account in to_reconcile_ids:
account_m_line_obj.reconcile(cr, uid, to_reconcile_ids[account],
writeoff_period_id=period,
writeoff_journal_id = inv.journal_id.id,
@@ -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)
@@ -217,7 +214,7 @@ class account_invoice_refund(osv.osv_memory):
return result
def invoice_refund(self, cr, uid, ids, context=None):
data_refund = self.read(cr, uid, ids, [] ,context=context)[0]['filter_refund']
data_refund = self.read(cr, uid, ids, [],context=context)[0]['filter_refund']
return self.compute_refund(cr, uid, ids, data_refund, context=context)
account_invoice_refund()
@@ -33,8 +33,8 @@
<form string="Cancel Selected Invoices">
<separator string="Cancel Selected Invoices" colspan="4"/>
<group colspan="4" col="6">
<button icon="terp-dialog-close" special="cancel" string="Close"/>
<button icon="gtk-cancel" string="Cancel Invoices" name="invoice_cancel" type="object" default_focus="1"/>
<button icon="terp-dialog-close" special="cancel" string="Close"/>
</group>
</form>
</field>
+26 -25
View File
@@ -33,7 +33,7 @@ class account_move_journal(osv.osv_memory):
"""
ids = self.pool.get('account.period').find(cr, uid, context=context)
period_id = False
if len(ids):
if ids:
period_id = ids[0]
return period_id
@@ -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
"""
@@ -73,7 +73,7 @@ class account_move_journal(osv.osv_memory):
period_pool = self.pool.get('account.period')
journal_pool = self.pool.get('account.journal')
journal_id = self._get_journal(cr, uid, context)
period_id = self._get_period(cr, uid, context)
@@ -91,21 +91,22 @@ class account_move_journal(osv.osv_memory):
<form string="Standard entries">
<separator string="Open Journal Items !" colspan="4"/>
<group colspan="4" >
<label width="300" string="Journal : %s"/>
<label width="300" string="Journal: %s"/>
<newline/>
<label width="300" string="Period : %s"/>
<label width="300" string="Period: %s"/>
</group>
<group colspan="4" col="4">
<label string ="" colspan="2"/>
<button icon="terp-gtk-go-back-rtl" string="Ok" name="action_open_window" type="object"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="terp-gtk-go-back-rtl" string="Open" name="action_open_window" default_focus="1" type="object"/>
</group>
</form>""" % (str(journal), str(period))
res.update({
'arch':view
})
return res
def action_open_window(self, cr, uid, ids, context=None):
"""
This function Open action move line window on given period and Journal/Payment Mode
@@ -114,47 +115,47 @@ class account_move_journal(osv.osv_memory):
@param ids: account move journal’s 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',
@@ -165,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:
@@ -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,base.group_system"/>
<!-- <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>
@@ -46,17 +37,7 @@
parent="menu_finance_payables"
icon="STOCK_JUSTIFY_FILL"
sequence="16"
groups="group_account_user,group_account_manager,base.group_system"/>
<!-- <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"/>-->
groups="group_account_user,group_account_manager"/>
<record id="action_account_moves_bank" model="ir.actions.act_window">
<field name="name">Journal Items</field>
@@ -73,7 +54,7 @@
id="menu_action_account_moves_bank"
parent="account.menu_finance_bank_and_cash"
sequence="16"
groups="group_account_user,group_account_manager,base.group_system"
groups="group_account_user,group_account_manager"
/>
</data>
</openerp>
@@ -46,7 +46,7 @@ class account_move_line_select(osv.osv_memory):
fiscalyears = fiscalyear_obj.browse(cr, uid, fiscalyear_ids)
period_ids = []
if fiscalyears :
if fiscalyears:
for fiscalyear in fiscalyears:
for period in fiscalyear.period_ids:
period_ids.append(period.id)
@@ -56,7 +56,7 @@ class account_move_line_select(osv.osv_memory):
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
result = act_obj.read(cr, uid, [id])[0]
result['context'] = {
'fiscalyear': False ,
'fiscalyear': False,
'account_id': context['active_id'],
'active_id': context['active_id'],
}
@@ -34,7 +34,7 @@
<record id="action_idea_post_vote_values" model="ir.values">
<field name="model_id" ref="model_account_period" />
<field name="object" eval="1" />
<field name="name"></field>
<field name="name">Close a Period</field>
<field name="key2">client_action_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_period_close'))"/>
<field name="key">action</field>

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