[IMP] useability misc icons and buttons

bzr revid: fp@tinyerp.com-20101008144454-y9hksj2qrxictk65
This commit is contained in:
Fabien Pinckaers 2010-10-08 16:44:54 +02:00
commit 73509ca4be
218 changed files with 2674 additions and 2746 deletions

View File

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

View File

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

View File

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

View File

@ -156,7 +156,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="Vendor" 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/>
@ -265,7 +265,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/>
@ -364,7 +364,7 @@
<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"/>
@ -521,9 +521,9 @@
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"
name="Invoice Items "
res_model="account.move.line"
src_model="account.invoice"/>

View File

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

View File

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

View File

@ -820,13 +820,10 @@
<field name="arch" type="xml">
<search string="Search Taxes">
<group col="10" colspan="4">
<separator orientation="vertical"/>
<field name="name"/>
<field name="description"/>
</group>
<newline/>
<group expand="0" string="Group By...">
</group>
</search>
</field>
</record>
@ -1568,7 +1565,7 @@
<field name="sequence"/>
<field name="name"/>
<field name="account_id"/>
<field name="analytic_account_id"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
<field name="partner_id"/>
<field name="debit"/>
<field name="credit"/>
@ -1587,7 +1584,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"/>

View File

@ -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
@ -250,7 +252,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 '),
@ -485,8 +487,8 @@ class account_installer(osv.osv_memory):
for position in obj_fiscal_position_template.browse(cr, uid, fp_ids):
vals_fp = {
'company_id' : company_id.id,
'name' : position.name,
'company_id': company_id.id,
'name': position.name,
}
new_fp = obj_fiscal_position.create(cr, uid, vals_fp)
@ -495,17 +497,17 @@ class account_installer(osv.osv_memory):
for tax in position.tax_ids:
vals_tax = {
'tax_src_id' : tax_template_ref[tax.tax_src_id.id],
'tax_dest_id' : tax.tax_dest_id and tax_template_ref[tax.tax_dest_id.id] or False,
'position_id' : new_fp,
'tax_src_id': tax_template_ref[tax.tax_src_id.id],
'tax_dest_id': tax.tax_dest_id and tax_template_ref[tax.tax_dest_id.id] or False,
'position_id': new_fp,
}
obj_tax_fp.create(cr, uid, vals_tax)
for acc in position.account_ids:
vals_acc = {
'account_src_id' : acc_template_ref[acc.account_src_id.id],
'account_dest_id' : acc_template_ref[acc.account_dest_id.id],
'position_id' : new_fp,
'account_src_id': acc_template_ref[acc.account_src_id.id],
'account_dest_id': acc_template_ref[acc.account_dest_id.id],
'position_id': new_fp,
}
obj_ac_fp.create(cr, uid, vals_acc)
@ -646,7 +648,7 @@ class account_installer(osv.osv_memory):
obj_acc.write(cr, uid, default_account_ids, {'tax_ids':[(6,0,[purchase_tax])]})
tax_val.update({'supplier_taxes_id':[(6,0,[purchase_tax])]})
default_tax.append(('supplier_taxes_id',purchase_tax))
if len(tax_val):
if tax_val:
product_ids = obj_product.search(cr, uid, [])
for product in obj_product.browse(cr, uid, product_ids):
obj_product.write(cr, uid, product.id, tax_val)

View File

@ -20,14 +20,12 @@
##############################################################################
import time
from operator import itemgetter
import decimal_precision as dp
from lxml import etree
import decimal_precision as dp
import netsvc
from osv import fields, osv, orm
import pooler
from tools import config
from tools.translate import _
class account_invoice(osv.osv):
@ -148,7 +146,7 @@ class account_invoice(osv.osv):
res[id] = []
if not invoice.move_id:
continue
data_lines = invoice.move_id.line_id
data_lines = [x for x in invoice.move_id.line_id if x.account_id.id == invoice.account_id.id]
partial_ids = []
for line in data_lines:
ids_line = []
@ -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 = 'Vendor'
for node in nodes:
node.set('string', partner_string)
res['arch'] = etree.tostring(doc)
return res
def create(self, cr, uid, vals, context=None):
@ -536,7 +544,7 @@ class account_invoice(osv.osv):
if not result_id:
raise osv.except_osv(_('Configuration Error !'),
_('Can not find account chart for this company in invoice line account, Please Create account.'))
r_id = self.pool.get('account.invoice.line').write(cr, uid, [line.id], {'account_id': result_id[0]})
self.pool.get('account.invoice.line').write(cr, uid, [line.id], {'account_id': result_id[0]})
else:
if invoice_line:
for inv_line in invoice_line:
@ -587,16 +595,6 @@ class account_invoice(osv.osv):
wf_service.trg_create(uid, 'account.invoice', inv_id, cr)
return True
def finalize_invoice_move_lines(self, cr, uid, invoice_browse, move_lines):
"""finalize_invoice_move_lines(cr, uid, invoice, move_lines) -> move_lines
Hook method to be overridden in additional modules to verify and possibly alter the
move lines to be created by an invoice, for special cases.
:param invoice_browse: browsable record of the invoice that is generating the move lines
:param move_lines: list of dictionaries with the account.move.lines (as for create())
:return: the (possibly updated) final move_lines to create for this invoice
"""
return move_lines
# Workflow stuff
#################
@ -817,7 +815,6 @@ class account_invoice(osv.osv):
self.write(cr, uid, [inv.id], {'date_invoice':time.strftime('%Y-%m-%d')})
company_currency = inv.company_id.currency_id.id
# create the analytical lines
line_ids = self.read(cr, uid, [inv.id], ['invoice_line'])[0]['invoice_line']
# one move line per invoice line
iml = self._get_analytic_lines(cr, uid, inv.id)
# check if taxes are all computed
@ -1390,8 +1387,6 @@ class account_invoice_line(osv.osv):
if a:
result['account_id'] = a
taxep = None
tax_obj = self.pool.get('account.tax')
if type in ('out_invoice', 'out_refund'):
taxes = res.taxes_id and res.taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a).tax_ids or False)
tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes)
@ -1444,13 +1439,10 @@ class account_invoice_line(osv.osv):
def move_line_get(self, cr, uid, invoice_id, context=None):
res = []
tax_grouped = {}
tax_obj = self.pool.get('account.tax')
cur_obj = self.pool.get('res.currency')
ait_obj = self.pool.get('account.invoice.tax')
inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id)
company_currency = inv.company_id.currency_id.id
cur = inv.currency_id
for line in inv.invoice_line:
mres = self.move_line_get_item(cr, uid, line, context)

