[MERGE] trunk
bzr revid: tfr@openerp.com-20101222150033-l395zkbh61vstwyb
This commit is contained in:
@@ -48,7 +48,6 @@ module named account_voucher.
|
||||
'security/account_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'account_menuitem.xml',
|
||||
'account_wizard.xml',
|
||||
'report/account_invoice_report_view.xml',
|
||||
'report/account_entries_report_view.xml',
|
||||
'report/account_report_view.xml',
|
||||
@@ -119,7 +118,7 @@ module named account_voucher.
|
||||
'project/project_demo.xml',
|
||||
'project/analytic_account_demo.xml',
|
||||
'demo/account_minimal.xml',
|
||||
#'account_unit_test.xml',
|
||||
# 'account_unit_test.xml',
|
||||
],
|
||||
'test': [
|
||||
'test/account_customer_invoice.yml',
|
||||
|
||||
+246
-152
@@ -20,16 +20,17 @@
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime
|
||||
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.translate import _
|
||||
|
||||
def check_cycle(self, cr, uid, ids):
|
||||
def check_cycle(self, cr, uid, ids, context=None):
|
||||
""" climbs the ``self._table.parent_id`` chains for 100 levels or
|
||||
until it can't find any more parent(s)
|
||||
|
||||
@@ -53,7 +54,7 @@ class account_payment_term(osv.osv):
|
||||
_description = "Payment Term"
|
||||
_columns = {
|
||||
'name': fields.char('Payment Term', size=64, translate=True, required=True),
|
||||
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the payment term without removing it."),
|
||||
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the payment term without removing it."),
|
||||
'note': fields.text('Description', translate=True),
|
||||
'line_ids': fields.one2many('account.payment.term.line', 'payment_id', 'Terms'),
|
||||
}
|
||||
@@ -115,13 +116,13 @@ class account_payment_term_line(osv.osv):
|
||||
_order = "sequence"
|
||||
|
||||
def _check_percent(self, cr, uid, ids, context=None):
|
||||
obj = self.browse(cr, uid, ids[0])
|
||||
obj = self.browse(cr, uid, ids[0], context=context)
|
||||
if obj.value == 'procent' and ( obj.value_amount < 0.0 or obj.value_amount > 1.0):
|
||||
return False
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_percent, _('Percentages for Payment Term Line must be between 0 and 1, Example: 0.02 for 2% '), ['value_amount']),
|
||||
(_check_percent, 'Percentages for Payment Term Line must be between 0 and 1, Example: 0.02 for 2% ', ['value_amount']),
|
||||
]
|
||||
|
||||
account_payment_term_line()
|
||||
@@ -193,7 +194,7 @@ class account_account(osv.osv):
|
||||
if not args[pos][2]:
|
||||
del args[pos]
|
||||
continue
|
||||
jour = self.pool.get('account.journal').browse(cr, uid, args[pos][2])
|
||||
jour = self.pool.get('account.journal').browse(cr, uid, args[pos][2], context=context)
|
||||
if (not (jour.account_control_ids or jour.type_control_ids)) or not args[pos][2]:
|
||||
args[pos] = ('type','not in',('consolidation','view'))
|
||||
continue
|
||||
@@ -206,7 +207,7 @@ class account_account(osv.osv):
|
||||
if context and context.has_key('consolidate_childs'): #add consolidated childs of accounts
|
||||
ids = super(account_account, self).search(cr, uid, args, offset, limit,
|
||||
order, context=context, count=count)
|
||||
for consolidate_child in self.browse(cr, uid, context['account_id']).child_consol_ids:
|
||||
for consolidate_child in self.browse(cr, uid, context['account_id'], context=context).child_consol_ids:
|
||||
ids.append(consolidate_child.id)
|
||||
return ids
|
||||
|
||||
@@ -214,8 +215,6 @@ class account_account(osv.osv):
|
||||
order, context=context, count=count)
|
||||
|
||||
def _get_children_and_consol(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
#this function search for all the children and all consolidated children (recursively) of the given account ids
|
||||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)
|
||||
ids3 = []
|
||||
@@ -288,35 +287,35 @@ class account_account(osv.osv):
|
||||
sums = {}
|
||||
while brs:
|
||||
current = brs[0]
|
||||
can_compute = True
|
||||
for child in current.child_id:
|
||||
if child.id not in sums:
|
||||
can_compute = False
|
||||
try:
|
||||
brs.insert(0, brs.pop(brs.index(child)))
|
||||
except ValueError:
|
||||
brs.insert(0, child)
|
||||
if can_compute:
|
||||
brs.pop(0)
|
||||
for fn in field_names:
|
||||
sums.setdefault(current.id, {})[fn] = accounts.get(current.id, {}).get(fn, 0.0)
|
||||
if current.child_id:
|
||||
sums[current.id][fn] += sum(sums[child.id][fn] for child in current.child_id)
|
||||
# can_compute = True
|
||||
# for child in current.child_id:
|
||||
# if child.id not in sums:
|
||||
# can_compute = False
|
||||
# try:
|
||||
# brs.insert(0, brs.pop(brs.index(child)))
|
||||
# except ValueError:
|
||||
# brs.insert(0, child)
|
||||
# if can_compute:
|
||||
brs.pop(0)
|
||||
for fn in field_names:
|
||||
sums.setdefault(current.id, {})[fn] = accounts.get(current.id, {}).get(fn, 0.0)
|
||||
if current.child_id:
|
||||
sums[current.id][fn] += sum(sums[child.id][fn] for child in current.child_id)
|
||||
res = {}
|
||||
null_result = dict((fn, 0.0) for fn in field_names)
|
||||
for id in ids:
|
||||
res[id] = sums.get(id, null_result)
|
||||
return res
|
||||
|
||||
def _get_company_currency(self, cr, uid, ids, field_name, arg, context={}):
|
||||
def _get_company_currency(self, cr, uid, ids, field_name, arg, context=None):
|
||||
result = {}
|
||||
for rec in self.browse(cr, uid, ids, context):
|
||||
result[rec.id] = (rec.company_id.currency_id.id,rec.company_id.currency_id.code)
|
||||
for rec in self.browse(cr, uid, ids, context=context):
|
||||
result[rec.id] = (rec.company_id.currency_id.id,rec.company_id.currency_id.symbol)
|
||||
return result
|
||||
|
||||
def _get_child_ids(self, cr, uid, ids, field_name, arg, context={}):
|
||||
def _get_child_ids(self, cr, uid, ids, field_name, arg, context=None):
|
||||
result = {}
|
||||
for record in self.browse(cr, uid, ids, context):
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
if record.child_parent_ids:
|
||||
result[record.id] = [x.id for x in record.child_parent_ids]
|
||||
else:
|
||||
@@ -329,9 +328,9 @@ class account_account(osv.osv):
|
||||
|
||||
return result
|
||||
|
||||
def _get_level(self, cr, uid, ids, field_name, arg, context={}):
|
||||
def _get_level(self, cr, uid, ids, field_name, arg, context=None):
|
||||
res={}
|
||||
accounts = self.browse(cr, uid, ids)
|
||||
accounts = self.browse(cr, uid, ids, context=context)
|
||||
for account in accounts:
|
||||
level = 0
|
||||
if account.parent_id:
|
||||
@@ -343,7 +342,7 @@ class account_account(osv.osv):
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=128, required=True, select=True),
|
||||
'currency_id': fields.many2one('res.currency', 'Secondary Currency', help="Forces all moves for this account to have this secondary currency."),
|
||||
'code': fields.char('Code', size=64, required=True),
|
||||
'code': fields.char('Code', size=64, required=True, select=1),
|
||||
'type': fields.selection([
|
||||
('view', 'View'),
|
||||
('other', 'Regular'),
|
||||
@@ -373,7 +372,7 @@ class account_account(osv.osv):
|
||||
'note': fields.text('Note'),
|
||||
'company_currency_id': fields.function(_get_company_currency, method=True, type='many2one', relation='res.currency', string='Company Currency'),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
'active': fields.boolean('Active', select=2, help="If the active field is set to true, it will allow you to hide the account without removing it."),
|
||||
'active': fields.boolean('Active', select=2, help="If the active field is set to False, it will allow you to hide the account without removing it."),
|
||||
|
||||
'parent_left': fields.integer('Parent Left', select=1),
|
||||
'parent_right': fields.integer('Parent Right', select=1),
|
||||
@@ -395,8 +394,8 @@ class account_account(osv.osv):
|
||||
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.account', context=c),
|
||||
}
|
||||
|
||||
def _check_recursion(self, cr, uid, ids):
|
||||
obj_self = self.browse(cr, uid, ids[0])
|
||||
def _check_recursion(self, cr, uid, ids, context=None):
|
||||
obj_self = self.browse(cr, uid, ids[0], context=context)
|
||||
p_id = obj_self.parent_id and obj_self.parent_id.id
|
||||
if (obj_self in obj_self.child_consol_ids) or (p_id and (p_id is obj_self.id)):
|
||||
return False
|
||||
@@ -425,14 +424,12 @@ class account_account(osv.osv):
|
||||
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
|
||||
if not args:
|
||||
args = []
|
||||
if not context:
|
||||
context = {}
|
||||
args = args[:]
|
||||
ids = []
|
||||
try:
|
||||
if name and str(name).startswith('partner:'):
|
||||
part_id = int(name.split(':')[1])
|
||||
part = self.pool.get('res.partner').browse(cr, user, part_id, context)
|
||||
part = self.pool.get('res.partner').browse(cr, user, part_id, context=context)
|
||||
args += [('id', 'in', (part.property_account_payable.id, part.property_account_receivable.id))]
|
||||
name = False
|
||||
if name and str(name).startswith('type:'):
|
||||
@@ -583,14 +580,14 @@ class account_journal(osv.osv):
|
||||
_name = "account.journal"
|
||||
_description = "Journal"
|
||||
_columns = {
|
||||
'name': fields.char('Journal Name', size=64, required=True, translate=True),
|
||||
'code': fields.char('Code', size=16, required=True, help="The code will be used to generate the numbers of the journal entries of this journal."),
|
||||
'type': fields.selection([('sale', 'Sale'),('sale_refund','Sale Refund'), ('purchase', 'Purchase'), ('purchase_refund','Purchase Refund'), ('cash', 'Cash'), ('bank', 'Bank and Cheques'), ('general', 'General'), ('situation', 'Situation')], 'Type', size=32, required=True,
|
||||
'name': fields.char('Journal Name', size=64, required=True),
|
||||
'code': fields.char('Code', size=5, required=True, help="The code will be used to generate the numbers of the journal entries of this journal."),
|
||||
'type': fields.selection([('sale', 'Sale'),('sale_refund','Sale Refund'), ('purchase', 'Purchase'), ('purchase_refund','Purchase Refund'), ('cash', 'Cash'), ('bank', 'Bank and Cheques'), ('general', 'General'), ('situation', 'Opening/Closing Situation')], 'Type', size=32, required=True,
|
||||
help="Select 'Sale' for Sale journal to be used at the time of making invoice."\
|
||||
" Select 'Purchase' for Purchase Journal to be used at the time of approving purchase order."\
|
||||
" Select 'Cash' to be used at the time of making payment."\
|
||||
" Select 'General' to be used at the time of stock input/output."\
|
||||
" Select 'Situation' to be used at the time of making vouchers."),
|
||||
" Select 'General' for miscellaneous operations."\
|
||||
" Select 'Opening/Closing Situation' to be used at the time of new fiscal year creation or end of year entries generation."),
|
||||
'refund_journal': fields.boolean('Refund Journal', help='Fill this if the journal is to be used for refunds of invoices.'),
|
||||
'type_control_ids': fields.many2many('account.account.type', 'account_journal_type_rel', 'journal_id','type_id', 'Type Controls', domain=[('code','<>','view'), ('code', '<>', 'closed')]),
|
||||
'account_control_ids': fields.many2many('account.account', 'account_account_type_rel', 'journal_id','account_id', 'Account', domain=[('type','<>','view'), ('type', '<>', 'closed')]),
|
||||
@@ -613,12 +610,30 @@ class account_journal(osv.osv):
|
||||
'user_id': lambda self,cr,uid,context: uid,
|
||||
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
|
||||
}
|
||||
_sql_constraints = [
|
||||
('code_company_uniq', 'unique (code, company_id)', 'The code of the journal must be unique per company !'),
|
||||
('name_company_uniq', 'unique (name, company_id)', 'The name of the journal must be unique per company !'),
|
||||
]
|
||||
|
||||
_order = 'code'
|
||||
|
||||
def copy(self, cr, uid, id, default={}, context=None, done_list=[], local=False):
|
||||
journal = self.browse(cr, uid, id, context=context)
|
||||
if not default:
|
||||
default = {}
|
||||
default = default.copy()
|
||||
default['code'] = (journal['code'] or '') + '(copy)'
|
||||
default['name'] = (journal['name'] or '') + '(copy)'
|
||||
return super(account_journal, self).copy(cr, uid, id, default, context=context)
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if 'company_id' in vals:
|
||||
move_lines = self.pool.get('account.move.line').search(cr, uid, [('journal_id', 'in', ids)])
|
||||
if move_lines:
|
||||
raise osv.except_osv(_('Warning !'), _('You cannot modify company of this journal as its related record exist in Entry Lines'))
|
||||
if context is None:
|
||||
context = {}
|
||||
for journal in self.browse(cr, uid, ids, context=context):
|
||||
if 'company_id' in vals and journal.company_id.id != vals['company_id']:
|
||||
move_lines = self.pool.get('account.move.line').search(cr, uid, [('journal_id', 'in', ids)])
|
||||
if move_lines:
|
||||
raise osv.except_osv(_('Warning !'), _('You cannot modify company of this journal as its related record exist in Entry Lines'))
|
||||
return super(account_journal, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
def create_sequence(self, cr, uid, vals, context=None):
|
||||
@@ -669,7 +684,7 @@ class account_journal(osv.osv):
|
||||
|
||||
@return: Returns a list of tupples containing id, name
|
||||
"""
|
||||
result = self.browse(cr, user, ids, context)
|
||||
result = self.browse(cr, user, ids, context=context)
|
||||
res = []
|
||||
for rs in result:
|
||||
name = rs.name
|
||||
@@ -693,7 +708,8 @@ class account_journal(osv.osv):
|
||||
|
||||
return self.name_get(cr, user, ids, context=context)
|
||||
|
||||
def onchange_type(self, cr, uid, ids, type, currency):
|
||||
|
||||
def onchange_type(self, cr, uid, ids, type, currency, context=None):
|
||||
obj_data = self.pool.get('ir.model.data')
|
||||
user_pool = self.pool.get('res.users')
|
||||
|
||||
@@ -710,14 +726,13 @@ class account_journal(osv.osv):
|
||||
|
||||
res = {}
|
||||
|
||||
view_id = type_map.get(type, 'general')
|
||||
view_id = type_map.get(type, 'account_journal_view')
|
||||
|
||||
user = user_pool.browse(cr, uid, uid)
|
||||
if type in ('cash', 'bank') and currency and user.company_id.currency_id.id != currency:
|
||||
view_id = 'account_journal_bank_view_multi'
|
||||
|
||||
data_id = obj_data.search(cr, uid, [('model','=','account.journal.view'), ('name','=',view_id)])
|
||||
data = obj_data.browse(cr, uid, data_id[0])
|
||||
data = obj_data.browse(cr, uid, data_id[0], context=context)
|
||||
|
||||
res.update({
|
||||
'centralisation':type == 'situation',
|
||||
@@ -762,8 +777,8 @@ class account_fiscalyear(osv.osv):
|
||||
return False
|
||||
return True
|
||||
|
||||
def _check_duration(self,cr,uid,ids):
|
||||
obj_fy = self.browse(cr,uid,ids[0])
|
||||
def _check_duration(self, cr, uid, ids, context=None):
|
||||
obj_fy = self.browse(cr, uid, ids[0], context=context)
|
||||
if obj_fy.date_stop < obj_fy.date_start:
|
||||
return False
|
||||
return True
|
||||
@@ -773,11 +788,11 @@ class account_fiscalyear(osv.osv):
|
||||
(_check_fiscal_year, 'Error! You cannot define overlapping fiscal years',['date_start', 'date_stop'])
|
||||
]
|
||||
|
||||
def create_period3(self,cr, uid, ids, context={}):
|
||||
def create_period3(self,cr, uid, ids, context=None):
|
||||
return self.create_period(cr, uid, ids, context, 3)
|
||||
|
||||
def create_period(self,cr, uid, ids, context={}, interval=1):
|
||||
for fy in self.browse(cr, uid, ids, context):
|
||||
def create_period(self,cr, uid, ids, context=None, interval=1):
|
||||
for fy in self.browse(cr, uid, ids, context=context):
|
||||
ds = datetime.strptime(fy.date_start, '%Y-%m-%d')
|
||||
while ds.strftime('%Y-%m-%d')<fy.date_stop:
|
||||
de = ds + relativedelta(months=interval, days=-1)
|
||||
@@ -795,7 +810,7 @@ class account_fiscalyear(osv.osv):
|
||||
ds = ds + relativedelta(months=interval)
|
||||
return True
|
||||
|
||||
def find(self, cr, uid, dt=None, exception=True, context={}):
|
||||
def find(self, cr, uid, dt=None, exception=True, context=None):
|
||||
if not dt:
|
||||
dt = time.strftime('%Y-%m-%d')
|
||||
ids = self.search(cr, uid, [('date_start', '<=', dt), ('date_stop', '>=', dt)])
|
||||
@@ -840,14 +855,14 @@ class account_period(osv.osv):
|
||||
}
|
||||
_order = "date_start"
|
||||
|
||||
def _check_duration(self,cr,uid,ids,context={}):
|
||||
obj_period=self.browse(cr,uid,ids[0])
|
||||
def _check_duration(self,cr,uid,ids,context=None):
|
||||
obj_period = self.browse(cr, uid, ids[0], context=context)
|
||||
if obj_period.date_stop < obj_period.date_start:
|
||||
return False
|
||||
return True
|
||||
|
||||
def _check_year_limit(self,cr,uid,ids,context={}):
|
||||
for obj_period in self.browse(cr,uid,ids):
|
||||
def _check_year_limit(self,cr,uid,ids,context=None):
|
||||
for obj_period in self.browse(cr, uid, ids, context=context):
|
||||
if obj_period.special:
|
||||
continue
|
||||
|
||||
@@ -868,13 +883,13 @@ class account_period(osv.osv):
|
||||
(_check_year_limit, 'Invalid period ! Some periods overlap or the date period is not in the scope of the fiscal year. ', ['date_stop'])
|
||||
]
|
||||
|
||||
def next(self, cr, uid, period, step, context={}):
|
||||
def next(self, cr, uid, period, step, context=None):
|
||||
ids = self.search(cr, uid, [('date_start','>',period.date_start)])
|
||||
if len(ids)>=step:
|
||||
return ids[step-1]
|
||||
return False
|
||||
|
||||
def find(self, cr, uid, dt=None, context={}):
|
||||
def find(self, cr, uid, dt=None, context=None):
|
||||
if not dt:
|
||||
dt = time.strftime('%Y-%m-%d')
|
||||
#CHECKME: shouldn't we check the state of the period?
|
||||
@@ -890,7 +905,7 @@ class account_period(osv.osv):
|
||||
cr.execute('update account_period set state=%s where id=%s', (mode, id))
|
||||
return True
|
||||
|
||||
def name_search(self, cr, user, name, args=None, operator='ilike', context={}, limit=80):
|
||||
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
|
||||
if args is None:
|
||||
args = []
|
||||
if context is None:
|
||||
@@ -902,7 +917,7 @@ class account_period(osv.osv):
|
||||
ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit)
|
||||
return self.name_get(cr, user, ids, context=context)
|
||||
|
||||
def write(self, cr, uid, ids, vals, context={}):
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if 'company_id' in vals:
|
||||
move_lines = self.pool.get('account.move.line').search(cr, uid, [('period_id', 'in', ids)])
|
||||
if move_lines:
|
||||
@@ -928,7 +943,7 @@ class account_journal_period(osv.osv):
|
||||
_name = "account.journal.period"
|
||||
_description = "Journal Period"
|
||||
|
||||
def _icon_get(self, cr, uid, ids, field_name, arg=None, context={}):
|
||||
def _icon_get(self, cr, uid, ids, field_name, arg=None, context=None):
|
||||
result = {}.fromkeys(ids, 'STOCK_NEW')
|
||||
for r in self.read(cr, uid, ids, ['state']):
|
||||
result[r['id']] = {
|
||||
@@ -943,35 +958,35 @@ class account_journal_period(osv.osv):
|
||||
'journal_id': fields.many2one('account.journal', 'Journal', required=True, ondelete="cascade"),
|
||||
'period_id': fields.many2one('account.period', 'Period', required=True, ondelete="cascade"),
|
||||
'icon': fields.function(_icon_get, method=True, string='Icon', type='char', size=32),
|
||||
'active': fields.boolean('Active', required=True, help="If the active field is set to true, it will allow you to hide the journal period without removing it."),
|
||||
'active': fields.boolean('Active', required=True, help="If the active field is set to False, it will allow you to hide the journal period without removing it."),
|
||||
'state': fields.selection([('draft','Draft'), ('printed','Printed'), ('done','Done')], 'State', required=True, readonly=True,
|
||||
help='When journal period is created. The state is \'Draft\'. If a report is printed it comes to \'Printed\' state. When all transactions are done, it comes in \'Done\' state.'),
|
||||
'fiscalyear_id': fields.related('period_id', 'fiscalyear_id', string='Fiscal Year', type='many2one', relation='account.fiscalyear'),
|
||||
'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company')
|
||||
}
|
||||
|
||||
def _check(self, cr, uid, ids, context={}):
|
||||
for obj in self.browse(cr, uid, ids, context):
|
||||
def _check(self, cr, uid, ids, context=None):
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
cr.execute('select * from account_move_line where journal_id=%s and period_id=%s limit 1', (obj.journal_id.id, obj.period_id.id))
|
||||
res = cr.fetchall()
|
||||
if res:
|
||||
raise osv.except_osv(_('Error !'), _('You can not modify/delete a journal with entries for this period !'))
|
||||
return True
|
||||
|
||||
def write(self, cr, uid, ids, vals, context={}):
|
||||
self._check(cr, uid, ids, context)
|
||||
return super(account_journal_period, self).write(cr, uid, ids, vals, context)
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
self._check(cr, uid, ids, context=context)
|
||||
return super(account_journal_period, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
def create(self, cr, uid, vals, context={}):
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
period_id=vals.get('period_id',False)
|
||||
if period_id:
|
||||
period = self.pool.get('account.period').browse(cr, uid,period_id)
|
||||
period = self.pool.get('account.period').browse(cr, uid, period_id, context=context)
|
||||
vals['state']=period.state
|
||||
return super(account_journal_period, self).create(cr, uid, vals, context)
|
||||
|
||||
def unlink(self, cr, uid, ids, context={}):
|
||||
self._check(cr, uid, ids, context)
|
||||
return super(account_journal_period, self).unlink(cr, uid, ids, context)
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
self._check(cr, uid, ids, context=context)
|
||||
return super(account_journal_period, self).unlink(cr, uid, ids, context=context)
|
||||
|
||||
_defaults = {
|
||||
'state': 'draft',
|
||||
@@ -1022,8 +1037,6 @@ class account_move(osv.osv):
|
||||
|
||||
if not args:
|
||||
args = []
|
||||
if not context:
|
||||
context = {}
|
||||
ids = []
|
||||
if name:
|
||||
ids += self.search(cr, user, [('name','ilike',name)]+args, limit=limit, context=context)
|
||||
@@ -1042,7 +1055,7 @@ class account_move(osv.osv):
|
||||
if not ids:
|
||||
return []
|
||||
res = []
|
||||
data_move = self.pool.get('account.move').browse(cursor,user,ids)
|
||||
data_move = self.pool.get('account.move').browse(cursor, user, ids, context=context)
|
||||
for move in data_move:
|
||||
if move.state=='draft':
|
||||
name = '*' + str(move.id)
|
||||
@@ -1051,7 +1064,7 @@ class account_move(osv.osv):
|
||||
res.append((move.id, name))
|
||||
return res
|
||||
|
||||
def _get_period(self, cr, uid, context):
|
||||
def _get_period(self, cr, uid, context=None):
|
||||
periods = self.pool.get('account.period').find(cr, uid)
|
||||
if periods:
|
||||
return periods[0]
|
||||
@@ -1108,12 +1121,12 @@ class account_move(osv.osv):
|
||||
'name': '/',
|
||||
'state': 'draft',
|
||||
'period_id': _get_period,
|
||||
'date': time.strftime('%Y-%m-%d'),
|
||||
'date': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
|
||||
}
|
||||
|
||||
def _check_centralisation(self, cursor, user, ids):
|
||||
for move in self.browse(cursor, user, ids):
|
||||
def _check_centralisation(self, cursor, user, ids, context=None):
|
||||
for move in self.browse(cursor, user, ids, context=context):
|
||||
if move.journal_id.centralisation:
|
||||
move_ids = self.search(cursor, user, [
|
||||
('period_id', '=', move.period_id.id),
|
||||
@@ -1123,8 +1136,8 @@ class account_move(osv.osv):
|
||||
return False
|
||||
return True
|
||||
|
||||
def _check_period_journal(self, cursor, user, ids):
|
||||
for move in self.browse(cursor, user, ids):
|
||||
def _check_period_journal(self, cursor, user, ids, context=None):
|
||||
for move in self.browse(cursor, user, ids, context=context):
|
||||
for line in move.line_id:
|
||||
if line.period_id.id != move.period_id.id:
|
||||
return False
|
||||
@@ -1150,7 +1163,7 @@ class account_move(osv.osv):
|
||||
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):
|
||||
for move in self.browse(cr, uid, valid_moves, context=context):
|
||||
if move.name =='/':
|
||||
new_name = False
|
||||
journal = move.journal_id
|
||||
@@ -1175,7 +1188,7 @@ class account_move(osv.osv):
|
||||
return True
|
||||
|
||||
def button_validate(self, cursor, user, ids, context=None):
|
||||
for move in self.browse(cursor, user, ids):
|
||||
for move in self.browse(cursor, user, ids, context=context):
|
||||
top = None
|
||||
for line in move.line_id:
|
||||
account = line.account_id
|
||||
@@ -1188,8 +1201,8 @@ class account_move(osv.osv):
|
||||
raise osv.except_osv(_('Error !'), _('You cannot validate a Journal Entry unless all journal items are in same chart of accounts !'))
|
||||
return self.post(cursor, user, ids, context=context)
|
||||
|
||||
def button_cancel(self, cr, uid, ids, context={}):
|
||||
for line in self.browse(cr, uid, ids, context):
|
||||
def button_cancel(self, cr, uid, ids, context=None):
|
||||
for line in self.browse(cr, uid, ids, context=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 ids:
|
||||
@@ -1198,18 +1211,21 @@ class account_move(osv.osv):
|
||||
'WHERE id IN %s', ('draft', tuple(ids),))
|
||||
return True
|
||||
|
||||
def write(self, cr, uid, ids, vals, context={}):
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
c = context.copy()
|
||||
c['novalidate'] = True
|
||||
result = super(osv.osv, self).write(cr, uid, ids, vals, c)
|
||||
self.validate(cr, uid, ids, context)
|
||||
self.validate(cr, uid, ids, context=context)
|
||||
return result
|
||||
|
||||
#
|
||||
# TODO: Check if period is closed !
|
||||
#
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
context = context or {}
|
||||
if context is None:
|
||||
context = {}
|
||||
if 'line_id' in vals and context.get('copy'):
|
||||
for l in vals['line_id']:
|
||||
if not l[0]:
|
||||
@@ -1249,8 +1265,9 @@ class account_move(osv.osv):
|
||||
result = super(account_move, self).create(cr, uid, vals, context)
|
||||
return result
|
||||
|
||||
def copy(self, cr, uid, id, default={}, context={}):
|
||||
context = context or {}
|
||||
def copy(self, cr, uid, id, default={}, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
default.update({
|
||||
'state':'draft',
|
||||
'name':'/',
|
||||
@@ -1261,10 +1278,9 @@ class account_move(osv.osv):
|
||||
return super(account_move, self).copy(cr, uid, id, default, context)
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None, check=True):
|
||||
context = context or {}
|
||||
toremove = []
|
||||
obj_move_line = self.pool.get('account.move.line')
|
||||
for move in self.browse(cr, uid, ids, context):
|
||||
for move in self.browse(cr, uid, ids, context=context):
|
||||
if move['state'] != 'draft':
|
||||
raise osv.except_osv(_('UserError'),
|
||||
_('You can not delete posted movement: "%s"!') % \
|
||||
@@ -1278,8 +1294,8 @@ class account_move(osv.osv):
|
||||
result = super(account_move, self).unlink(cr, uid, toremove, context)
|
||||
return result
|
||||
|
||||
def _compute_balance(self, cr, uid, id, context={}):
|
||||
move = self.browse(cr, uid, [id])[0]
|
||||
def _compute_balance(self, cr, uid, id, context=None):
|
||||
move = self.browse(cr, uid, id, context=context)
|
||||
amount = 0
|
||||
for line in move.line_id:
|
||||
amount+= (line.debit - line.credit)
|
||||
@@ -1342,7 +1358,7 @@ class account_move(osv.osv):
|
||||
#
|
||||
# Validate a balanced move. If it is a centralised journal, create a move.
|
||||
#
|
||||
def validate(self, cr, uid, ids, context={}):
|
||||
def validate(self, cr, uid, ids, context=None):
|
||||
if context and ('__last_update' in context):
|
||||
del context['__last_update']
|
||||
|
||||
@@ -1373,7 +1389,7 @@ class account_move(osv.osv):
|
||||
|
||||
if line.account_id.currency_id and line.currency_id:
|
||||
if line.account_id.currency_id.id != line.currency_id.id and (line.account_id.currency_id.id != line.account_id.company_id.currency_id.id):
|
||||
raise osv.except_osv(_('Error'), _("""Couldn't create move with currency different from the secondary currency of the account "%s - %s". Clear the secondary currency field of the account definition if you want to accept all currencies.""" % (line.account_id.code, line.account_id.name)))
|
||||
raise osv.except_osv(_('Error'), _("""Couldn't create move with currency different from the secondary currency of the account "%s - %s". Clear the secondary currency field of the account definition if you want to accept all currencies.""") % (line.account_id.code, line.account_id.name))
|
||||
|
||||
if abs(amount) < 10 ** -4:
|
||||
# If the move is balanced
|
||||
@@ -1456,9 +1472,9 @@ class account_move_reconcile(osv.osv):
|
||||
_defaults = {
|
||||
'name': lambda self,cr,uid,ctx={}: self.pool.get('ir.sequence').get(cr, uid, 'account.reconcile') or '/',
|
||||
}
|
||||
def reconcile_partial_check(self, cr, uid, ids, type='auto', context={}):
|
||||
def reconcile_partial_check(self, cr, uid, ids, type='auto', context=None):
|
||||
total = 0.0
|
||||
for rec in self.browse(cr, uid, ids, context):
|
||||
for rec in self.browse(cr, uid, ids, context=context):
|
||||
for line in rec.line_partial_ids:
|
||||
total += (line.debit or 0.0) - (line.credit or 0.0)
|
||||
if not total:
|
||||
@@ -1472,7 +1488,7 @@ class account_move_reconcile(osv.osv):
|
||||
if not ids:
|
||||
return []
|
||||
result = []
|
||||
for r in self.browse(cr, uid, ids, context):
|
||||
for r in self.browse(cr, uid, ids, context=context):
|
||||
total = reduce(lambda y,t: (t.debit or 0.0) - (t.credit or 0.0) + y, r.line_partial_ids, 0.0)
|
||||
if total:
|
||||
name = '%s (%.2f)' % (r.name, total)
|
||||
@@ -1521,7 +1537,7 @@ class account_tax_code(osv.osv):
|
||||
(parent_ids,) + where_params)
|
||||
res=dict(cr.fetchall())
|
||||
obj_precision = self.pool.get('decimal.precision')
|
||||
for record in self.browse(cr, uid, ids, context):
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
def _rec_get(record):
|
||||
amount = res.get(record.id, 0.0)
|
||||
for rec in record.child_ids:
|
||||
@@ -1583,7 +1599,6 @@ class account_tax_code(osv.osv):
|
||||
'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"),
|
||||
}
|
||||
|
||||
|
||||
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
|
||||
if not args:
|
||||
args = []
|
||||
@@ -1604,7 +1619,7 @@ class account_tax_code(osv.osv):
|
||||
return [(x['id'], (x['code'] and (x['code'] + ' - ') or '') + x['name']) \
|
||||
for x in reads]
|
||||
|
||||
def _default_company(self, cr, uid, context={}):
|
||||
def _default_company(self, cr, uid, context=None):
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
if user.company_id:
|
||||
return user.company_id.id
|
||||
@@ -1626,7 +1641,7 @@ class account_tax_code(osv.osv):
|
||||
_constraints = [
|
||||
(_check_recursion, 'Error ! You can not create recursive accounts.', ['parent_id'])
|
||||
]
|
||||
_order = 'code,name'
|
||||
_order = 'code'
|
||||
account_tax_code()
|
||||
|
||||
class account_tax(osv.osv):
|
||||
@@ -1641,13 +1656,20 @@ class account_tax(osv.osv):
|
||||
return result in the context
|
||||
Ex: result=round(price_unit*0.21,4)
|
||||
"""
|
||||
|
||||
def get_precision_tax():
|
||||
def change_digit_tax(cr):
|
||||
res = pooler.get_pool(cr.dbname).get('decimal.precision').precision_get(cr, 1, 'Account')
|
||||
return (16, res+2)
|
||||
return change_digit_tax
|
||||
|
||||
_name = 'account.tax'
|
||||
_description = 'Tax'
|
||||
_columns = {
|
||||
'name': fields.char('Tax Name', size=64, required=True, translate=True, help="This name will be displayed on reports"),
|
||||
'sequence': fields.integer('Sequence', required=True, help="The sequence field is used to order the tax lines from the lowest sequences to the higher ones. The order is important if you have a tax with several tax children. In this case, the evaluation order is important."),
|
||||
'amount': fields.float('Amount', required=True, digits_compute=dp.get_precision('Account'), help="For taxes of type percentage, enter % ratio between 0-1."),
|
||||
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the tax without removing it."),
|
||||
'amount': fields.float('Amount', required=True, digits_compute=get_precision_tax(), help="For taxes of type percentage, enter % ratio between 0-1."),
|
||||
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the tax without removing it."),
|
||||
'type': fields.selection( [('percent','Percentage'), ('fixed','Fixed Amount'), ('none','None'), ('code','Python Code'), ('balance','Balance')], 'Tax Type', required=True,
|
||||
help="The computation method for the tax amount."),
|
||||
'applicable_type': fields.selection( [('true','Always'), ('code','Given by Python Code')], 'Applicability', required=True,
|
||||
@@ -1701,10 +1723,15 @@ class account_tax(osv.osv):
|
||||
"""
|
||||
if not args:
|
||||
args = []
|
||||
if not context:
|
||||
if context is None:
|
||||
context = {}
|
||||
ids = []
|
||||
ids = self.search(cr, user, args, limit=limit, context=context)
|
||||
if name:
|
||||
ids = self.search(cr, user, [('description', '=', name)] + args, limit=limit, context=context)
|
||||
if not ids:
|
||||
ids = self.search(cr, user, [('name', operator, name)] + args, limit=limit, context=context)
|
||||
else:
|
||||
ids = self.search(cr, user, args, limit=limit, context=context or {})
|
||||
return self.name_get(cr, user, ids, context=context)
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
@@ -2035,7 +2062,7 @@ class account_model(osv.osv):
|
||||
raise osv.except_osv(_('No period found !'), _('Unable to find a valid period !'))
|
||||
period_id = period_id[0]
|
||||
|
||||
for model in self.browse(cr, uid, ids, context):
|
||||
for model in self.browse(cr, uid, ids, context=context):
|
||||
entry['name'] = model.name%{'year':time.strftime('%Y'), 'month':time.strftime('%m'), 'date':time.strftime('%Y-%m')}
|
||||
move_id = account_move_obj.create(cr, uid, {
|
||||
'ref': entry['name'],
|
||||
@@ -2060,8 +2087,8 @@ class account_model(osv.osv):
|
||||
date_maturity = time.strftime('%Y-%m-%d')
|
||||
if line.date_maturity == 'partner':
|
||||
if not line.partner_id:
|
||||
raise osv.except_osv(_('Error !'), _("Maturity date of entry line generated by model line '%s' of model '%s' is based on partner payment term! \
|
||||
\nPlease define partner on it!"%(line.name, model.name)))
|
||||
raise osv.except_osv(_('Error !'), _("Maturity date of entry line generated by model line '%s' of model '%s' is based on partner payment term!" \
|
||||
"\nPlease define partner on it!")%(line.name, model.name))
|
||||
if line.partner_id.property_payment_term:
|
||||
payment_term_id = line.partner_id.property_payment_term.id
|
||||
pterm_list = pt_obj.compute(cr, uid, payment_term_id, value=1, date_ref=date_maturity)
|
||||
@@ -2135,19 +2162,19 @@ class account_subscription(osv.osv):
|
||||
'lines_id': fields.one2many('account.subscription.line', 'subscription_id', 'Subscription Lines')
|
||||
}
|
||||
_defaults = {
|
||||
'date_start': time.strftime('%Y-%m-%d'),
|
||||
'date_start': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'period_type': 'month',
|
||||
'period_total': 12,
|
||||
'period_nbr': 1,
|
||||
'state': 'draft',
|
||||
}
|
||||
def state_draft(self, cr, uid, ids, context={}):
|
||||
def state_draft(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state':'draft'})
|
||||
return False
|
||||
|
||||
def check(self, cr, uid, ids, context={}):
|
||||
def check(self, cr, uid, ids, context=None):
|
||||
todone = []
|
||||
for sub in self.browse(cr, uid, ids, context):
|
||||
for sub in self.browse(cr, uid, ids, context=context):
|
||||
ok = True
|
||||
for line in sub.lines_id:
|
||||
if not line.move_id.id:
|
||||
@@ -2159,9 +2186,9 @@ class account_subscription(osv.osv):
|
||||
self.write(cr, uid, todone, {'state':'done'})
|
||||
return False
|
||||
|
||||
def remove_line(self, cr, uid, ids, context={}):
|
||||
def remove_line(self, cr, uid, ids, context=None):
|
||||
toremove = []
|
||||
for sub in self.browse(cr, uid, ids, context):
|
||||
for sub in self.browse(cr, uid, ids, context=context):
|
||||
for line in sub.lines_id:
|
||||
if not line.move_id.id:
|
||||
toremove.append(line.id)
|
||||
@@ -2170,8 +2197,8 @@ class account_subscription(osv.osv):
|
||||
self.write(cr, uid, ids, {'state':'draft'})
|
||||
return False
|
||||
|
||||
def compute(self, cr, uid, ids, context={}):
|
||||
for sub in self.browse(cr, uid, ids, context):
|
||||
def compute(self, cr, uid, ids, context=None):
|
||||
for sub in self.browse(cr, uid, ids, context=context):
|
||||
ds = sub.date_start
|
||||
for i in range(sub.period_total):
|
||||
self.pool.get('account.subscription.line').create(cr, uid, {
|
||||
@@ -2232,7 +2259,7 @@ class account_account_template(osv.osv):
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=128, required=True, select=True),
|
||||
'currency_id': fields.many2one('res.currency', 'Secondary Currency', help="Forces all moves for this account to have this secondary currency."),
|
||||
'code': fields.char('Code', size=64),
|
||||
'code': fields.char('Code', size=64, select=1),
|
||||
'type': fields.selection([
|
||||
('receivable','Receivable'),
|
||||
('payable','Payable'),
|
||||
@@ -2269,10 +2296,10 @@ class account_account_template(osv.osv):
|
||||
]
|
||||
|
||||
|
||||
def name_get(self, cr, uid, ids, context={}):
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
if not ids:
|
||||
return []
|
||||
reads = self.read(cr, uid, ids, ['name','code'], context)
|
||||
reads = self.read(cr, uid, ids, ['name','code'], context=context)
|
||||
res = []
|
||||
for record in reads:
|
||||
name = record['name']
|
||||
@@ -2289,7 +2316,7 @@ class account_add_tmpl_wizard(osv.osv_memory):
|
||||
With the 'nocreate' option, some accounts may not be created. Use this to add them later."""
|
||||
_name = 'account.addtmpl.wizard'
|
||||
|
||||
def _get_def_cparent(self, cr, uid, context):
|
||||
def _get_def_cparent(self, cr, uid, context=None):
|
||||
acc_obj=self.pool.get('account.account')
|
||||
tmpl_obj=self.pool.get('account.account.template')
|
||||
tids=tmpl_obj.read(cr, uid, [context['tmpl_ids']], ['parent_id'])
|
||||
@@ -2311,6 +2338,8 @@ class account_add_tmpl_wizard(osv.osv_memory):
|
||||
}
|
||||
|
||||
def action_create(self,cr,uid,ids,context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
acc_obj = self.pool.get('account.account')
|
||||
tmpl_obj = self.pool.get('account.account.template')
|
||||
data = self.read(cr, uid, ids)
|
||||
@@ -2432,19 +2461,20 @@ class account_tax_template(osv.osv):
|
||||
'ref_tax_sign': fields.float('Tax Code Sign', help="Usually 1 or -1."),
|
||||
'include_base_amount': fields.boolean('Include in Base Amount', help="Set if the amount of tax must be included in the base amount before computing the next taxes."),
|
||||
'description': fields.char('Internal Name', size=32),
|
||||
'type_tax_use': fields.selection([('sale','Sale'),('purchase','Purchase'),('all','All')], 'Tax Use In', required=True,)
|
||||
'type_tax_use': fields.selection([('sale','Sale'),('purchase','Purchase'),('all','All')], 'Tax Use In', required=True,),
|
||||
'price_include': fields.boolean('Tax Included in Price', help="Check this if the price you use on the product and invoices includes this tax."),
|
||||
}
|
||||
|
||||
def name_get(self, cr, uid, ids, context={}):
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
if not ids:
|
||||
return []
|
||||
res = []
|
||||
for record in self.read(cr, uid, ids, ['description','name'], context):
|
||||
for record in self.read(cr, uid, ids, ['description','name'], context=context):
|
||||
name = record['description'] and record['description'] or record['name']
|
||||
res.append((record['id'],name ))
|
||||
return res
|
||||
|
||||
def _default_company(self, cr, uid, context={}):
|
||||
def _default_company(self, cr, uid, context=None):
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
if user.company_id:
|
||||
return user.company_id.id
|
||||
@@ -2463,6 +2493,7 @@ class account_tax_template(osv.osv):
|
||||
'base_sign': 1,
|
||||
'include_base_amount': False,
|
||||
'type_tax_use': 'all',
|
||||
'price_include': 0,
|
||||
}
|
||||
_order = 'sequence'
|
||||
|
||||
@@ -2550,7 +2581,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
res['value']["purchase_tax"] = purchase_tax_ids and purchase_tax_ids[0] or False
|
||||
return res
|
||||
|
||||
def _get_chart(self, cr, uid, context={}):
|
||||
def _get_chart(self, cr, uid, context=None):
|
||||
ids = self.pool.get('account.chart.template').search(cr, uid, [], context=context)
|
||||
if ids:
|
||||
return ids[0]
|
||||
@@ -2596,7 +2627,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
#create all the tax code
|
||||
children_tax_code_template = self.pool.get('account.tax.code.template').search(cr, uid, [('parent_id','child_of',[tax_code_root_id])], order='id')
|
||||
children_tax_code_template.sort()
|
||||
for tax_code_template in self.pool.get('account.tax.code.template').browse(cr, uid, children_tax_code_template):
|
||||
for tax_code_template in self.pool.get('account.tax.code.template').browse(cr, uid, children_tax_code_template, context=context):
|
||||
vals={
|
||||
'name': (tax_code_root_id == tax_code_template.id) and obj_multi.company_id.name or tax_code_template.name,
|
||||
'code': tax_code_template.code,
|
||||
@@ -2636,7 +2667,8 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
'include_base_amount': tax.include_base_amount,
|
||||
'description':tax.description,
|
||||
'company_id': company_id,
|
||||
'type_tax_use': tax.type_tax_use
|
||||
'type_tax_use': tax.type_tax_use,
|
||||
'price_include': tax.price_include
|
||||
}
|
||||
new_tax = obj_acc_tax.create(cr, uid, vals_tax)
|
||||
tax_template_to_tax[tax.id] = new_tax
|
||||
@@ -2648,11 +2680,12 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
tax_template_ref[tax.id] = new_tax
|
||||
|
||||
#deactivate the parent_store functionnality on account_account for rapidity purpose
|
||||
self.pool._init = True
|
||||
ctx = context and context.copy() or {}
|
||||
ctx['defer_parent_store_computation'] = True
|
||||
|
||||
children_acc_template = obj_acc_template.search(cr, uid, [('parent_id','child_of',[obj_acc_root.id]),('nocreate','!=',True)])
|
||||
children_acc_template.sort()
|
||||
for account_template in obj_acc_template.browse(cr, uid, children_acc_template):
|
||||
for account_template in obj_acc_template.browse(cr, uid, children_acc_template,context=context):
|
||||
tax_ids = []
|
||||
for tax in account_template.tax_ids:
|
||||
tax_ids.append(tax_template_ref[tax.id])
|
||||
@@ -2676,23 +2709,22 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
'tax_ids': [(6,0,tax_ids)],
|
||||
'company_id': company_id,
|
||||
}
|
||||
new_account = obj_acc.create(cr, uid, vals)
|
||||
new_account = obj_acc.create(cr, uid, vals, context=ctx)
|
||||
acc_template_ref[account_template.id] = new_account
|
||||
#reactivate the parent_store functionnality on account_account
|
||||
self.pool._init = False
|
||||
self.pool.get('account.account')._parent_store_compute(cr)
|
||||
|
||||
for key,value in todo_dict.items():
|
||||
if value['account_collected_id'] or value['account_paid_id']:
|
||||
obj_acc_tax.write(cr, uid, [key], {
|
||||
'account_collected_id': acc_template_ref[value['account_collected_id']],
|
||||
'account_paid_id': acc_template_ref[value['account_paid_id']],
|
||||
'account_collected_id': acc_template_ref.get(value['account_collected_id'], False),
|
||||
'account_paid_id': acc_template_ref.get(value['account_paid_id'], False),
|
||||
})
|
||||
|
||||
# Creating Journals Sales and Purchase
|
||||
vals_journal={}
|
||||
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])
|
||||
data = obj_data.browse(cr, uid, data_id[0], context=context)
|
||||
view_id = data.res_id
|
||||
|
||||
seq_id = obj_sequence.search(cr, uid, [('name','=','Account Journal')])[0]
|
||||
@@ -2700,9 +2732,17 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
if obj_multi.seq_journal:
|
||||
seq_id_sale = obj_sequence.search(cr, uid, [('name','=','Sale Journal')])[0]
|
||||
seq_id_purchase = obj_sequence.search(cr, uid, [('name','=','Purchase Journal')])[0]
|
||||
seq_id_sale_refund = obj_sequence.search(cr, uid, [('name','=','Sales Refund Journal')])
|
||||
if seq_id_sale_refund:
|
||||
seq_id_sale_refund = seq_id_sale_refund[0]
|
||||
seq_id_purchase_refund = obj_sequence.search(cr, uid, [('name','=','Purchase Refund Journal')])
|
||||
if seq_id_purchase_refund:
|
||||
seq_id_purchase_refund = seq_id_purchase_refund[0]
|
||||
else:
|
||||
seq_id_sale = seq_id
|
||||
seq_id_purchase = seq_id
|
||||
seq_id_sale_refund = seq_id
|
||||
seq_id_purchase_refund = seq_id
|
||||
|
||||
vals_journal['view_id'] = view_id
|
||||
|
||||
@@ -2741,13 +2781,67 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
|
||||
obj_journal.create(cr,uid,vals_journal)
|
||||
|
||||
# Creating Journals Sales Refund and Purchase Refund
|
||||
vals_journal = {}
|
||||
data_id = obj_data.search(cr, uid, [('model', '=', 'account.journal.view'), ('name', '=', 'account_sp_refund_journal_view')], context=context)
|
||||
data = obj_data.browse(cr, uid, data_id[0], context=context)
|
||||
view_id = data.res_id
|
||||
|
||||
#Sales Refund Journal
|
||||
vals_journal = {
|
||||
'view_id': view_id,
|
||||
'name': _('Sales Refund Journal'),
|
||||
'type': 'sale_refund',
|
||||
'refund_journal': True,
|
||||
'code': _('SCNJ'),
|
||||
'sequence_id': seq_id_sale_refund,
|
||||
'analytic_journal_id': analitical_journal_sale,
|
||||
'company_id': company_id
|
||||
}
|
||||
|
||||
if obj_multi.chart_template_id.property_account_receivable:
|
||||
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_income_categ.id]
|
||||
vals_journal['default_debit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_income_categ.id]
|
||||
|
||||
|
||||
# if obj_multi.property_account_receivable:
|
||||
# vals_journal.update({
|
||||
# 'default_credit_account_id': acc_template_ref[obj_multi.chart_template_id.property_account_income_categ.id],
|
||||
# 'default_debit_account_id': acc_template_ref[obj_multi.chart_template_id.property_account_income_categ.id]
|
||||
# })
|
||||
obj_journal.create(cr, uid, vals_journal, context=context)
|
||||
|
||||
# Purchase Refund Journal
|
||||
vals_journal = {
|
||||
'view_id': view_id,
|
||||
'name': _('Purchase Refund Journal'),
|
||||
'type': 'purchase_refund',
|
||||
'refund_journal': True,
|
||||
'code': _('ECNJ'),
|
||||
'sequence_id': seq_id_purchase_refund,
|
||||
'analytic_journal_id': analitical_journal_purchase,
|
||||
'company_id': company_id
|
||||
}
|
||||
|
||||
if obj_multi.chart_template_id.property_account_payable:
|
||||
vals_journal['default_credit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_expense_categ.id]
|
||||
vals_journal['default_debit_account_id'] = acc_template_ref[obj_multi.chart_template_id.property_account_expense_categ.id]
|
||||
|
||||
|
||||
# if obj_multi.property_account_payable:
|
||||
# vals_journal.update({
|
||||
# 'default_credit_account_id': acc_template_ref[obj_multi.property_account_expense_categ.id],
|
||||
# 'default_debit_account_id': acc_template_ref[obj_multi.property_account_expense_categ.id]
|
||||
# })
|
||||
obj_journal.create(cr, uid, vals_journal, context=context)
|
||||
|
||||
# Bank Journals
|
||||
data_id = obj_data.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view')])
|
||||
data = obj_data.browse(cr, uid, data_id[0])
|
||||
data = obj_data.browse(cr, uid, data_id[0], context=context)
|
||||
view_id_cash = data.res_id
|
||||
|
||||
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])
|
||||
data = obj_data.browse(cr, uid, data_id[0], context=context)
|
||||
view_id_cur = data.res_id
|
||||
ref_acc_bank = obj_multi.chart_template_id.bank_account_view_id
|
||||
|
||||
@@ -2765,7 +2859,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
'name': tmp,
|
||||
'currency_id': line.currency_id and line.currency_id.id or False,
|
||||
'code': new_code,
|
||||
'type': 'other',
|
||||
'type': 'liquidity',
|
||||
'user_type': account_template.user_type and account_template.user_type.id or False,
|
||||
'reconcile': True,
|
||||
'parent_id': acc_template_ref[ref_acc_bank.id] or False,
|
||||
@@ -2787,7 +2881,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
vals_journal['name']= vals['name']
|
||||
vals_journal['code']= _('BNK') + str(current_num)
|
||||
vals_journal['sequence_id'] = seq_id
|
||||
vals_journal['type'] = 'cash'
|
||||
vals_journal['type'] = line.account_type == 'cash' and 'cash' or 'bank'
|
||||
vals_journal['company_id'] = company_id
|
||||
vals_journal['analytic_journal_id'] = analitical_journal_bank
|
||||
|
||||
@@ -2840,7 +2934,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
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):
|
||||
for position in obj_fiscal_position_template.browse(cr, uid, fp_ids, context=context):
|
||||
|
||||
vals_fp = {
|
||||
'company_id': company_id,
|
||||
@@ -2875,17 +2969,17 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
||||
wizard_multi_charts_accounts()
|
||||
|
||||
class account_bank_accounts_wizard(osv.osv_memory):
|
||||
_name='account.bank.accounts.wizard'
|
||||
_name = 'account.bank.accounts.wizard'
|
||||
|
||||
_columns = {
|
||||
'acc_name':fields.char('Account Name.', size=64, required=True),
|
||||
'bank_account_id':fields.many2one('wizard.multi.charts.accounts', 'Bank Account', required=True),
|
||||
'currency_id':fields.many2one('res.currency', 'Currency'),
|
||||
'account_type':fields.selection([('cash','Cash'),('check','Check'),('bank','Bank')], 'Type', size=32),
|
||||
'acc_name': fields.char('Account Name.', size=64, required=True),
|
||||
'bank_account_id': fields.many2one('wizard.multi.charts.accounts', 'Bank Account', required=True),
|
||||
'currency_id': fields.many2one('res.currency', 'Currency'),
|
||||
'account_type': fields.selection([('cash','Cash'),('check','Check'),('bank','Bank')], 'Type', size=32),
|
||||
}
|
||||
_defaults = {
|
||||
'currency_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.currency_id.id,
|
||||
}
|
||||
}
|
||||
|
||||
account_bank_accounts_wizard()
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@ class account_analytic_line(osv.osv):
|
||||
_columns = {
|
||||
'product_uom_id': fields.many2one('product.uom', 'UoM'),
|
||||
'product_id': fields.many2one('product.product', 'Product'),
|
||||
'general_account_id': fields.many2one('account.account', 'General Account', required=True, ondelete='cascade'),
|
||||
'move_id': fields.many2one('account.move.line', 'Move Line', ondelete='cascade', select=True),
|
||||
'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal', required=True, ondelete='cascade', select=True),
|
||||
'general_account_id': fields.many2one('account.account', 'General Account', required=True, ondelete='restrict'),
|
||||
'move_id': fields.many2one('account.move.line', 'Move Line', ondelete='restrict', select=True),
|
||||
'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal', required=True, ondelete='restrict', select=True),
|
||||
'code': fields.char('Code', size=8),
|
||||
'ref': fields.char('Ref.', size=64),
|
||||
'currency_id': fields.related('move_id', 'currency_id', type='many2one', relation='res.currency', string='Account currency', store=True, help="The related account currency if not equal to the company one.", readonly=True),
|
||||
@@ -58,14 +58,12 @@ class account_analytic_line(osv.osv):
|
||||
return super(account_analytic_line, self).search(cr, uid, args, offset, limit,
|
||||
order, context=context, count=count)
|
||||
|
||||
def _check_company(self, cr, uid, ids):
|
||||
lines = self.browse(cr, uid, ids)
|
||||
def _check_company(self, cr, uid, ids, context=None):
|
||||
lines = self.browse(cr, uid, ids, context=context)
|
||||
for l in lines:
|
||||
if l.move_id and not l.account_id.company_id.id == l.move_id.account_id.company_id.id:
|
||||
return False
|
||||
return True
|
||||
_constraints = [
|
||||
]
|
||||
|
||||
# Compute the cost based on the price type define into company
|
||||
# property_valuation_price_type property
|
||||
@@ -75,17 +73,14 @@ class account_analytic_line(osv.osv):
|
||||
context={}
|
||||
if not journal_id:
|
||||
j_ids = self.pool.get('account.analytic.journal').search(cr, uid, [('type','=','purchase')])
|
||||
j_id = j_ids and j_ids[0] or False
|
||||
journal_id = j_ids and j_ids[0] or False
|
||||
if not journal_id or not prod_id:
|
||||
return {}
|
||||
product_obj = self.pool.get('product.product')
|
||||
analytic_journal_obj =self.pool.get('account.analytic.journal')
|
||||
company_obj = self.pool.get('res.company')
|
||||
product_price_type_obj = self.pool.get('product.price.type')
|
||||
j_id = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
|
||||
prod = product_obj.browse(cr, uid, prod_id)
|
||||
if not company_id:
|
||||
company_id = j_id.company_id.id
|
||||
prod = product_obj.browse(cr, uid, prod_id, context=context)
|
||||
result = 0.0
|
||||
|
||||
if j_id.type <> 'sale':
|
||||
@@ -97,7 +92,6 @@ class account_analytic_line(osv.osv):
|
||||
_('There is no expense account defined ' \
|
||||
'for this product: "%s" (id:%d)') % \
|
||||
(prod.name, prod.id,))
|
||||
amount_unit = prod.price_get('standard_price', context)[prod.id]
|
||||
else:
|
||||
a = prod.product_tmpl_id.property_account_income.id
|
||||
if not a:
|
||||
@@ -107,36 +101,41 @@ class account_analytic_line(osv.osv):
|
||||
_('There is no income account defined ' \
|
||||
'for this product: "%s" (id:%d)') % \
|
||||
(prod.name, prod_id,))
|
||||
amount_unit = prod.price_get('list_price', context)[prod_id]
|
||||
|
||||
if not company_id:
|
||||
company_id = company_obj._company_default_get(cr, uid, 'account.analytic.line', context=context)
|
||||
flag = False
|
||||
# Compute based on pricetype
|
||||
product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','standard_price')], context)
|
||||
pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context)[0]
|
||||
if journal_id:
|
||||
journal = analytic_journal_obj.browse(cr, uid, journal_id)
|
||||
if journal.type == 'sale':
|
||||
product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','list_price')], context)
|
||||
if product_price_type_ids:
|
||||
pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context)[0]
|
||||
# Take the company currency as the reference one
|
||||
if pricetype.field == 'list_price':
|
||||
flag = True
|
||||
amount_unit = prod.price_get(pricetype.field, context)[prod.id]
|
||||
prec = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
|
||||
amount = amount_unit*unit or 1.0
|
||||
result = round(amount, prec)
|
||||
if not flag:
|
||||
result *= -1
|
||||
flag = False
|
||||
# Compute based on pricetype
|
||||
product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','standard_price')], context=context)
|
||||
pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context=context)[0]
|
||||
if journal_id:
|
||||
journal = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
|
||||
if journal.type == 'sale':
|
||||
product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','list_price')], context)
|
||||
if product_price_type_ids:
|
||||
pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context=context)[0]
|
||||
# Take the company currency as the reference one
|
||||
if pricetype.field == 'list_price':
|
||||
flag = True
|
||||
ctx = context.copy()
|
||||
if unit:
|
||||
# price_get() will respect a 'uom' in its context, in order
|
||||
# to return a default price for those units
|
||||
ctx['uom'] = unit
|
||||
amount_unit = prod.price_get(pricetype.field, context=ctx)[prod.id]
|
||||
prec = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
|
||||
amount = amount_unit * quantity or 1.0
|
||||
result = round(amount, prec)
|
||||
if not flag:
|
||||
result *= -1
|
||||
|
||||
return {'value': {
|
||||
'amount': result,
|
||||
'general_account_id': a,
|
||||
}
|
||||
}
|
||||
|
||||
def view_header_get(self, cr, user, view_id, view_type, context):
|
||||
def view_header_get(self, cr, user, view_id, view_type, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
if context.get('account_id', False):
|
||||
# account_id in context may also be pointing to an account.account.id
|
||||
cr.execute('select name from account_analytic_account where id=%s', (context['account_id'],))
|
||||
@@ -153,11 +152,10 @@ class res_partner(osv.osv):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
_columns = {
|
||||
'contract_ids': fields.one2many('account.analytic.account', \
|
||||
'contract_ids': fields.one2many('account.analytic.account', \
|
||||
'partner_id', 'Contracts', readonly=True),
|
||||
}
|
||||
}
|
||||
|
||||
res_partner()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -43,31 +43,12 @@ class account_bank_statement(osv.osv):
|
||||
seq = 0
|
||||
for line in statement.line_ids:
|
||||
seq += 1
|
||||
if not line.sequence:
|
||||
account_bank_statement_line_obj.write(cr, uid, [line.id], {'sequence': seq}, context=context)
|
||||
account_bank_statement_line_obj.write(cr, uid, [line.id], {'sequence': seq}, context=context)
|
||||
return res
|
||||
|
||||
def button_import_invoice(self, cr, uid, ids, context=None):
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
def _default_journal_id(self, cr, uid, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
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,
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.statement.from.invoice',
|
||||
'views': [(resource_id,'form')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
'nodestroy': True
|
||||
}
|
||||
|
||||
def _default_journal_id(self, cr, uid, context={}):
|
||||
journal_pool = self.pool.get('account.journal')
|
||||
journal_type = context.get('journal_type', False)
|
||||
journal_id = False
|
||||
@@ -77,11 +58,11 @@ class account_bank_statement(osv.osv):
|
||||
journal_id = ids[0]
|
||||
return journal_id
|
||||
|
||||
def _default_balance_start(self, cr, uid, context={}):
|
||||
def _default_balance_start(self, cr, uid, context=None):
|
||||
cr.execute('select id from account_bank_statement where journal_id=%s order by date desc limit 1', (1,))
|
||||
res = cr.fetchone()
|
||||
if res:
|
||||
return self.browse(cr, uid, [res[0]], context)[0].balance_end
|
||||
return self.browse(cr, uid, res[0], context=context).balance_end
|
||||
return 0.0
|
||||
|
||||
def _end_balance(self, cursor, user, ids, name, attr, context=None):
|
||||
@@ -116,7 +97,7 @@ class account_bank_statement(osv.osv):
|
||||
res[r] = round(res[r], 2)
|
||||
return res
|
||||
|
||||
def _get_period(self, cr, uid, context={}):
|
||||
def _get_period(self, cr, uid, context=None):
|
||||
periods = self.pool.get('account.period').find(cr, uid)
|
||||
if periods:
|
||||
return periods[0]
|
||||
@@ -142,7 +123,7 @@ class account_bank_statement(osv.osv):
|
||||
res[statement_id] = (currency_id, currency_names[currency_id])
|
||||
return res
|
||||
|
||||
_order = "date desc"
|
||||
_order = "date desc, id desc"
|
||||
_name = "account.bank.statement"
|
||||
_description = "Bank Statement"
|
||||
_columns = {
|
||||
@@ -170,11 +151,12 @@ class account_bank_statement(osv.osv):
|
||||
\n* And after getting confirmation from the bank it will be in \'Confirmed\' state.'),
|
||||
'currency': fields.function(_currency, method=True, string='Currency',
|
||||
type='many2one', relation='res.currency'),
|
||||
'account_id': fields.related('journal_id', 'default_debit_account_id', type='many2one', relation='account.account', string='Account used in this journal', readonly=True, help='used in statement reconciliation domain, but shouldn\'t be used elswhere.'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'name': "/",
|
||||
'date': time.strftime('%Y-%m-%d'),
|
||||
'date': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'state': 'draft',
|
||||
'balance_start': _default_balance_start,
|
||||
'journal_id': _default_journal_id,
|
||||
@@ -215,11 +197,13 @@ class account_bank_statement(osv.osv):
|
||||
return self.write(cr, uid, ids, {}, context=context)
|
||||
|
||||
def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, st_line_number, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
res_currency_obj = self.pool.get('res.currency')
|
||||
account_move_obj = self.pool.get('account.move')
|
||||
account_move_line_obj = self.pool.get('account.move.line')
|
||||
account_bank_statement_line_obj = self.pool.get('account.bank.statement.line')
|
||||
st_line = account_bank_statement_line_obj.browse(cr, uid, st_line_id, context)
|
||||
st_line = account_bank_statement_line_obj.browse(cr, uid, st_line_id, context=context)
|
||||
st = st_line.statement_id
|
||||
|
||||
context.update({'date': st_line.date})
|
||||
@@ -272,13 +256,10 @@ class account_bank_statement(osv.osv):
|
||||
|
||||
if st_line.account_id and st_line.account_id.currency_id and st_line.account_id.currency_id.id <> company_currency_id:
|
||||
val['currency_id'] = st_line.account_id.currency_id.id
|
||||
if company_currency_id==st_line.account_id.currency_id.id:
|
||||
amount_cur = st_line.amount
|
||||
else:
|
||||
amount_cur = res_currency_obj.compute(cr, uid, company_currency_id,
|
||||
st_line.account_id.currency_id.id, amount, context=context,
|
||||
account=acc_cur)
|
||||
val['amount_currency'] = amount_cur
|
||||
amount_cur = res_currency_obj.compute(cr, uid, company_currency_id,
|
||||
st_line.account_id.currency_id.id, amount, context=context,
|
||||
account=acc_cur)
|
||||
val['amount_currency'] = -amount_cur
|
||||
|
||||
move_line_id = account_move_line_obj.create(cr, uid, val, context=context)
|
||||
torec.append(move_line_id)
|
||||
@@ -319,10 +300,10 @@ class account_bank_statement(osv.osv):
|
||||
return move_id
|
||||
|
||||
def get_next_st_line_number(self, cr, uid, st_number, st_line, context=None):
|
||||
return st_number + ' - ' + str(st_line.sequence)
|
||||
return st_number + '/' + str(st_line.sequence)
|
||||
|
||||
def balance_check(self, cr, uid, st_id, journal_type='bank', context=None):
|
||||
st = self.browse(cr, uid, st_id, context)
|
||||
st = self.browse(cr, uid, st_id, context=context)
|
||||
if not (abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001):
|
||||
raise osv.except_osv(_('Error !'),
|
||||
_('The statement balance is incorrect !\n') +
|
||||
@@ -341,7 +322,7 @@ class account_bank_statement(osv.osv):
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
for st in self.browse(cr, uid, ids, context):
|
||||
for st in self.browse(cr, uid, ids, context=context):
|
||||
j_type = st.journal_id.type
|
||||
company_currency_id = st.journal_id.company_id.currency_id.id
|
||||
if not self.check_status_condition(cr, uid, st.state, journal_type=j_type):
|
||||
@@ -383,7 +364,7 @@ class account_bank_statement(osv.osv):
|
||||
def button_cancel(self, cr, uid, ids, context=None):
|
||||
done = []
|
||||
account_move_obj = self.pool.get('account.move')
|
||||
for st in self.browse(cr, uid, ids, context):
|
||||
for st in self.browse(cr, uid, ids, context=context):
|
||||
if st.state=='draft':
|
||||
continue
|
||||
ids = []
|
||||
@@ -393,17 +374,18 @@ class account_bank_statement(osv.osv):
|
||||
done.append(st.id)
|
||||
return self.write(cr, uid, done, {'state':'draft'}, context=context)
|
||||
|
||||
def onchange_journal_id(self, cursor, user, statement_id, journal_id, context=None):
|
||||
cursor.execute('SELECT balance_end_real \
|
||||
def onchange_journal_id(self, cr, uid, statement_id, journal_id, context=None):
|
||||
cr.execute('SELECT balance_end_real \
|
||||
FROM account_bank_statement \
|
||||
WHERE journal_id = %s AND NOT state = %s \
|
||||
ORDER BY date DESC,id DESC LIMIT 1', (journal_id, 'draft'))
|
||||
res = cursor.fetchone()
|
||||
res = cr.fetchone()
|
||||
balance_start = res and res[0] or 0.0
|
||||
return {'value': {'balance_start': balance_start}}
|
||||
account_id = self.pool.get('account.journal').read(cr, uid, journal_id, ['default_debit_account_id'], context=context)['default_debit_account_id']
|
||||
return {'value': {'balance_start': balance_start, 'account_id': account_id}}
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
stat = self.read(cr, uid, ids, ['state'])
|
||||
stat = self.read(cr, uid, ids, ['state'], context=context)
|
||||
unlink_ids = []
|
||||
for t in stat:
|
||||
if t['state'] in ('draft'):
|
||||
@@ -426,9 +408,7 @@ account_bank_statement()
|
||||
|
||||
class account_bank_statement_line(osv.osv):
|
||||
|
||||
def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context=None):
|
||||
res_users_obj = self.pool.get('res.users')
|
||||
res_currency_obj = self.pool.get('res.currency')
|
||||
def onchange_type(self, cr, uid, line_id, partner_id, type, context=None):
|
||||
res = {'value': {}}
|
||||
obj_partner = self.pool.get('res.partner')
|
||||
if context is None:
|
||||
@@ -436,41 +416,23 @@ class account_bank_statement_line(osv.osv):
|
||||
if not partner_id:
|
||||
return res
|
||||
account_id = False
|
||||
line = self.browse(cursor, user, line_id)
|
||||
line = self.browse(cr, uid, line_id, context=context)
|
||||
if not line or (line and not line[0].account_id):
|
||||
part = obj_partner.browse(cursor, user, partner_id, context=context)
|
||||
part = obj_partner.browse(cr, uid, partner_id, context=context)
|
||||
if type == 'supplier':
|
||||
account_id = part.property_account_payable.id
|
||||
else:
|
||||
account_id = part.property_account_receivable.id
|
||||
res['value']['account_id'] = account_id
|
||||
|
||||
if account_id and (not line or (line and not line[0].amount)) and not context.get('amount', False):
|
||||
company_currency_id = res_users_obj.browse(cursor, user, user,
|
||||
context=context).company_id.currency_id.id
|
||||
if not currency_id:
|
||||
currency_id = company_currency_id
|
||||
|
||||
cursor.execute('SELECT sum(debit-credit) \
|
||||
FROM account_move_line \
|
||||
WHERE (reconcile_id is null) \
|
||||
AND partner_id = %s \
|
||||
AND account_id=%s', (partner_id, account_id))
|
||||
pgres = cursor.fetchone()
|
||||
balance = pgres and pgres[0] or 0.0
|
||||
|
||||
balance = res_currency_obj.compute(cursor, user, company_currency_id,
|
||||
currency_id, balance, context=context)
|
||||
res['value']['amount'] = balance
|
||||
return res
|
||||
|
||||
_order = "statement_id desc, sequence"
|
||||
_name = "account.bank.statement.line"
|
||||
_description = "Bank Statement Line"
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64, required=True),
|
||||
'name': fields.char('Communication', size=64, required=True),
|
||||
'date': fields.date('Date', required=True),
|
||||
'amount': fields.float('Amount'),
|
||||
'amount': fields.float('Amount', digits_compute=dp.get_precision('Account')),
|
||||
'type': fields.selection([
|
||||
('supplier','Supplier'),
|
||||
('customer','Customer'),
|
||||
@@ -492,10 +454,10 @@ class account_bank_statement_line(osv.osv):
|
||||
}
|
||||
_defaults = {
|
||||
'name': lambda self,cr,uid,context={}: self.pool.get('ir.sequence').get(cr, uid, 'account.bank.statement.line'),
|
||||
'date': time.strftime('%Y-%m-%d'),
|
||||
'date': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'type': 'general',
|
||||
}
|
||||
|
||||
account_bank_statement_line()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -41,7 +41,7 @@ class account_cashbox_line(osv.osv):
|
||||
@return: Dictionary of values.
|
||||
"""
|
||||
res = {}
|
||||
for obj in self.browse(cr, uid, ids):
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
res[obj.id] = obj.pieces * obj.number
|
||||
return res
|
||||
|
||||
@@ -76,7 +76,7 @@ class account_cash_statement(osv.osv):
|
||||
@return: Dictionary of values.
|
||||
"""
|
||||
res = {}
|
||||
for statement in self.browse(cr, uid, ids):
|
||||
for statement in self.browse(cr, uid, ids, context=context):
|
||||
amount_total = 0.0
|
||||
|
||||
if statement.journal_id.type not in('cash'):
|
||||
@@ -95,8 +95,8 @@ class account_cash_statement(osv.osv):
|
||||
@param arg: User defined arguments
|
||||
@return: Dictionary of values.
|
||||
"""
|
||||
res ={}
|
||||
for statement in self.browse(cr, uid, ids):
|
||||
res = {}
|
||||
for statement in self.browse(cr, uid, ids, context=context):
|
||||
amount_total = 0.0
|
||||
for line in statement.ending_details_ids:
|
||||
amount_total += line.pieces * line.number
|
||||
@@ -110,8 +110,8 @@ class account_cash_statement(osv.osv):
|
||||
@param arg: User defined arguments
|
||||
@return: Dictionary of values.
|
||||
"""
|
||||
res2={}
|
||||
for statement in self.browse(cr, uid, ids):
|
||||
res2 = {}
|
||||
for statement in self.browse(cr, uid, ids, context=context):
|
||||
encoding_total=0.0
|
||||
for line in statement.line_ids:
|
||||
encoding_total += line.amount
|
||||
@@ -160,7 +160,7 @@ class account_cash_statement(osv.osv):
|
||||
company_id = company_pool.search(cr, uid, [])
|
||||
return company_id and company_id[0] or False
|
||||
|
||||
def _get_cash_open_box_lines(self, cr, uid, context={}):
|
||||
def _get_cash_open_box_lines(self, cr, uid, context=None):
|
||||
res = []
|
||||
curr = [1, 2, 5, 10, 20, 50, 100, 500]
|
||||
for rs in curr:
|
||||
@@ -173,14 +173,14 @@ class account_cash_statement(osv.osv):
|
||||
if journal_ids:
|
||||
results = self.search(cr, uid, [('journal_id', 'in', journal_ids),('state', '=', 'confirm')], context=context)
|
||||
if results:
|
||||
cash_st = self.browse(cr, uid, results, context)[0]
|
||||
cash_st = self.browse(cr, uid, results, context=context)[0]
|
||||
for cash_line in cash_st.ending_details_ids:
|
||||
for r in res:
|
||||
if cash_line.pieces == r['pieces']:
|
||||
r['number'] = cash_line.number
|
||||
return res
|
||||
|
||||
def _get_default_cash_close_box_lines(self, cr, uid, context={}):
|
||||
def _get_default_cash_close_box_lines(self, cr, uid, context=None):
|
||||
res = []
|
||||
curr = [1, 2, 5, 10, 20, 50, 100, 500]
|
||||
for rs in curr:
|
||||
@@ -191,7 +191,7 @@ class account_cash_statement(osv.osv):
|
||||
res.append(dct)
|
||||
return res
|
||||
|
||||
def _get_cash_close_box_lines(self, cr, uid, context={}):
|
||||
def _get_cash_close_box_lines(self, cr, uid, context=None):
|
||||
res = []
|
||||
curr = [1, 2, 5, 10, 20, 50, 100, 500]
|
||||
for rs in curr:
|
||||
@@ -202,11 +202,11 @@ class account_cash_statement(osv.osv):
|
||||
res.append((0, 0, dct))
|
||||
return res
|
||||
|
||||
def _get_cash_open_close_box_lines(self, cr, uid, context={}):
|
||||
def _get_cash_open_close_box_lines(self, cr, uid, context=None):
|
||||
res = {}
|
||||
start_l = []
|
||||
end_l = []
|
||||
starting_details = self._get_cash_open_box_lines(cr, uid, context)
|
||||
starting_details = self._get_cash_open_box_lines(cr, uid, context=context)
|
||||
ending_details = self._get_default_cash_close_box_lines(cr, uid, context)
|
||||
for start in starting_details:
|
||||
start_l.append((0, 0, start))
|
||||
@@ -233,24 +233,22 @@ class account_cash_statement(osv.osv):
|
||||
}
|
||||
_defaults = {
|
||||
'state': 'draft',
|
||||
'date': time.strftime("%Y-%m-%d %H:%M:%S"),
|
||||
'date': lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"),
|
||||
'user_id': lambda self, cr, uid, context=None: uid,
|
||||
'starting_details_ids': _get_cash_open_box_lines,
|
||||
'ending_details_ids': _get_default_cash_close_box_lines
|
||||
}
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
if 'journal_id' not in vals:
|
||||
raise osv.except_osv('Error', _('You cannot create a bank or cash register without a journal!'))
|
||||
sql = [
|
||||
('journal_id', '=', vals.get('journal_id', False)),
|
||||
('state', '=', 'open')
|
||||
]
|
||||
open_jrnl = self.search(cr, uid, sql)
|
||||
if open_jrnl:
|
||||
raise osv.except_osv('Error', _('You can not have two open register for the same journal'))
|
||||
raise osv.except_osv(_('Error'), _('You can not have two open register for the same journal'))
|
||||
|
||||
if self.pool.get('account.journal').browse(cr, uid, vals['journal_id']).type == 'cash':
|
||||
if self.pool.get('account.journal').browse(cr, uid, vals['journal_id'], context=context).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'):
|
||||
@@ -285,7 +283,7 @@ class account_cash_statement(osv.osv):
|
||||
@return: True on success, False otherwise
|
||||
"""
|
||||
|
||||
super(account_cash_statement, self).write(cr, uid, ids, vals)
|
||||
super(account_cash_statement, self).write(cr, uid, ids, vals, context=context)
|
||||
res = self._get_starting_balance(cr, uid, ids)
|
||||
for rs in res:
|
||||
super(account_cash_statement, self).write(cr, uid, [rs], res.get(rs))
|
||||
@@ -299,7 +297,6 @@ class account_cash_statement(osv.osv):
|
||||
"""
|
||||
res = {}
|
||||
balance_start = 0.0
|
||||
|
||||
if not journal_id:
|
||||
res.update({
|
||||
'balance_start': balance_start
|
||||
@@ -313,8 +310,7 @@ class account_cash_statement(osv.osv):
|
||||
statement.balance_end_real = statement.balance_end
|
||||
if statement.balance_end != statement.balance_end_cash:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
return True
|
||||
|
||||
def _user_allow(self, cr, uid, statement_id, context=None):
|
||||
return True
|
||||
@@ -329,7 +325,7 @@ class account_cash_statement(osv.osv):
|
||||
for statement in statement_pool.browse(cr, uid, ids, context=context):
|
||||
vals = {}
|
||||
if not self._user_allow(cr, uid, statement.id, context=context):
|
||||
raise osv.except_osv(_('Error !'), _('User %s does not have rights to access %s journal !' % (statement.user_id.name, statement.journal_id.name)))
|
||||
raise osv.except_osv(_('Error !'), (_('User %s does not have rights to access %s journal !') % (statement.user_id.name, statement.journal_id.name)))
|
||||
|
||||
if statement.name and statement.name == '/':
|
||||
number = self.pool.get('ir.sequence').get(cr, uid, 'account.cash.statement')
|
||||
@@ -342,7 +338,7 @@ class account_cash_statement(osv.osv):
|
||||
'state': 'open',
|
||||
|
||||
})
|
||||
self.write(cr, uid, [statement.id], vals)
|
||||
self.write(cr, uid, [statement.id], vals, context=context)
|
||||
return True
|
||||
|
||||
def balance_check(self, cr, uid, cash_id, journal_type='bank', context=None):
|
||||
|
||||
@@ -63,7 +63,9 @@
|
||||
<field domain="[('type','<>','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
||||
<newline/>
|
||||
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
|
||||
<field colspan="4" name="invoice_line_tax_id" context="{'type':parent.type}" domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]"/>
|
||||
<separator colspan="4" string="Taxes"/>
|
||||
<field colspan="4" name="invoice_line_tax_id" context="{'type':parent.type}" domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]"
|
||||
nolabel="1"/>
|
||||
</page>
|
||||
<page string="Notes">
|
||||
<field colspan="4" name="note" nolabel="1"/>
|
||||
@@ -300,7 +302,7 @@
|
||||
<field name="amount_total"/>
|
||||
<field name="state"/>
|
||||
<field name="residual"/>
|
||||
<group col="7" colspan="4" groups="base.group_user">
|
||||
<group col="8" colspan="4" groups="base.group_user">
|
||||
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object" icon="terp-stock_effects-object-colorize"/>
|
||||
|
||||
@@ -308,6 +310,7 @@
|
||||
<button name='%(action_account_state_open)d' type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="base.group_no_one"/>
|
||||
<button name="invoice_proforma2" states="draft" string="PRO-FORMA" icon="terp-gtk-media-pause" groups="account.group_account_user"/>
|
||||
<button name="invoice_open" states="draft,proforma2" string="Validate" icon="gtk-go-forward"/>
|
||||
<button name="%(account_invoices)d" string="Print Invoice" type="action" icon="gtk-print"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
@@ -471,7 +474,7 @@
|
||||
<field name="domain">[('type','=','out_refund')]</field>
|
||||
<field name="context">{'type':'out_refund', 'journal_type': 'sale_refund'}</field>
|
||||
<field name="search_view_id" ref="view_account_invoice_filter"/>
|
||||
<field name="help">Customer Refunds helps you manage the credit notes issued/to be issued for your customers. A refund invoice is a document that cancels an invoice or a part of it. You can easily generate refunds and reconcile them from the invoice form.</field>
|
||||
<field name="help">This menu helps you manage the credit notes issued/to be issued for your customers. A refund invoice is a document that cancels an invoice or a part of it. You can easily generate refunds and reconcile them from the invoice form.</field>
|
||||
</record>
|
||||
|
||||
<record id="action_invoice_tree3_view1" model="ir.actions.act_window.view">
|
||||
@@ -497,7 +500,7 @@
|
||||
<field name="domain">[('type','=','in_refund')]</field>
|
||||
<field name="context">{'type':'in_refund', 'journal_type': 'purchase_refund'}</field>
|
||||
<field name="search_view_id" ref="view_account_invoice_filter"/>
|
||||
<field name="help">A vendor refund is a credit note from your supplier indicating that he refunds part or totality of the invoice sent to you.</field>
|
||||
<field name="help">A supplier refund is a credit note from your supplier indicating that he refunds part or totality of the invoice sent to you.</field>
|
||||
</record>
|
||||
<menuitem action="action_invoice_tree4" id="menu_action_invoice_tree4" parent="menu_finance_payables"/>
|
||||
|
||||
|
||||
@@ -3,38 +3,41 @@
|
||||
<data>
|
||||
|
||||
<menuitem icon="terp-account" id="menu_finance" name="Accounting" sequence="13"
|
||||
groups="group_account_user,group_account_manager,group_account_invoice"/>
|
||||
<menuitem id="menu_finance_receivables" name="Customers" parent="menu_finance" sequence="1"/>
|
||||
<menuitem id="menu_finance_payables" name="Suppliers" parent="menu_finance" sequence="2"/>
|
||||
<menuitem id="menu_finance_bank_and_cash" name="Bank and Cash" parent="menu_finance" sequence="3"
|
||||
groups="group_account_user,group_account_manager,group_account_invoice"
|
||||
web_icon="images/accounting.png"
|
||||
web_icon_hover="images/accounting-hover.png"/>
|
||||
<menuitem id="menu_partners" name="Partners" parent="menu_finance" sequence="1"/>
|
||||
<menuitem id="menu_finance_receivables" name="Customers" parent="menu_finance" sequence="2"/>
|
||||
<menuitem id="menu_finance_payables" name="Suppliers" parent="menu_finance" sequence="3"/>
|
||||
<menuitem id="menu_finance_bank_and_cash" name="Bank and Cash" parent="menu_finance" sequence="4"
|
||||
groups="group_account_user,group_account_manager"/>
|
||||
<menuitem id="menu_finance_periodical_processing" name="Periodical Processing" parent="menu_finance" sequence="8" groups="group_account_user,group_account_manager"/>
|
||||
<menuitem id="menu_finance_periodical_processing" name="Periodical Processing" parent="menu_finance" sequence="9" groups="group_account_user,group_account_manager"/>
|
||||
<!-- This menu is used in account_code module -->
|
||||
<menuitem id="menu_account_pp_statements" name="Statements" parent="menu_finance_periodical_processing" sequence="12"/>
|
||||
<menuitem id="periodical_processing_journal_entries_validation" name="Draft Entries" parent="menu_finance_periodical_processing"/>
|
||||
<menuitem id="periodical_processing_reconciliation" name="Reconciliation" parent="menu_finance_periodical_processing"/>
|
||||
<menuitem id="periodical_processing_invoicing" name="Invoicing" parent="menu_finance_periodical_processing"/>
|
||||
<menuitem id="menu_finance_charts" name="Charts" parent="menu_finance" sequence="5"/>
|
||||
<menuitem id="menu_finance_reporting" name="Reporting" parent="account.menu_finance" sequence="12"/>
|
||||
<menuitem id="menu_finance_charts" name="Charts" parent="menu_finance" sequence="6"/>
|
||||
<menuitem id="menu_finance_reporting" name="Reporting" parent="account.menu_finance" sequence="13"/>
|
||||
<menuitem id="menu_finance_reporting_budgets" name="Budgets" parent="menu_finance_reporting" groups="group_account_user"/>
|
||||
<menuitem id="menu_finance_legal_statement" name="Legal Reports" parent="menu_finance_reporting"/>
|
||||
<menuitem id="menu_finance_management_belgian_reports" name="Belgian Reports" parent="menu_finance_reporting"/>
|
||||
<menuitem id="menu_finance_configuration" name="Configuration" parent="menu_finance" sequence="13" groups="group_account_manager"/>
|
||||
<menuitem id="menu_finance_configuration" name="Configuration" parent="menu_finance" sequence="14" groups="group_account_manager"/>
|
||||
<menuitem id="menu_finance_accounting" name="Financial Accounting" parent="menu_finance_configuration"/>
|
||||
<menuitem id="menu_analytic_accounting" name="Analytic Accounting" parent="menu_finance_configuration" groups="analytic.group_analytic_accounting"/>
|
||||
<menuitem id="menu_analytic" parent="menu_analytic_accounting" name="Accounts" groups="analytic.group_analytic_accounting"/>
|
||||
<menuitem id="menu_low_level" name="Low Level" parent="menu_finance_accounting" groups="base.group_extended,group_account_manager"/>
|
||||
<menuitem id="menu_journals" sequence="9" name="Journals" parent="menu_finance_accounting" groups="base.group_extended,group_account_manager"/>
|
||||
<menuitem id="menu_configuration_misc" name="Miscellaneous" parent="menu_finance_configuration" sequence="30" groups="group_account_manager"/>
|
||||
<menuitem id="base.menu_action_currency_form" parent="menu_configuration_misc" sequence="20"/>
|
||||
<menuitem id="menu_finance_generic_reporting" name="Generic Reporting" parent="menu_finance_reporting" sequence="100"/>
|
||||
<menuitem id="menu_finance_entries" name="Journal Entries" parent="menu_finance" sequence="4" groups="group_account_user,group_account_manager"/>
|
||||
<menuitem id="menu_finance_entries" name="Journal Entries" parent="menu_finance" sequence="5" groups="group_account_user,group_account_manager"/>
|
||||
<menuitem id="account.menu_finance_recurrent_entries" name="Recurring Entries" parent="menu_finance_periodical_processing" sequence="15" groups="base.group_extended,group_account_manager,group_account_user"/>
|
||||
|
||||
<menuitem id="menu_account_end_year_treatments" name="End of Period" parent="menu_finance_periodical_processing" groups="group_account_manager,group_account_user" sequence="25"/>
|
||||
<menuitem id="menu_finance_periodical_processing_billing" name="Billing" parent="menu_finance_periodical_processing" sequence="35"/>
|
||||
|
||||
<menuitem id="menu_finance_statistic_report_statement" name="Statistic Reports" parent="menu_finance_reporting" sequence="300"/>
|
||||
|
||||
<menuitem id="next_id_22" name="Partners" parent="menu_finance_generic_reporting" sequence="1"/>
|
||||
<menuitem
|
||||
parent="account.menu_finance_legal_statement"
|
||||
id="final_accounting_reports"
|
||||
|
||||
@@ -47,11 +47,8 @@ class account_move_line(osv.osv):
|
||||
if not context.get('fiscalyear', False):
|
||||
fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('state', '=', 'draft')])
|
||||
else:
|
||||
if initial_bal:
|
||||
fiscalyear_date_start = fiscalyear_obj.read(cr, uid, context['fiscalyear'], ['date_start'])['date_start']
|
||||
fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('date_stop', '<', fiscalyear_date_start), ('state', '=', 'draft')], context=context)
|
||||
else:
|
||||
fiscalyear_ids = [context['fiscalyear']]
|
||||
#for initial balance as well as for normal query, we check only the selected FY because the best practice is to generate the FY opening entries
|
||||
fiscalyear_ids = [context['fiscalyear']]
|
||||
|
||||
fiscalyear_clause = (','.join([str(x) for x in fiscalyear_ids])) or '0'
|
||||
state = context.get('state', False)
|
||||
@@ -85,7 +82,7 @@ class account_move_line(osv.osv):
|
||||
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)
|
||||
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, 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)
|
||||
@@ -110,9 +107,9 @@ class account_move_line(osv.osv):
|
||||
del data[f]
|
||||
return data
|
||||
|
||||
def create_analytic_lines(self, cr, uid, ids, context={}):
|
||||
def create_analytic_lines(self, cr, uid, ids, context=None):
|
||||
acc_ana_line_obj = self.pool.get('account.analytic.line')
|
||||
for obj_line in self.browse(cr, uid, ids, context):
|
||||
for obj_line in self.browse(cr, uid, ids, context=context):
|
||||
if obj_line.analytic_account_id:
|
||||
if not obj_line.journal_id.analytic_journal_id:
|
||||
raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (obj_line.journal_id.name, ))
|
||||
@@ -142,7 +139,9 @@ class account_move_line(osv.osv):
|
||||
del(data['account_tax_id'])
|
||||
return data
|
||||
|
||||
def convert_to_period(self, cr, uid, context={}):
|
||||
def convert_to_period(self, cr, uid, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
period_obj = self.pool.get('account.period')
|
||||
#check if the period_id changed in the context from client side
|
||||
if context.get('period_id', False):
|
||||
@@ -154,7 +153,9 @@ class account_move_line(osv.osv):
|
||||
})
|
||||
return context
|
||||
|
||||
def _default_get(self, cr, uid, fields, context={}):
|
||||
def _default_get(self, cr, uid, fields, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
if not context.get('journal_id', False) and context.get('search_default_journal_id', False):
|
||||
context['journal_id'] = context.get('search_default_journal_id')
|
||||
account_obj = self.pool.get('account.account')
|
||||
@@ -167,7 +168,7 @@ class account_move_line(osv.osv):
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
context = self.convert_to_period(cr, uid, context)
|
||||
# Compute simple values
|
||||
data = super(account_move_line, self).default_get(cr, uid, fields, context)
|
||||
data = super(account_move_line, self).default_get(cr, uid, fields, context=context)
|
||||
# Starts: Manual entry from account.move form
|
||||
if context.get('lines',[]):
|
||||
total_new = 0.00
|
||||
@@ -177,7 +178,7 @@ class account_move_line(osv.osv):
|
||||
for item in i[2]:
|
||||
data[item] = i[2][item]
|
||||
if context['journal']:
|
||||
journal_data = journal_obj.browse(cr, uid, context['journal'])
|
||||
journal_data = journal_obj.browse(cr, uid, context['journal'], context=context)
|
||||
if journal_data.type == 'purchase':
|
||||
if total_new > 0:
|
||||
account = journal_data.default_credit_account_id
|
||||
@@ -189,9 +190,9 @@ class account_move_line(osv.osv):
|
||||
else:
|
||||
account = journal_data.default_debit_account_id
|
||||
if account and ((not fields) or ('debit' in fields) or ('credit' in fields)) and 'partner_id' in data and (data['partner_id']):
|
||||
part = partner_obj.browse(cr, uid, data['partner_id'])
|
||||
part = partner_obj.browse(cr, uid, data['partner_id'], context=context)
|
||||
account = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, account.id)
|
||||
account = account_obj.browse(cr, uid, account)
|
||||
account = account_obj.browse(cr, uid, account, context=context)
|
||||
data['account_id'] = account.id
|
||||
|
||||
s = -total_new
|
||||
@@ -239,7 +240,7 @@ class account_move_line(osv.osv):
|
||||
return data
|
||||
total = 0
|
||||
ref_id = False
|
||||
move = move_obj.browse(cr, uid, move_id, context)
|
||||
move = move_obj.browse(cr, uid, move_id, context=context)
|
||||
if 'name' in fields:
|
||||
data.setdefault('name', move.line_id[-1].name)
|
||||
acc1 = False
|
||||
@@ -268,7 +269,7 @@ class account_move_line(osv.osv):
|
||||
# part = False is acceptable for fiscal position.
|
||||
account = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, account.id)
|
||||
if account:
|
||||
account = account_obj.browse(cr, uid, account)
|
||||
account = account_obj.browse(cr, uid, account, context=context)
|
||||
|
||||
if account and ((not fields) or ('debit' in fields) or ('credit' in fields)):
|
||||
data['account_id'] = account.id
|
||||
@@ -292,10 +293,10 @@ class account_move_line(osv.osv):
|
||||
data['amount_currency'] = v
|
||||
return data
|
||||
|
||||
def on_create_write(self, cr, uid, id, context={}):
|
||||
def on_create_write(self, cr, uid, id, context=None):
|
||||
if not id:
|
||||
return []
|
||||
ml = self.browse(cr, uid, id, context)
|
||||
ml = self.browse(cr, uid, id, context=context)
|
||||
return map(lambda x: x.id, ml.move_id.line_id)
|
||||
|
||||
def _balance(self, cr, uid, ids, name, arg, context=None):
|
||||
@@ -303,19 +304,15 @@ class account_move_line(osv.osv):
|
||||
context = {}
|
||||
c = context.copy()
|
||||
c['initital_bal'] = True
|
||||
sql = [
|
||||
"""SELECT l2.id, SUM(l1.debit-l1.credit) FROM account_move_line l1, account_move_line l2""",
|
||||
"""WHERE l2.account_id = l1.account_id""",
|
||||
"""AND""",
|
||||
"""l1.id <= l2.id""",
|
||||
"""AND""",
|
||||
"""l2.id IN %s""",
|
||||
"""AND""",
|
||||
self._query_get(cr, uid, obj='l1', context=c),
|
||||
""" GROUP BY l2.id""",
|
||||
]
|
||||
sql = """SELECT l2.id, SUM(l1.debit-l1.credit)
|
||||
FROM account_move_line l1, account_move_line l2
|
||||
WHERE l2.account_id = l1.account_id
|
||||
AND l1.id <= l2.id
|
||||
AND l2.id IN %s AND """ + \
|
||||
self._query_get(cr, uid, obj='l1', context=c) + \
|
||||
" GROUP BY l2.id"
|
||||
|
||||
cr.execute('\n'.join(sql), [tuple(ids)])
|
||||
cr.execute(sql, [tuple(ids)])
|
||||
res = dict(cr.fetchall())
|
||||
return res
|
||||
|
||||
@@ -341,11 +338,11 @@ class account_move_line(osv.osv):
|
||||
res[line_id] = (invoice_id, invoice_names[invoice_id])
|
||||
return res
|
||||
|
||||
def name_get(self, cr, uid, ids, context={}):
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
if not ids:
|
||||
return []
|
||||
result = []
|
||||
for line in self.browse(cr, uid, ids, context):
|
||||
for line in self.browse(cr, uid, ids, context=context):
|
||||
if line.ref:
|
||||
result.append((line.id, (line.move_id.name or '')+' ('+line.ref+')'))
|
||||
else:
|
||||
@@ -436,7 +433,7 @@ class account_move_line(osv.osv):
|
||||
'period_id': fields.many2one('account.period', 'Period', required=True, select=2),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal', required=True, select=1),
|
||||
'blocked': fields.boolean('Litigation', help="You can check this box to mark this journal item as a litigation with the associated partner"),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner'),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', select=1, ondelete='restrict'),
|
||||
'date_maturity': fields.date('Due date', help="This field is used for payable and receivable journal entries. You can put the limit date for the payment of this line."),
|
||||
'date': fields.related('move_id','date', string='Effective date', type='date', required=True,
|
||||
store = {
|
||||
@@ -461,6 +458,8 @@ class account_move_line(osv.osv):
|
||||
}
|
||||
|
||||
def _get_date(self, cr, uid, context=None):
|
||||
if context is None:
|
||||
context or {}
|
||||
period_obj = self.pool.get('account.period')
|
||||
dt = time.strftime('%Y-%m-%d')
|
||||
if ('journal_id' in context) and ('period_id' in context):
|
||||
@@ -488,10 +487,11 @@ class account_move_line(osv.osv):
|
||||
'blocked': False,
|
||||
'centralisation': 'normal',
|
||||
'date': _get_date,
|
||||
'date_created': time.strftime('%Y-%m-%d'),
|
||||
'date_created': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'state': 'draft',
|
||||
'currency_id': _get_currency,
|
||||
'journal_id': lambda self, cr, uid, c: c.get('journal_id', False),
|
||||
'account_id': lambda self, cr, uid, c: c.get('account_id', False),
|
||||
'period_id': lambda self, cr, uid, c: c.get('period_id', False),
|
||||
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.move.line', context=c)
|
||||
}
|
||||
@@ -501,52 +501,63 @@ class account_move_line(osv.osv):
|
||||
('credit_debit2', 'CHECK (credit+debit>=0)', 'Wrong credit or debit value in accounting entry !'),
|
||||
]
|
||||
|
||||
def _auto_init(self, cr, context={}):
|
||||
super(account_move_line, self)._auto_init(cr, context)
|
||||
def _auto_init(self, cr, context=None):
|
||||
super(account_move_line, self)._auto_init(cr, context=context)
|
||||
cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'account_move_line_journal_id_period_id_index\'')
|
||||
if not cr.fetchone():
|
||||
cr.execute('CREATE INDEX account_move_line_journal_id_period_id_index ON account_move_line (journal_id, period_id)')
|
||||
|
||||
def _check_no_view(self, cr, uid, ids):
|
||||
lines = self.browse(cr, uid, ids)
|
||||
def _check_no_view(self, cr, uid, ids, context=None):
|
||||
lines = self.browse(cr, uid, ids, context=context)
|
||||
for l in lines:
|
||||
if l.account_id.type == 'view':
|
||||
return False
|
||||
return True
|
||||
|
||||
def _check_no_closed(self, cr, uid, ids):
|
||||
lines = self.browse(cr, uid, ids)
|
||||
def _check_no_closed(self, cr, uid, ids, context=None):
|
||||
lines = self.browse(cr, uid, ids, context=context)
|
||||
for l in lines:
|
||||
if l.account_id.type == 'closed':
|
||||
return False
|
||||
return True
|
||||
|
||||
def _check_company_id(self, cr, uid, ids):
|
||||
lines = self.browse(cr, uid, ids)
|
||||
def _check_company_id(self, cr, uid, ids, context=None):
|
||||
lines = self.browse(cr, uid, ids, context=context)
|
||||
for l in lines:
|
||||
if l.company_id != l.account_id.company_id or l.company_id != l.period_id.company_id:
|
||||
return False
|
||||
return True
|
||||
|
||||
def _check_partner_id(self, cr, uid, ids, context=None):
|
||||
lines = self.browse(cr, uid, ids, context=context)
|
||||
for l in lines:
|
||||
if l.account_id.type in ('receivable', 'payable') and not l.partner_id:
|
||||
return False
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_no_view, 'You can not create move line on view account.', ['account_id']),
|
||||
(_check_no_closed, 'You can not create move line on closed account.', ['account_id']),
|
||||
(_check_company_id,'Company must be same for its related account and period.',['company_id'] ),
|
||||
(_check_company_id, 'Company must be same for its related account and period.',['company_id'] ),
|
||||
(_check_partner_id, 'You can not create move line on receivable/payable account without partner', ['account_id'] )
|
||||
]
|
||||
|
||||
#TODO: ONCHANGE_ACCOUNT_ID: set account_tax_id
|
||||
def onchange_currency(self, cr, uid, ids, account_id, amount, currency_id, date=False, journal=False):
|
||||
def onchange_currency(self, cr, uid, ids, account_id, amount, currency_id, date=False, journal=False, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
account_obj = self.pool.get('account.account')
|
||||
journal_obj = self.pool.get('account.journal')
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
if (not currency_id) or (not account_id):
|
||||
return {}
|
||||
result = {}
|
||||
acc = account_obj.browse(cr, uid, account_id)
|
||||
acc = account_obj.browse(cr, uid, account_id, context=context)
|
||||
if (amount>0) and journal:
|
||||
x = journal_obj.browse(cr, uid, journal).default_credit_account_id
|
||||
if x: acc = x
|
||||
v = currency_obj.compute(cr, uid, currency_id, acc.company_id.currency_id.id, amount, account=acc)
|
||||
context.update({'date': date})
|
||||
v = currency_obj.compute(cr, uid, currency_id, acc.company_id.currency_id.id, amount, account=acc, context=context)
|
||||
result['value'] = {
|
||||
'debit': v > 0 and v or 0.0,
|
||||
'credit': v < 0 and -v or 0.0
|
||||
@@ -657,7 +668,7 @@ class account_move_line(osv.osv):
|
||||
raise osv.except_osv(_('Warning !'), _('To reconcile the entries company should be the same for all entries'))
|
||||
company_list.append(line.company_id.id)
|
||||
|
||||
for line in self.browse(cr, uid, ids, context):
|
||||
for line in self.browse(cr, uid, ids, context=context):
|
||||
if line.reconcile_id:
|
||||
raise osv.except_osv(_('Warning'), _('Already Reconciled!'))
|
||||
if line.reconcile_partial_id:
|
||||
@@ -752,7 +763,7 @@ class account_move_line(osv.osv):
|
||||
if 'comment' in context and context['comment']:
|
||||
libelle = context['comment']
|
||||
else:
|
||||
libelle = 'Write-Off'
|
||||
libelle = _('Write-Off')
|
||||
writeoff_lines = [
|
||||
(0, 0, {
|
||||
'name': libelle,
|
||||
@@ -803,8 +814,10 @@ class account_move_line(osv.osv):
|
||||
partner_obj.write(cr, uid, [partner_id], {'last_reconciliation_date': time.strftime('%Y-%m-%d %H:%M:%S')})
|
||||
return r_id
|
||||
|
||||
def view_header_get(self, cr, user, view_id, view_type, context):
|
||||
context = self.convert_to_period(cr, user, context)
|
||||
def view_header_get(self, cr, user, view_id, view_type, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
context = self.convert_to_period(cr, user, context=context)
|
||||
if context.get('account_id', False):
|
||||
cr.execute('SELECT code FROM account_account WHERE id = %s', (context['account_id'], ))
|
||||
res = cr.fetchone()
|
||||
@@ -820,7 +833,7 @@ class account_move_line(osv.osv):
|
||||
return j+(p and (':'+p) or '')
|
||||
return False
|
||||
|
||||
def onchange_date(self, cr, user, ids, date, context={}):
|
||||
def onchange_date(self, cr, user, ids, date, context=None):
|
||||
"""
|
||||
Returns a dict that contains new values and context
|
||||
@param cr: A database cursor
|
||||
@@ -831,6 +844,8 @@ class account_move_line(osv.osv):
|
||||
@return: Returns a dict which contains new values, and context
|
||||
"""
|
||||
res = {}
|
||||
if context is None:
|
||||
context = {}
|
||||
period_pool = self.pool.get('account.period')
|
||||
pids = period_pool.search(cr, user, [('date_start','<=',date), ('date_stop','>=',date)])
|
||||
if pids:
|
||||
@@ -845,9 +860,11 @@ class account_move_line(osv.osv):
|
||||
'context':context,
|
||||
}
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False):
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
journal_pool = self.pool.get('account.journal')
|
||||
result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
|
||||
if context is None:
|
||||
context = {}
|
||||
result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu)
|
||||
if view_type != 'tree':
|
||||
#Remove the toolbar from the form view
|
||||
if view_type == 'form':
|
||||
@@ -866,7 +883,7 @@ class account_move_line(osv.osv):
|
||||
xml = '''<?xml version="1.0"?>\n<tree string="%s" editable="top" refresh="5" on_write="on_create_write" colors="red:state==\'draft\';black:state==\'valid\'">\n\t''' % (title)
|
||||
|
||||
ids = journal_pool.search(cr, uid, [])
|
||||
journals = journal_pool.browse(cr, uid, ids)
|
||||
journals = journal_pool.browse(cr, uid, ids, context=context)
|
||||
all_journal = [None]
|
||||
common_fields = {}
|
||||
total = len(journals)
|
||||
@@ -929,13 +946,15 @@ class account_move_line(osv.osv):
|
||||
elif field == 'date':
|
||||
attrs.append('on_change="onchange_date(date)"')
|
||||
|
||||
elif field == 'analytic_account_id':
|
||||
attrs.append('''groups="analytic.group_analytic_accounting"''') # Currently it is not working due to framework problem may be ..
|
||||
|
||||
if field in ('amount_currency', 'currency_id'):
|
||||
attrs.append('on_change="onchange_currency(account_id, amount_currency, currency_id, date, journal_id)"')
|
||||
attrs.append('''attrs="{'readonly': [('state', '=', 'valid')]}"''')
|
||||
|
||||
if field in widths:
|
||||
attrs.append('width="'+str(widths[field])+'"')
|
||||
attrs.append('string="'+field_it[2]+'"')
|
||||
attrs.append("invisible=\"context.get('visible_id') not in %s\"" % (fields.get(field)))
|
||||
xml += '''<field name="%s" %s/>\n''' % (field,' '.join(attrs))
|
||||
|
||||
@@ -944,8 +963,10 @@ class account_move_line(osv.osv):
|
||||
result['fields'] = self.fields_get(cr, uid, flds, context)
|
||||
return result
|
||||
|
||||
def _check_moves(self, cr, uid, context):
|
||||
def _check_moves(self, cr, uid, context=None):
|
||||
# use the first move ever created for this journal and period
|
||||
if context is None:
|
||||
context = {}
|
||||
cr.execute('SELECT id, state, name FROM account_move WHERE journal_id = %s AND period_id = %s ORDER BY id limit 1', (context['journal_id'],context['period_id']))
|
||||
res = cr.fetchone()
|
||||
if res:
|
||||
@@ -973,11 +994,13 @@ class account_move_line(osv.osv):
|
||||
obj_move_rec.unlink(cr, uid, unlink_ids)
|
||||
return True
|
||||
|
||||
def unlink(self, cr, uid, ids, context={}, check=True):
|
||||
def unlink(self, cr, uid, ids, context=None, check=True):
|
||||
if context is None:
|
||||
context = {}
|
||||
move_obj = self.pool.get('account.move')
|
||||
self._update_check(cr, uid, ids, context)
|
||||
result = False
|
||||
for line in self.browse(cr, uid, ids, context):
|
||||
for line in self.browse(cr, uid, ids, context=context):
|
||||
context['journal_id'] = line.journal_id.id
|
||||
context['period_id'] = line.period_id.id
|
||||
result = super(account_move_line, self).unlink(cr, uid, [line.id], context=context)
|
||||
@@ -1006,9 +1029,9 @@ class account_move_line(osv.osv):
|
||||
journal_id = context.get('journal_id', False)
|
||||
period_id = context.get('period_id', False)
|
||||
if journal_id:
|
||||
journal = journal_obj.browse(cr, uid, [journal_id])[0]
|
||||
journal = journal_obj.browse(cr, uid, journal_id, context=context)
|
||||
if journal.allow_date and period_id:
|
||||
period = period_obj.browse(cr, uid, [period_id])[0]
|
||||
period = period_obj.browse(cr, uid, period_id, context=context)
|
||||
if not time.strptime(vals['date'][:10],'%Y-%m-%d') >= time.strptime(period.date_start, '%Y-%m-%d') or not time.strptime(vals['date'][:10], '%Y-%m-%d') <= time.strptime(period.date_stop, '%Y-%m-%d'):
|
||||
raise osv.except_osv(_('Error'),_('The date of your Journal Entry is not in the defined period!'))
|
||||
else:
|
||||
@@ -1061,7 +1084,7 @@ class account_move_line(osv.osv):
|
||||
move_obj.write(cr, uid, [line.move_id.id], {'date': todo_date}, context=context)
|
||||
return result
|
||||
|
||||
def _update_journal_check(self, cr, uid, journal_id, period_id, context={}):
|
||||
def _update_journal_check(self, cr, uid, journal_id, period_id, context=None):
|
||||
journal_obj = self.pool.get('account.journal')
|
||||
period_obj = self.pool.get('account.period')
|
||||
jour_period_obj = self.pool.get('account.journal.period')
|
||||
@@ -1071,8 +1094,8 @@ class account_move_line(osv.osv):
|
||||
if state == 'done':
|
||||
raise osv.except_osv(_('Error !'), _('You can not add/modify entries in a closed journal.'))
|
||||
if not result:
|
||||
journal = journal_obj.browse(cr, uid, journal_id, context)
|
||||
period = period_obj.browse(cr, uid, period_id, context)
|
||||
journal = journal_obj.browse(cr, uid, journal_id, context=context)
|
||||
period = period_obj.browse(cr, uid, period_id, context=context)
|
||||
jour_period_obj.create(cr, uid, {
|
||||
'name': (journal.code or journal.name)+':'+(period.name or ''),
|
||||
'journal_id': journal.id,
|
||||
@@ -1080,10 +1103,10 @@ class account_move_line(osv.osv):
|
||||
})
|
||||
return True
|
||||
|
||||
def _update_check(self, cr, uid, ids, context={}):
|
||||
def _update_check(self, cr, uid, ids, context=None):
|
||||
done = {}
|
||||
for line in self.browse(cr, uid, ids, context):
|
||||
if line.move_id.state <> 'draft':
|
||||
for line in self.browse(cr, uid, ids, context=context):
|
||||
if line.move_id.state <> 'draft' and (not line.journal_id.entry_posted):
|
||||
raise osv.except_osv(_('Error !'), _('You can not do this modification on a confirmed entry ! Please note that you can just change some non important fields !'))
|
||||
if line.reconcile_id:
|
||||
raise osv.except_osv(_('Error !'), _('You can not do this modification on a reconciled entry ! Please note that you can just change some non important fields !'))
|
||||
@@ -1101,6 +1124,10 @@ class account_move_line(osv.osv):
|
||||
journal_obj = self.pool.get('account.journal')
|
||||
if context is None:
|
||||
context = {}
|
||||
if vals.get('move_id', False):
|
||||
company_id = self.pool.get('account.move').read(cr, uid, vals['move_id'], ['company_id']).get('company_id', False)
|
||||
if company_id:
|
||||
vals['company_id'] = company_id[0]
|
||||
self._check_date(cr, uid, vals, context, check)
|
||||
if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']:
|
||||
raise osv.except_osv(_('Bad account!'), _('You can not use an inactive account!'))
|
||||
@@ -1115,7 +1142,7 @@ class account_move_line(osv.osv):
|
||||
|
||||
self._update_journal_check(cr, uid, context['journal_id'], context['period_id'], context)
|
||||
move_id = vals.get('move_id', False)
|
||||
journal = journal_obj.browse(cr, uid, context['journal_id'])
|
||||
journal = journal_obj.browse(cr, uid, context['journal_id'], context=context)
|
||||
if not move_id:
|
||||
if journal.centralisation:
|
||||
#Check for centralisation
|
||||
@@ -1138,7 +1165,7 @@ class account_move_line(osv.osv):
|
||||
raise osv.except_osv(_('No piece number !'), _('Can not create an automatic sequence for this piece !\n\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.'))
|
||||
ok = not (journal.type_control_ids or journal.account_control_ids)
|
||||
if ('account_id' in vals):
|
||||
account = account_obj.browse(cr, uid, vals['account_id'])
|
||||
account = account_obj.browse(cr, uid, vals['account_id'], context=context)
|
||||
if journal.type_control_ids:
|
||||
type = account.user_type
|
||||
for t in journal.type_control_ids:
|
||||
@@ -1249,4 +1276,4 @@ class account_move_line(osv.osv):
|
||||
|
||||
account_move_line()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
<data>
|
||||
<report auto="False" id="account_general_ledger" menu="False" model="account.account" name="account.general.ledger" rml="account/report/account_general_ledger.rml" string="General Ledger"/>
|
||||
<report auto="False" id="account_3rdparty_ledger" menu="False" model="res.partner" name="account.third_party_ledger" rml="account/report/account_partner_ledger.rml" string="Partner Ledger"/>
|
||||
<report auto="False" id="account_3rdparty_ledger_other" menu="False" model="res.partner" name="account.third_party_ledger_other" rml="account/report/account_partner_ledger_other.rml" string="Partner Other Ledger"/>
|
||||
<report auto="False" id="account_3rdparty_ledger_other" menu="False" model="res.partner" name="account.third_party_ledger_other" rml="account/report/account_partner_ledger_other.rml" string="Partner Ledger"/>
|
||||
<report auto="False" id="account_account_balance" menu="False" model="account.account" name="account.account.balance" rml="account/report/account_balance.rml" string="Trial Balance"/>
|
||||
<report auto="False" id="account_3rdparty_account_balance" menu="False" model="account.account" name="account.partner.balance" rml="account/report/account_partner_balance.rml" string="Partner Balance"/>
|
||||
<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_central_journal" model="account.journal.period" name="account.central.journal" rml="account/report/account_central_journal.rml" string="Central Journal" 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 Journal" header="False"/>
|
||||
<report auto="False" id="account_journal" model="account.journal.period" name="account.journal.period.print" rml="account/report/account_journal.rml" string="Journal" header="False"/>
|
||||
<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"
|
||||
@@ -18,7 +18,8 @@
|
||||
rml="account/report/account_print_invoice.rml"
|
||||
string="Invoices"
|
||||
attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/',''))"
|
||||
attachment_use="1"/>
|
||||
attachment_use="1"
|
||||
multi="True"/>
|
||||
<report id="account_transfers" model="account.transfer" name="account.transfer" string="Transfers" xml="account/report/transfer.xml" xsl="account/report/transfer.xsl"/>
|
||||
<report auto="False" id="account_intracom" menu="False" model="account.move.line" name="account.intracom" string="IntraCom"/>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- This file must be loaded _after_ account_demo.xml ! -->
|
||||
<!-- This file must be loaded _after_ account_demo.xml ! -->
|
||||
<record id="test_invoice_1" model="account.invoice">
|
||||
<field name="currency_id" ref="base.EUR"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
@@ -19,8 +19,8 @@
|
||||
<field name="base">5.00</field>
|
||||
<field name="amount">100.00</field>
|
||||
<field name="account_id" ref="account.ova"/>
|
||||
<field name="invoice_id" ref="test_invoice_1"/>
|
||||
</record>
|
||||
<field name="invoice_id" ref="test_invoice_1"/>
|
||||
</record>
|
||||
<record id="test_invoice_1_line_1" model="account.invoice.line">
|
||||
<field name="name">Basic computer with Dvorak keyboard and left-handed mouse</field>
|
||||
<field name="invoice_id" ref="test_invoice_1"/>
|
||||
@@ -34,19 +34,19 @@
|
||||
<field name="price_unit">800</field>
|
||||
<field name="quantity">2</field>
|
||||
<field name="account_id" ref="account.a_sale"/>
|
||||
</record>
|
||||
|
||||
</record>
|
||||
|
||||
<assert id="test_invoice_1" model="account.invoice" string="The currency unit of Test invoice 1 is EUR">
|
||||
<test expr="currency_id.code">EUR</test>
|
||||
<test expr="currency_id.symbol">€</test>
|
||||
</assert>
|
||||
|
||||
|
||||
<assert id="test_invoice_1" model="account.invoice" severity="error" string="The amount of Test invoice 1 is correct">
|
||||
<test expr="sum([l.price_subtotal for l in invoice_line]) == 1850"/>
|
||||
<test expr="sum([l.price_subtotal for l in invoice_line]) == amount_untaxed"/>
|
||||
</assert>
|
||||
|
||||
|
||||
<workflow action="invoice_open" model="account.invoice" ref="test_invoice_1"/>
|
||||
|
||||
|
||||
<assert id="test_invoice_1" model="account.invoice" string="Test invoice 1 is now open">
|
||||
<test expr="state">open</test>
|
||||
</assert>
|
||||
@@ -62,7 +62,7 @@
|
||||
<!-- context = --> <value eval="{}"/>
|
||||
<!-- name = --> <value eval="str('Payment from ASUStek')"/>
|
||||
</function>
|
||||
|
||||
|
||||
<assert id="test_invoice_1" model="account.invoice" string="Test invoice 1 is now paid">
|
||||
<test expr="state">paid</test>
|
||||
</assert>
|
||||
|
||||
+109
-64
@@ -76,9 +76,10 @@
|
||||
<field name="name">Fiscal Years</field>
|
||||
<field name="res_model">account.fiscalyear</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help">Define your company's fiscal year depending on the period you have chosen to follow. A fiscal year is a 1 year period over which a company budgets its spending. It may run over any period of 12 months. The fiscal year is referred to by the date in which it ends. For example, if a company's fiscal year ends November 30, 2011, then everything between December 1, 2010 and November 30, 2011 would be referred to as FY 2011. Not using the actual calendar year gives many companies an advantage, allowing them to close their books at a time which is most convenient for them.</field>
|
||||
</record>
|
||||
<menuitem id="next_id_23" name="Periods" parent="account.menu_finance_accounting"/>
|
||||
<menuitem id="next_id_23" name="Periods" parent="account.menu_finance_accounting" sequence="8" />
|
||||
<menuitem action="action_account_fiscalyear_form" id="menu_action_account_fiscalyear_form" parent="next_id_23"/>
|
||||
|
||||
<!--
|
||||
@@ -142,8 +143,9 @@
|
||||
<field name="name">Periods</field>
|
||||
<field name="res_model">account.period</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{'search_default_draft': 1}</field>
|
||||
<field name="help">Here, you can define a period, an interval of time between successive closings of the books of your company. An accounting period typically is a month or a quarter, corresponding to the tax year used by the business. Create and manage them from here and decide whether a period should be left open or closed depending on your company's activities over a specific period.</field>
|
||||
</record>
|
||||
<menuitem action="action_account_period_form" id="menu_action_account_period_form" parent="account.next_id_23"/>
|
||||
|
||||
@@ -237,11 +239,11 @@
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_treasory_graph" model="ir.ui.view">
|
||||
<field name="name">account.treasory.graph</field>
|
||||
<field name="name">account.treasury.graph</field>
|
||||
<field name="model">account.account</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Treasory Analysis" type="bar">
|
||||
<graph string="Treasury Analysis" type="bar">
|
||||
<field name="name"/>
|
||||
<field name="balance" operator="+"/>
|
||||
</graph>
|
||||
@@ -254,6 +256,7 @@
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
<field name="search_view_id" ref="view_account_search"/>
|
||||
<field name="view_id" ref="view_account_list"/>
|
||||
<field name="help">Create and manage accounts you will need to record financial entries in. Accounts are financial records of your company that register all financial transactions. Companies present their annual accounts in two main parts: the balance sheet and the income statement (profit and loss account). The annual accounts of a company are required by law to disclose a certain amount of information. They have to be certified by an external auditor yearly.</field>
|
||||
</record>
|
||||
<menuitem id="account_account_menu" name="Accounts" parent="menu_finance_accounting"/>
|
||||
<menuitem action="action_account_form" id="menu_action_account_form" parent="account_account_menu"/>
|
||||
@@ -351,9 +354,10 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_account_journal_view_search"/>
|
||||
<field name="help">Here you can personalize and create each view of your financial journals by selecting the fields you want to appear and the sequence they will appear.</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_account_journal_view" id="menu_action_account_journal_view" parent="account.menu_low_level"/>
|
||||
<menuitem action="action_account_journal_view" id="menu_action_account_journal_view" parent="account.menu_journals"/>
|
||||
|
||||
<!--
|
||||
# Account Journal
|
||||
@@ -380,7 +384,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Search Account Journal">
|
||||
<group>
|
||||
<filter domain="['|', ('type', '=', 'sale'), ('type', '=', 'sale_refund')]" string="Sale" icon="terp-sale"/>
|
||||
<filter domain="['|', ('type', '=', 'sale'), ('type', '=', 'sale_refund')]" string="Sale" icon="terp-camera_test"/>
|
||||
<filter domain="['|', ('type', '=', 'purchase'), ('type', '=', 'purchase_refund')]" string="Purchase" icon="terp-purchase"/>
|
||||
<filter domain="['|', ('type', '=', 'cash'), ('type', '=', 'bank')]" string="Liquidity" icon="terp-dolar"/>
|
||||
<filter domain="['|', ('type', '=', 'general'), ('type', '=', 'situation')]" string="Others" icon="terp-stock"/>
|
||||
@@ -407,7 +411,7 @@
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="type" on_change="onchange_type(type, currency)"/>
|
||||
<field name="type" on_change="onchange_type(type, currency, context)"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="General Information">
|
||||
@@ -463,8 +467,9 @@
|
||||
<field name="res_model">account.journal</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help">Create and manage your company's financial journals from this menu. A journal is a business diary in which all financial data related to the day to day business transactions of your company is recorded using double-entry book keeping system. Depending on the nature of its activities and number of daily transactions, a company may keep several types of specialized journals such as a cash journal, purchases journal, and sales journal.</field>
|
||||
</record>
|
||||
<menuitem action="action_account_journal_form" id="menu_action_account_journal_form" parent="account_account_menu"/>
|
||||
<menuitem action="action_account_journal_form" id="menu_action_account_journal_form" parent="menu_journals"/>
|
||||
|
||||
<record id="view_account_bank_statement_filter" model="ir.ui.view">
|
||||
<field name="name">account.cash.statement.select</field>
|
||||
@@ -555,12 +560,12 @@
|
||||
<page string="Transaction" name="statement_line_ids">
|
||||
<field colspan="4" name="line_ids" nolabel="1">
|
||||
<tree editable="bottom" string="Statement lines">
|
||||
<field name="sequence" readonly="1"/>
|
||||
<field name="date"/>
|
||||
<field name="ref"/>
|
||||
<field name="sequence" readonly="1" invisible="1"/>
|
||||
<field name="date" groups="base.group_extended"/>
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency, {'amount': amount})"/>
|
||||
<field name="ref"/>
|
||||
<field name="partner_id" on_change="onchange_type(partner_id, type)"/>
|
||||
<field name="type" on_change="onchange_type(partner_id, type)"/>
|
||||
<field domain="[('journal_id','=',parent.journal_id)]" name="account_id"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', parent.company_id), ('type', '<>', 'view')]"/>
|
||||
<field name="amount"/>
|
||||
@@ -568,8 +573,8 @@
|
||||
<form string="Statement lines">
|
||||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency, {'amount': amount})"/>
|
||||
<field name="type" on_change="onchange_type(partner_id, type)"/>
|
||||
<field name="partner_id" on_change="onchange_type(partner_id, type)"/>
|
||||
<field domain="[('journal_id', '=', parent.journal_id), ('type', '<>', 'view')]" name="account_id"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', parent.company_id), ('type', '<>', 'view')]"/>
|
||||
<field name="amount"/>
|
||||
@@ -604,16 +609,29 @@
|
||||
<group col="7" colspan="4">
|
||||
<field name="name" select="1"/>
|
||||
<field name="date" select="1" on_change="onchange_date(date)"/>
|
||||
<field name="journal_id" domain="[('type', '=', 'bank')]" on_change="onchange_journal_id(journal_id)" select="1"/>
|
||||
<field name="journal_id" domain="[('type', '=', 'bank')]" on_change="onchange_journal_id(journal_id)" widget="selection"/>
|
||||
<newline/>
|
||||
<field name="period_id"/>
|
||||
<field name="balance_start"/>
|
||||
<field name="balance_end_real"/>
|
||||
<field name="currency" invisible="1"/>
|
||||
<field name="account_id" invisible="1"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Journal Entries">
|
||||
<field colspan="4" name="move_line_ids" nolabel="1" widget="many2many"/>
|
||||
<field colspan="4" name="move_line_ids" nolabel="1" widget="many2many" domain="[('account_id','=',account_id),('statement_id', '=', False)]">
|
||||
<tree string="Statement lines">
|
||||
<field name="date"/>
|
||||
<field name="period_id"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="ref"/>
|
||||
<field name="name"/>
|
||||
<field name="account_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="debit"/>
|
||||
<field name="credit"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
<group col="8" colspan="4">
|
||||
@@ -680,7 +698,7 @@
|
||||
<field name="name">Draft statements</field>
|
||||
<field name="res_model">account.bank.statement</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('state','=','draft')]</field>
|
||||
<field name="filter" eval="True"/>
|
||||
</record>
|
||||
@@ -742,8 +760,9 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_account_type_search"/>
|
||||
<field name="help">An account type is a name or code given to an account that indicates its purpose. For example, the account type could be linked to an asset account, expense account or payable account. From this view, you can create and manage the account types you need to be used for your company management.</field>
|
||||
</record>
|
||||
<menuitem action="action_account_type_form" groups="base.group_extended,group_account_manager" id="menu_action_account_type_form" parent="menu_low_level"/>
|
||||
<menuitem action="action_account_type_form" groups="base.group_extended,group_account_manager" sequence="6" id="menu_action_account_type_form" parent="account_account_menu"/>
|
||||
<!--
|
||||
Entries
|
||||
-->
|
||||
@@ -854,9 +873,10 @@
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_tax_code_tree"/>
|
||||
<field name="search_view_id" ref="view_tax_code_search"/>
|
||||
<field name="help">A tax code is a reference of a tax that will be taken out of a gross income depending on the country and sometimes industry sector. OpenERP allows you to define and manage them from this menu.</field>
|
||||
</record>
|
||||
<menuitem id="next_id_27" name="Taxes" parent="account.menu_finance_accounting"/>
|
||||
<menuitem action="action_tax_code_list" id="menu_action_tax_code_list" parent="menu_low_level" sequence="12"/>
|
||||
<menuitem action="action_tax_code_list" id="menu_action_tax_code_list" parent="next_id_27" sequence="12"/>
|
||||
|
||||
|
||||
<!--
|
||||
@@ -926,7 +946,14 @@
|
||||
<field groups="base.group_extended" name="child_depend"/>
|
||||
<field groups="base.group_extended" name="sequence"/>
|
||||
<field groups="base.group_extended" name="include_base_amount"/>
|
||||
<field groups="base.group_extended" colspan="4" name="child_ids"/>
|
||||
<field groups="base.group_extended" colspan="4" name="child_ids">
|
||||
<tree string="Account Tax">
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
<field name="price_include" groups="base.group_extended"/>
|
||||
<field name="description"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
</page>
|
||||
<page groups="base.group_extended" string="Special Computation">
|
||||
@@ -983,7 +1010,7 @@
|
||||
<field name="debit" sum="Total debit"/>
|
||||
<field name="credit" sum="Total credit"/>
|
||||
<field name="account_tax_id" groups="base.group_extended"/>
|
||||
<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="amount_currency" groups="base.group_extended" attrs="{'readonly':[('state','=','valid')]}"/>
|
||||
<field name="currency_id" groups="base.group_extended" attrs="{'readonly':[('state','=','valid')]}"/>
|
||||
<field name="reconcile_partial_id" groups="base.group_extended"/>
|
||||
@@ -1060,13 +1087,13 @@
|
||||
|
||||
<group col="2" colspan="2" groups="base.group_extended">
|
||||
<separator colspan="2" string="Analytic"/>
|
||||
<field name="analytic_account_id" domain="[('parent_id','!=',False)]" groups="base.group_extended"/>
|
||||
<field name="analytic_account_id" domain="[('parent_id','!=',False)]" groups="analytic.group_analytic_accounting"/>
|
||||
</group>
|
||||
<separator string="Narration" colspan="4"/>
|
||||
<field name="narration" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Analytic Lines" groups="base.group_extended">
|
||||
<field colspan="4" name="analytic_lines" nolabel="1" context="{'default_general_account_id':account_id, 'default_name': name, 'default_date':date, 'amount': (debit or 0.0)-(credit or 0.0)}" groups="base.group_extended"/>
|
||||
<page string="Analytic Lines" groups="base.group_analytic_accounting">
|
||||
<field colspan="4" name="analytic_lines" nolabel="1" context="{'default_general_account_id':account_id, 'default_name': name, 'default_date':date, 'amount': (debit or 0.0)-(credit or 0.0)}"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
@@ -1105,15 +1132,15 @@
|
||||
<field name="blocked" select="3"/>
|
||||
<newline/>
|
||||
<field name="account_tax_id" domain="[('parent_id','=',False)]"/>
|
||||
<field name="analytic_account_id" domain="[('parent_id','!=',False)]" groups="base.group_extended"/>
|
||||
<field name="analytic_account_id" domain="[('parent_id','!=',False)]" groups="analytic.group_analytic_accounting"/>
|
||||
<separator colspan="4" string="State"/>
|
||||
<newline/>
|
||||
<field name="reconcile_id"/>
|
||||
<field name="reconcile_partial_id"/>
|
||||
<field name="state"/>
|
||||
</page>
|
||||
<page string="Analytic Lines" groups="base.group_extended">
|
||||
<field colspan="4" name="analytic_lines" nolabel="1" groups="base.group_extended"/>
|
||||
<page string="Analytic Lines" groups="base.group_analytic_accounting">
|
||||
<field colspan="4" name="analytic_lines" nolabel="1" />
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
@@ -1143,12 +1170,12 @@
|
||||
<filter icon="terp-document-new" string="Unbalanced" domain="[('state','=','draft')]" help="Unbalanced Journal Items"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-document-new" string="Unposted" domain="[('move_id.state','=','draft')]" help="Unposted Journal Items"/>
|
||||
<filter icon="terp-camera_test" string="Posted" domain="[('move_id.state','=','posted')]" help="Posted Journal Items"/>
|
||||
<filter name="posted" icon="terp-camera_test" string="Posted" domain="[('move_id.state','=','posted')]" help="Posted Journal Items"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter
|
||||
icon="terp-dolar_ok!"
|
||||
string="Unreconciled"
|
||||
domain="[('reconcile_id','=',False), ('account_id.type','in',['receivable', 'payable'])]" help="Unreconciled Journal Items"
|
||||
domain="[('reconcile_id','=',False), ('account_id.reconcile','=',True)]" help="Unreconciled Journal Items"
|
||||
name="unreconciled"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="move_id" select="1" string="Number (Move)"/>
|
||||
@@ -1189,6 +1216,7 @@
|
||||
<field name="res_model">account.move.line</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{'search_default_posted': 1}</field>
|
||||
<field name="search_view_id" ref="view_account_move_line_filter"/>
|
||||
<field name="help">This view is used by accountants in order to record entries massively in OpenERP. If you want to record a supplier invoice, start by recording the line of the expense account, OpenERP will propose to you automatically the Tax related to this account and the counter-part "Account Payable".</field>
|
||||
</record>
|
||||
@@ -1229,6 +1257,7 @@
|
||||
<field name="view_id" ref="view_move_line_tree"/>
|
||||
<field name="search_view_id" ref="view_account_move_line_filter"/>
|
||||
<field name="domain">[('account_id', 'child_of', active_id)]</field>
|
||||
<field name="context">{'account_id':active_id}</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_account_move_line_select" model="ir.values">
|
||||
@@ -1353,13 +1382,13 @@
|
||||
|
||||
<group col="2" colspan="2" groups="base.group_extended">
|
||||
<separator colspan="2" string="Analytic"/>
|
||||
<field name="analytic_account_id" domain="[('parent_id','!=',False)]" groups="base.group_extended"/>
|
||||
<field name="analytic_account_id" domain="[('parent_id','!=',False)]" groups="analytic.group_analytic_accounting"/>
|
||||
</group>
|
||||
<separator string="Narration" colspan="4"/>
|
||||
<field name="narration" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Analytic Lines" groups="base.group_extended">
|
||||
<field colspan="4" name="analytic_lines" nolabel="1" context="{'default_general_account_id':account_id, 'default_name': name, 'default_date':date, 'amount': (debit or 0.0)-(credit or 0.0)}" groups="base.group_extended"/>
|
||||
<page string="Analytic Lines" groups="base.group_analytic_accounting">
|
||||
<field colspan="4" name="analytic_lines" nolabel="1" context="{'default_general_account_id':account_id, 'default_name': name, 'default_date':date, 'amount': (debit or 0.0)-(credit or 0.0)}"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
@@ -1372,7 +1401,7 @@
|
||||
<field name="date_maturity"/>
|
||||
<field name="debit" sum="Total Debit"/>
|
||||
<field name="credit" sum="Total Credit"/>
|
||||
<field name="analytic_account_id" domain="[('parent_id','!=',False)]" groups="base.group_extended"/>
|
||||
<field name="analytic_account_id" domain="[('parent_id','!=',False)]" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="amount_currency" groups="base.group_extended"/>
|
||||
<field name="currency_id" groups="base.group_extended"/>
|
||||
<field name="tax_code_id"/>
|
||||
@@ -1512,8 +1541,8 @@
|
||||
<tree editable="bottom" string="Statement lines">
|
||||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency)"/>
|
||||
<field name="type" on_change="onchange_type(partner_id, type)"/>
|
||||
<field name="partner_id" on_change="onchange_type(partner_id, type)"/>
|
||||
<field domain="[('journal_id', '=', parent.journal_id)]" name="account_id"/>
|
||||
<field name="amount"/>
|
||||
<field context="{'partner_id': partner_id, 'amount': amount, 'account_id': account_id, 'date':date}" name="reconcile_id"/>
|
||||
@@ -1521,8 +1550,8 @@
|
||||
<form string="Statement lines">
|
||||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency)"/>
|
||||
<field name="type" on_change="onchange_type(partner_id, type)"/>
|
||||
<field name="partner_id" on_change="onchange_type(partner_id, type)"/>
|
||||
<field domain="[('journal_id', '=', parent.journal_id)]" name="account_id"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" />
|
||||
<field name="amount"/>
|
||||
@@ -1689,7 +1718,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Journal Entry Model">
|
||||
<group>
|
||||
<filter string="Sale" icon="terp-sale" domain="[('journal_id.type', '=', 'sale')]"/>
|
||||
<filter string="Sale" icon="terp-camera_test" domain="[('journal_id.type', '=', 'sale')]"/>
|
||||
<filter string="Purchase" icon="terp-purchase" domain="[('journal_id.type', '=', 'purchase')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
@@ -1708,7 +1737,7 @@
|
||||
<field name="name">Recurring Models</field>
|
||||
<field name="res_model">account.model</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_model_search"/>
|
||||
</record>
|
||||
<menuitem
|
||||
@@ -1991,7 +2020,7 @@
|
||||
<field name="debit" sum="Total debit"/>
|
||||
<field name="credit" sum="Total credit"/>
|
||||
<field name="account_tax_id"/>
|
||||
<field name="analytic_account_id" domain="[('parent_id','!=',False)]" groups="base.group_extended"/>
|
||||
<field name="analytic_account_id" domain="[('parent_id','!=',False)]" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
@@ -2132,7 +2161,8 @@
|
||||
<filter icon="terp-sale" string="Receivale Accounts" domain="[('type','=','receivable')]"/>
|
||||
<filter icon="terp-purchase" string="Payable Accounts" domain="[('type','=','payable')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="code"/>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="type"/>
|
||||
<field name="user_type"/>
|
||||
@@ -2150,7 +2180,7 @@
|
||||
<field name="name">Account Templates</field>
|
||||
<field name="res_model">account.account.template</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_account_template_search"/>
|
||||
</record>
|
||||
|
||||
@@ -2173,13 +2203,13 @@
|
||||
<field name="tax_template_ids" colspan="4" readonly="1" nolabel="1"/>
|
||||
<separator string="Properties" colspan="4"/>
|
||||
<group>
|
||||
<field name="property_account_receivable"/>
|
||||
<field name="property_account_payable"/>
|
||||
<field name="property_account_expense_categ" />
|
||||
<field name="property_account_income_categ"/>
|
||||
<field name="property_account_expense"/>
|
||||
<field name="property_account_income"/>
|
||||
<field name="property_reserve_and_surplus_account"/>
|
||||
<field name="property_account_receivable" domain="[('id', 'child_of', [account_root_id])]"/>
|
||||
<field name="property_account_payable" domain="[('id', 'child_of', [account_root_id])]"/>
|
||||
<field name="property_account_expense_categ" domain="[('id', 'child_of', [account_root_id])]"/>
|
||||
<field name="property_account_income_categ" domain="[('id', 'child_of', [account_root_id])]" />
|
||||
<field name="property_account_expense" domain="[('id', 'child_of', [account_root_id])]"/>
|
||||
<field name="property_account_income" domain="[('id', 'child_of', [account_root_id])]"/>
|
||||
<field name="property_reserve_and_surplus_account" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
@@ -2230,7 +2260,7 @@
|
||||
<field name="name">Chart of Accounts Templates</field>
|
||||
<field name="res_model">account.chart.template</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_account_chart_template_form" id="menu_action_account_chart_template_form" parent="account_template_accounts" sequence="1"/>
|
||||
@@ -2250,6 +2280,7 @@
|
||||
<field name="chart_template_id"/>
|
||||
<field name="type"/>
|
||||
<field name="type_tax_use"/>
|
||||
<field name="price_include"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Tax Definition">
|
||||
@@ -2384,7 +2415,7 @@
|
||||
<field name="name">Tax Code Templates</field>
|
||||
<field name="res_model">account.tax.code.template</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_tax_code_template_search"/>
|
||||
</record>
|
||||
<menuitem action="action_account_tax_code_template_form" id="menu_action_account_tax_code_template_form" parent="account_template_taxes" sequence="14"/>
|
||||
@@ -2415,7 +2446,7 @@
|
||||
<attribute name='string'></attribute>
|
||||
</xpath>
|
||||
<group string="res_config_contents" position="replace">
|
||||
<field name="company_id" widget="selection"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
<field name ="code_digits" groups="base.group_extended"/>
|
||||
<field name="chart_template_id" widget="selection" on_change="onchange_chart_template_id(chart_template_id)"/>
|
||||
<field name ="seq_journal" groups="base.group_extended"/>
|
||||
@@ -2593,23 +2624,23 @@ action = self.pool.get('res.config').next(cr, uid, [], context)
|
||||
<page string="Cash Transactions" attrs="{'invisible': [('state','=','draft')]}">
|
||||
<field colspan="4" name="line_ids" nolabel="1">
|
||||
<tree editable="bottom" string="Statement lines">
|
||||
<field name="sequence"/>
|
||||
<field name="date"/>
|
||||
<field name="ref"/>
|
||||
<field name="sequence" invisible="1"/>
|
||||
<field name="date" groups="base.group_extended"/>
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency, {'amount': amount})"/>
|
||||
<field name="ref"/>
|
||||
<field name="partner_id" on_change="onchange_type(partner_id, type)"/>
|
||||
<field name="type" on_change="onchange_type(partner_id, type)"/>
|
||||
<field domain="[('journal_id','=',parent.journal_id)]" name="account_id"/>
|
||||
<field name="analytic_account_id" groups="base.group_extended" />
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" />
|
||||
<field name="amount"/>
|
||||
</tree>
|
||||
<form string="Statement lines">
|
||||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, type, parent.currency)"/>
|
||||
<field name="type" on_change="onchange_type(partner_id, type)"/>
|
||||
<field name="partner_id" on_change="onchange_type(partner_id, type)"/>
|
||||
<field domain="[('journal_id', '=', parent.journal_id), ('type', '<>', 'view')]" name="account_id"/>
|
||||
<field name="analytic_account_id" groups="base.group_extended" />
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" />
|
||||
<field name="amount"/>
|
||||
<field name="ref"/>
|
||||
<field name="sequence"/>
|
||||
@@ -2673,7 +2704,7 @@ action = self.pool.get('res.config').next(cr, uid, [], context)
|
||||
<field name="state" colspan="4"/>
|
||||
<button name="button_cancel" states="confirm,open" string="Cancel" icon="terp-gtk-stop" type="object" groups="base.group_extended"/>
|
||||
<button name="button_confirm_cash" states="open" string="Close CashBox" icon="terp-dialog-close" type="object"/>
|
||||
<button name="button_open" states="draft" string="Open CashBox" icon="terp-document-new" type="object"/>
|
||||
<button name="button_open" states="draft" string="Open CashBox" icon="gtk-go-forward" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
@@ -2723,5 +2754,19 @@ action = self.pool.get('res.config').next(cr, uid, [], context)
|
||||
<menuitem action="action_view_bank_statement_tree" id="journal_cash_move_lines" parent="menu_finance_bank_and_cash"
|
||||
groups="group_account_user,group_account_manager"/>
|
||||
|
||||
<record id="action_partner_all" model="ir.actions.act_window">
|
||||
<field name="name">Partners</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">res.partner</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="filter" eval="True"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_partners_partners"
|
||||
name="Partners"
|
||||
parent="menu_partners"
|
||||
action="action_partner_all"
|
||||
sequence="1"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<menuitem id="next_id_22" name="Partners" parent="menu_finance_generic_reporting" sequence="1"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -29,7 +29,7 @@
|
||||
<field name="view_id" ref="account.view_account_entries_report_tree"/>
|
||||
</record>
|
||||
<record id="action_treasory_graph" model="ir.actions.act_window">
|
||||
<field name="name">Treasory</field>
|
||||
<field name="name">Treasury</field>
|
||||
<field name="res_model">account.account</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
@@ -44,12 +44,12 @@
|
||||
<form string="Account Board">
|
||||
<hpaned>
|
||||
<child1>
|
||||
<action colspan="4" height="160" width="400" name="%(account.action_invoice_tree1)d" string="Customer Invoices to Validate" domain="[('state','=','draft'),('type','=','out_invoice')]"/>
|
||||
<action colspan="4" height="160" width="400" name="%(account.action_invoice_tree1)d" string="Customer Invoices to Approve" domain="[('state','=','draft'),('type','=','out_invoice')]"/>
|
||||
<action colspan="4" height="160" width="400" name="%(action_company_analysis_tree)d" string="Company Analysis" />
|
||||
</child1>
|
||||
<child2>
|
||||
<action colspan="4" height="220" name="%(action_treasory_graph)d" string="Treasory"/>
|
||||
<action colspan="4" height="220" name="%(action_aged_receivable)d" string="Aged receivables"/>
|
||||
<action colspan="4" height="220" name="%(action_treasory_graph)d" string="Treasury"/>
|
||||
<action colspan="4" height="220" name="%(action_aged_receivable)d" string="Aged Receivables"/>
|
||||
<!-- <action colspan="4" height="220" name="%(action_aged_income)d" string="Aged income"/> -->
|
||||
</child2>
|
||||
</hpaned>
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
<menuitem id="menu_dashboard_acc" name="Dashboard" sequence="2" parent="account.menu_finance_reporting" groups="group_account_user,group_account_manager"/>
|
||||
<menuitem action="open_board_account" icon="terp-graph" id="menu_board_account" parent="menu_dashboard_acc" sequence="1"/>
|
||||
<menuitem icon="terp-account" id="account.menu_finance" name="Accounting" sequence="13" action="open_board_account"/>
|
||||
<menuitem icon="terp-account" id="account.menu_finance" name="Accounting" sequence="14" action="open_board_account"/>
|
||||
|
||||
|
||||
</data>
|
||||
|
||||
@@ -32,14 +32,15 @@ class res_company(osv.osv):
|
||||
string="Reserve and Profit/Loss Account",
|
||||
method=True,
|
||||
view_load=True,
|
||||
domain="[('type', '=', 'payable')]",
|
||||
domain="[('type', '=', 'other')]",
|
||||
help="This Account is used for transferring Profit/Loss(If It is Profit: Amount will be added, Loss : Amount will be deducted.), Which is calculated from Profit & Loss Report"),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'overdue_msg': 'Would your payment have been carried \
|
||||
out after this mail was sent, please consider the present one as \
|
||||
void. Do not hesitate to contact our accounting department'
|
||||
'overdue_msg': 'Please note that the following payments are now due. If your payment \
|
||||
has been sent, kindly forward your payment details. If payment will be \
|
||||
delayed further, please contact us to discuss. \
|
||||
\nWould your payment have been carried out after this mail was sent, please consider the present one as void.'
|
||||
}
|
||||
|
||||
res_company()
|
||||
|
||||
@@ -220,7 +220,7 @@
|
||||
<field name="code">1113</field>
|
||||
<field name="name">Reserve and Profit/Loss Account</field>
|
||||
<field ref="conf_cli" name="parent_id"/>
|
||||
<field name="type">payable</field>
|
||||
<field name="type">other</field>
|
||||
<field eval="True" name="reconcile"/>
|
||||
<field name="user_type" ref="conf_account_type_liability"/>
|
||||
</record>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
-->
|
||||
<record id="account_payment_term" model="account.payment.term">
|
||||
<field name="name">30 Days End of Month</field>
|
||||
<field name="note">30 Days End of Month</field>
|
||||
</record>
|
||||
<record id="account_payment_term_line" model="account.payment.term.line">
|
||||
<field name="name">30 Days End of Month</field>
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
<field ref="cas" name="parent_id"/>
|
||||
<field name="type">receivable</field>
|
||||
<field eval="True" name="reconcile"/>
|
||||
<field name="user_type" ref="account_type_asset"/>
|
||||
<field name="user_type" ref="account_type_receivable"/>
|
||||
</record>
|
||||
|
||||
<record id="ova" model="account.account">
|
||||
@@ -186,7 +186,7 @@
|
||||
<field ref="cli" name="parent_id"/>
|
||||
<field name="type">payable</field>
|
||||
<field eval="True" name="reconcile"/>
|
||||
<field name="user_type" ref="account_type_liability"/>
|
||||
<field name="user_type" ref="account_type_payable"/>
|
||||
</record>
|
||||
|
||||
<record id="iva" model="account.account">
|
||||
@@ -201,7 +201,7 @@
|
||||
<field name="code">X1113</field>
|
||||
<field name="name">Reserve and Profit/Loss - (test)</field>
|
||||
<field ref="cli" name="parent_id"/>
|
||||
<field name="type">payable</field>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_liability"/>
|
||||
</record>
|
||||
|
||||
@@ -342,7 +342,7 @@
|
||||
|
||||
<record id="sales_journal" model="account.journal">
|
||||
<field name="name">Sales Journal - (test)</field>
|
||||
<field name="code">SAJ</field>
|
||||
<field name="code">TSAJ</field>
|
||||
<field name="type">sale</field>
|
||||
<field name="view_id" ref="account_sp_journal_view"/>
|
||||
<field name="sequence_id" ref="sequence_sale_journal"/>
|
||||
@@ -353,7 +353,7 @@
|
||||
</record>
|
||||
<record id="refund_sales_journal" model="account.journal">
|
||||
<field name="name">Sales Credit Note Journal - (test)</field>
|
||||
<field name="code">SCNJ</field>
|
||||
<field name="code">TSCNJ</field>
|
||||
<field name="type">sale_refund</field>
|
||||
<field eval="True" name="refund_journal"/>
|
||||
<field name="view_id" ref="account_sp_refund_journal_view"/>
|
||||
@@ -366,7 +366,7 @@
|
||||
|
||||
<record id="expenses_journal" model="account.journal">
|
||||
<field name="name">Expenses Journal - (test)</field>
|
||||
<field name="code">EXJ</field>
|
||||
<field name="code">TEXJ</field>
|
||||
<field name="type">purchase</field>
|
||||
<field name="view_id" ref="account_sp_journal_view"/>
|
||||
<field name="sequence_id" ref="sequence_purchase_journal"/>
|
||||
@@ -377,7 +377,7 @@
|
||||
</record>
|
||||
<record id="refund_expenses_journal" model="account.journal">
|
||||
<field name="name">Expenses Credit Notes Journal - (test)</field>
|
||||
<field name="code">ECNJ</field>
|
||||
<field name="code">TECNJ</field>
|
||||
<field name="type">purchase_refund</field>
|
||||
<field eval="True" name="refund_journal"/>
|
||||
<field name="view_id" ref="account_sp_refund_journal_view"/>
|
||||
@@ -390,7 +390,7 @@
|
||||
|
||||
<record id="bank_journal" model="account.journal">
|
||||
<field name="name">Bank Journal - (test)</field>
|
||||
<field name="code">BNK</field>
|
||||
<field name="code">TBNK</field>
|
||||
<field name="type">bank</field>
|
||||
<field name="view_id" ref="account_journal_bank_view"/>
|
||||
<field name="sequence_id" ref="sequence_bank_journal"/>
|
||||
@@ -401,7 +401,7 @@
|
||||
</record>
|
||||
<record id="check_journal" model="account.journal">
|
||||
<field name="name">Checks Journal - (test)</field>
|
||||
<field name="code">CHK</field>
|
||||
<field name="code">TCHK</field>
|
||||
<field name="type">bank</field>
|
||||
<field name="view_id" ref="account_journal_bank_view"/>
|
||||
<field name="sequence_id" ref="sequence_check_journal"/>
|
||||
@@ -412,7 +412,7 @@
|
||||
</record>
|
||||
<record id="cash_journal" model="account.journal">
|
||||
<field name="name">Cash Journal - (test)</field>
|
||||
<field name="code">CSH</field>
|
||||
<field name="code">TCSH</field>
|
||||
<field name="type">cash</field>
|
||||
<field name="view_id" ref="account_journal_bank_view"/>
|
||||
<field name="sequence_id" ref="sequence_cash_journal"/>
|
||||
|
||||
+898
-648
File diff suppressed because it is too large
Load Diff
+8348
-5019
File diff suppressed because it is too large
Load Diff
+8910
-5264
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+9839
-5341
File diff suppressed because it is too large
Load Diff
+10036
-5261
File diff suppressed because it is too large
Load Diff
+8471
-5016
File diff suppressed because it is too large
Load Diff
+8402
-4996
File diff suppressed because it is too large
Load Diff
+10743
-5364
File diff suppressed because it is too large
Load Diff
+9876
-5526
File diff suppressed because it is too large
Load Diff
+10345
-5491
File diff suppressed because it is too large
Load Diff
+9774
-5509
File diff suppressed because it is too large
Load Diff
+10640
-5178
File diff suppressed because it is too large
Load Diff
+9040
-5170
File diff suppressed because it is too large
Load Diff
+8298
-5011
File diff suppressed because it is too large
Load Diff
+8293
-5025
File diff suppressed because it is too large
Load Diff
+9856
-5381
File diff suppressed because it is too large
Load Diff
+10486
-5364
File diff suppressed because it is too large
Load Diff
+8469
-5061
File diff suppressed because it is too large
Load Diff
+8331
-5035
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+9517
-5181
File diff suppressed because it is too large
Load Diff
+8580
-4996
File diff suppressed because it is too large
Load Diff
+8688
-5048
File diff suppressed because it is too large
Load Diff
+9400
-5072
File diff suppressed because it is too large
Load Diff
+8292
-5011
File diff suppressed because it is too large
Load Diff
+8447
-5053
File diff suppressed because it is too large
Load Diff
+9476
-5421
File diff suppressed because it is too large
Load Diff
+8867
-5214
File diff suppressed because it is too large
Load Diff
+10108
-5315
File diff suppressed because it is too large
Load Diff
+8291
-5020
File diff suppressed because it is too large
Load Diff
+10009
-5497
File diff suppressed because it is too large
Load Diff
+8918
-5150
File diff suppressed because it is too large
Load Diff
+8511
-5060
File diff suppressed because it is too large
Load Diff
+10082
-5565
File diff suppressed because it is too large
Load Diff
+9998
-5154
File diff suppressed because it is too large
Load Diff
+9972
-5604
File diff suppressed because it is too large
Load Diff
+10115
-5380
File diff suppressed because it is too large
Load Diff
+9334
-5212
File diff suppressed because it is too large
Load Diff
+8289
-5012
File diff suppressed because it is too large
Load Diff
+8337
-5020
File diff suppressed because it is too large
Load Diff
+9295
-5095
File diff suppressed because it is too large
Load Diff
+8521
-5074
File diff suppressed because it is too large
Load Diff
+9897
-5376
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+9722
-5053
File diff suppressed because it is too large
Load Diff
+8294
-5010
File diff suppressed because it is too large
Load Diff
+8406
-5052
File diff suppressed because it is too large
Load Diff
+8304
-5021
File diff suppressed because it is too large
Load Diff
+8285
-5013
File diff suppressed because it is too large
Load Diff
+20249
-5106
File diff suppressed because it is too large
Load Diff
+8298
-5011
File diff suppressed because it is too large
Load Diff
+8892
-5137
File diff suppressed because it is too large
Load Diff
+9474
-5275
File diff suppressed because it is too large
Load Diff
+9853
-5156
File diff suppressed because it is too large
Load Diff
+8311
-5025
File diff suppressed because it is too large
Load Diff
+8306
-5013
File diff suppressed because it is too large
Load Diff
+66
-35
@@ -45,7 +45,7 @@ class account_installer(osv.osv_memory):
|
||||
ids = modules.search(cr, uid, [('category_id', '=', 'Account Charts')], context=context)
|
||||
charts = list(
|
||||
sorted(((m.name, m.shortdesc)
|
||||
for m in modules.browse(cr, uid, ids)),
|
||||
for m in modules.browse(cr, uid, ids, context=context)),
|
||||
key=itemgetter(1)))
|
||||
charts.insert(0, ('configurable', 'Generic Chart Of Account'))
|
||||
return charts
|
||||
@@ -86,8 +86,8 @@ class account_installer(osv.osv_memory):
|
||||
return 'configurable'
|
||||
|
||||
_defaults = {
|
||||
'date_start': time.strftime('%Y-01-01'),
|
||||
'date_stop': time.strftime('%Y-12-31'),
|
||||
'date_start': lambda *a: time.strftime('%Y-01-01'),
|
||||
'date_stop': lambda *a: time.strftime('%Y-12-31'),
|
||||
'period': 'month',
|
||||
'sale_tax': 0.0,
|
||||
'purchase_tax': 0.0,
|
||||
@@ -95,6 +95,25 @@ class account_installer(osv.osv_memory):
|
||||
'bank_accounts_id': _get_default_accounts,
|
||||
'charts': _get_default_charts
|
||||
}
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
res = super(account_installer, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
|
||||
configured_cmp = []
|
||||
unconfigured_cmp = []
|
||||
cmp_select = []
|
||||
company_ids = self.pool.get('res.company').search(cr, uid, [], context=context)
|
||||
cr.execute("SELECT company_id FROM account_account WHERE account_account.parent_id IS NULL")
|
||||
for r in cr.fetchall():
|
||||
configured_cmp.append(r[0])
|
||||
unconfigured_cmp = list(set(company_ids)-set(configured_cmp))
|
||||
if unconfigured_cmp:
|
||||
for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp):
|
||||
cmp_select.append((line.id,line.name))
|
||||
for field in res['fields']:
|
||||
if field == 'company_id':
|
||||
res['fields'][field]['domain'] = unconfigured_cmp
|
||||
res['fields'][field]['selection'] = cmp_select
|
||||
return res
|
||||
|
||||
def on_change_tax(self, cr, uid, id, tax):
|
||||
return {'value': {'purchase_tax': tax}}
|
||||
@@ -125,8 +144,8 @@ class account_installer(osv.osv_memory):
|
||||
obj_tax_fp = self.pool.get('account.fiscal.position.tax')
|
||||
obj_ac_fp = self.pool.get('account.fiscal.position.account')
|
||||
|
||||
result = mod_obj._get_id(cr, uid, 'account', 'configurable_chart_template')
|
||||
id = mod_obj.read(cr, uid, [result], ['res_id'], context=context)[0]['res_id']
|
||||
result = mod_obj.get_object_reference(cr, uid, 'account', 'configurable_chart_template')
|
||||
id = result and result[1] or False
|
||||
obj_multi = obj_acc_chart_template.browse(cr, uid, id, context=context)
|
||||
|
||||
record = self.browse(cr, uid, ids, context=context)[0]
|
||||
@@ -188,7 +207,8 @@ class account_installer(osv.osv_memory):
|
||||
'include_base_amount': tax.include_base_amount,
|
||||
'description': tax.description,
|
||||
'company_id': company_id.id,
|
||||
'type_tax_use': tax.type_tax_use
|
||||
'type_tax_use': tax.type_tax_use,
|
||||
'price_include': tax.price_include
|
||||
}
|
||||
new_tax = obj_acc_tax.create(cr, uid, vals_tax, context=context)
|
||||
#as the accounts have not been created yet, we have to wait before filling these fields
|
||||
@@ -199,7 +219,8 @@ class account_installer(osv.osv_memory):
|
||||
tax_template_ref[tax.id] = new_tax
|
||||
|
||||
#deactivate the parent_store functionnality on account_account for rapidity purpose
|
||||
self.pool._init = True
|
||||
ctx = context and context.copy() or {}
|
||||
ctx['defer_parent_store_computation'] = True
|
||||
|
||||
children_acc_template = obj_acc_template.search(cr, uid, [('parent_id', 'child_of', [obj_acc_root.id]), ('nocreate', '!=', True)], context=context)
|
||||
children_acc_template.sort()
|
||||
@@ -228,7 +249,7 @@ class account_installer(osv.osv_memory):
|
||||
'tax_ids': [(6, 0, tax_ids)],
|
||||
'company_id': company_id.id,
|
||||
}
|
||||
new_account = obj_acc.create(cr, uid, vals, context=context)
|
||||
new_account = obj_acc.create(cr, uid, vals, context=ctx)
|
||||
acc_template_ref[account_template.id] = new_account
|
||||
if account_template.name == 'Bank Current Account':
|
||||
b_vals = {
|
||||
@@ -242,19 +263,19 @@ class account_installer(osv.osv_memory):
|
||||
'tax_ids': [(6,0,tax_ids)],
|
||||
'company_id': company_id.id,
|
||||
}
|
||||
bank_account = obj_acc.create(cr, uid, b_vals, context=context)
|
||||
bank_account = obj_acc.create(cr, uid, b_vals, context=ctx)
|
||||
|
||||
view_id_cash = obj_acc_journal_view.search(cr, uid, [('name', '=', 'Bank/Cash Journal View')], context=context)[0] #why fixed name here?
|
||||
view_id_cur = obj_acc_journal_view.search(cr, uid, [('name', '=', 'Bank/Cash Journal (Multi-Currency) View')], context=context)[0] #Why Fixed name here?
|
||||
|
||||
cash_result = mod_obj._get_id(cr, uid, 'account', 'conf_account_type_cash')
|
||||
cash_type_id = mod_obj.read(cr, uid, [cash_result], ['res_id'], context=context)[0]['res_id']
|
||||
cash_result = mod_obj.get_object_reference(cr, uid, 'account', 'conf_account_type_cash')
|
||||
cash_type_id = cash_result and cash_result[1] or False
|
||||
|
||||
bank_result = mod_obj._get_id(cr, uid, 'account', 'conf_account_type_bnk')
|
||||
bank_type_id = mod_obj.read(cr, uid, [bank_result], ['res_id'], context=context)[0]['res_id']
|
||||
bank_result = mod_obj.get_object_reference(cr, uid, 'account', 'conf_account_type_bnk')
|
||||
bank_type_id = bank_result and bank_result[1] or False
|
||||
|
||||
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'], context=context)[0]['res_id']
|
||||
check_result = mod_obj.get_object_reference(cr, uid, 'account', 'conf_account_type_chk')
|
||||
check_type_id = check_result and check_result[1] or False
|
||||
|
||||
# record = self.browse(cr, uid, ids, context=context)[0]
|
||||
code_cnt = 1
|
||||
@@ -262,6 +283,7 @@ class account_installer(osv.osv_memory):
|
||||
'name': _('Bank Journal '),
|
||||
'code': 'account.journal',
|
||||
'prefix': 'BNK/%(year)s/',
|
||||
'company_id': company_id.id,
|
||||
'padding': 5
|
||||
}
|
||||
seq_id = obj_sequence.create(cr, uid, vals_seq, context=context)
|
||||
@@ -274,6 +296,7 @@ class account_installer(osv.osv_memory):
|
||||
'code': _('BNK'),
|
||||
'sequence_id': seq_id,
|
||||
'type': 'bank',
|
||||
'company_id': company_id.id,
|
||||
'analytic_journal_id': analitical_journal_bank
|
||||
}
|
||||
if vals.get('currency_id', False):
|
||||
@@ -310,7 +333,7 @@ class account_installer(osv.osv_memory):
|
||||
'parent_id': bank_account,
|
||||
'company_id': company_id.id
|
||||
}
|
||||
child_bnk_acc = obj_acc.create(cr, uid, vals_bnk, context=context)
|
||||
child_bnk_acc = obj_acc.create(cr, uid, vals_bnk, context=ctx)
|
||||
vals_seq_child = {
|
||||
'name': _(vals_bnk['name'] + ' ' + 'Journal'),
|
||||
'code': 'account.journal',
|
||||
@@ -326,6 +349,7 @@ class account_installer(osv.osv_memory):
|
||||
'code': _(vals_bnk['name'][:3]).upper(),
|
||||
'sequence_id': seq_id,
|
||||
'type': 'cash',
|
||||
'company_id': company_id.id
|
||||
}
|
||||
if vals.get('currency_id', False):
|
||||
vals_journal.update({
|
||||
@@ -343,7 +367,6 @@ class account_installer(osv.osv_memory):
|
||||
code_cnt += 1
|
||||
|
||||
#reactivate the parent_store functionality on account_account
|
||||
self.pool._init = False
|
||||
obj_acc._parent_store_compute(cr)
|
||||
|
||||
for key, value in todo_dict.items():
|
||||
@@ -365,28 +388,32 @@ class account_installer(osv.osv_memory):
|
||||
'name': 'Sale Journal',
|
||||
'code': 'account.journal',
|
||||
'prefix': 'SAJ/%(year)s/',
|
||||
'padding': 3
|
||||
'padding': 3,
|
||||
'company_id': company_id.id
|
||||
}
|
||||
seq_id_sale = obj_sequence.create(cr, uid, seq_sale, context=context)
|
||||
seq_purchase = {
|
||||
'name': 'Purchase Journal',
|
||||
'code': 'account.journal',
|
||||
'prefix': 'EXJ/%(year)s/',
|
||||
'padding': 3
|
||||
'padding': 3,
|
||||
'company_id': company_id.id
|
||||
}
|
||||
seq_id_purchase = obj_sequence.create(cr, uid, seq_purchase, context=context)
|
||||
seq_refund_sale = {
|
||||
'name': 'Sales Refund Journal',
|
||||
'code': 'account.journal',
|
||||
'prefix': 'SCNJ/%(year)s/',
|
||||
'padding': 3
|
||||
'padding': 3,
|
||||
'company_id': company_id.id
|
||||
}
|
||||
seq_id_sale_refund = obj_sequence.create(cr, uid, seq_refund_sale, context=context)
|
||||
seq_refund_purchase = {
|
||||
'name': 'Purchase Refund Journal',
|
||||
'code': 'account.journal',
|
||||
'prefix': 'ECNJ/%(year)s/',
|
||||
'padding': 3
|
||||
'padding': 3,
|
||||
'company_id': company_id.id
|
||||
}
|
||||
seq_id_purchase_refund = obj_sequence.create(cr, uid, seq_refund_purchase, context=context)
|
||||
else:
|
||||
@@ -406,7 +433,8 @@ class account_installer(osv.osv_memory):
|
||||
'type': 'sale',
|
||||
'code': _('SAJ'),
|
||||
'sequence_id': seq_id_sale,
|
||||
'analytic_journal_id': analitical_journal_sale
|
||||
'analytic_journal_id': analitical_journal_sale,
|
||||
'company_id': company_id.id
|
||||
})
|
||||
|
||||
if obj_multi.property_account_receivable:
|
||||
@@ -425,7 +453,8 @@ class account_installer(osv.osv_memory):
|
||||
'type': 'purchase',
|
||||
'code': _('EXJ'),
|
||||
'sequence_id': seq_id_purchase,
|
||||
'analytic_journal_id': analitical_journal_purchase
|
||||
'analytic_journal_id': analitical_journal_purchase,
|
||||
'company_id': company_id.id
|
||||
})
|
||||
|
||||
if obj_multi.property_account_payable:
|
||||
@@ -449,7 +478,8 @@ class account_installer(osv.osv_memory):
|
||||
'refund_journal': True,
|
||||
'code': _('SCNJ'),
|
||||
'sequence_id': seq_id_sale_refund,
|
||||
'analytic_journal_id': analitical_journal_sale
|
||||
'analytic_journal_id': analitical_journal_sale,
|
||||
'company_id': company_id.id
|
||||
}
|
||||
if obj_multi.property_account_receivable:
|
||||
vals_journal.update({
|
||||
@@ -467,7 +497,8 @@ class account_installer(osv.osv_memory):
|
||||
'refund_journal': True,
|
||||
'code': _('ECNJ'),
|
||||
'sequence_id': seq_id_purchase_refund,
|
||||
'analytic_journal_id': analitical_journal_purchase
|
||||
'analytic_journal_id': analitical_journal_purchase,
|
||||
'company_id': company_id.id
|
||||
}
|
||||
|
||||
if obj_multi.property_account_payable:
|
||||
@@ -559,8 +590,9 @@ class account_installer(osv.osv_memory):
|
||||
tax_val = {}
|
||||
default_tax = []
|
||||
|
||||
pur_temp_tax = mod_obj._get_id(cr, uid, 'account', 'tax_code_base_purchases')
|
||||
pur_temp_tax_id = mod_obj.read(cr, uid, [pur_temp_tax], ['res_id'], context=context)[0]['res_id']
|
||||
pur_temp_tax = mod_obj.get_object_reference(cr, uid, 'account', 'tax_code_base_purchases')
|
||||
pur_temp_tax_id = pur_temp_tax and pur_temp_tax[1] or False
|
||||
|
||||
pur_temp_tax_names = obj_temp_tax_code.read(cr, uid, [pur_temp_tax_id], ['name'], context=context)
|
||||
pur_tax_parent_name = pur_temp_tax_names and pur_temp_tax_names[0]['name'] or False
|
||||
pur_taxcode_parent_id = obj_tax_code.search(cr, uid, [('name', 'ilike', pur_tax_parent_name)], context=context)
|
||||
@@ -568,9 +600,8 @@ class account_installer(osv.osv_memory):
|
||||
pur_taxcode_parent_id = pur_taxcode_parent_id[0]
|
||||
else:
|
||||
pur_taxcode_parent_id = False
|
||||
|
||||
pur_temp_tax_paid = mod_obj._get_id(cr, uid, 'account', 'tax_code_input')
|
||||
pur_temp_tax_paid_id = mod_obj.read(cr, uid, [pur_temp_tax_paid], ['res_id'], context=context)[0]['res_id']
|
||||
pur_temp_tax_paid = mod_obj.get_object_reference(cr, uid, 'account', 'tax_code_input')
|
||||
pur_temp_tax_paid_id = pur_temp_tax_paid and pur_temp_tax_paid[1] or False
|
||||
pur_temp_tax_paid_names = obj_temp_tax_code.read(cr, uid, [pur_temp_tax_paid_id], ['name'], context=context)
|
||||
pur_tax_paid_parent_name = pur_temp_tax_names and pur_temp_tax_paid_names[0]['name'] or False
|
||||
pur_taxcode_paid_parent_id = obj_tax_code.search(cr, uid, [('name', 'ilike', pur_tax_paid_parent_name)], context=context)
|
||||
@@ -579,8 +610,8 @@ class account_installer(osv.osv_memory):
|
||||
else:
|
||||
pur_taxcode_paid_parent_id = False
|
||||
|
||||
sale_temp_tax = mod_obj._get_id(cr, uid, 'account', 'tax_code_base_sales')
|
||||
sale_temp_tax_id = mod_obj.read(cr, uid, [sale_temp_tax], ['res_id'], context=context)[0]['res_id']
|
||||
sale_temp_tax = mod_obj.get_object_reference(cr, uid, 'account', 'tax_code_base_sales')
|
||||
sale_temp_tax_id = sale_temp_tax and sale_temp_tax[1] or False
|
||||
sale_temp_tax_names = obj_temp_tax_code.read(cr, uid, [sale_temp_tax_id], ['name'], context=context)
|
||||
sale_tax_parent_name = sale_temp_tax_names and sale_temp_tax_names[0]['name'] or False
|
||||
sale_taxcode_parent_id = obj_tax_code.search(cr, uid, [('name', 'ilike', sale_tax_parent_name)], context=context)
|
||||
@@ -589,8 +620,8 @@ class account_installer(osv.osv_memory):
|
||||
else:
|
||||
sale_taxcode_parent_id = False
|
||||
|
||||
sale_temp_tax_paid = mod_obj._get_id(cr, uid, 'account', 'tax_code_output')
|
||||
sale_temp_tax_paid_id = mod_obj.read(cr, uid, [sale_temp_tax_paid], ['res_id'], context=context)[0]['res_id']
|
||||
sale_temp_tax_paid = mod_obj.get_object_reference(cr, uid, 'account', 'tax_code_output')
|
||||
sale_temp_tax_paid_id = sale_temp_tax_paid and sale_temp_tax_paid[1] or False
|
||||
sale_temp_tax_paid_names = obj_temp_tax_code.read(cr, uid, [sale_temp_tax_paid_id], ['name'], context=context)
|
||||
sale_tax_paid_parent_name = sale_temp_tax_paid_names and sale_temp_tax_paid_names[0]['name'] or False
|
||||
sale_taxcode_paid_parent_id = obj_tax_code.search(cr, uid, [('name', 'ilike', sale_tax_paid_parent_name)], context=context)
|
||||
@@ -749,4 +780,4 @@ class account_installer_modules(osv.osv_memory):
|
||||
|
||||
account_installer_modules()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
+66
-50
@@ -60,7 +60,7 @@ class account_invoice(osv.osv):
|
||||
return res and res[0] or False
|
||||
|
||||
def _get_currency(self, cr, uid, context=None):
|
||||
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, [uid])[0]
|
||||
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, [uid], context=context)[0]
|
||||
if user.company_id:
|
||||
return user.company_id.currency_id.id
|
||||
return pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('rate','=', 1.0)])[0]
|
||||
@@ -89,11 +89,11 @@ class account_invoice(osv.osv):
|
||||
|
||||
def _amount_residual(self, cr, uid, ids, name, args, context=None):
|
||||
res = {}
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
data_inv = self.browse(cr, uid, ids)
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
data_inv = self.browse(cr, uid, ids, context=context)
|
||||
for inv in data_inv:
|
||||
debit = credit = 0.0
|
||||
context.update({'date':inv.date_invoice})
|
||||
@@ -168,7 +168,7 @@ class account_invoice(osv.osv):
|
||||
|
||||
def _compute_lines(self, cr, uid, ids, name, args, context=None):
|
||||
result = {}
|
||||
for invoice in self.browse(cr, uid, ids, context):
|
||||
for invoice in self.browse(cr, uid, ids, context=context):
|
||||
src = []
|
||||
lines = []
|
||||
if invoice.move_id:
|
||||
@@ -187,7 +187,7 @@ class account_invoice(osv.osv):
|
||||
|
||||
def _get_invoice_from_line(self, cr, uid, ids, context=None):
|
||||
move = {}
|
||||
for line in self.pool.get('account.move.line').browse(cr, uid, ids):
|
||||
for line in self.pool.get('account.move.line').browse(cr, uid, ids, context=context):
|
||||
if line.reconcile_partial_id:
|
||||
for line2 in line.reconcile_partial_id.line_partial_ids:
|
||||
move[line2.move_id.id] = True
|
||||
@@ -201,7 +201,7 @@ class account_invoice(osv.osv):
|
||||
|
||||
def _get_invoice_from_reconcile(self, cr, uid, ids, context=None):
|
||||
move = {}
|
||||
for r in self.pool.get('account.move.reconcile').browse(cr, uid, ids):
|
||||
for r in self.pool.get('account.move.reconcile').browse(cr, uid, ids, context=context):
|
||||
for line in r.line_partial_ids:
|
||||
move[line.move_id.id] = True
|
||||
for line in r.line_id:
|
||||
@@ -263,26 +263,26 @@ class account_invoice(osv.osv):
|
||||
'invoice_line': fields.one2many('account.invoice.line', 'invoice_id', 'Invoice Lines', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'tax_line': fields.one2many('account.invoice.tax', 'invoice_id', 'Tax Lines', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
|
||||
'move_id': fields.many2one('account.move', 'Journal Entry', readonly=True, help="Link to the automatically generated Journal Items."),
|
||||
'move_id': fields.many2one('account.move', 'Journal Entry', readonly=True, select=1, help="Link to the automatically generated Journal Items."),
|
||||
'amount_untaxed': fields.function(_amount_all, method=True, digits_compute=dp.get_precision('Account'), string='Untaxed',
|
||||
store={
|
||||
'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20),
|
||||
'account.invoice.tax': (_get_invoice_tax, None, 20),
|
||||
'account.invoice.line': (_get_invoice_line, ['price_unit','invoice_line_tax_id','quantity','discount'], 20),
|
||||
'account.invoice.line': (_get_invoice_line, ['price_unit','invoice_line_tax_id','quantity','discount','invoice_id'], 20),
|
||||
},
|
||||
multi='all'),
|
||||
'amount_tax': fields.function(_amount_all, method=True, digits_compute=dp.get_precision('Account'), string='Tax',
|
||||
store={
|
||||
'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20),
|
||||
'account.invoice.tax': (_get_invoice_tax, None, 20),
|
||||
'account.invoice.line': (_get_invoice_line, ['price_unit','invoice_line_tax_id','quantity','discount'], 20),
|
||||
'account.invoice.line': (_get_invoice_line, ['price_unit','invoice_line_tax_id','quantity','discount','invoice_id'], 20),
|
||||
},
|
||||
multi='all'),
|
||||
'amount_total': fields.function(_amount_all, method=True, digits_compute=dp.get_precision('Account'), string='Total',
|
||||
store={
|
||||
'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20),
|
||||
'account.invoice.tax': (_get_invoice_tax, None, 20),
|
||||
'account.invoice.line': (_get_invoice_line, ['price_unit','invoice_line_tax_id','quantity','discount'], 20),
|
||||
'account.invoice.line': (_get_invoice_line, ['price_unit','invoice_line_tax_id','quantity','discount','invoice_id'], 20),
|
||||
},
|
||||
multi='all'),
|
||||
'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
@@ -302,7 +302,7 @@ class account_invoice(osv.osv):
|
||||
store={
|
||||
'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 50),
|
||||
'account.invoice.tax': (_get_invoice_tax, None, 50),
|
||||
'account.invoice.line': (_get_invoice_line, ['price_unit','invoice_line_tax_id','quantity','discount'], 50),
|
||||
'account.invoice.line': (_get_invoice_line, ['price_unit','invoice_line_tax_id','quantity','discount','invoice_id'], 50),
|
||||
'account.move.line': (_get_invoice_from_line, None, 50),
|
||||
'account.move.reconcile': (_get_invoice_from_reconcile, None, 50),
|
||||
},
|
||||
@@ -326,17 +326,23 @@ class account_invoice(osv.osv):
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
|
||||
journal_obj = self.pool.get('account.journal')
|
||||
if context.get('active_model','') in ['res.partner']:
|
||||
partner = self.pool.get(context['active_model']).read(cr,uid,context['active_ids'],['supplier','customer'])[0]
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
if context.get('active_model', '') in ['res.partner'] and context.get('active_ids', False) and context['active_ids']:
|
||||
partner = self.pool.get(context['active_model']).read(cr, uid, context['active_ids'], ['supplier','customer'])[0]
|
||||
if not view_type:
|
||||
view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name','=','account.invoice.tree')])[0]
|
||||
view_id = self.pool.get('ir.ui.view').search(cr, uid, [('name', '=', 'account.invoice.tree')])
|
||||
view_type = 'tree'
|
||||
if view_type == 'form':
|
||||
if partner['supplier'] and not partner['customer']:
|
||||
view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name','=','account.invoice.supplier.form')])[0]
|
||||
view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name', '=', 'account.invoice.supplier.form')])
|
||||
else:
|
||||
view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name','=','account.invoice.form')])[0]
|
||||
view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name', '=', 'account.invoice.form')])
|
||||
if view_id and isinstance(view_id, (list, tuple)):
|
||||
view_id = view_id[0]
|
||||
res = super(account_invoice,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
|
||||
|
||||
type = context.get('journal_type', 'sale')
|
||||
for field in res['fields']:
|
||||
if field == 'journal_id':
|
||||
@@ -358,7 +364,7 @@ class account_invoice(osv.osv):
|
||||
if context is None:
|
||||
context = {}
|
||||
mob_obj = self.pool.get('ir.model.data')
|
||||
res = mob_obj.get_object_reference(cr, uid, 'account', 'invoice_form') or False
|
||||
res = mob_obj.get_object_reference(cr, uid, 'account', 'invoice_form')
|
||||
view_id = res and res[1] or False
|
||||
context.update({'view_id': view_id})
|
||||
return context
|
||||
@@ -380,7 +386,7 @@ class account_invoice(osv.osv):
|
||||
raise orm.except_orm(_('Configuration Error!'),
|
||||
_('There is no Accounting Journal of type Sale/Purchase defined!'))
|
||||
else:
|
||||
raise orm.except_orm(_('UnknownError'), str(e))
|
||||
raise orm.except_orm(_('Unknown Error'), str(e))
|
||||
|
||||
def confirm_paid(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state':'paid'}, context=context)
|
||||
@@ -390,7 +396,7 @@ class account_invoice(osv.osv):
|
||||
return True
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
invoices = self.read(cr, uid, ids, ['state'])
|
||||
invoices = self.read(cr, uid, ids, ['state'], context=context)
|
||||
unlink_ids = []
|
||||
for t in invoices:
|
||||
if t['state'] in ('draft', 'cancel'):
|
||||
@@ -571,7 +577,7 @@ class account_invoice(osv.osv):
|
||||
if journal_ids:
|
||||
val['journal_id'] = journal_ids[0]
|
||||
else:
|
||||
raise osv.except_osv(_('Configuration Error !'), _('Can\'t find any account journal of %s type for this company.\n\nYou can create one in the menu: \nConfiguration\Financial Accounting\Accounts\Journals.' % (journal_type)))
|
||||
raise osv.except_osv(_('Configuration Error !'), (_('Can\'t find any account journal of %s type for this company.\n\nYou can create one in the menu: \nConfiguration\Financial Accounting\Accounts\Journals.') % (journal_type)))
|
||||
dom = {'journal_id': [('id', 'in', journal_ids)]}
|
||||
else:
|
||||
journal_ids = obj_journal.search(cr, uid, [])
|
||||
@@ -596,6 +602,7 @@ class account_invoice(osv.osv):
|
||||
self.write(cr, uid, ids, {'state':'draft'})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for inv_id in ids:
|
||||
wf_service.trg_delete(uid, 'account.invoice', inv_id, cr)
|
||||
wf_service.trg_create(uid, 'account.invoice', inv_id, cr)
|
||||
return True
|
||||
|
||||
@@ -657,7 +664,7 @@ class account_invoice(osv.osv):
|
||||
ctx = context.copy()
|
||||
ait_obj = self.pool.get('account.invoice.tax')
|
||||
for id in ids:
|
||||
cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s", (id,))
|
||||
cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s AND manual is False", (id,))
|
||||
partner = self.browse(cr, uid, id, context=ctx).partner_id
|
||||
if partner.lang:
|
||||
ctx.update({'lang': partner.lang})
|
||||
@@ -669,7 +676,7 @@ class account_invoice(osv.osv):
|
||||
|
||||
def button_compute(self, cr, uid, ids, context=None, set_total=False):
|
||||
self.button_reset_taxes(cr, uid, ids, context)
|
||||
for inv in self.browse(cr, uid, ids):
|
||||
for inv in self.browse(cr, uid, ids, context=context):
|
||||
if set_total:
|
||||
self.pool.get('account.invoice').write(cr, uid, [inv.id], {'check_total': inv.amount_total})
|
||||
return True
|
||||
@@ -823,9 +830,9 @@ class account_invoice(osv.osv):
|
||||
# one move line per invoice line
|
||||
iml = self._get_analytic_lines(cr, uid, inv.id)
|
||||
# check if taxes are all computed
|
||||
|
||||
context.update({'lang': inv.partner_id.lang})
|
||||
compute_taxes = ait_obj.compute(cr, uid, inv.id, context=context)
|
||||
ctx = context.copy()
|
||||
ctx.update({'lang': inv.partner_id.lang})
|
||||
compute_taxes = ait_obj.compute(cr, uid, inv.id, context=ctx)
|
||||
self.check_tax_lines(cr, uid, inv, compute_taxes, ait_obj)
|
||||
|
||||
if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0):
|
||||
@@ -981,7 +988,7 @@ class account_invoice(osv.osv):
|
||||
#TODO: not correct fix but required a frech values before reading it.
|
||||
self.write(cr, uid, ids, {})
|
||||
|
||||
for obj_inv in self.browse(cr, uid, ids):
|
||||
for obj_inv in self.browse(cr, uid, ids, context=context):
|
||||
id = obj_inv.id
|
||||
invtype = obj_inv.type
|
||||
number = obj_inv.number
|
||||
@@ -1063,7 +1070,7 @@ class account_invoice(osv.osv):
|
||||
'out_refund': 'OR: ',
|
||||
'in_refund': 'SR: ',
|
||||
}
|
||||
return [(r['id'], types[r['type']]+(r['number'] or '')+' '+(r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')]
|
||||
return [(r['id'], (r['number']) or types[r['type']] + (r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')]
|
||||
|
||||
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
|
||||
if not args:
|
||||
@@ -1072,9 +1079,9 @@ class account_invoice(osv.osv):
|
||||
context = {}
|
||||
ids = []
|
||||
if name:
|
||||
ids = self.search(cr, user, [('number','=',name)]+ args, limit=limit, context=context)
|
||||
ids = self.search(cr, user, [('number','=',name)] + args, limit=limit, context=context)
|
||||
if not ids:
|
||||
ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit, context=context)
|
||||
ids = self.search(cr, user, [('name',operator,name)] + args, limit=limit, context=context)
|
||||
return self.name_get(cr, user, ids, context)
|
||||
|
||||
def _refund_cleanup_lines(self, cr, uid, lines):
|
||||
@@ -1149,7 +1156,7 @@ class account_invoice(osv.osv):
|
||||
context = {}
|
||||
#TODO check if we can use different period for payment and the writeoff line
|
||||
assert len(ids)==1, "Can only pay one invoice at a time"
|
||||
invoice = self.browse(cr, uid, ids[0])
|
||||
invoice = self.browse(cr, uid, ids[0], context=context)
|
||||
src_account_id = invoice.account_id.id
|
||||
# Take the seq as name for move
|
||||
types = {'out_invoice': -1, 'in_invoice': 1, 'out_refund': 1, 'in_refund': -1}
|
||||
@@ -1232,7 +1239,7 @@ class account_invoice(osv.osv):
|
||||
if (not round(total,self.pool.get('decimal.precision').precision_get(cr, uid, 'Account'))) or writeoff_acc_id:
|
||||
self.pool.get('account.move.line').reconcile(cr, uid, line_ids, 'manual', writeoff_acc_id, writeoff_period_id, writeoff_journal_id, context)
|
||||
else:
|
||||
code = invoice.currency_id.code
|
||||
code = invoice.currency_id.symbol
|
||||
# TODO: use currency's formatting function
|
||||
msg = _("Invoice '%s' is paid partially: %s%s of %s%s (%s%s remaining)") % \
|
||||
(name, pay_amount, code, invoice.amount_total, code, total, code)
|
||||
@@ -1313,9 +1320,9 @@ class account_invoice_line(osv.osv):
|
||||
return {'value': {'categ_id': False}, 'domain':{'product_uom':[]}}
|
||||
else:
|
||||
return {'value': {'price_unit': 0.0, 'categ_id': False}, 'domain':{'product_uom':[]}}
|
||||
part = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||
part = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
|
||||
fpos_obj = self.pool.get('account.fiscal.position')
|
||||
fpos = fposition_id and fpos_obj.browse(cr, uid, fposition_id) or False
|
||||
fpos = fposition_id and fpos_obj.browse(cr, uid, fposition_id, context=context) or False
|
||||
|
||||
if part.lang:
|
||||
context.update({'lang': part.lang})
|
||||
@@ -1345,7 +1352,7 @@ class account_invoice_line(osv.osv):
|
||||
# Parse the value_reference field to get the ID of the account.account record
|
||||
account_id = int (my_value[0]["value_reference"].split(",")[1])
|
||||
# Use the ID of the account.account record in the browse for the account.account record
|
||||
app_acc_in = account_obj.browse(cr, uid, [account_id])[0]
|
||||
app_acc_in = account_obj.browse(cr, uid, account_id, context=context)
|
||||
if not exp_pro_id:
|
||||
ex_acc = res.product_tmpl_id.property_account_expense
|
||||
ex_acc_cate = res.categ_id.property_account_expense_categ
|
||||
@@ -1354,7 +1361,7 @@ class account_invoice_line(osv.osv):
|
||||
else:
|
||||
app_acc_exp = ex_acc_cate
|
||||
else:
|
||||
app_acc_exp = account_obj.browse(cr, uid, exp_pro_id)[0]
|
||||
app_acc_exp = account_obj.browse(cr, uid, exp_pro_id, context=context)[0]
|
||||
if not in_pro_id and not exp_pro_id:
|
||||
in_acc = res.product_tmpl_id.property_account_income
|
||||
in_acc_cate = res.categ_id.property_account_income_categ
|
||||
@@ -1372,8 +1379,8 @@ class account_invoice_line(osv.osv):
|
||||
if not in_res_id and not exp_res_id:
|
||||
raise osv.except_osv(_('Configuration Error !'),
|
||||
_('Can not find account chart for this company, Please Create account.'))
|
||||
in_obj_acc = account_obj.browse(cr, uid, in_res_id)
|
||||
exp_obj_acc = account_obj.browse(cr, uid, exp_res_id)
|
||||
in_obj_acc = account_obj.browse(cr, uid, in_res_id, context=context)
|
||||
exp_obj_acc = account_obj.browse(cr, uid, exp_res_id, context=context)
|
||||
if in_acc or ex_acc:
|
||||
res.product_tmpl_id.property_account_income = in_obj_acc[0]
|
||||
res.product_tmpl_id.property_account_expense = exp_obj_acc[0]
|
||||
@@ -1389,23 +1396,20 @@ class account_invoice_line(osv.osv):
|
||||
a = res.product_tmpl_id.property_account_expense.id
|
||||
if not a:
|
||||
a = res.categ_id.property_account_expense_categ.id
|
||||
|
||||
a = fpos_obj.map_account(cr, uid, fpos, a)
|
||||
if a:
|
||||
result['account_id'] = a
|
||||
|
||||
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)
|
||||
taxes = res.taxes_id and res.taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False)
|
||||
else:
|
||||
taxes = res.supplier_taxes_id and res.supplier_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)
|
||||
taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False)
|
||||
tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes)
|
||||
|
||||
if type in ('in_invoice', 'in_refund'):
|
||||
result.update( {'price_unit': price_unit or res.standard_price,'invoice_line_tax_id': tax_id} )
|
||||
else:
|
||||
result.update({'price_unit': res.list_price, 'invoice_line_tax_id': tax_id})
|
||||
|
||||
# if not name:
|
||||
result['name'] = res.partner_ref
|
||||
|
||||
domain = {}
|
||||
@@ -1421,8 +1425,8 @@ class account_invoice_line(osv.osv):
|
||||
if not company_id or not currency_id:
|
||||
return res_final
|
||||
|
||||
company = self.pool.get('res.company').browse(cr, uid, company_id)
|
||||
currency = self.pool.get('res.currency').browse(cr, uid, currency_id)
|
||||
company = self.pool.get('res.company').browse(cr, uid, company_id, context=context)
|
||||
currency = self.pool.get('res.currency').browse(cr, uid, currency_id, context=context)
|
||||
|
||||
if company.currency_id.id != currency.id:
|
||||
new_price = res_final['value']['price_unit'] * currency.rate
|
||||
@@ -1436,18 +1440,30 @@ class account_invoice_line(osv.osv):
|
||||
return res_final
|
||||
|
||||
def uos_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None):
|
||||
res = self.product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id, context)
|
||||
warning = {}
|
||||
res = self.product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id, context=context)
|
||||
if 'uos_id' in res['value']:
|
||||
del res['value']['uos_id']
|
||||
if not uom:
|
||||
res['value']['price_unit'] = 0.0
|
||||
if product and uom:
|
||||
prod = self.pool.get('product.product').browse(cr, uid, product, context=context)
|
||||
prod_uom = self.pool.get('product.uom').browse(cr, uid, uom, context=context)
|
||||
if prod.uom_id.category_id.id != prod_uom.category_id.id:
|
||||
warning = {
|
||||
'title': _('Warning!'),
|
||||
'message': _('You selected an Unit of Measure which is not compatible with the product.')
|
||||
}
|
||||
return {'value': res['value'], 'warning': warning}
|
||||
return res
|
||||
|
||||
def move_line_get(self, cr, uid, invoice_id, context=None):
|
||||
res = []
|
||||
tax_obj = self.pool.get('account.tax')
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id)
|
||||
if context is None:
|
||||
context = {}
|
||||
inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context=context)
|
||||
company_currency = inv.company_id.currency_id.id
|
||||
|
||||
for line in inv.invoice_line:
|
||||
@@ -1578,11 +1594,11 @@ class account_invoice_tax(osv.osv):
|
||||
'base_amount': 0.0,
|
||||
'tax_amount': 0.0,
|
||||
}
|
||||
def compute(self, cr, uid, invoice_id, context={}):
|
||||
def compute(self, cr, uid, invoice_id, context=None):
|
||||
tax_grouped = {}
|
||||
tax_obj = self.pool.get('account.tax')
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context)
|
||||
inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context=context)
|
||||
cur = inv.currency_id
|
||||
company_currency = inv.company_id.currency_id.id
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class account_fiscal_position(osv.osv):
|
||||
'note': fields.text('Notes', translate=True),
|
||||
}
|
||||
|
||||
def map_tax(self, cr, uid, fposition_id, taxes, context={}):
|
||||
def map_tax(self, cr, uid, fposition_id, taxes, context=None):
|
||||
if not taxes:
|
||||
return []
|
||||
if not fposition_id:
|
||||
@@ -51,7 +51,7 @@ class account_fiscal_position(osv.osv):
|
||||
result.append(t.id)
|
||||
return result
|
||||
|
||||
def map_account(self, cr, uid, fposition_id, account_id, context={}):
|
||||
def map_account(self, cr, uid, fposition_id, account_id, context=None):
|
||||
if not fposition_id:
|
||||
return account_id
|
||||
for pos in fposition_id.account_ids:
|
||||
@@ -134,10 +134,10 @@ class res_partner(osv.osv):
|
||||
return [('id','=','0')]
|
||||
return [('id','in',map(itemgetter(0), res))]
|
||||
|
||||
def _credit_search(self, cr, uid, obj, name, args, context):
|
||||
def _credit_search(self, cr, uid, obj, name, args, context=None):
|
||||
return self._asset_difference_search(cr, uid, obj, name, 'receivable', args, context=context)
|
||||
|
||||
def _debit_search(self, cr, uid, obj, name, args, context):
|
||||
def _debit_search(self, cr, uid, obj, name, args, context=None):
|
||||
return self._asset_difference_search(cr, uid, obj, name, 'payable', args, context=context)
|
||||
|
||||
_columns = {
|
||||
|
||||
@@ -27,7 +27,7 @@ class account_analytic_journal(osv.osv):
|
||||
_columns = {
|
||||
'name': fields.char('Journal Name', size=64, required=True),
|
||||
'code': fields.char('Journal Code', size=8),
|
||||
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the analytic journal without removing it."),
|
||||
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the analytic journal without removing it."),
|
||||
'type': fields.selection([('sale','Sale'), ('purchase','Purchase'), ('cash','Cash'), ('general','General'), ('situation','Situation')], 'Type', size=32, required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type."),
|
||||
'line_ids': fields.one2many('account.analytic.line', 'journal_id', 'Lines'),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True),
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Analytic Lines">
|
||||
<group col='6' colspan='4'>
|
||||
<filter name="sales" string="Sales" domain="[('journal_id.type','=','sale')]" icon="terp-check" help="Analytic Journal Items related to a sale journal."/>
|
||||
<filter name="sales" string="Sales" domain="[('journal_id.type','=','sale')]" icon="terp-camera_test" help="Analytic Journal Items related to a sale journal."/>
|
||||
<filter name="purchases" string="Purchases" domain="[('journal_id.type','=','purchase')]" icon="terp-purchase" help="Analytic Journal Items related to a purchase journal."/>
|
||||
<filter name="others" string="Others" domain="[('journal_id.type','in',('cash','general','situation'))]" icon="terp-folder-orange"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -337,7 +337,7 @@
|
||||
<field name="name">Analytic Journals</field>
|
||||
<field name="res_model">account.analytic.journal</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_analytic_journal_search" />
|
||||
</record>
|
||||
<menuitem groups="analytic.group_analytic_accounting,group_account_manager" action="action_account_analytic_journal_form" id="account_def_analytic_journal" parent="menu_analytic_accounting" sequence="5"/>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Analytic Balance" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
|
||||
<document filename="Analytic Balance.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Analytic Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
|
||||
<frame id="first" x1="31.0" y1="30.0" width="531" height="779"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
@@ -34,13 +34,13 @@
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="1,-1" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
|
||||
@@ -88,17 +88,9 @@
|
||||
<images/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<blockTable colWidths="482.0" style="Table_Header_analytic">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_header_Centre">Analytic Balance - [[ company.currency_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_space">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="55.0,221.0,55.0,52.0,60.0,39.0" style="Table_Header_Tile">
|
||||
<pto>
|
||||
<pto_header>
|
||||
<blockTable colWidths="57.0,192.0,71.0,71.0,71.0,71.0" style="Table_Header_Tile">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Code</para>
|
||||
@@ -120,24 +112,55 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_2">
|
||||
</pto_header>
|
||||
|
||||
<blockTable colWidths="532.0" style="Table_Header_analytic">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_header_Centre">Analytic Balance - [[ company.currency_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_space">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="54.0,222.0,56.0,51.0,62.0,38.0" style="Table1">
|
||||
<blockTable colWidths="57.0,192.0,71.0,71.0,71.0,71.0" style="Table_Header_Tile">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Code</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Account Name</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Credit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Quantity</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="57.0,192.0,71.0,71.0,71.0,71.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Total</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">
|
||||
<font color="white"></font>
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'debit')) ]]</para>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'debit')) ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'credit')) ]]</para>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'credit')) ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(sum_balance(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol]]</para>
|
||||
@@ -148,8 +171,8 @@
|
||||
</tr>
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(get_objects(data['form']['empty_acc']),'o') ]]</para>
|
||||
<blockTable colWidths="55.0,221.0,56.0,50.0,62.0,38.0" style="Table3">
|
||||
<para style="terp_default_2">[[ repeatIn(get_objects(data['form']['empty_acc']),'o') ]]</para>
|
||||
<blockTable colWidths="57.0,192.0,71.0,71.0,71.0,71.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">[[ o['code'] ]]</para>
|
||||
@@ -158,10 +181,10 @@
|
||||
<para style="terp_default_Bold_9">[[ o['complete_name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'debit')) ]]</para>
|
||||
<para style="terp_default_Right_9_Bold">[[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'debit')) ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'credit')) ]]</para>
|
||||
<para style="terp_default_Right_9_Bold">[[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'credit')) ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ formatLang(move_sum_balance(o['id'],data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol]]</para>
|
||||
@@ -171,12 +194,9 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(lines_g(o['id'],data['form']['date1'],data['form']['date2']),'move_g') ]]</para>
|
||||
<blockTable colWidths="55.0,222.0,56.0,49.0,63.0,37.0" style="Table2">
|
||||
<para style="terp_default_2">[[ repeatIn(lines_g(o['id'],data['form']['date1'],data['form']['date2']),'move_g') ]]</para>
|
||||
<blockTable colWidths="57.0,192.0,71.0,71.0,71.0,71.0" style="Table3">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ move_g['code'] ]]</para>
|
||||
@@ -188,7 +208,7 @@
|
||||
<para style="terp_default_Right_9">[[ formatLang(move_g['debit'])]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(move_g['credit']) ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(move_g['credit']) ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(move_g['balance'])]] [[ company.currency_id.symbol ]]</para>
|
||||
@@ -202,21 +222,13 @@
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</section>
|
||||
<para style="terp_default_2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</section>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</pto>
|
||||
</story>
|
||||
</document>
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Cost Ledger" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
|
||||
<document filename="Cost Ledger.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Cost Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
|
||||
<frame id="first" x1="28.0" y1="30.0" width="539" height="785"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
@@ -120,7 +120,29 @@
|
||||
<images/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<blockTable colWidths="161.0,161.0,161.0" repeatRows="1" style="Table1">
|
||||
<pto>
|
||||
<pto_header>
|
||||
<blockTable colWidths="53.0,276.0,70.0,71.0,68.0" style="Table_Header_Title">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date/Code</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">J.C. /Move name</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Credit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</pto_header>
|
||||
<blockTable colWidths="179.0,179.0,180.0" repeatRows="1" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
@@ -137,7 +159,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="161.0,161.0,161.0" style="Table_Date_Sub_detail">
|
||||
<blockTable colWidths="179.0,179.0,179.0" style="Table_Date_Sub_detail">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Period from </para>
|
||||
@@ -150,7 +172,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="161.0,161.0,161.0" style="Table_Sub_Content">
|
||||
<blockTable colWidths="179.0,179.0,179.0" style="Table_Sub_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ formatLang(data['form']['date1'],date = True) ]]</para>
|
||||
@@ -166,7 +188,7 @@
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="63.0,249.0,57.0,57.0,57.0" style="Table_Header_Title">
|
||||
<blockTable colWidths="53.0,276.0,70.0,71.0,68.0" style="Table_Header_Title">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date/Code</para>
|
||||
@@ -181,11 +203,11 @@
|
||||
<para style="terp_tblheader_Details_Right">Credit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Balance</para>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="62.0,250.0,57.0,56.0,57.0" style="Table_Grant_Total">
|
||||
<blockTable colWidths="56.0,273.0,70.0,70.0,70.0" style="Table_Grant_Total">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Total:</para>
|
||||
@@ -208,7 +230,7 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_2">[[ repeatIn(objects,'o') ]]</para>
|
||||
<blockTable colWidths="62.0,249.0,57.0,57.0,57.0" style="Table_Account_Detail">
|
||||
<blockTable colWidths="56.0,273.0,70.0,70.0,70.0" style="Table_Account_Detail">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">[[ o.code ]]</para>
|
||||
@@ -229,7 +251,7 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_2">[[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2']),'move_g') ]]</para>
|
||||
<blockTable colWidths="62.0,249.0,58.0,56.0,57.0" style="Table_Move_Line_Detail">
|
||||
<blockTable colWidths="56.0,273.0,70.0,70.0,70.0" style="Table_Move_Line_Detail">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">[[ move_g['code'] ]]</para>
|
||||
@@ -250,7 +272,7 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_2">[[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2']),'move_a') ]]</para>
|
||||
<blockTable colWidths="60.0,46.0,204.0,59.0,55.0,58.0" style="Table_Move_Line_Content">
|
||||
<blockTable colWidths="56.0,56.0,217.0,70.0,70.0,70.0" style="Table_Move_Line_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9_Italic">[[ formatLang(move_a['date'],date = True) ]]</para>
|
||||
@@ -278,5 +300,6 @@
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
</pto>
|
||||
</story>
|
||||
</document>
|
||||
@@ -87,6 +87,31 @@
|
||||
<images/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<pto>
|
||||
<pto_header>
|
||||
<blockTable colWidths="58.0,238.0,62.0,62.0,60.0,59.0" style="Table_Header_table">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Code</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Name</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Credit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Quantity</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</pto_header>
|
||||
<blockTable colWidths="539.0" style="Table_Title">
|
||||
<tr>
|
||||
<td>
|
||||
@@ -199,5 +224,6 @@
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
</pto>
|
||||
</story>
|
||||
</document>
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Cost Ledger" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
|
||||
<document filename="Cost Ledger.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Cost Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
|
||||
<frame id="first" x1="30.0" y1="29.0" width="534" height="783"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
@@ -117,7 +117,26 @@
|
||||
<images/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<blockTable colWidths="161.0,161.0,161.0" repeatRows="1" style="Table_Header_Detail">
|
||||
<pto>
|
||||
<pto_header>
|
||||
<blockTable colWidths="57.0,322.0,85.0,71.0" style="Table_Header_Move_Line">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Code/Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">J.C./Move name</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Quantity</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Total</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</pto_header>
|
||||
<blockTable colWidths="178.0,178.0,178.0" repeatRows="1" style="Table_Header_Detail">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
@@ -134,7 +153,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="161.0,161.0,161.0" style="Table_Date_Detail">
|
||||
<blockTable colWidths="178.0,178.0,178.0" style="Table_Date_Detail">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Period from</para>
|
||||
@@ -147,7 +166,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="161.0,161.0,161.0" style="Table_Date_Content">
|
||||
<blockTable colWidths="178.0,178.0,178.0" style="Table_Date_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ formatLang(data['form']['date1'],date = True) ]]</para>
|
||||
@@ -166,7 +185,7 @@
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="57.0,288.0,77.0,60.0" style="Table_Header_Move_Line">
|
||||
<blockTable colWidths="57.0,322.0,85.0,71.0" style="Table_Header_Move_Line">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Code/Date</para>
|
||||
@@ -175,14 +194,14 @@
|
||||
<para style="terp_tblheader_Details">J.C./Move name</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Quantity</para>
|
||||
<para style="terp_tblheader_Details_Centre">Quantity</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Total</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="57.0,288.0,77.0,60.0" style="Table_Final_Total">
|
||||
<blockTable colWidths="57.0,322.0,85.0,71.0" style="Table_Final_Total">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Total:</para>
|
||||
@@ -203,8 +222,8 @@
|
||||
</tr>
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
|
||||
<blockTable colWidths="58.0,287.0,78.0,59.0" style="Table_Account_Detail">
|
||||
<para style="terp_default_2">[[ repeatIn(objects,'o') ]]</para>
|
||||
<blockTable colWidths="57.0,322.0,85.0,71.0" style="Table_Account_Detail">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">[[ o.code ]]<font face="Helvetica" size="10.0"/></para>
|
||||
@@ -221,8 +240,8 @@
|
||||
</tr>
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_g') ]]</para>
|
||||
<blockTable colWidths="58.0,365.0,59.0" style="Table_Analytical_Detail">
|
||||
<para style="terp_default_2">[[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_g') ]]</para>
|
||||
<blockTable colWidths="57.0,407.0,71.0" style="Table_Analytical_Detail">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">[[ move_g['code'] ]] </para>
|
||||
@@ -235,7 +254,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="59.0,32.0,332.0,59.0" style="Table_Move_Line_Content">
|
||||
<blockTable colWidths="57.0,71.0,336.0,71.0" style="Table_Move_Line_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9_Italic">[[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_a') ]]</para>
|
||||
@@ -257,5 +276,6 @@
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
</pto>
|
||||
</story>
|
||||
</document>
|
||||
@@ -33,8 +33,8 @@ class account_analytic_balance(osv.osv_memory):
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'date1':time.strftime('%Y-01-01'),
|
||||
'date2':time.strftime('%Y-%m-%d')
|
||||
'date1': lambda *a: time.strftime('%Y-01-01'),
|
||||
'date2': lambda *a: time.strftime('%Y-%m-%d')
|
||||
}
|
||||
|
||||
def check_report(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -35,8 +35,8 @@ class account_analytic_chart(osv.osv_memory):
|
||||
result_context = {}
|
||||
if context is None:
|
||||
context = {}
|
||||
result = mod_obj._get_id(cr, uid, 'account', 'action_account_analytic_account_tree2')
|
||||
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
|
||||
result = mod_obj.get_object_reference(cr, uid, 'account', 'action_account_analytic_account_tree2')
|
||||
id = result and result[1] or False
|
||||
result = act_obj.read(cr, uid, [id], context=context)[0]
|
||||
data = self.read(cr, uid, ids, [])[0]
|
||||
if data['from_date']:
|
||||
|
||||
@@ -33,8 +33,8 @@ class account_analytic_cost_ledger_journal_report(osv.osv_memory):
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'date1':time.strftime('%Y-01-01'),
|
||||
'date2':time.strftime('%Y-%m-%d')
|
||||
'date1': lambda *a: time.strftime('%Y-01-01'),
|
||||
'date2': lambda *a: time.strftime('%Y-%m-%d')
|
||||
}
|
||||
|
||||
def check_report(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -32,8 +32,8 @@ class account_analytic_cost_ledger(osv.osv_memory):
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'date1':time.strftime('%Y-01-01'),
|
||||
'date2':time.strftime('%Y-%m-%d')
|
||||
'date1': lambda *a: time.strftime('%Y-01-01'),
|
||||
'date2': lambda *a: time.strftime('%Y-%m-%d')
|
||||
}
|
||||
|
||||
def check_report(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -32,8 +32,8 @@ class account_analytic_inverted_balance(osv.osv_memory):
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'date1':time.strftime('%Y-01-01'),
|
||||
'date2':time.strftime('%Y-%m-%d')
|
||||
'date1': lambda *a: time.strftime('%Y-01-01'),
|
||||
'date2': lambda *a: time.strftime('%Y-%m-%d')
|
||||
}
|
||||
|
||||
def check_report(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -32,8 +32,8 @@ class account_analytic_Journal_report(osv.osv_memory):
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'date1':time.strftime('%Y-01-01'),
|
||||
'date2':time.strftime('%Y-%m-%d')
|
||||
'date1': lambda *a: time.strftime('%Y-01-01'),
|
||||
'date2': lambda *a: time.strftime('%Y-%m-%d')
|
||||
}
|
||||
|
||||
def check_report(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -29,7 +29,7 @@ class project_account_analytic_line(osv.osv_memory):
|
||||
'to_date': fields.date('To'),
|
||||
}
|
||||
|
||||
def action_open_window(self, cr, uid, ids, context={}):
|
||||
def action_open_window(self, cr, uid, ids, context=None):
|
||||
mod_obj =self.pool.get('ir.model.data')
|
||||
domain = []
|
||||
data = self.read(cr, uid, ids, [])[0]
|
||||
@@ -41,8 +41,8 @@ class project_account_analytic_line(osv.osv_memory):
|
||||
domain = [('date','>=',from_date)]
|
||||
elif to_date:
|
||||
domain = [('date','<=',to_date)]
|
||||
result = mod_obj._get_id(cr, uid, 'account', 'view_account_analytic_line_filter')
|
||||
id = mod_obj.read(cr, uid, result, ['res_id'], context=context)
|
||||
result = mod_obj.get_object_reference(cr, uid, 'account', 'view_account_analytic_line_filter')
|
||||
id = result and result[1] or False
|
||||
return {
|
||||
'name': _('Analytic Entries by line'),
|
||||
'view_type': 'form',
|
||||
|
||||
@@ -20,12 +20,10 @@
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
import rml_parse
|
||||
from report import report_sxw
|
||||
from common_report_header import common_report_header
|
||||
|
||||
class aged_trial_report(rml_parse.rml_parse, common_report_header):
|
||||
class aged_trial_report(report_sxw.rml_parse, common_report_header):
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(aged_trial_report, self).__init__(cr, uid, name, context=context)
|
||||
@@ -61,15 +59,23 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
|
||||
|
||||
def _get_lines(self, form):
|
||||
res = []
|
||||
move_state = ['draft','posted']
|
||||
if self.target_move == 'posted':
|
||||
move_state = ['posted']
|
||||
self.cr.execute('SELECT DISTINCT res_partner.id AS id,\
|
||||
res_partner.name AS name \
|
||||
FROM res_partner,account_move_line AS l, account_account\
|
||||
FROM res_partner,account_move_line AS l, account_account, account_move am\
|
||||
WHERE (l.account_id=account_account.id) \
|
||||
AND (l.move_id=am.id) \
|
||||
AND (am.state IN %s)\
|
||||
AND (account_account.type IN %s)\
|
||||
AND account_account.active\
|
||||
AND ((reconcile_id IS NULL)\
|
||||
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
|
||||
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
|
||||
AND (l.partner_id=res_partner.id)\
|
||||
AND (l.date <= %s)\
|
||||
AND ' + self.query + ' \
|
||||
ORDER BY res_partner.name', (self.date_from,))
|
||||
ORDER BY res_partner.name', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from,))
|
||||
partners = self.cr.dictfetchall()
|
||||
## mise a 0 du total
|
||||
for i in range(7):
|
||||
@@ -80,9 +86,6 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
|
||||
if not partner_ids:
|
||||
return []
|
||||
# This dictionary will store the debit-credit for all partners, using partner_id as key.
|
||||
move_state = ['draft','posted']
|
||||
if self.target_move == 'posted':
|
||||
move_state = ['posted']
|
||||
|
||||
totals = {}
|
||||
self.cr.execute('SELECT l.partner_id, SUM(l.debit-l.credit) \
|
||||
@@ -95,7 +98,8 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
|
||||
AND ' + self.query + '\
|
||||
AND account_account.active\
|
||||
GROUP BY l.partner_id ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids), self.date_from))
|
||||
AND (l.date <= %s)\
|
||||
GROUP BY l.partner_id ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids), self.date_from, self.date_from,))
|
||||
t = self.cr.fetchall()
|
||||
for i in t:
|
||||
totals[i[0]] = i[1]
|
||||
@@ -114,7 +118,8 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
|
||||
AND '+ self.query + '\
|
||||
AND account_account.active\
|
||||
GROUP BY l.partner_id', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids),self.date_from))
|
||||
AND (l.date <= %s)\
|
||||
GROUP BY l.partner_id', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids),self.date_from, self.date_from,))
|
||||
t = self.cr.fetchall()
|
||||
for i in t:
|
||||
future_past[i[0]] = i[1]
|
||||
@@ -130,7 +135,8 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
|
||||
AND '+ self.query + '\
|
||||
AND account_account.active\
|
||||
GROUP BY l.partner_id', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids), self.date_from))
|
||||
AND (l.date <= %s)\
|
||||
GROUP BY l.partner_id', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids), self.date_from, self.date_from,))
|
||||
t = self.cr.fetchall()
|
||||
for i in t:
|
||||
future_past[i[0]] = i[1]
|
||||
@@ -150,19 +156,20 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
|
||||
else:
|
||||
dates_query += ' < %s)'
|
||||
args_list += (form[str(i)]['stop'],)
|
||||
|
||||
self.cr.execute('SELECT l.partner_id, SUM(l.debit-l.credit)\
|
||||
FROM account_move_line AS l, account_account, account_move am \
|
||||
WHERE (l.account_id = account_account.id) AND (l.move_id=am.id)\
|
||||
AND (am.state IN %s)\
|
||||
AND (account_account.type IN %s)\
|
||||
AND (l.partner_id IN %s)\
|
||||
AND ((l.reconcile_id IS NULL)\
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
|
||||
AND '+ self.query + '\
|
||||
AND account_account.active\
|
||||
AND ' + dates_query + '\
|
||||
GROUP BY l.partner_id', args_list)
|
||||
args_list += (self.date_from,)
|
||||
self.cr.execute('''SELECT l.partner_id, SUM(l.debit-l.credit)
|
||||
FROM account_move_line AS l, account_account, account_move am
|
||||
WHERE (l.account_id = account_account.id) AND (l.move_id=am.id)
|
||||
AND (am.state IN %s)
|
||||
AND (account_account.type IN %s)
|
||||
AND (l.partner_id IN %s)
|
||||
AND ((l.reconcile_id IS NULL)
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))
|
||||
AND ''' + self.query + '''
|
||||
AND account_account.active
|
||||
AND ''' + dates_query + '''
|
||||
AND (l.date <= %s)
|
||||
GROUP BY l.partner_id''', args_list)
|
||||
t = self.cr.fetchall()
|
||||
d = {}
|
||||
for i in t:
|
||||
@@ -203,8 +210,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
|
||||
self.total_account[(i+1)] = self.total_account[(i+1)] + (total and total[0] or 0.0)
|
||||
values['name'] = partner['name']
|
||||
|
||||
if values['total']:
|
||||
res.append(values)
|
||||
res.append(values)
|
||||
|
||||
total = 0.0
|
||||
totals = {}
|
||||
@@ -234,7 +240,8 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
|
||||
AND ((l.reconcile_id IS NULL) \
|
||||
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
|
||||
AND ' + self.query + '\
|
||||
AND account_account.active ',(tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from))
|
||||
AND (l.date <= %s)\
|
||||
AND account_account.active ',(tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from,))
|
||||
t = self.cr.fetchall()
|
||||
for i in t:
|
||||
totals['Unknown Partner'] = i[0]
|
||||
@@ -283,7 +290,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
|
||||
else:
|
||||
dates_query += ' < %s)'
|
||||
args_list += (form[str(i)]['stop'],)
|
||||
|
||||
args_list += (self.date_from,)
|
||||
self.cr.execute('SELECT SUM(l.debit-l.credit)\
|
||||
FROM account_move_line AS l, account_account, account_move am \
|
||||
WHERE (l.account_id = account_account.id) AND (l.move_id=am.id)\
|
||||
@@ -295,6 +302,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
|
||||
AND '+ self.query + '\
|
||||
AND account_account.active\
|
||||
AND ' + dates_query + '\
|
||||
AND (l.date <= %s)\
|
||||
GROUP BY l.partner_id', args_list)
|
||||
t = self.cr.fetchall()
|
||||
d = {}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(1120.0,770.0)" title="Aged Trial balance" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
|
||||
<document filename="Aged Trial Balance.pdf">
|
||||
<template pageSize="(842.0,595.0)" title="Aged Trial Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="20.0" y1="35.0" width="1080" height="650"/>
|
||||
<frame id="first" x1="28.0" y1="57.0" width="772" height="481"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
@@ -100,18 +100,16 @@
|
||||
|
||||
</stylesheet>
|
||||
<story>
|
||||
<para style="P9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
|
||||
<blockTable colWidths="180.0,180.0,180.0" style="Table_header_Content">
|
||||
<tr>
|
||||
<td><para style="terp_header"><font color="white"> </font></para>
|
||||
</td>
|
||||
<td><para style="terp_header_Centre">Aged Trial balance</para></td>
|
||||
<td><para style="terp_header_Centre">Aged Trial Balance</para></td>
|
||||
<td><para style="terp_header"><font color="white"> </font></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="200.0,200.0,100.0,100.0,119.0,100.0,200.0" style="Table8">
|
||||
<blockTable colWidths="110.0,110.0,110.0,110.0,128.0,93.0,110.0" style="Table8">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Chart of Account</para>
|
||||
@@ -162,7 +160,7 @@
|
||||
<para style="P9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="300.0,100.0,100.0,100.0,100.0,105.0,105.0,125.0" style="Table2" repeatRows="1">
|
||||
<blockTable colWidths="135.0,90.0,90.0,90.0,90.0,90.0,90.0,90.0" style="Table2" repeatRows="1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Partners</para>
|
||||
|
||||
@@ -95,10 +95,10 @@
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="context">{'search_default_month':1, 'group_by_no_leaf':1, 'search_default_Account':1, 'search_default_Month':1, 'group_by':[]}</field>
|
||||
<field name="search_view_id" ref="view_analytic_entries_report_search"/>
|
||||
<field name="help">A tool search lets you know statistics on your analytics records that match your needs.</field>
|
||||
<field name="help">From this view, have an analysis of your different analytic entries following the analytic account you defined matching your business need. Use the tool search to analyse information about analytic entries generated in the system.</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_analytic_entries_report"
|
||||
<menuitem action="action_analytic_entries_report"
|
||||
id="menu_action_analytic_entries_report"
|
||||
groups="analytic.group_analytic_accounting,group_account_manager"
|
||||
parent="account.menu_finance_statistic_report_statement" sequence="4"/>
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
from report import report_sxw
|
||||
from common_report_header import common_report_header
|
||||
|
||||
@@ -85,11 +84,12 @@ class account_balance(report_sxw.rml_parse, common_report_header):
|
||||
}
|
||||
self.sum_debit += account_rec['debit']
|
||||
self.sum_credit += account_rec['credit']
|
||||
acc_digit = self.pool.get('decimal.precision').precision_get(self.cr, 1, 'Account')
|
||||
if disp_acc == 'bal_movement':
|
||||
if res['credit'] > 0 or res['debit'] > 0 or res['balance'] > 0:
|
||||
if round(res['credit'], acc_digit) > 0 or round(res['debit'], acc_digit) > 0 or round(res['balance'], acc_digit) != 0:
|
||||
self.result_acc.append(res)
|
||||
elif disp_acc == 'bal_solde':
|
||||
if res['balance'] != 0:
|
||||
if round(res['balance'], acc_digit) != 0:
|
||||
self.result_acc.append(res)
|
||||
else:
|
||||
self.result_acc.append(res)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Account Balance" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
|
||||
<document filename="Account Balance.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Account Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="35.0" y1="35.0" width="525" height="772"/>
|
||||
</pageTemplate>
|
||||
@@ -18,7 +18,7 @@
|
||||
<blockValign value="TOP"/>
|
||||
<blockAlignment value="RIGHT"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<blockTableStyle id="Table8">
|
||||
@@ -148,11 +148,11 @@
|
||||
<paraStyle name="P7" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P8" fontName="Helvetica"/>
|
||||
<paraStyle name="P9" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P10" fontName="Helvetica-Bold" fontSize="8.0" leading="14" spaceBefore="0.0" spaceAfter="6.0" alignment="RIGHT"/>
|
||||
<paraStyle name="P10" fontName="Helvetica-Bold" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="0.0" alignment="RIGHT"/>
|
||||
<paraStyle name="P11" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P12" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P13" fontName="Helvetica-Bold" fontSize="2.0" leading="3" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0" textColor="#ffffff"/>
|
||||
<paraStyle name="P14" rightIndent="17.0" leftIndent="-0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P14" rightIndent="17.0" leftIndent="-0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P15" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P16" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P17" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
@@ -189,7 +189,7 @@
|
||||
<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_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Heading 3" fontName="Helvetica-Bold" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P12a" fontName="Helvetica-Bold" fontSize="8.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P12a" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<images/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
@@ -283,7 +283,7 @@
|
||||
<para style="P11">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="67,295.0,60.0,60.0,60.0" style="Table2" repeatRows="1">
|
||||
<blockTable colWidths="80,215.0,80.0,80.0,80.0" style="Table2" repeatRows="1">
|
||||
<tr noRowsplits="1">
|
||||
<td><para style="P12a">Code</para></td>
|
||||
<td><para style="P12a">Account</para></td>
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
import time
|
||||
import locale
|
||||
from report import report_sxw
|
||||
import rml_parse
|
||||
|
||||
parents = {
|
||||
'tr':1,
|
||||
@@ -31,7 +30,7 @@ parents = {
|
||||
'section': 0
|
||||
}
|
||||
|
||||
class account_balance_landscape(rml_parse.rml_parse):
|
||||
class account_balance_landscape(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(account_balance_landscape, self).__init__(cr, uid, name, context=context)
|
||||
self.flag=1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(842.0,595.0)" title="Account Balance" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
|
||||
<document filename="Account Balance.pdf">
|
||||
<template pageSize="(842.0,595.0)" title="Account Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="28.0" y1="28.0" width="786" height="539"/>
|
||||
</pageTemplate>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(1120.0,770.0)" title="Account balance" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20" >
|
||||
<document filename="Account Balance.pdf">
|
||||
<template pageSize="(1120.0,770.0)" title="Account Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20" >
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="22.0" y1="31.0" width="1080" height="680"/>
|
||||
</pageTemplate>
|
||||
@@ -80,7 +80,7 @@
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P1">Account balance</para>
|
||||
<para style="P1">Account Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(635.0,842.0)" title="Account balance" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
|
||||
<document filename="Account Balance.pdf">
|
||||
<template pageSize="(635.0,842.0)" title="Account Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="15.0" y1="15.0" width="615" height="772"/>
|
||||
</pageTemplate>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user