View File

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

View File

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

View File

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

View File

@ -43,6 +43,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
'get_partners':self._get_partners,
'get_account': self._get_account,
'get_fiscalyear': self._get_fiscalyear,
'get_target_move': self._get_target_move,
})
def set_context(self, objects, data, ids, report_type=None):

View File

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

View File

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

View File

@ -16,7 +16,7 @@
<field name="partner_id" invisible="1"/>
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
<field name="currency_id" invisible="1"/>
<field name="account_id" invisible="1"/>
<field name="account_id" invisible="1" groups="analytic.group_analytic_accounting"/>
<field name="general_account_id" invisible="1"/>
<field name="journal_id" invisible="1"/>
<field name="product_id" invisible="1"/>
@ -49,7 +49,7 @@
help="Analytic Entries during last 7 days"/>
<separator orientation="vertical"/>
<field name="date" />
<field name="account_id" />
<field name="account_id" groups="analytic.group_analytic_accounting"/>
<field name="product_id" />
<field name="user_id">
<filter icon="terp-personal" domain="[('user_id','=',uid)]" help="My Entries"/>
@ -63,7 +63,7 @@
<field name="journal_id" widget="selection"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="account_id"/>
<field name="account_id" groups="analytic.group_analytic_accounting"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<newline/>
@ -72,7 +72,7 @@
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}"/>
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
<filter string="Account" name="Account" icon="terp-folder-green" context="{'group_by':'account_id'}"/>
<filter string="Account" name="Account" icon="terp-folder-green" context="{'group_by':'account_id'}" groups="analytic.group_analytic_accounting"/>
<filter string="General Account" icon="terp-folder-green" context="{'group_by':'general_account_id'}"/>
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
<separator orientation="vertical"/>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -31,7 +31,7 @@ class account_invoice(report_sxw.rml_parse):
report_sxw.report_sxw(
'report.account.invoice',
'account.invoice',
'addons/account/report/invoice.rml',
'addons/account/report/account_print_invoice.rml',
parser=account_invoice
)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

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

View File

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

View File

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

View File

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

View File

@ -36,7 +36,7 @@ class tax_report(rml_parse.rml_parse):
'get_general': self._get_general,
'get_company': self._get_company,
'get_currency': self._get_currency,
'get_lines' : self._get_lines,
'get_lines': self._get_lines,
})
@ -45,12 +45,12 @@ class tax_report(rml_parse.rml_parse):
if period_list:
res = self._add_codes(based_on, res, period_list, context=context)
else :
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 :
for p in periods:
period_list.append(p[0])
res = self._add_codes(based_on, res, period_list, context=context)
@ -58,20 +58,20 @@ class tax_report(rml_parse.rml_parse):
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
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) :
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']
@ -84,7 +84,7 @@ class tax_report(rml_parse.rml_parse):
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={}):
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)
@ -112,7 +112,7 @@ class tax_report(rml_parse.rml_parse):
GROUP BY account.id,account.name,account.code', ('draft', tax_code_id,
company_id, periods_ids, 'paid',))
else :
else:
self.cr.execute('SELECT SUM(line.tax_amount) AS tax_amount, \
SUM(line.debit) AS debit, \
SUM(line.credit) AS credit, \
@ -191,14 +191,14 @@ class tax_report(rml_parse.rml_parse):
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
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:
@ -215,6 +215,6 @@ class tax_report(rml_parse.rml_parse):
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")
'addons/account/report/account_tax_report.rml', parser=tax_report, header="internal")
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

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

View File

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

View File

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,9 +8,8 @@
<field name="type">form</field>
<field name="inherit_id" ref="account.account_common_report_view" />
<field name="arch" type="xml">
<field name="fiscalyear_id" position="after">
<field name="target_move" position="after">
<field name="display_account"/>
<field name="target_move"/>
<field name="display_type"/>
<field name="reserve_account_id" required="0" invisible="1"/>
<newline/>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -32,15 +32,12 @@ class account_report_general_ledger(osv.osv_memory):
help='It adds initial balance row on report which display previous sum amount of debit/credit/balance'),
'amount_currency': fields.boolean("With Currency", help="It adds the currency column if the currency is different then the company currency"),
'sortby': fields.selection([('sort_date', 'Date'), ('sort_journal_partner', 'Journal & Partner')], 'Sort By', required=True),
'target_move': fields.selection([('all', 'All Entries'),
('posted', 'All Posted Entries')], 'Target Moves', required=True),
}
_defaults = {
'landscape': True,
'amount_currency': True,
'sortby': 'sort_date',
'initial_balance': False,
'target_move': 'all',
}
def onchange_fiscalyear(self, cr, uid, ids, fiscalyear=False, context=None):
@ -53,7 +50,7 @@ class account_report_general_ledger(osv.osv_memory):
if context is None:
context = {}
data = self.pre_print_report(cr, uid, ids, data, context=context)
data['form'].update(self.read(cr, uid, ids, ['landscape', 'initial_balance', 'amount_currency', 'sortby', 'target_move'])[0])
data['form'].update(self.read(cr, uid, ids, ['landscape', 'initial_balance', 'amount_currency', 'sortby'])[0])
if not data['form']['fiscalyear_id']:# GTK client problem onchange does not consider in save record
data['form'].update({'initial_balance': False})
if data['form']['landscape']:

View File

@ -8,9 +8,8 @@
<field name="type">form</field>
<field name="inherit_id" ref="account_common_report_view" />
<field name="arch" type="xml">
<field name="fiscalyear_id" position="after">
<field name="target_move" position="after">
<field name="display_account"/>
<field name="target_move"/>
<field name="sortby"/>
<field name="landscape"/>
<field name="initial_balance" attrs="{'readonly':[('fiscalyear_id','=', False)]}"/>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -30,7 +30,7 @@ class account_crossovered_analytic(osv.osv_memory):
'date1': fields.date('Start Date', required=True),
'date2': fields.date('End Date', required=True),
'journal_ids': fields.many2many('account.analytic.journal', 'crossovered_journal_rel', 'crossover_id', 'journal_id', 'Analytic Journal'),
'ref': fields.many2one('account.analytic.account', 'Analytic Account Reference', required=True),
'ref': fields.many2one('account.analytic.account', 'Analytic Account Reference', required=False),
'empty_line': fields.boolean('Dont show empty lines'),
}
_defaults = {

View File

@ -12,7 +12,7 @@
<group col="4" colspan="6">
<field name="date1"/>
<field name="date2"/>
<field name="ref"/>
<field name="ref" groups="analytic.group_analytic_accounting"/>
<field name="empty_line"/>
<separator colspan="4" string="Analytic Journal"/>
<field name="journal_ids" colspan="4" nolabel="1"/>

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,11 +15,11 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import crossovered_budget
import account_budget
import report
import wizard

View File

@ -50,16 +50,16 @@ Three reports are available:
'security/ir.model.access.csv',
'security/account_budget_security.xml',
'wizard/account_budget_spread_view.xml',
'crossovered_budget_view.xml',
'crossovered_budget_report.xml',
'crossovered_budget_workflow.xml',
'account_budget_view.xml',
'account_budget_report.xml',
'account_budget_workflow.xml',
'wizard/account_budget_analytic_view.xml',
'wizard/account_budget_report_view.xml',
'wizard/account_budget_spread_view.xml',
'wizard/account_budget_crossovered_summary_report_view.xml',
'wizard/account_budget_crossovered_report_view.xml',
],
'demo_xml': ['crossovered_budget_demo.xml'],
'demo_xml': ['account_budget_demo.xml'],
'test':[
'test/account_budget.yml',
'test/account_budget_report.yml',

View File

@ -73,7 +73,6 @@ class account_budget_post_dotation(osv.osv):
if line.period_id:
obj_period = self.pool.get('account.period').browse(cr, uid, line.period_id.id)
total_days = strToDate(obj_period.date_stop) - strToDate(obj_period.date_start)
budget_id = line.post_id and line.post_id.id or False
query="SELECT id FROM crossovered_budget_lines WHERE \
general_budget_id= %s AND (date_from >=%s AND date_from <= %s ) \
@ -238,7 +237,7 @@ class crossovered_budget_lines(osv.osv):
_description = "Budget Line"
_columns = {
'crossovered_budget_id': fields.many2one('crossovered.budget', 'Budget', ondelete='cascade', select=True, required=True),
'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account',required=True),
'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account',required=False),
'general_budget_id': fields.many2one('account.budget.post', 'Budgetary Position',required=True),
'date_from': fields.date('Start Date', required=True),
'date_to': fields.date('End Date', required=True),

View File

@ -77,13 +77,13 @@
<page string="Budget Lines">
<field name="crossovered_budget_line" widget="one2many_list" colspan="4" nolabel="1" mode="graph,tree">
<graph type="bar" string="Lines">
<field name="analytic_account_id" groups="base.group_extended"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
<field name="planned_amount" operator="+"/>
<field group="True" name="general_budget_id"/>
</graph>
<tree string="Budget Lines" editable="top">
<field name="crossovered_budget_id"/>
<field name="analytic_account_id" groups="base.group_extended" domain="[('parent_id','!=',False)]"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="paid_date"/>
@ -94,7 +94,7 @@
</tree>
<form string="Budget Lines">
<field name="crossovered_budget_id"/>
<field name="analytic_account_id" groups="base.group_extended" domain="[('parent_id','!=',False)]" />
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]" />
<field name="date_from"/>
<field name="date_to"/>
<field name="paid_date"/>
@ -125,7 +125,7 @@
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="crossovered_budget_line" colspan="4" nolabel="1" attrs="{'readonly':[('state','!=','draft')]}">
<tree string="Budget Lines">
<field name="analytic_account_id" groups="base.group_extended"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
<field name="general_budget_id"/>
<field name="date_from"/>
<field name="date_to"/>
@ -136,7 +136,7 @@
<field name="percentage"/>
</tree>
<form string="Budget Lines">
<field name="analytic_account_id" select="1" groups="base.group_extended"/>
<field name="analytic_account_id" select="1" groups="analytic.group_analytic_accounting"/>
<field name="general_budget_id" select="1"/>
<field name="date_from"/>
<field name="date_to"/>
@ -213,7 +213,7 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Budget Lines">
<field name="analytic_account_id" groups="base.group_extended"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
<field name="general_budget_id"/>
<field name="date_from"/>
<field name="date_to"/>
@ -232,7 +232,7 @@
<field name="arch" type="xml">
<form string="Budget Lines">
<field name="crossovered_budget_id"/>
<field name="analytic_account_id" select="1" groups="base.group_extended"/>
<field name="analytic_account_id" select="1" groups="analytic.group_analytic_accounting"/>
<field name="general_budget_id" select="1"/>
<field name="date_from"/>
<field name="date_to"/>

View File

@ -48,7 +48,7 @@
<group col="10" colspan="4">
<field name="journal_id" widget='selection'/>
<field name="date"/>
<field name="user_id" default="uid"/>
<field name="user_id" widget='selection'/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<newline/>

View File

@ -59,12 +59,12 @@ class account_coda_import(osv.osv_memory):
account_period_obj = self.pool.get('account.period')
partner_bank_obj = self.pool.get('res.partner.bank')
bank_statement_obj = self.pool.get('account.bank.statement')
move_line_obj = self.pool.get('account.move.line')
bank_statement_line_obj = self.pool.get('account.bank.statement.line')
voucher_obj = self.pool.get('account.voucher')
voucher_line_obj = self.pool.get('account.voucher.line')
account_coda_obj = self.pool.get('account.coda')
mod_obj = self.pool.get('ir.model.data')
line_obj = self.pool.get('account.move.line')
if not context:
context = {}
@ -78,7 +78,6 @@ class account_coda_import(osv.osv_memory):
def_pay_acc = data['def_payable']
def_rec_acc = data['def_receivable']
str_log = ""
err_log = "Errors:\n------\n"
nb_err=0
std_log=''
@ -206,26 +205,31 @@ class account_coda_import(osv.osv_memory):
lines = statement.get('bank_statement_line',False)
if lines:
for value in lines:
journal = journal_obj.browse(cr, uid, statement['journal_id'], context=context)
line = lines[value]
if not line['partner_id']:
line['partner_id'] = journal.company_id.partner_id.id
voucher_id = False
rec_id = False
if line.get('toreconcile',False): # Fix me
name = line['name'][:3] + '/' + line['name'][3:7] + '/' + line['name'][7:]
rec_id = self.pool.get('account.move.line').search(cr, uid, [('name', '=', name), ('reconcile_id', '=', False), ('account_id.reconcile', '=', True)])
if rec_id:
result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line['partner_id'], journal_id=statement['journal_id'], price=abs(line['amount']), currency_id = journal.company_id.currency_id.id, ttype=(line['amount'] < 0 and 'payment' or 'receipt'), context=context)
voucher_res = { 'type':(line['amount'] < 0 and 'payment' or 'receipt') ,
'name': line['name'],#line.name,
'partner_id': line['partner_id'] ,#line.partner_id.id,
'journal_id': statement['journal_id'], #statement.journal_id.id,
'account_id': line['account_id'],#line.account_id.id,
'company_id': statement['company_id'],#statement.company_id.id,
'currency_id': statement['currency'],#statement.currency.id,
'account_id': result.get('account_id', journal.default_credit_account_id.id),#line.account_id.id,
'company_id': journal.company_id.id,#statement.company_id.id,
'currency_id': journal.company_id.currency_id.id,#statement.currency.id,
'date': line['date'], #line.date,
'amount':abs(line['amount']),
'period_id':statement.get('period_id',False) or period,# statement.period_id.id
}
voucher_id = voucher_obj.create(cr, uid, voucher_res, context=context)
context.update({'move_line_ids': rec_id})
result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype=(amount < 0 and 'payment' or 'receipt'), context=context)
voucher_line_dict = False
if result['value']['line_ids']:
for line_dict in result['value']['line_ids']:
@ -237,10 +241,10 @@ class account_coda_import(osv.osv_memory):
voucher_line_dict.update({'voucher_id':voucher_id})
voucher_line_obj.create(cr, uid, voucher_line_dict, context=context)
# reconcile_id = statement_reconcile_obj.create(cr, uid, {
# 'line_ids': [(6, 0, rec_id)]
# }, context=context)
#
# reconcile_id = statement_reconcile_obj.create(cr, uid, {
# 'line_ids': [(6, 0, rec_id)]
# }, context=context)
#
mv = self.pool.get('account.move.line').browse(cr, uid, rec_id[0], context=context)
if mv.partner_id:
@ -249,20 +253,20 @@ class account_coda_import(osv.osv_memory):
line['account_id'] = mv.partner_id.property_account_payable.id
else :
line['account_id'] = mv.partner_id.property_account_receivable.id
str_not1 = ''
if line.has_key('contry_name') and line.has_key('cntry_number'):
str_not1="Partner name:%s \n Partner Account Number:%s \n Communication:%s \n Value Date:%s \n Entry Date:%s \n"%(line["contry_name"], line["cntry_number"], line["free_comm"]+line['extra_note'], line["val_date"][0], line["entry_date"][0])
id = bank_statement_line_obj.create(cr, uid, {
'name':line['name'],
'date': line['date'],
'amount': line['amount'],
'partner_id':line['partner_id'] or 0,
'account_id':line['account_id'],
'statement_id': bk_st_id,
'voucher_id': voucher_id,
'note':str_not1,
'ref':line['ref'],
})
str_not1 = ''
if line.has_key('contry_name') and line.has_key('cntry_number'):
str_not1="Partner name:%s \n Partner Account Number:%s \n Communication:%s \n Value Date:%s \n Entry Date:%s \n"%(line["contry_name"], line["cntry_number"], line["free_comm"]+line['extra_note'], line["val_date"][0], line["entry_date"][0])
bank_statement_line_obj.create(cr, uid, {
'name':line['name'],
'date': line['date'],
'amount': line['amount'],
'partner_id':line['partner_id'],
'account_id':line['account_id'],
'statement_id': bk_st_id,
'voucher_id': voucher_id,
'note':str_not1,
'ref':line['ref'],
})
str_not = "\n \n Account Number: %s \n Account Holder Name: %s " %(statement["acc_number"], statement["acc_holder"])
std_log += "\nStatement : %s , Date : %s, Starting Balance : %.2f , Ending Balance : %.2f \n"\
@ -299,7 +303,6 @@ class account_coda_import(osv.osv_memory):
test = ''
test = str_log1 + std_log + err_log
self.write(cr, uid, ids, {'note': test}, context=context)
extraction = { 'statment_ids': bkst_list}
context.update({ 'statment_ids': bkst_list})
model_data_ids = mod_obj.search(cr, uid, [('model', '=', 'ir.ui.view'), ('name', '=', 'account_coda_note_view')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
@ -319,7 +322,7 @@ class account_coda_import(osv.osv_memory):
def action_open_window(self, cr, uid, data, context=None):
if not context:
cotext = {}
context = {}
return {
'domain':"[('id','in',%s)]"%(context.get('statment_ids', False)),

View File

@ -237,7 +237,7 @@
<para style="terp_default_Right_9">[[formatLang(line.amount) or '-' ]] [[get_company_currency_symbol()]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line.amount_currency) ]] [[ line.currency.name ]] </para>
<para style="terp_default_Right_9">[[ formatLang(line.amount_currency) ]] [[get_company_currency_symbol()]] </para>
</td>
</tr>
</blockTable>
@ -256,7 +256,7 @@
<para style="terp_default_Right_9">[[ formatLang(get_amount_total(o)) or '' ]] [[get_company_currency_symbol()]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(get_amount_total_in_currency(o)) or '' ]] [[ line.currency.name ]] </para>
<para style="terp_default_Right_9">[[ formatLang(get_amount_total_in_currency(o)) or '' ]] [[get_company_currency_symbol()]] </para>
</td>
</tr>
</blockTable>

View File

@ -71,6 +71,10 @@ class account_payment_populate_statement(osv.osv_memory):
ctx['date'] = line.ml_maturity_date # was value_date earlier,but this field exists no more now
amount = currency_obj.compute(cr, uid, line.currency.id,
statement.currency.id, line.amount_currency, context=ctx)
context.update({'move_line_ids': [line.move_line_id.id]})
result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype='payment', context=context)
if line.partner_id:
# line['partner_id'] = mv.partner_id.id
if amount < 0 :
@ -83,7 +87,7 @@ class account_payment_populate_statement(osv.osv_memory):
'name': line.name,
'partner_id': line.partner_id.id,
'journal_id': statement.journal_id.id,
'account_id': account,
'account_id': result.get('account_id', statement.journal_id.default_credit_account_id.id),
'company_id': statement.company_id.id,
'currency_id': statement.currency.id,
'date': line.date or time.strftime('%Y-%m-%d'),
@ -91,8 +95,6 @@ class account_payment_populate_statement(osv.osv_memory):
'period_id': statement.period_id.id
}
voucher_id = voucher_obj.create(cr, uid, voucher_res, context=context)
context.update({'move_line_ids': [line.move_line_id.id]})
result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype='payment', context=context)
voucher_line_dict = False
if result['value']['line_ids']:
for line_dict in result['value']['line_ids']:

View File

@ -106,10 +106,10 @@
<section>
<blockTable colWidths="528.0" style="Table7">
<tr>
<td><para style="P11"><font color="white">[['.....'*(o['level']) ]]</font><font>[[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold','fontSize':'10.5'}) ]]</font>(<seq/>)<font>[[ o['name'] ]] ([[ o['code'] ]])</font></para></td>
<td><para style="P11"><font color="white">[['.....'*(o['level']) ]]</font><font>[[ o['type']&lt;&gt;'view' and setTag('para','para',{'fontName':'Helvetica-Bold','fontSize':'10.5'}) ]]</font>(<seq/>)<font>[[ o['name'] ]] ([[ o['code'] ]])</font></para></td>
</tr>
</blockTable>
<para style="P1">[[ o['disp_tree'] and setTag('para','image',{'file':gettree(data['form'],o)}) or removeParentNode('para') ]]</para>
<para style="P1">[[ o['disp_tree'] and setTag('para','image',{'width':'450.00','height':'215.00','file':gettree(data['form'],o)}) or removeParentNode('para') ]]</para>
<para style="P1">[[ o['disp_graph'] and setTag('para','image',{'width':'450.00','height':'215.00','file':getgraph(data['form'],o)}) or removeParentNode('para') ]]</para>
<para style="P3"><font color="white"> </font></para>
<blockTable colWidths="528.0" repeatRows="1" style="Table7">

View File

@ -94,7 +94,7 @@ class account_voucher(osv.osv):
journal = journal_pool.browse(cr, uid, journal_id)
currency_id = journal.company_id.currency_id.id
if journal.currency:
currency_id = journal.currency.id
return journal.currency.id
return False
def _get_partner(self, cr, uid, context={}):
@ -112,6 +112,14 @@ class account_voucher(osv.osv):
return [(r['id'], (str("%.2f" % r['amount']) or '')) for r in self.read(cr, uid, ids, ['amount'], context, load='_classic_write')]
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
if not view_id and context.get('invoice_type',False):
mod_obj = self.pool.get('ir.model.data')
if context.get('invoice_type') in ('out_invoice','out_refund'):
result = mod_obj._get_id(cr, uid, 'account_voucher', 'view_vendor_receipt_form')
else:
result = mod_obj._get_id(cr, uid, 'account_voucher', 'view_vendor_payment_form')
result = mod_obj.read(cr, uid, [result], ['res_id'], context=context)[0]['res_id']
view_id = result
res = super(account_voucher,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
doc = etree.XML(res['arch'])
nodes = doc.xpath("//field[@name='partner_id']")
@ -216,16 +224,15 @@ class account_voucher(osv.osv):
if not tax[0].price_include:
for tax_line in tax_pool.compute_all(cr, uid, tax, voucher_amount, 1).get('taxes',[]):
total_tax += tax_line.get('amount')
total_tax += tax_line.get('amount', 0.0)
total += total_tax
else:
line_ids2 = []
for line in voucher.line_ids:
line_total = 0.0
line_tax = 0.0
for tax_line in tax_pool.compute_all(cr, uid, tax, line.untax_amount or line.amount, 1).get('taxes',[]):
line_tax += tax_line.get('amount')
line_tax += tax_line.get('amount', 0.0)
line_total += tax_line.get('price_unit')
total_tax += line_tax
untax_amount = line.untax_amount or line.amount
@ -238,12 +245,10 @@ class account_voucher(osv.osv):
tax_pool = self.pool.get('account.tax')
partner_pool = self.pool.get('res.partner')
position_pool = self.pool.get('account.fiscal.position')
voucher_line_pool = self.pool.get('account.voucher.line')
res = {
'tax_amount':False,
'amount':False,
}
voucher_total_tax = 0.0
voucher_total = 0.0
voucher_line_ids = []
@ -349,9 +354,7 @@ class account_voucher(osv.osv):
if context is None:
context = {}
currency_pool = self.pool.get('res.currency')
move_pool = self.pool.get('account.move')
line_pool = self.pool.get('account.voucher.line')
move_line_pool = self.pool.get('account.move.line')
partner_pool = self.pool.get('res.partner')
@ -384,6 +387,7 @@ class account_voucher(osv.osv):
account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id
default['value']['account_id'] = account_id
if journal.type not in ('cash', 'bank'):
return default
@ -454,6 +458,7 @@ class account_voucher(osv.osv):
default['value']['pre_line'] = 1
elif ttype == 'receipt' and len(default['value']['line_dr_ids']) > 0:
default['value']['pre_line'] = 1
return default
def onchange_date(self, cr, user, ids, date, context={}):
@ -505,7 +510,6 @@ class account_voucher(osv.osv):
def cancel_voucher(self, cr, uid, ids, context={}):
reconcile_pool = self.pool.get('account.move.reconcile')
move_pool = self.pool.get('account.move')
voucher_line_pool = self.pool.get('account.voucher.line')
for voucher in self.browse(cr, uid, ids):
recs = []
@ -565,9 +569,7 @@ class account_voucher(osv.osv):
context = {}
move_pool = self.pool.get('account.move')
move_line_pool = self.pool.get('account.move.line')
analytic_pool = self.pool.get('account.analytic.line')
currency_pool = self.pool.get('res.currency')
invoice_pool = self.pool.get('account.invoice')
bank_st_line_obj = self.pool.get('account.bank.statement.line')
for inv in self.browse(cr, uid, ids):
if inv.move_id:
@ -674,6 +676,7 @@ class account_voucher(osv.osv):
move_line.update({
'account_tax_id':inv.tax_id.id,
})
master_line = move_line_pool.create(cr, uid, move_line)
if line.move_line_id.id:
rec_ids = [master_line, line.move_line_id.id]
@ -697,7 +700,8 @@ class account_voucher(osv.osv):
else:
account_id = inv.partner_id.property_account_payable.id
move_line['account_id'] = account_id
move_line_id = move_line_pool.create(cr, uid, move_line)
move_line_pool.create(cr, uid, move_line)
self.write(cr, uid, [inv.id], {
'move_id': move_id,
@ -787,13 +791,11 @@ class account_voucher_line(osv.osv):
move_line_pool = self.pool.get('account.move.line')
if move_line_id:
move_line = move_line_pool.browse(cr, user, move_line_id, context=context)
move_id = move_line.move_id.id
if move_line.credit:
ttype='dr'
amount = move_line.credit
else:
ttype='cr'
amount = move_line.debit
account_id = move_line.account_id.id
res.update({
'account_id':account_id,
@ -848,14 +850,12 @@ class account_bank_statement(osv.osv):
_inherit = 'account.bank.statement'
def button_cancel(self, cr, uid, ids, context=None):
done = []
for st in self.browse(cr, uid, ids, context):
voucher_ids = []
for line in st.line_ids:
if line.voucher_id:
voucher_ids.append(line.voucher_id.id)
self.pool.get('account.voucher').cancel_voucher(cr, uid, voucher_ids, context)
self.pool.get('account.voucher').unlink(cr, uid, voucher_ids, context)
return super(account_bank_statement, self).button_cancel(cr, uid, ids, context=context)
def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, next_number, context=None):
@ -864,6 +864,8 @@ class account_bank_statement(osv.osv):
st_line = self.pool.get('account.bank.statement.line').browse(cr, uid, st_line_id, context=context)
if st_line.voucher_id:
voucher_obj.write(cr, uid, [st_line.voucher_id.id], {'number': next_number}, context=context)
if st_line.voucher_id.state == 'cancel':
voucher_obj.action_cancel_draft(cr, uid, [st_line.voucher_id.id], context=context)
wf_service.trg_validate(uid, 'account.voucher', st_line.voucher_id.id, 'proforma_voucher', cr)
return self.pool.get('account.move.line').write(cr, uid, [x.id for x in st_line.voucher_id.move_ids], {'statement_id': st_line.statement_id.id}, context=context)
return super(account_bank_statement, self).create_move_from_st_line(cr, uid, st_line.id, company_currency_id, next_number, context=context)
@ -877,9 +879,8 @@ class account_bank_statement_line(osv.osv):
if not ids:
return {}
res_currency_obj = self.pool.get('res.currency')
res = {}
company_currency_id = False
# company_currency_id = False
for line in self.browse(cursor, user, ids, context=context):
# if not company_currency_id:
# company_currency_id = line.company_id.id

View File

@ -161,7 +161,6 @@
<menuitem action="action_voucher_list" id="menu_encode_entries_by_voucher" parent="account.menu_finance_entries" sequence="6"/>
<act_window
id="act_journal_voucher_open"
name="Voucher Entries"
context="{'search_default_journal_id': active_id, 'type':type}"
@ -219,6 +218,14 @@
</field>
</record>
<act_window
id="act_invoice_voucher_open"
name="Pay Invoice"
view_mode="form,tree"
domain="[('partner_id', '=', partner_id)]"
context="{'default_partner_id': partner_id, 'default_amount':residual, 'default_name':name, 'default_state': 'draft', 'invoice_type':type, 'default_type': type in ('out_invoice','out_refund') and 'receipt' or 'payment'}"
res_model="account.voucher"
src_model="account.invoice"/>
</data>
</openerp>

View File

@ -72,19 +72,20 @@ class account_statement_from_invoice_lines(osv.osv_memory):
amount = currency_obj.compute(cr, uid, line.invoice.currency_id.id,
statement.currency.id, amount, context=ctx)
context.update({'move_line_ids': [line.id]})
result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype=(amount < 0 and 'payment' or 'receipt'), context=context)
voucher_res = { 'type':(amount < 0 and 'payment' or 'receipt') ,
'name': line.name,
'partner_id': line.partner_id.id,
'journal_id': statement.journal_id.id,
'account_id': line.account_id.id,
'account_id': result.get('account_id', statement.journal_id.default_credit_account_id.id), # improve me: statement.journal_id.default_credit_account_id.id
'company_id':statement.company_id.id,
'currency_id':statement.currency.id,
'date':line.date,
'amount':abs(amount),
'period_id':statement.period_id.id}
voucher_id = voucher_obj.create(cr, uid, voucher_res, context=context)
context.update({'move_line_ids': [line.id]})
result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype=(amount < 0 and 'payment' or 'receipt'), context=context)
voucher_line_dict = False
if result['value']['line_ids']:
for line_dict in result['value']['line_ids']:
@ -128,7 +129,7 @@ class account_statement_from_invoice(osv.osv_memory):
'line_ids': fields.many2many('account.move.line', 'account_move_line_relation', 'move_id', 'line_id', 'Invoices'),
}
_defaults = {
'date':lambda *a: time.strftime('%Y-%m-%d'),
'date': time.strftime('%Y-%m-%d'),
}
def search_invoices(self, cr, uid, ids, context=None):
@ -170,6 +171,7 @@ class account_statement_from_invoice(osv.osv_memory):
line_ids = line_obj.search(cr, uid, args,
context=context)
model_data_ids = mod_obj.search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_account_statement_from_invoice_lines')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
return {

View File

@ -38,7 +38,7 @@
<form string="Import Entries">
<group colspan="4" expand="1">
<separator string="Payable and Receivables" colspan="4"/>
<field height="300" width="700" name="line_ids" colspan="4" nolabel="1" domain="[('account_id.type','in',['receivable','payable']), ('reconcile_id','=',False), ('reconcile_partial_id','=',False)]"/>
<field height="300" width="700" name="line_ids" colspan="4" nolabel="1" domain="[('account_id.type','in',['receivable','payable']),('reconcile_id','=',False), ('reconcile_partial_id','=',False)]"/>
</group>
<group colspan="4" col="6">
<label string ="" colspan="2"/>
@ -48,7 +48,7 @@
</form>
</field>
</record>
<record id="action_view_account_statement_from_invoice_lines" model="ir.actions.act_window">
<field name="name">Import Entries</field>
<field name="res_model">account.statement.from.invoice.lines</field>

View File

@ -1,4 +1,2 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_account_analytic_line_analytic_accounting","account.analytic.line","analytic.model_account_analytic_line","analytic.group_analytic_accounting",1,1,1,1
"access_account_analytic_account_analytic_accounting","account.analytic.account","analytic.model_account_analytic_account","analytic.group_analytic_accounting",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
access_account_analytic_line_analytic_accounting account.analytic.line analytic.model_account_analytic_line analytic.group_analytic_accounting 1 1 1 1
access_account_analytic_account_analytic_accounting account.analytic.account analytic.model_account_analytic_account analytic.group_analytic_accounting 1 1 1 1
2

View File

@ -64,7 +64,7 @@ class auction_dates(osv.osv):
reads = self.read(cr, uid, ids, ['name', 'auction1'], context)
name = [(r['id'], '['+r['auction1']+'] '+ r['name']) for r in reads]
return name
def _get_invoice(self, cr, uid, ids, name, arg, context={}):
lots_obj = self.pool.get('auction.lots')
result = {}
@ -100,7 +100,7 @@ class auction_dates(osv.osv):
'adj_total': fields.function(_adjudication_get, method=True, string='Total Adjudication', store=True),
'state': fields.selection((('draft', 'Draft'), ('closed', 'Closed')), 'State', select=1, readonly=True,
help='When auction starts the state is \'Draft\'.\n At the end of auction, the state becomes \'Closed\'.'),
'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True),
'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account', required=False),
'buyer_invoice_history': fields.function(_get_invoice, relation='account.invoice', method=True, string="Buyer Invoice", type='many2many', multi=True),
'seller_invoice_history': fields.function(_get_invoice, relation='account.invoice', method=True, string="Seller Invoice", type='many2many', multi=True),
}
@ -291,7 +291,7 @@ class auction_lots(osv.osv):
taxes += lot.auction_id.buyer_costs
tax = pt_tax.compute_all(cr, uid, taxes, amount, 1)['taxes']
for t in tax:
result += t['amount']
result += t.get('amount', 0.0)
result += amount
elif name == "seller_price":
if lot.bord_vnd_id.tax_id:
@ -300,7 +300,7 @@ class auction_lots(osv.osv):
taxes += lot.auction_id.seller_costs
tax = pt_tax.compute_all(cr, uid, taxes, amount, 1)['taxes']
for t in tax:
result += t['amount']
result += t.get('amount', 0.0)
result += amount
elif name == "gross_revenue":
if lot.auction_id:
@ -621,14 +621,14 @@ class auction_lots(osv.osv):
taxes.append(lot.author_right.id)
inv_line= {
'invoice_id': inv_id,
'quantity': 1,
'product_id': lot.product_id.id,
'name': 'proforma'+'['+str(lot.obj_num)+'] '+ lot.name,
'invoice_line_tax_id': [(6, 0, taxes)],
'account_analytic_id': lot.auction_id.account_analytic_id.id,
'account_id': lot.auction_id.acc_income.id,
'price_unit': lot.obj_price,
'invoice_id': inv_id,
'quantity': 1,
'product_id': lot.product_id.id,
'name': 'proforma'+'['+str(lot.obj_num)+'] '+ lot.name,
'invoice_line_tax_id': [(6, 0, taxes)],
'account_analytic_id': lot.auction_id.account_analytic_id.id,
'account_id': lot.auction_id.acc_income.id,
'price_unit': lot.obj_price,
}
inv_line_obj.create(cr, uid, inv_line, context)
inv_ref.button_compute(cr, uid, invoices.values())

View File

@ -134,7 +134,7 @@
<separator string="Analytic" colspan="4"/>
<field name="journal_id"/>
<field name="journal_seller_id"/>
<field name="account_analytic_id" groups="base.group_extended"/>
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
</group>
</group>
</page>

View File

@ -19,12 +19,11 @@
#
##############################################################################
import time
from crm import crm
from osv import fields, osv
from tools.translate import _
import netsvc
import pooler
import time
import tools
import decimal_precision as dp
@ -38,7 +37,7 @@ class event_type(osv.osv):
}
event_type()
class event_event(osv.osv):
class event_event(crm.crm_case, osv.osv):
"""Event"""
_name = 'event.event'
_description = __doc__
@ -56,6 +55,7 @@ class event_event(osv.osv):
'registration_ids': False,
})
return super(event_event, self).copy(cr, uid, id, default=default, context=context)
def onchange_product(self, cr, uid, ids, product_id):
"""This function returns value of product's unit price based on product id.
@param self: The object pointer
@ -157,11 +157,14 @@ class event_event(osv.osv):
('event_id', '=', event.id),
('state', 'in', state)])
number = 0.0
if reg_ids:
cr.execute('select sum(nb_register) from event_registration where id IN %s', (tuple(reg_ids),))
number = cr.fetchone()
if 'register_current' in fields:
res[event.id]['register_current'] = len(reg_ids)
res[event.id]['register_current'] = number and number[0]
if 'register_prospect' in fields:
res[event.id]['register_prospect'] = len(reg_ids)
res[event.id]['register_prospect'] = number and number[0]
return res
def write(self, cr, uid, ids, vals, context=None):
@ -235,7 +238,7 @@ class event_event(osv.osv):
type='many2one', relation='res.country', string='Country', readonly=False, states={'done': [('readonly', True)]}),
'language': fields.char('Language',size=64, readonly=False, states={'done': [('readonly', True)]}),
'note': fields.text('Description', readonly=False, states={'done': [('readonly', True)]}),
'company_id': fields.many2one('res.company', 'Company', required=True, change_default=True, readonly=False, states={'done': [('readonly', True)]}),
'company_id': fields.many2one('res.company', 'Company', required=False, change_default=True, readonly=False, states={'done': [('readonly', True)]}),
}
@ -243,6 +246,7 @@ class event_event(osv.osv):
'state': 'draft',
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'event.event', context=c),
'user_id': lambda obj, cr, uid, context: uid,
'section_id': crm.crm_case._get_section,
}
def _check_recursion(self, cr, uid, ids):
@ -337,8 +341,8 @@ class event_registration(osv.osv):
_defaults = {
'nb_register': 1,
'tobe_invoiced': True,
'state': lambda *a: 'draft',
'active': lambda *a: 1,
'state': 'draft',
'active': True,
'user_id': lambda self, cr, uid, ctx: uid,
}
@ -354,11 +358,8 @@ class event_registration(osv.osv):
val_invoice = inv_pool.onchange_partner_id(cr, uid, [], 'out_invoice', reg.partner_invoice_id.id, False, False)
val_invoice['value'].update({'partner_id': reg.partner_invoice_id.id})
partner_address_id = val_invoice['value']['address_invoice_id']
value = inv_lines_pool.product_id_change(cr, uid, [], reg.event_id.product_id.id, uom =False, partner_id=reg.partner_invoice_id.id, fposition_id=reg.partner_invoice_id.property_account_position.id)
l = inv_lines_pool.read(cr, uid, lines)
inv_lines_pool.product_id_change(cr, uid, [], reg.event_id.product_id.id, uom =False, partner_id=reg.partner_invoice_id.id, fposition_id=reg.partner_invoice_id.property_account_position.id)
val_invoice['value'].update({
'origin': reg.event_product,
@ -591,11 +592,9 @@ class event_registration(osv.osv):
data ={}
if not contact:
return data
contact_obj = self.pool.get('res.partner.contact')
addr_obj = self.pool.get('res.partner.address')
job_obj = self.pool.get('res.partner.job')
contact_id = contact_obj.browse(cr, uid, contact)
if partner:
partner_addresses = addr_obj.search(cr, uid, [('partner_id', '=', partner)])
job_ids = job_obj.search(cr, uid, [('contact_id', '=', contact), ('address_id', 'in', partner_addresses)])
@ -667,7 +666,6 @@ class event_registration(osv.osv):
data['contact_id'] = job_obj.browse(cr, uid, job_ids[0]).contact_id.id
d = self.onchange_contact_id(cr, uid, ids, data['contact_id'], part)
data.update(d['value'])
partner_data = res_obj.browse(cr, uid, part)
return {'value': data}
def onchange_partner_invoice_id(self, cr, uid, ids, event_id, partner_invoice_id):
@ -714,5 +712,4 @@ class event_registration_badge(osv.osv):
}
event_registration_badge()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -58,7 +58,7 @@
<separator string="Invoice Information" colspan="4"/>
<field name="product_id" on_change="onchange_product(product_id)" colspan="4"/>
<field name="unit_price"/>
<field name="pricelist_id" domain="[('type','=','sale')]" groups="base.group_extended"/>
<field name="pricelist_id" widget="selection" domain="[('type','=','sale')]" groups="base.group_extended"/>
</group>
<group colspan="2" col="2">
<separator string="Contact" colspan="4"/>
@ -164,6 +164,7 @@
<field name="arch" type="xml">
<tree string="Events" colors="red:register_min>register_current;black:register_min&lt;=register_current">
<field name="name" string="Name"/>
<field name="user_id"/>
<field name="main_speaker_id"/>
<field name="language"/>
<field name="type"/>
@ -171,6 +172,7 @@
<field name="date_end"/>
<field name="register_min"/>
<field name="register_current"/>
<field name="section_id" invisible="context.get('invisible_section', True)"/>
<field name="state"/>
<button string="Confirm Event" help="Confirm Event" name="button_confirm" states="draft" type="object" icon="gtk-apply"/>
<button string="Cancel Event" help="Cancel Event" name="button_cancel" states="draft,confirm" type="object" icon="gtk-cancel"/>
@ -231,13 +233,20 @@
</field>
<field name="date_begin" select="1"/>
<field name="state" select="1"/>
<field name="section_id" default="context.get('section_id', False)" widget="selection" groups="base.group_extended">
<filter icon="terp-personal+"
context="{'invisible_section': False}"
domain="[('section_id.user_id','=',uid)]"
groups="base.group_extended"
help="My Sales Team(s)"/>
</field>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="12">
<filter string="Responsible" icon="terp-personal" context="{'group_by': 'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Event Type" icon="terp-crm" context="{'group_by':'type'}"/>
<filter string="state" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Beginning Date" icon="terp-go-month"
domain="[]" context="{'group_by':'date_begin'}"/>
@ -254,7 +263,7 @@
<field name="res_model">event.event</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
<field name="context">{"search_default_draft": "1"}</field>
<field name="context">{"search_default_draft": "1", "search_default_section_id": section_id}</field>
<field name="search_view_id" ref="view_event_search"/>
</record>
@ -264,7 +273,7 @@
res_model="event.registration"
src_model="event.event"
view_mode="tree,form,calendar,graph"
context="{'search_default_event_id': [active_id]}"
context="{'search_default_event_id': active_id}"
view_type="form"/>
<act_window

View File

@ -84,7 +84,7 @@
<filter string="Event" name="event" icon="terp-crm" context="{'group_by':'event_id'}"/>
<filter string="Event Type" icon="terp-crm" context="{'group_by':'type'}"/>
<separator orientation="vertical"/>
<filter string="state" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Speaker" name="user" icon="terp-personal+" context="{'group_by': 'speaker_id'}"/>
<separator orientation="vertical" />

View File

@ -1,11 +1,11 @@
<?xml version="1.0"?>
<openerp>
<data>
<data>
<record id="base.group_marketing_manager" model="res.groups">
<field name="name">Marketing / Manager</field>
</record>
<record id="base.res_groups_email_template_admin" model="res.groups">
<field name="name">Marketing / User</field>
</record>
@ -17,8 +17,7 @@
<record id="base.group_sale_salesman" model="res.groups">
<field name="name">Sales / User</field>
</record>
</data>
</data>
</openerp>

View File

@ -20,7 +20,6 @@
##############################################################################
from osv import fields, osv
from tools.translate import _
class event_confirm(osv.osv_memory):
"""
@ -29,19 +28,10 @@ class event_confirm(osv.osv_memory):
_name = "event.confirm"
_description = "Event Confirmation"
_columns = {
'msg': fields.text('Message', readonly=True),
}
_defaults = {
'msg': _('Warning: This Event has not reached its Minimum Registration Limit. Are you sure you want to confirm it?')
}
def confirm(self, cr, uid, ids, context):
event_pool = self.pool.get('event.event')
event_ids = context.get('event_ids', [])
event_pool.do_confirm(cr, uid, event_ids, context=context)
def confirm(self, cr, uid, ids, context=None):
self.pool.get('event.event').do_confirm(cr, uid, context.get('event_ids', []), context=context)
return {}
event_confirm()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

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