commit
5dd4167527
|
@ -611,8 +611,8 @@ class account_journal(osv.osv):
|
|||
}
|
||||
|
||||
_defaults = {
|
||||
'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,
|
||||
'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 !'),
|
||||
|
@ -712,7 +712,6 @@ class account_journal(osv.osv):
|
|||
|
||||
return self.name_get(cr, user, ids, context=context)
|
||||
|
||||
|
||||
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')
|
||||
|
@ -1282,6 +1281,8 @@ 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):
|
||||
if context is None:
|
||||
context = {}
|
||||
toremove = []
|
||||
obj_move_line = self.pool.get('account.move.line')
|
||||
for move in self.browse(cr, uid, ids, context=context):
|
||||
|
@ -2615,11 +2616,12 @@ class wizard_multi_charts_accounts(osv.osv_memory):
|
|||
cr.execute("SELECT company_id FROM account_account WHERE active = 't' AND account_account.parent_id IS NULL AND name != %s", ("Chart For Automated Tests",))
|
||||
configured_cmp = [r[0] for r in cr.fetchall()]
|
||||
unconfigured_cmp = list(set(company_ids)-set(configured_cmp))
|
||||
if unconfigured_cmp:
|
||||
cmp_select = [(line.id, line.name) for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp)]
|
||||
for field in res['fields']:
|
||||
if field == 'company_id':
|
||||
res['fields'][field]['domain'] = unconfigured_cmp
|
||||
for field in res['fields']:
|
||||
if field == 'company_id':
|
||||
res['fields'][field]['domain'] = unconfigured_cmp
|
||||
res['fields'][field]['selection'] = [('', '')]
|
||||
if unconfigured_cmp:
|
||||
cmp_select = [(line.id, line.name) for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp)]
|
||||
res['fields'][field]['selection'] = cmp_select
|
||||
return res
|
||||
|
||||
|
|
|
@ -50,11 +50,10 @@ class account_analytic_line(osv.osv):
|
|||
if context is None:
|
||||
context = {}
|
||||
if context.get('from_date',False):
|
||||
args.append(['date', '>=',context['from_date']])
|
||||
args.append(['date', '>=', context['from_date']])
|
||||
|
||||
if context.get('to_date',False):
|
||||
args.append(['date','<=',context['to_date']])
|
||||
|
||||
args.append(['date','<=', context['to_date']])
|
||||
return super(account_analytic_line, self).search(cr, uid, args, offset, limit,
|
||||
order, context=context, count=count)
|
||||
|
||||
|
@ -158,4 +157,4 @@ class res_partner(osv.osv):
|
|||
|
||||
res_partner()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -309,7 +309,7 @@ class account_move_line(osv.osv):
|
|||
context = {}
|
||||
c = context.copy()
|
||||
c['initital_bal'] = True
|
||||
sql = """SELECT l2.id, SUM(l1.debit-l1.credit)
|
||||
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
|
||||
|
@ -318,8 +318,7 @@ class account_move_line(osv.osv):
|
|||
" GROUP BY l2.id"
|
||||
|
||||
cr.execute(sql, [tuple(ids)])
|
||||
res = dict(cr.fetchall())
|
||||
return res
|
||||
return dict(cr.fetchall())
|
||||
|
||||
def _invoice(self, cursor, user, ids, name, arg, context=None):
|
||||
invoice_obj = self.pool.get('account.invoice')
|
||||
|
@ -887,7 +886,7 @@ class account_move_line(osv.osv):
|
|||
fld = []
|
||||
fields = {}
|
||||
flds = []
|
||||
title = "Accounting Entries" #self.view_header_get(cr, uid, view_id, view_type, context)
|
||||
title = _("Accounting Entries") #self.view_header_get(cr, uid, view_id, view_type, context)
|
||||
xml = '''<?xml version="1.0"?>\n<tree string="%s" editable="top" refresh="5" on_write="on_create_write" colors="red:state==\'draft\';black:state==\'valid\'">\n\t''' % (title)
|
||||
|
||||
ids = journal_pool.search(cr, uid, [])
|
||||
|
@ -906,8 +905,8 @@ class account_move_line(osv.osv):
|
|||
else:
|
||||
fields.get(field.field).append(journal.id)
|
||||
common_fields[field.field] = common_fields[field.field] + 1
|
||||
fld.append(('period_id', 3, 'Period'))
|
||||
fld.append(('journal_id', 10, 'Journal'))
|
||||
fld.append(('period_id', 3, _('Period')))
|
||||
fld.append(('journal_id', 10, _('Journal')))
|
||||
flds.append('period_id')
|
||||
flds.append('journal_id')
|
||||
fields['period_id'] = all_journal
|
||||
|
@ -927,10 +926,10 @@ class account_move_line(osv.osv):
|
|||
# state = 'colors="red:state==\'draft\'"'
|
||||
attrs = []
|
||||
if field == 'debit':
|
||||
attrs.append('sum = "Total debit"')
|
||||
attrs.append('sum = "%s"' % _("Total debit"))
|
||||
|
||||
elif field == 'credit':
|
||||
attrs.append('sum = "Total credit"')
|
||||
attrs.append('sum = "%s"' % _("Total credit"))
|
||||
|
||||
elif field == 'move_id':
|
||||
attrs.append('required = "False"')
|
||||
|
@ -1284,4 +1283,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:
|
|
@ -7426,7 +7426,7 @@ msgstr ""
|
|||
|
||||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid "This Account is used for trasfering Profit/Loss(If It is Profit: Amount will be added, Loss : Amount will be duducted.), Which is calculated from Profilt & Loss Report"
|
||||
msgid "This Account is used for transferring Profit/Loss(If It is Profit: Amount will be added, Loss : Amount will be duducted.), Which is calculated from Profilt & Loss Report"
|
||||
msgstr ""
|
||||
|
||||
#. module: account
|
||||
|
|
|
@ -7845,7 +7845,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7876,7 +7876,7 @@ msgstr "Вид отпратка"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7843,7 +7843,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7900,7 +7900,7 @@ msgstr "Tip reference"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7935,7 +7935,7 @@ msgstr "Tipus referència"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7842,7 +7842,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7862,7 +7862,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -8408,7 +8408,7 @@ msgstr "Referenztyp"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7966,7 +7966,7 @@ msgstr "Τύπος Παραπομπής"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -8306,7 +8306,7 @@ msgstr "Tipo de referencia"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7937,7 +7937,7 @@ msgstr "Tipo de referencia"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -8249,11 +8249,11 @@ msgstr "Tipo de referencia"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
|
||||
|
|
|
@ -7843,7 +7843,7 @@ msgstr "Viite tüüp"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7843,7 +7843,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7843,7 +7843,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7907,7 +7907,7 @@ msgstr "Viitetyyppi"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -8353,7 +8353,7 @@ msgstr "Type de référence"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7843,7 +7843,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7843,7 +7843,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7843,7 +7843,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7844,7 +7844,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7872,7 +7872,7 @@ msgstr "Tip veze"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7846,7 +7846,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7847,7 +7847,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -8139,7 +8139,7 @@ msgstr "Tipo riferimento"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7843,7 +7843,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7843,7 +7843,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7886,7 +7886,7 @@ msgstr "Nuorodos tipas"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7855,7 +7855,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -8039,7 +8039,7 @@ msgstr "Дугаарлалтын төрөл"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7843,7 +7843,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7968,7 +7968,7 @@ msgstr "Referentietype"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7874,7 +7874,7 @@ msgstr "Referentietype"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7843,7 +7843,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7970,7 +7970,7 @@ msgstr "Typ odnośnika"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7985,7 +7985,7 @@ msgstr "Tipo de referência"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7938,7 +7938,7 @@ msgstr "Tipo de referência"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7919,7 +7919,7 @@ msgstr "Tipul referinţei"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7897,7 +7897,7 @@ msgstr "Тип ссылки"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7843,7 +7843,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7846,7 +7846,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7864,7 +7864,7 @@ msgstr "Vrsta sklica"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7859,7 +7859,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7901,7 +7901,7 @@ msgstr "Tip reference"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7901,7 +7901,7 @@ msgstr "Tip reference"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7946,7 +7946,7 @@ msgstr "Referenstyp"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7843,7 +7843,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7843,7 +7843,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7843,7 +7843,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7842,7 +7842,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -8115,11 +8115,11 @@ msgstr "Referans Tipi"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
|
||||
|
|
|
@ -7843,7 +7843,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7848,7 +7848,7 @@ msgstr "Тип посилання"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -8238,11 +8238,11 @@ msgstr "Lọai tham chiếu"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
|
||||
|
|
|
@ -7849,7 +7849,7 @@ msgstr "关联类型"
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7843,7 +7843,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -7842,7 +7842,7 @@ msgstr ""
|
|||
#. module: account
|
||||
#: help:account.bs.report,reserve_account_id:0
|
||||
msgid ""
|
||||
"This Account is used for trasfering Profit/Loss(If It is Profit: Amount will "
|
||||
"This Account is used for transferring Profit/Loss(If It is Profit: Amount will "
|
||||
"be added, Loss : Amount will be duducted.), Which is calculated from Profilt "
|
||||
"& Loss Report"
|
||||
msgstr ""
|
||||
|
|
|
@ -95,7 +95,7 @@ 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 = []
|
||||
|
@ -106,11 +106,12 @@ class account_installer(osv.osv_memory):
|
|||
cr.execute("SELECT company_id FROM account_account WHERE active = 't' AND account_account.parent_id IS NULL AND name != %s", ("Chart For Automated Tests",))
|
||||
configured_cmp = [r[0] for r in cr.fetchall()]
|
||||
unconfigured_cmp = list(set(company_ids)-set(configured_cmp))
|
||||
if unconfigured_cmp:
|
||||
cmp_select = [(line.id, line.name) for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp)]
|
||||
for field in res['fields']:
|
||||
if field == 'company_id':
|
||||
res['fields'][field]['domain'] = unconfigured_cmp
|
||||
for field in res['fields']:
|
||||
if field == 'company_id':
|
||||
res['fields'][field]['domain'] = unconfigured_cmp
|
||||
res['fields'][field]['selection'] = [('', '')]
|
||||
if unconfigured_cmp:
|
||||
cmp_select = [(line.id, line.name) for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp)]
|
||||
res['fields'][field]['selection'] = cmp_select
|
||||
return res
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ class account_invoice(osv.osv):
|
|||
cur_obj = self.pool.get('res.currency')
|
||||
data_inv = self.browse(cr, uid, ids, context=context)
|
||||
for inv in data_inv:
|
||||
if inv.reconciled:
|
||||
if inv.reconciled:
|
||||
res[inv.id] = 0.0
|
||||
continue
|
||||
inv_total = inv.amount_total
|
||||
|
@ -111,7 +111,7 @@ class account_invoice(osv.osv):
|
|||
amount_in_invoice_currency = cur_obj.compute(cr, uid, inv.company_id.currency_id.id, inv.currency_id.id,abs(lines.debit-lines.credit),round=False,context=context_unreconciled)
|
||||
inv_total -= amount_in_invoice_currency
|
||||
|
||||
result = inv_total
|
||||
result = inv_total
|
||||
res[inv.id] = self.pool.get('res.currency').round(cr, uid, inv.currency_id, result)
|
||||
return res
|
||||
|
||||
|
@ -246,7 +246,7 @@ 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, select=1, help="Link to the automatically generated Journal Items."),
|
||||
'move_id': fields.many2one('account.move', 'Journal Entry', readonly=True, select=1, ondelete='restrict', 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),
|
||||
|
@ -947,22 +947,22 @@ class account_invoice(osv.osv):
|
|||
def line_get_convert(self, cr, uid, x, part, date, context=None):
|
||||
return {
|
||||
'date_maturity': x.get('date_maturity', False),
|
||||
'partner_id':part,
|
||||
'name':x['name'][:64],
|
||||
'partner_id': part,
|
||||
'name': x['name'][:64],
|
||||
'date': date,
|
||||
'debit':x['price']>0 and x['price'],
|
||||
'credit':x['price']<0 and -x['price'],
|
||||
'account_id':x['account_id'],
|
||||
'analytic_lines':x.get('analytic_lines', []),
|
||||
'amount_currency':x['price']>0 and abs(x.get('amount_currency', False)) or -abs(x.get('amount_currency', False)),
|
||||
'currency_id':x.get('currency_id', False),
|
||||
'debit': x['price']>0 and x['price'],
|
||||
'credit': x['price']<0 and -x['price'],
|
||||
'account_id': x['account_id'],
|
||||
'analytic_lines': x.get('analytic_lines', []),
|
||||
'amount_currency': x['price']>0 and abs(x.get('amount_currency', False)) or -abs(x.get('amount_currency', False)),
|
||||
'currency_id': x.get('currency_id', False),
|
||||
'tax_code_id': x.get('tax_code_id', False),
|
||||
'tax_amount': x.get('tax_amount', False),
|
||||
'ref':x.get('ref',False),
|
||||
'quantity':x.get('quantity',1.00),
|
||||
'product_id':x.get('product_id', False),
|
||||
'product_uom_id':x.get('uos_id',False),
|
||||
'analytic_account_id':x.get('account_analytic_id',False),
|
||||
'ref': x.get('ref', False),
|
||||
'quantity': x.get('quantity',1.00),
|
||||
'product_id': x.get('product_id', False),
|
||||
'product_uom_id': x.get('uos_id', False),
|
||||
'analytic_account_id': x.get('account_analytic_id', False),
|
||||
}
|
||||
|
||||
def action_number(self, cr, uid, ids, context=None):
|
||||
|
@ -1132,6 +1132,7 @@ class account_invoice(osv.osv):
|
|||
invoice[field] = invoice[field] and invoice[field][0]
|
||||
# create the new invoice
|
||||
new_ids.append(self.create(cr, uid, invoice))
|
||||
|
||||
return new_ids
|
||||
|
||||
def pay_and_reconcile(self, cr, uid, ids, pay_amount, pay_account_id, period_id, pay_journal_id, writeoff_acc_id, writeoff_period_id, writeoff_journal_id, context=None, name=''):
|
||||
|
@ -1232,6 +1233,7 @@ class account_invoice(osv.osv):
|
|||
# Update the stored value (fields.function), so we write to trigger recompute
|
||||
self.pool.get('account.invoice').write(cr, uid, ids, {}, context=context)
|
||||
return True
|
||||
|
||||
account_invoice()
|
||||
|
||||
class account_invoice_line(osv.osv):
|
||||
|
@ -1643,6 +1645,7 @@ class account_invoice_tax(osv.osv):
|
|||
'tax_amount': t['tax_amount']
|
||||
})
|
||||
return res
|
||||
|
||||
account_invoice_tax()
|
||||
|
||||
|
||||
|
|
|
@ -70,6 +70,9 @@ class account_balance(report_sxw.rml_parse, common_report_header):
|
|||
def lines(self, form, ids=[], done=None):#, level=1):
|
||||
def _process_child(accounts, disp_acc, parent):
|
||||
account_rec = [acct for acct in accounts if acct['id']==parent][0]
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
acc_id = self.pool.get('account.account').browse(self.cr, self.uid, account_rec['id'])
|
||||
currency = acc_id.currency_id and acc_id.currency_id or acc_id.company_id.currency_id
|
||||
res = {
|
||||
'id': account_rec['id'],
|
||||
'type': account_rec['type'],
|
||||
|
@ -84,12 +87,11 @@ 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 round(res['credit'], acc_digit) > 0 or round(res['debit'], acc_digit) > 0 or round(res['balance'], acc_digit) != 0:
|
||||
if currency_obj.is_zero(self.cr, self.uid, currency, res['credit']) > 0 or currency_obj.is_zero(self.cr, self.uid, currency, res['debit']) > 0 or currency_obj.is_zero(self.cr, self.uid, currency, res['balance']) != 0:
|
||||
self.result_acc.append(res)
|
||||
elif disp_acc == 'bal_solde':
|
||||
if round(res['balance'], acc_digit) != 0:
|
||||
if currency_obj.is_zero(self.cr, self.uid, currency, res['debit']) != 0:
|
||||
self.result_acc.append(res)
|
||||
else:
|
||||
self.result_acc.append(res)
|
||||
|
|
|
@ -89,6 +89,7 @@ class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header)
|
|||
self.res_bl = self.obj_pl.final_result()
|
||||
|
||||
account_pool = db_pool.get('account.account')
|
||||
currency_pool = db_pool.get('res.currency')
|
||||
|
||||
types = [
|
||||
'liability',
|
||||
|
@ -136,16 +137,16 @@ class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header)
|
|||
'level': account.level,
|
||||
'balance':account.balance,
|
||||
}
|
||||
acc_digit = self.pool.get('decimal.precision').precision_get(self.cr, 1, 'Account')
|
||||
currency = account.currency_id and account.currency_id or account.company_id.currency_id
|
||||
if typ == 'liability' and account.type <> 'view' and (account.debit <> account.credit):
|
||||
self.result_sum_dr += account.balance
|
||||
if typ == 'asset' and account.type <> 'view' and (account.debit <> account.credit):
|
||||
self.result_sum_cr += account.balance
|
||||
if data['form']['display_account'] == 'bal_movement':
|
||||
if round(account.credit, acc_digit) > 0 or round(account.debit, acc_digit) > 0 or round(account.balance, acc_digit) != 0:
|
||||
if currency_pool.is_zero(self.cr, self.uid, currency, account.credit) > 0 or currency_pool.is_zero(self.cr, self.uid, currency, account.debit) > 0 or currency_pool.is_zero(self.cr, self.uid, currency, account.balance) != 0:
|
||||
accounts_temp.append(account_dict)
|
||||
elif data['form']['display_account'] == 'bal_solde':
|
||||
if round(account.balance, acc_digit) != 0:
|
||||
if currency_pool.is_zero(self.cr, self.uid, currency, account.balance) != 0:
|
||||
accounts_temp.append(account_dict)
|
||||
else:
|
||||
accounts_temp.append(account_dict)
|
||||
|
|
|
@ -341,7 +341,7 @@
|
|||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="82.0,82.0,82.0,128.0,82.0,82.0" style="Table13">
|
||||
<blockTable colWidths="102.0,102.0,102.0,130.0,102.0" style="Table13">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Chart of Account</para>
|
||||
|
@ -355,15 +355,12 @@
|
|||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Filters By [[ get_filter(data)!='No Filter' and get_filter(data) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Partner's</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Target Moves</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="82.0,82.0,82.0,128.0,82.0,82.0" style="Table1">
|
||||
<blockTable colWidths="102.0,102.0,102.0,130.0,102.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ get_account(data) or '' ]]</para>
|
||||
|
@ -420,9 +417,6 @@
|
|||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ get_partners() ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para>
|
||||
</td>
|
||||
|
|
|
@ -36,7 +36,7 @@ class account_invoice_report(osv.osv):
|
|||
('10','October'), ('11','November'), ('12','December')], 'Month', readonly=True),
|
||||
'product_id': fields.many2one('product.product', 'Product', readonly=True),
|
||||
'product_qty':fields.float('Qty', readonly=True),
|
||||
'uom_name': fields.char('Default UoM', size=128, readonly=True),
|
||||
'uom_name': fields.char('Reference UoM', size=128, readonly=True),
|
||||
'payment_term': fields.many2one('account.payment.term', 'Payment Term', readonly=True),
|
||||
'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], readonly=True),
|
||||
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True),
|
||||
|
@ -88,7 +88,11 @@ class account_invoice_report(osv.osv):
|
|||
ai.partner_id as partner_id,
|
||||
ai.payment_term as payment_term,
|
||||
ai.period_id as period_id,
|
||||
u.name as uom_name,
|
||||
(case when u.uom_type not in ('reference') then
|
||||
(select name from product_uom where uom_type='reference' and category_id=u.category_id)
|
||||
else
|
||||
u.name
|
||||
end) as uom_name,
|
||||
ai.currency_id as currency_id,
|
||||
ai.journal_id as journal_id,
|
||||
ai.fiscal_position as fiscal_position,
|
||||
|
@ -104,9 +108,9 @@ class account_invoice_report(osv.osv):
|
|||
ai.account_id as account_id,
|
||||
ai.partner_bank_id as partner_bank_id,
|
||||
sum(case when ai.type in ('out_refund','in_invoice') then
|
||||
ail.quantity * u.factor * -1
|
||||
ail.quantity / u.factor * -1
|
||||
else
|
||||
ail.quantity * u.factor
|
||||
ail.quantity / u.factor
|
||||
end) as product_qty,
|
||||
sum(case when ai.type in ('out_refund','in_invoice') then
|
||||
ail.quantity*ail.price_unit * -1
|
||||
|
@ -125,9 +129,9 @@ class account_invoice_report(osv.osv):
|
|||
else
|
||||
sum(ail.quantity*ail.price_unit)
|
||||
end)/(case when ai.type in ('out_refund','in_invoice') then
|
||||
sum(ail.quantity*u.factor*-1)
|
||||
sum(ail.quantity/u.factor*-1)
|
||||
else
|
||||
sum(ail.quantity*u.factor)
|
||||
sum(ail.quantity/u.factor)
|
||||
end) / cr.rate as price_average,
|
||||
cr.rate as currency_rate,
|
||||
sum((select extract(epoch from avg(date_trunc('day',aml.date_created)-date_trunc('day',l.create_date)))/(24*60*60)::decimal(16,2)
|
||||
|
@ -179,7 +183,9 @@ class account_invoice_report(osv.osv):
|
|||
ai.account_id,
|
||||
ai.partner_bank_id,
|
||||
ai.residual,
|
||||
ai.amount_total
|
||||
ai.amount_total,
|
||||
u.uom_type,
|
||||
u.category_id
|
||||
)
|
||||
""")
|
||||
|
||||
|
|
|
@ -82,6 +82,7 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header):
|
|||
db_pool = pooler.get_pool(self.cr.dbname)
|
||||
|
||||
account_pool = db_pool.get('account.account')
|
||||
currency_pool = db_pool.get('res.currency')
|
||||
|
||||
types = [
|
||||
'expense',
|
||||
|
@ -106,16 +107,16 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header):
|
|||
accounts_temp = []
|
||||
for account in accounts:
|
||||
if (account.user_type.report_type) and (account.user_type.report_type == typ):
|
||||
acc_digit = self.pool.get('decimal.precision').precision_get(self.cr, 1, 'Account')
|
||||
currency = account.currency_id and account.currency_id or account.company_id.currency_id
|
||||
if typ == 'expense' and account.type <> 'view' and (account.debit <> account.credit):
|
||||
self.result_sum_dr += abs(account.debit - account.credit)
|
||||
if typ == 'income' and account.type <> 'view' and (account.debit <> account.credit):
|
||||
self.result_sum_cr += abs(account.debit - account.credit)
|
||||
if data['form']['display_account'] == 'bal_movement':
|
||||
if round(account.credit, acc_digit) > 0 or round(account.debit, acc_digit) > 0 or round(account.balance, acc_digit) != 0:
|
||||
if currency_pool.is_zero(self.cr, self.uid, currency, account.credit) > 0 or currency_pool.is_zero(self.cr, self.uid, currency, account.debit) > 0 or currency_pool.is_zero(self.cr, self.uid, currency, account.balance) != 0:
|
||||
accounts_temp.append(account)
|
||||
elif data['form']['display_account'] == 'bal_solde':
|
||||
if round(account.balance, acc_digit) != 0:
|
||||
if currency_pool.is_zero(self.cr, self.uid, currency, account.balance) != 0:
|
||||
accounts_temp.append(account)
|
||||
else:
|
||||
accounts_temp.append(account)
|
||||
|
|
|
@ -92,12 +92,14 @@ class account_move_journal(osv.osv_memory):
|
|||
journal = False
|
||||
if journal_id:
|
||||
journal = journal_pool.read(cr, uid, [journal_id], ['name'])[0]['name']
|
||||
journal_string = _("Journal: %s") % tools.ustr(journal)
|
||||
else:
|
||||
journal = "All"
|
||||
journal_string = _("Journal: All")
|
||||
|
||||
period = False
|
||||
if period_id:
|
||||
period = period_pool.browse(cr, uid, [period_id], ['name'])[0]['name']
|
||||
period_string = _("Period: %s") % tools.ustr(period)
|
||||
|
||||
view = """<?xml version="1.0" encoding="utf-8"?>
|
||||
<form string="Standard entries">
|
||||
|
@ -105,16 +107,16 @@ class account_move_journal(osv.osv_memory):
|
|||
<field name="target_move" />
|
||||
<newline/>
|
||||
<group colspan="4" >
|
||||
<label width="300" string="Journal: %s"/>
|
||||
<label width="300" string="%s"/>
|
||||
<newline/>
|
||||
<label width="300" string="Period: %s"/>
|
||||
<label width="300" string="%s"/>
|
||||
</group>
|
||||
<group colspan="4" col="4">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="terp-gtk-go-back-rtl" string="Open" name="action_open_window" default_focus="1" type="object"/>
|
||||
</group>
|
||||
</form>""" % (tools.ustr(journal), tools.ustr(period))
|
||||
</form>""" % (journal_string, period_string)
|
||||
|
||||
view = etree.fromstring(view.encode('utf8'))
|
||||
xarch, xfields = self._view_look_dom_arch(cr, uid, view, view_id, context=context)
|
||||
|
@ -190,4 +192,4 @@ class account_move_journal(osv.osv_memory):
|
|||
|
||||
account_move_journal()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -32,17 +32,6 @@ class account_balance_report(osv.osv_memory):
|
|||
'journal_ids': [],
|
||||
}
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
res = super(account_balance_report, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
|
||||
doc = etree.XML(res['arch'])
|
||||
nodes = doc.xpath("//field[@name='journal_ids']")
|
||||
for node in nodes:
|
||||
node.set('readonly', '1')
|
||||
node.set('required', '0')
|
||||
res['arch'] = etree.tostring(doc)
|
||||
return res
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
data = self.pre_print_report(cr, uid, ids, data, context=context)
|
||||
return {'type': 'ir.actions.report.xml', 'report_name': 'account.account.balance', 'datas': data}
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
<field name="inherit_id" ref="account_common_report_view" />
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='journal_ids']" position="replace">
|
||||
<field name="journal_ids" colspan="4" nolabel="1" required="0" readonly="1"/>
|
||||
</xpath>
|
||||
<xpath expr="/form/label[@string='']" position="replace">
|
||||
<separator string="Trial Balance" colspan="4"/>
|
||||
<label nolabel="1" colspan="4" string="This report allows you to print or generate a pdf of your trial balance allowing you to quickly check the balance of each of your accounts in a single report"/>
|
||||
|
|
|
@ -44,16 +44,6 @@ class account_aged_trial_balance(osv.osv_memory):
|
|||
'direction_selection': 'past',
|
||||
}
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
res = super(account_aged_trial_balance, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
|
||||
doc = etree.XML(res['arch'])
|
||||
nodes = doc.xpath("//field[@name='journal_ids']")
|
||||
for node in nodes:
|
||||
node.set('invisible', '1')
|
||||
node.set('required', '0')
|
||||
res['arch'] = etree.tostring(doc)
|
||||
return res
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
res = {}
|
||||
if context is None:
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<newline/>
|
||||
<field name="result_selection"/>
|
||||
<field name="direction_selection"/>
|
||||
<field name="journal_ids"/>
|
||||
<field name="journal_ids" required="0" invisible="1"/>
|
||||
<newline/>
|
||||
<separator colspan="4"/>
|
||||
<group col="4" colspan="4">
|
||||
|
|
|
@ -32,36 +32,45 @@ class account_bs_report(osv.osv_memory):
|
|||
_inherit = "account.common.account.report"
|
||||
_description = 'Account Balance Sheet Report'
|
||||
|
||||
def _get_def_reserve_account(self, cr, uid, context=None):
|
||||
chart_id = self._get_account(cr, uid, context=context)
|
||||
res = self.onchange_chart_id(cr, uid, [], chart_id, context=context)
|
||||
if not res:
|
||||
return False
|
||||
return res['value']['reserve_account_id']
|
||||
|
||||
_columns = {
|
||||
'display_type': fields.boolean("Landscape Mode"),
|
||||
'reserve_account_id': fields.many2one('account.account', 'Reserve & Profit/Loss Account',required = True,
|
||||
help='This Account is used for trasfering Profit/Loss(If It is Profit: Amount will be added, Loss : Amount will be duducted.), Which is calculated from Profilt & Loss Report', domain = [('type','=','payable')]),
|
||||
'reserve_account_id': fields.many2one('account.account', 'Reserve & Profit/Loss Account',
|
||||
required=True,
|
||||
help='This Account is used for transfering Profit/Loss ' \
|
||||
'(Profit: Amount will be added, Loss: Amount will be duducted), ' \
|
||||
'which is calculated from Profilt & Loss Report',
|
||||
domain = [('type','=','payable')]),
|
||||
}
|
||||
|
||||
_defaults={
|
||||
'display_type': True,
|
||||
'journal_ids': [],
|
||||
'reserve_account_id': _get_def_reserve_account,
|
||||
}
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
res = super(account_bs_report, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
|
||||
doc = etree.XML(res['arch'])
|
||||
nodes = doc.xpath("//field[@name='journal_ids']")
|
||||
for node in nodes:
|
||||
node.set('readonly', '1')
|
||||
node.set('required', '0')
|
||||
res['arch'] = etree.tostring(doc)
|
||||
return res
|
||||
def onchange_chart_id(self, cr, uid, ids, chart_id, context=None):
|
||||
if not chart_id:
|
||||
return {}
|
||||
account = self.pool.get('account.account').browse(cr, uid, chart_id , context=context)
|
||||
if not account.company_id.property_reserve_and_surplus_account:
|
||||
return {'value': {'reserve_account_id': False}}
|
||||
return {'value': {'reserve_account_id': account.company_id.property_reserve_and_surplus_account.id}}
|
||||
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data = self.pre_print_report(cr, uid, ids, data, context=context)
|
||||
account = self.pool.get('account.account').browse(cr, uid, data['form']['chart_account_id'], context=context)
|
||||
if not account.company_id.property_reserve_and_surplus_account:
|
||||
data['form'].update(self.read(cr, uid, ids, ['display_type','reserve_account_id'])[0])
|
||||
if not data['form']['reserve_account_id']:
|
||||
raise osv.except_osv(_('Warning'),_('Please define the Reserve and Profit/Loss account for current user company !'))
|
||||
data['form']['reserve_account_id'] = account.company_id.property_reserve_and_surplus_account.id
|
||||
data['form'].update(self.read(cr, uid, ids, ['display_type'])[0])
|
||||
data = self.pre_print_report(cr, uid, ids, data, context=context)
|
||||
if data['form']['display_type']:
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
|
@ -77,4 +86,4 @@ class account_bs_report(osv.osv_memory):
|
|||
|
||||
account_bs_report()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -9,14 +9,20 @@
|
|||
<field name="inherit_id" ref="account.account_common_report_view" />
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='chart_account_id']" position="replace">
|
||||
<field name="chart_account_id" widget="selection" on_change="onchange_chart_id(chart_account_id)"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='journal_ids']" position="replace">
|
||||
<field name="journal_ids" colspan="4" nolabel="1" required="0" readonly="1"/>
|
||||
</xpath>
|
||||
<xpath expr="/form/label[@string='']" position="replace">
|
||||
<separator string="Balance Sheet" colspan="4"/>
|
||||
<label nolabel="1" colspan="4" string="This report allows you to print or generate a pdf of your trial balance allowing you to quickly check the balance of each of your accounts in a single report"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='target_move']" position="after">
|
||||
<field name="display_account"/>
|
||||
<field name="reserve_account_id" required="1"/>
|
||||
<field name="display_type"/>
|
||||
<field name="reserve_account_id" required="0" invisible="1"/>
|
||||
<newline/>
|
||||
</xpath>
|
||||
</data>
|
||||
|
|
|
@ -86,7 +86,7 @@ class account_common_report(osv.osv_memory):
|
|||
return res
|
||||
|
||||
def _get_account(self, cr, uid, context=None):
|
||||
accounts = self.pool.get('account.account').search(cr, uid, [], limit=1)
|
||||
accounts = self.pool.get('account.account').search(cr, uid, [('parent_id', '=', False)], limit=1)
|
||||
return accounts and accounts[0] or False
|
||||
|
||||
def _get_fiscalyear(self, cr, uid, context=None):
|
||||
|
|
|
@ -40,21 +40,6 @@ class account_pl_report(osv.osv_memory):
|
|||
'target_move': False
|
||||
}
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
res = super(account_pl_report, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
|
||||
doc = etree.XML(res['arch'])
|
||||
nodes = doc.xpath("//field[@name='journal_ids']")
|
||||
for node in nodes:
|
||||
node.set('readonly', '1')
|
||||
node.set('required', '0')
|
||||
nodes = doc.xpath("//field[@name='target_move']")
|
||||
for node in nodes:
|
||||
node.set('readonly', '1')
|
||||
node.set('required', '0')
|
||||
res['arch'] = etree.tostring(doc)
|
||||
return res
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
|
|
|
@ -9,6 +9,12 @@
|
|||
<field name="inherit_id" ref="account.account_common_report_view" />
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='target_move']" position="replace">
|
||||
<field name="target_move" required="0" readonly="1"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='journal_ids']" position="replace">
|
||||
<field name="journal_ids" required="0" colspan="4" nolabel="1" readonly="1"/>
|
||||
</xpath>
|
||||
<xpath expr="/form/label[@string='']" position="replace">
|
||||
<separator string="Profit And Loss" colspan="4"/>
|
||||
<label nolabel="1" colspan="4" string="The Profit and Loss report gives you an overview of your company profit and loss in a single document"/>
|
||||
|
|
|
@ -171,7 +171,7 @@ class account_analytic_plan_instance(osv.osv):
|
|||
"""% (tools.to_xml(plan_id.name), wiz_id[0])
|
||||
for line in plan_id.plan_ids:
|
||||
res['arch']+="""
|
||||
<field name="account%d_ids" string="%s" colspan="4">
|
||||
<field name="account%d_ids" string="%s" nolabel="1" colspan="4">
|
||||
<tree string="%s" editable="bottom">
|
||||
<field name="rate"/>
|
||||
<field name="analytic_account_id" domain="[('parent_id','child_of',[%d])]" groups="base.group_extended"/>
|
||||
|
|
|
@ -29,6 +29,15 @@ class account_invoice_line(osv.osv):
|
|||
def move_line_get(self, cr, uid, invoice_id, context=None):
|
||||
res = super(account_invoice_line,self).move_line_get(cr, uid, invoice_id, context=context)
|
||||
inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context=context)
|
||||
company_currency = inv.company_id.currency_id.id
|
||||
def get_price(cr, uid, inv, company_currency,i_line):
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
if inv.currency_id.id != company_currency:
|
||||
price = cur_obj.compute(cr, uid, company_currency, inv.currency_id.id, i_line.product_id.product_tmpl_id.standard_price * i_line.quantity, context={'date': inv.date_invoice})
|
||||
else:
|
||||
price = i_line.product_id.product_tmpl_id.standard_price * i_line.quantity
|
||||
return price
|
||||
|
||||
if inv.type in ('out_invoice','out_refund'):
|
||||
for i_line in inv.invoice_line:
|
||||
if i_line.product_id:
|
||||
|
@ -56,7 +65,7 @@ class account_invoice_line(osv.osv):
|
|||
'name': i_line.name[:64],
|
||||
'price_unit':i_line.product_id.product_tmpl_id.standard_price,
|
||||
'quantity':i_line.quantity,
|
||||
'price':i_line.product_id.product_tmpl_id.standard_price * i_line.quantity,
|
||||
'price':get_price(cr, uid, inv, company_currency, i_line),
|
||||
'account_id':dacc,
|
||||
'product_id':i_line.product_id.id,
|
||||
'uos_id':i_line.uos_id.id,
|
||||
|
@ -69,7 +78,7 @@ class account_invoice_line(osv.osv):
|
|||
'name': i_line.name[:64],
|
||||
'price_unit':i_line.product_id.product_tmpl_id.standard_price,
|
||||
'quantity':i_line.quantity,
|
||||
'price': -1 * i_line.product_id.product_tmpl_id.standard_price * i_line.quantity,
|
||||
'price': -1 * get_price(cr, uid, inv, company_currency, i_line),
|
||||
'account_id':cacc,
|
||||
'product_id':i_line.product_id.id,
|
||||
'uos_id':i_line.uos_id.id,
|
||||
|
|
|
@ -30,7 +30,25 @@ class product_category(osv.osv):
|
|||
string="Price Difference Account",
|
||||
method=True,
|
||||
view_load=True,
|
||||
help="This account will be used to value price difference between purchase price and cost price."),
|
||||
help="This account will be used to value price difference between purchase price and cost price."),
|
||||
|
||||
#Redefine fields to change help text for anglo saxon methodology.
|
||||
'property_account_income_categ': fields.property(
|
||||
'account.account',
|
||||
type='many2one',
|
||||
relation='account.account',
|
||||
string="Income Account",
|
||||
method=True,
|
||||
view_load=True,
|
||||
help="This account will be used to value outgoing stock for the current product category using sale price"),
|
||||
'property_account_expense_categ': fields.property(
|
||||
'account.account',
|
||||
type='many2one',
|
||||
relation='account.account',
|
||||
string="Expense Account",
|
||||
method=True,
|
||||
view_load=True,
|
||||
help="This account will be used to value outgoing stock for the current product category using cost price"),
|
||||
|
||||
}
|
||||
product_category()
|
||||
|
@ -45,7 +63,25 @@ class product_template(osv.osv):
|
|||
string="Price Difference Account",
|
||||
method=True,
|
||||
view_load=True,
|
||||
help="This account will be used to value price difference between purchase price and cost price."),
|
||||
help="This account will be used to value price difference between purchase price and cost price."),
|
||||
|
||||
#Redefine fields to change help text for anglo saxon methodology.
|
||||
'property_account_income': fields.property(
|
||||
'account.account',
|
||||
type='many2one',
|
||||
relation='account.account',
|
||||
string="Income Account",
|
||||
method=True,
|
||||
view_load=True,
|
||||
help="This account will be used to value outgoing stock for the current product category using sale price"),
|
||||
'property_account_expense': fields.property(
|
||||
'account.account',
|
||||
type='many2one',
|
||||
relation='account.account',
|
||||
string="Expense Account",
|
||||
method=True,
|
||||
view_load=True,
|
||||
help="This account will be used to value outgoing stock for the current product category using cost price"),
|
||||
|
||||
}
|
||||
product_template()
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
"voucher_sales_purchase_view.xml",
|
||||
"account_voucher_wizard.xml",
|
||||
"account_voucher_pay_invoice.xml",
|
||||
"report/account_voucher_sales_receipt_view.xml",
|
||||
"security/account_voucher_security.xml"
|
||||
],
|
||||
"test" : [
|
||||
|
|
|
@ -982,7 +982,7 @@ class account_bank_statement_line(osv.osv):
|
|||
def _check_amount(self, cr, uid, ids, context=None):
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
if obj.voucher_id:
|
||||
if not (obj.amount == obj.voucher_id.amount):
|
||||
if not (abs(obj.amount) == obj.voucher_id.amount):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
|
|
@ -21,5 +21,6 @@
|
|||
|
||||
import account_voucher
|
||||
import account_voucher_print
|
||||
import account_voucher_sales_receipt
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,134 @@
|
|||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
import time
|
||||
|
||||
from osv import fields, osv
|
||||
import pooler
|
||||
from tools import config
|
||||
import tools
|
||||
|
||||
class sale_receipt_report(osv.osv):
|
||||
_name = "sale.receipt.report"
|
||||
_description = "Sales Receipt Statistics"
|
||||
_auto = False
|
||||
_rec_name = 'date'
|
||||
_columns = {
|
||||
'date': fields.date('Date', readonly=True),
|
||||
'year': fields.char('Year', size=4, readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'month': fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
||||
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
|
||||
('10','October'), ('11','November'), ('12','December')], 'Month', readonly=True),
|
||||
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal', readonly=True),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', readonly=True),
|
||||
'user_id': fields.many2one('res.users', 'Salesman', readonly=True),
|
||||
'price_total': fields.float('Total Without Tax', readonly=True),
|
||||
'price_total_tax': fields.float('Total With Tax', readonly=True),
|
||||
'nbr':fields.integer('# of Voucher Lines', readonly=True),
|
||||
'type': fields.selection([
|
||||
('sale','Sale'),
|
||||
('purchase','Purchase'),
|
||||
('payment','Payment'),
|
||||
('receipt','Receipt'),
|
||||
],'Type', readonly=True),
|
||||
'state': fields.selection([
|
||||
('draft','Draft'),
|
||||
('proforma','Pro-forma'),
|
||||
('posted','Posted'),
|
||||
('cancel','Cancelled')
|
||||
], 'Voucher State', readonly=True),
|
||||
'pay_now':fields.selection([
|
||||
('pay_now','Pay Directly'),
|
||||
('pay_later','Pay Later or Group Funds'),
|
||||
],'Payment', readonly=True),
|
||||
'date_due': fields.date('Due Date', readonly=True),
|
||||
'account_id': fields.many2one('account.account', 'Account',readonly=True),
|
||||
'delay_to_pay': fields.float('Avg. Delay To Pay', readonly=True, group_operator="avg"),
|
||||
'due_delay': fields.float('Avg. Due Delay', readonly=True, group_operator="avg")
|
||||
}
|
||||
_order = 'date desc'
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'sale_receipt_report')
|
||||
cr.execute("""
|
||||
create or replace view sale_receipt_report as (
|
||||
select min(avl.id) as id,
|
||||
av.date as date,
|
||||
to_char(av.date, 'YYYY') as year,
|
||||
to_char(av.date, 'MM') as month,
|
||||
to_char(av.date, 'YYYY-MM-DD') as day,
|
||||
av.partner_id as partner_id,
|
||||
av.currency_id as currency_id,
|
||||
av.journal_id as journal_id,
|
||||
rp.user_id as user_id,
|
||||
av.company_id as company_id,
|
||||
count(avl.*) as nbr,
|
||||
av.type as type,
|
||||
av.state,
|
||||
av.pay_now,
|
||||
av.date_due as date_due,
|
||||
av.account_id as account_id,
|
||||
sum(av.amount-av.tax_amount)/(select count(l.id) from account_voucher_line as l
|
||||
left join account_voucher as a ON (a.id=l.voucher_id)
|
||||
where a.id=av.id) as price_total,
|
||||
sum(av.amount)/(select count(l.id) from account_voucher_line as l
|
||||
left join account_voucher as a ON (a.id=l.voucher_id)
|
||||
where a.id=av.id) as price_total_tax,
|
||||
sum((select extract(epoch from avg(date_trunc('day',aml.date_created)-date_trunc('day',l.create_date)))/(24*60*60)::decimal(16,2)
|
||||
from account_move_line as aml
|
||||
left join account_voucher as a ON (a.move_id=aml.move_id)
|
||||
left join account_voucher_line as l ON (a.id=l.voucher_id)
|
||||
where a.id=av.id)) as delay_to_pay,
|
||||
sum((select extract(epoch from avg(date_trunc('day',a.date_due)-date_trunc('day',a.date)))/(24*60*60)::decimal(16,2)
|
||||
from account_move_line as aml
|
||||
left join account_voucher as a ON (a.move_id=aml.move_id)
|
||||
left join account_voucher_line as l ON (a.id=l.voucher_id)
|
||||
where a.id=av.id)) as due_delay
|
||||
from account_voucher_line as avl
|
||||
left join account_voucher as av on (av.id=avl.voucher_id)
|
||||
left join res_partner as rp ON (rp.id=av.partner_id)
|
||||
left join account_journal as aj ON (aj.id=av.journal_id)
|
||||
where av.type='sale' and aj.type in ('sale','sale_refund')
|
||||
group by
|
||||
av.date,
|
||||
av.id,
|
||||
to_char(av.date, 'YYYY'),
|
||||
to_char(av.date, 'MM'),
|
||||
to_char(av.date, 'YYYY-MM-DD'),
|
||||
av.partner_id,
|
||||
av.currency_id,
|
||||
av.journal_id,
|
||||
rp.user_id,
|
||||
av.company_id,
|
||||
av.type,
|
||||
av.state,
|
||||
av.date_due,
|
||||
av.account_id,
|
||||
av.tax_amount,
|
||||
av.amount,
|
||||
av.tax_amount,
|
||||
av.pay_now
|
||||
)
|
||||
""")
|
||||
|
||||
sale_receipt_report()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,115 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_sale_receipt_report_tree" model="ir.ui.view">
|
||||
<field name="name">sale.receipt.report.tree</field>
|
||||
<field name="model">sale.receipt.report</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="blue:state in ('draft');gray:state in ('cancel','paid');black:state in ('proforma','proforma2')" string="Sales Receipt Analysis">
|
||||
<field name="date" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="year" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="type" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="journal_id" invisible="1"/>
|
||||
<field name="date_due" invisible="1"/>
|
||||
<field name="account_id" invisible="1"/>
|
||||
<field name="nbr" sum="# of Voucher Lines"/>
|
||||
<field name="price_total" sum="Total Without Tax"/>
|
||||
<field name="price_total_tax" sum="Total With Tax"/>
|
||||
<field name="due_delay" sum="Avg. Due Delay"/>
|
||||
<field name="delay_to_pay" sum="Avg. Delay To Pay"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_sale_receipt_report_graph" model="ir.ui.view">
|
||||
<field name="name">sale.receipt.report.graph</field>
|
||||
<field name="model">sale.receipt.report</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Sales Receipt Analysis" type="bar">
|
||||
<field name="account_id"/>
|
||||
<field name="price_total"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_sale_receipt_report_search" model="ir.ui.view">
|
||||
<field name="name">sale.receipt.report.search</field>
|
||||
<field name="model">sale.receipt.report</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Sales Receipt Analysis">
|
||||
<group col="10" colspan="12">
|
||||
<filter string="Draft"
|
||||
icon="terp-document-new"
|
||||
domain="[('state','=','draft')]"
|
||||
help = "Draft Vouchers"/>
|
||||
<filter string="Pro-forma"
|
||||
icon="terp-gtk-media-pause"
|
||||
domain="[('state','=','proforma')]"
|
||||
help = "Pro-forma Vouchers"/>
|
||||
<filter string="Posted"
|
||||
name="current"
|
||||
icon="terp-check"
|
||||
domain="[('state','not in', ('draft','cancel'))]"
|
||||
help = "Validated Vouchers"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="date" string="Voucher Date"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended Filters..." groups="base.group_extended">
|
||||
<field name="journal_id" widget="selection"/>
|
||||
<field name="pay_now"/>
|
||||
<field name="account_id"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date_due"/>
|
||||
<separator orientation="vertical" groups="base.group_multi_company"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By...">
|
||||
<filter string="Partner" name="partner" icon="terp-partner" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Salesman" name='user' icon="terp-personal" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
|
||||
<filter string="Type" icon="terp-stock_symbol-selection" context="{'group_by':'type'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Due Date" icon="terp-go-today" context="{'group_by':'date_due'}"/>
|
||||
<separator orientation="vertical" groups="base.group_multi_company"/>
|
||||
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" name="day" icon="terp-go-today" context="{'group_by':'day'}" help="Group by Invoice Date"/>
|
||||
<filter string="Month" name="month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of Invoice Date"/>
|
||||
<filter string="Year" name="year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of Invoice Date"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_sale_receipt_report_all" model="ir.actions.act_window">
|
||||
<field name="name">Sales Receipt Analysis</field>
|
||||
<field name="res_model">sale.receipt.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="context">{'search_default_current':1, 'search_default_partner':1, 'search_default_customer':1, 'search_default_date': time.strftime('%Y-01-01'), 'group_by':[], 'group_by_no_leaf':1,}</field>
|
||||
<field name="search_view_id" ref="view_sale_receipt_report_search"/>
|
||||
<field name="help">From this report, you can have an overview of the amount invoiced to your customer as well as payment delays. The tool search can also be used to personalise your Invoices reports and so, match this analysis to your needs.</field>
|
||||
|
||||
</record>
|
||||
|
||||
<menuitem action="action_sale_receipt_report_all" id="menu_action_sale_receipt_report_all" parent="account.menu_finance_statistic_report_statement" sequence="3"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -35,7 +35,7 @@ class account_statement_from_invoice_lines(osv.osv_memory):
|
|||
}
|
||||
|
||||
def populate_statement(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
if context is None:
|
||||
context = {}
|
||||
statement_id = context.get('statement_id', False)
|
||||
if not statement_id:
|
||||
|
@ -75,7 +75,7 @@ class account_statement_from_invoice_lines(osv.osv_memory):
|
|||
statement.currency.id, amount, context=ctx)
|
||||
|
||||
context.update({'move_line_ids': [line.id]})
|
||||
result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype=(amount < 0 and 'payment' or 'receipt'), context=context)
|
||||
result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype=(amount < 0 and 'payment' or 'receipt'), date=time.strftime('%Y-%m-%d'), context=context)
|
||||
voucher_res = { 'type':(amount < 0 and 'payment' or 'receipt'),
|
||||
'name': line.name,
|
||||
'partner_id': line.partner_id.id,
|
||||
|
@ -135,7 +135,7 @@ class account_statement_from_invoice(osv.osv_memory):
|
|||
}
|
||||
|
||||
def search_invoices(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
if context is None:
|
||||
context = {}
|
||||
line_obj = self.pool.get('account.move.line')
|
||||
statement_obj = self.pool.get('account.bank.statement')
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
<field name="inherit_id" ref="hr_timesheet_invoice.account_analytic_account_form_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='to_invoice']" position="after">
|
||||
<field name="journal_rate_ids" colspan="4"/>
|
||||
</xpath>
|
||||
<field name="journal_rate_ids" nolabel="1" colspan="4"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -221,7 +221,7 @@ class hr_department(osv.osv):
|
|||
_inherit = 'hr.department'
|
||||
_columns = {
|
||||
'manager_id': fields.many2one('hr.employee', 'Manager'),
|
||||
'member_ids': fields.one2many('hr.employee', 'department_id', 'Members'),
|
||||
'member_ids': fields.one2many('hr.employee', 'department_id', 'Members', readonly=True),
|
||||
}
|
||||
|
||||
hr_department()
|
||||
|
|
|
@ -114,6 +114,18 @@ class hr_contract(osv.osv):
|
|||
'date_start': lambda *a: time.strftime("%Y-%m-%d"),
|
||||
}
|
||||
|
||||
def _check_dates(self, cr, uid, ids, context=None):
|
||||
for contract in self.read(cr, uid, ids, ['date_start', 'date_end'], context=context):
|
||||
if contract['date_start'] and contract['date_end'] and contract['date_start'] > contract['date_end']:
|
||||
return False
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_dates, 'Error! contract start-date must be lower then contract end-date.', ['date_start', 'date_end'])
|
||||
]
|
||||
|
||||
|
||||
|
||||
hr_contract()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -28,11 +28,11 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree string="Expenses" colors="blue:state=='draft'">
|
||||
<field name="employee_id"/>
|
||||
<field name="date"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="department_id" groups="base.group_extended"/>
|
||||
<field name="name"/>
|
||||
<field name="date"/>
|
||||
<field name="ref"/>
|
||||
<field name="name"/>
|
||||
<field name="amount"/>
|
||||
<field name="state"/>
|
||||
<button name="confirm" states="draft" string="Confirm" type="workflow" icon="gtk-apply" groups="base.group_hr_user,base.group_hr_manager"/>
|
||||
|
@ -175,7 +175,8 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="context">{"search_default_user_id":uid}</field>
|
||||
<field name="search_view_id" ref="view_hr_expense_filter"/>
|
||||
<field name="help">The OpenERP expenses management module allows you to track the full flow. Every month, employees record their expenses. At the end of the month, the manager concerned validates the Expense Sheets which creates costs on projects/analytic accounts. The accountant validates the proposed entries and the employee can be reimbursed. You can also reinvoice the customer at the end of the flow.</field>
|
||||
<field name="view_id" ref="view_expenses_tree"/>
|
||||
<field name="help">The OpenERP expenses management module allows you to track the full flow. Every month, the employees record their expenses. At the end of the month, their managers validates the expenses sheets which creates costs on projects/analytic accounts. The accountant validates the proposed entries and the employee can be reimbursed. You can also reinvoice the customer at the end of the flow.</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="next_id_49" name="Expenses" sequence="4" parent="hr.menu_hr_root"/>
|
||||
|
|
|
@ -55,9 +55,9 @@
|
|||
'wizard/hr_payroll_year_salary.xml',
|
||||
],
|
||||
'test': [
|
||||
# 'test/payslip.yml',
|
||||
# 'test/payment_advice.yml',
|
||||
# 'test/payroll_register.yml',
|
||||
'test/payslip.yml',
|
||||
'test/payment_advice.yml',
|
||||
'test/payroll_register.yml',
|
||||
# 'test/hr_payroll_report.yml',
|
||||
],
|
||||
'demo_xml': [
|
||||
|
|
|
@ -27,6 +27,7 @@ from datetime import timedelta
|
|||
|
||||
import netsvc
|
||||
from osv import fields, osv
|
||||
import tools
|
||||
from tools.translate import _
|
||||
import decimal_precision as dp
|
||||
|
||||
|
@ -1058,7 +1059,7 @@ class hr_payslip(osv.osv):
|
|||
update.update({
|
||||
'basic': round(0.0),
|
||||
'basic_before_leaves': round(0.0),
|
||||
'name':'Salary Slip of %s for %s' % (slip.employee_id.name, ttyme.strftime('%B-%Y')),
|
||||
'name':'Salary Slip of %s for %s' % (slip.employee_id.name, tools.ustr(ttyme.strftime('%B-%Y'))),
|
||||
'state':'draft',
|
||||
'contract_id':False,
|
||||
'company_id':slip.employee_id.company_id.id
|
||||
|
@ -1181,7 +1182,7 @@ class hr_payslip(osv.osv):
|
|||
'number':number,
|
||||
'basic': round(basic),
|
||||
'basic_before_leaves': round(basic),
|
||||
'name':'Salary Slip of %s for %s' % (slip.employee_id.name, ttyme.strftime('%B-%Y')),
|
||||
'name':'Salary Slip of %s for %s' % (slip.employee_id.name, tools.ustr(ttyme.strftime('%B-%Y'))),
|
||||
'state':'draft',
|
||||
'contract_id':contract.id,
|
||||
'company_id':slip.employee_id.company_id.id
|
||||
|
|
|
@ -19,19 +19,14 @@
|
|||
type_id: hr_contract.hr_contract_type_emp
|
||||
country_id: base.in
|
||||
department_id: hr.dep_it
|
||||
employee_account: account.a_recv
|
||||
gender: male
|
||||
marital: hr.hr_employee_marital_status_single
|
||||
name: Richie
|
||||
pg_joining: '2009-12-01'
|
||||
property_bank_account: account.cash
|
||||
salary_account: account.a_recv
|
||||
vehicle_distance: 0.0
|
||||
-
|
||||
I create a new payment advice record
|
||||
-
|
||||
!record {model: hr.payroll.advice, id: hr_payroll_advice_advice0}:
|
||||
account_id: account.cash
|
||||
line_ids:
|
||||
- amount: 5500.0
|
||||
bysal: 5000.0
|
||||
|
@ -56,7 +51,7 @@
|
|||
|
||||
-
|
||||
Print Payroll Advice
|
||||
-
|
||||
-
|
||||
!python {model: hr.payroll.advice}: |
|
||||
import netsvc, tools, os
|
||||
(data, format) = netsvc.LocalService('report.payroll.advice').create(cr, uid, [ref('hr_payroll_advice_advice0')], {}, {})
|
||||
|
|
|
@ -18,25 +18,17 @@
|
|||
type_id: hr_contract.hr_contract_type_emp
|
||||
country_id: base.in
|
||||
department_id: hr.dep_it
|
||||
employee_account: account.a_recv
|
||||
gender: male
|
||||
marital: hr.hr_employee_marital_status_single
|
||||
name: Keith
|
||||
pg_joining: '2009-12-01'
|
||||
property_bank_account: account.cash
|
||||
salary_account: account.a_recv
|
||||
vehicle_distance: 0.0
|
||||
-
|
||||
I create a payroll register record.
|
||||
-
|
||||
!record {model: hr.payroll.register, id: hr_payroll_register_payroll0}:
|
||||
bank_journal_id: account.bank_journal
|
||||
date: '2010-07-02'
|
||||
journal_id: account.expenses_journal
|
||||
line_ids:
|
||||
- employee_id: hr_payroll.hr_employee_keith0
|
||||
bank_journal_id: account.bank_journal
|
||||
journal_id: account.expenses_journal
|
||||
name: payroll1
|
||||
-
|
||||
I click on Compute button.
|
||||
|
|
|
@ -29,14 +29,10 @@
|
|||
type_id: hr_contract.hr_contract_type_emp
|
||||
country_id: base.in
|
||||
department_id: hr.dep_it
|
||||
employee_account: account.a_recv
|
||||
gender: male
|
||||
marital: hr.hr_employee_marital_status_single
|
||||
name: Richard
|
||||
pg_joining: '2009-12-01'
|
||||
property_bank_account: account.cash
|
||||
bank_account_id: res_partner_bank_0
|
||||
salary_account: account.a_recv
|
||||
vehicle_distance: 0.0
|
||||
-
|
||||
I create a new payroll structure for software developer
|
||||
|
@ -44,8 +40,7 @@
|
|||
!record {model: hr.payroll.structure, id: hr_payroll_structure_softwaredeveloper0}:
|
||||
code: SD
|
||||
line_ids:
|
||||
- account_id: account.a_expense
|
||||
amount: 0.40000000000000002
|
||||
- amount: 0.40000000000000002
|
||||
amount_type: per
|
||||
category_id: hr_payroll.HRA
|
||||
code: HRA
|
||||
|
@ -54,8 +49,7 @@
|
|||
sequence: 5
|
||||
total: 0.0
|
||||
type: allowance
|
||||
- account_id: account.a_expense
|
||||
amount: 10000.0
|
||||
- amount: 10000.0
|
||||
amount_type: fix
|
||||
category_id: hr_payroll.CA
|
||||
code: CA
|
||||
|
@ -64,8 +58,7 @@
|
|||
sequence: 10
|
||||
total: 0.0
|
||||
type: allowance
|
||||
- account_id: account.a_pay
|
||||
amount: 10000.0
|
||||
- amount: 10000.0
|
||||
amount_type: fix
|
||||
category_id: hr_payroll.PT
|
||||
code: PT
|
||||
|
@ -74,8 +67,7 @@
|
|||
sequence: 15
|
||||
total: 0.0
|
||||
type: deduction
|
||||
- account_id: account.a_pay
|
||||
amount: 0.125
|
||||
- amount: 0.125
|
||||
amount_type: per
|
||||
category_id: hr_payroll.PF
|
||||
code: PF
|
||||
|
@ -89,9 +81,8 @@
|
|||
I create a employee payslip record
|
||||
-
|
||||
!record {model: hr.payslip, id: hr_payslip_0}:
|
||||
bank_journal_id: account.bank_journal
|
||||
employee_id: hr_payroll.hr_employee_richard0
|
||||
journal_id: account.expenses_journal
|
||||
|
||||
-
|
||||
I click on 'Compute Sheet' button
|
||||
-
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
|
||||
<record id="hr_payroll.hr_payslip_line_houserantallowance1" model="hr.payslip.line">
|
||||
<field name="account_id" ref="account.a_salary_expense"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="hr_payroll.hr_payslip_line_convanceallowance1" model="hr.payslip.line">
|
||||
<field name="account_id" ref="account.a_salary_expense"/>
|
||||
</record>
|
||||
|
@ -26,7 +26,7 @@
|
|||
|
||||
<!-- Assigned Default Account in Different Demo Employees -->
|
||||
|
||||
<record id="hr.employee" model="hr.employee">
|
||||
<!--record id="hr.employee" model="hr.employee">
|
||||
<field name="property_bank_account" ref="account.bnk"/>
|
||||
<field name="salary_account" ref="account.a_salary_expense"/>
|
||||
<field name="employee_account" ref="account.a_expense"/>
|
||||
|
@ -37,7 +37,7 @@
|
|||
<field name="salary_account" ref="account.a_salary_expense"/>
|
||||
<field name="employee_account" ref="account.a_expense"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="hr.employee2" model="hr.employee">
|
||||
<field name="property_bank_account" ref="account.bnk"/>
|
||||
<field name="salary_account" ref="account.a_salary_expense"/>
|
||||
|
@ -54,6 +54,52 @@
|
|||
<field name="property_bank_account" ref="account.bnk"/>
|
||||
<field name="salary_account" ref="account.a_salary_expense"/>
|
||||
<field name="employee_account" ref="account.a_expense"/>
|
||||
</record-->
|
||||
|
||||
<record id="bnk" model="account.account">
|
||||
<field name="code">X110041</field>
|
||||
<field name="name">Bank Current Account</field>
|
||||
<field ref="account.cas" name="parent_id"/>
|
||||
<field name="type">liquidity</field>
|
||||
<field name="user_type" ref="account.account_type_asset"/>
|
||||
</record>
|
||||
|
||||
<record id="a_salary_expense" model="account.account">
|
||||
<field name="code">X21122</field>
|
||||
<field name="name">Salary Expenses</field>
|
||||
<field ref="account.ovr" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account.account_type_expense"/>
|
||||
</record>
|
||||
|
||||
<record id="a_expense" model="account.account">
|
||||
<field name="code">X21102</field>
|
||||
<field name="name">Expenses</field>
|
||||
<field ref="account.ovr" name="parent_id"/>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account.account_type_expense"/>
|
||||
</record>
|
||||
|
||||
<!-- Properties -->
|
||||
<record forcecreate="True" id="property_bank_account" model="ir.property">
|
||||
<field name="name">property_bank_account</field>
|
||||
<field name="fields_id" search="[('model','=','hr.employee'),('name','=','property_bank_account')]"/>
|
||||
<field eval="'account.account,'+str(bnk)" name="value"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record forcecreate="True" id="salary_account" model="ir.property">
|
||||
<field name="name">salary_account</field>
|
||||
<field name="fields_id" search="[('model','=','hr.employee'),('name','=','salary_account')]"/>
|
||||
<field eval="'account.account,'+str(a_salary_expense)" name="value"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
<record forcecreate="True" id="employee_account" model="ir.property">
|
||||
<field name="name">employee_account</field>
|
||||
<field name="fields_id" search="[('model','=','hr.employee'),('name','=','employee_account')]"/>
|
||||
<field eval="'account.account,'+str(a_expense)" name="value"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree string="Applicants" colors="grey:state in ('cancel','done');blue:state=='pending'">
|
||||
<field name="create_date"/>
|
||||
<field name="name" string="Subject"/>
|
||||
<field name="partner_name"/>
|
||||
<field name="email_from"/>
|
||||
<field name="partner_phone"/>
|
||||
|
|
|
@ -35,10 +35,10 @@ def lengthmonth(year, month):
|
|||
|
||||
class report_custom(report_rml):
|
||||
|
||||
def get_month_name(self, cr, uid, month):
|
||||
def get_month_name(self, cr, uid, month, context=None):
|
||||
_months = {1:_("January"), 2:_("February"), 3:_("March"), 4:_("April"), 5:_("May"), 6:_("June"), 7:_("July"), 8:_("August"), 9:_("September"), 10:_("October"), 11:_("November"), 12:_("December")}
|
||||
return _months[month]
|
||||
def get_weekday_name(self, cr, uid, weekday):
|
||||
def get_weekday_name(self, cr, uid, weekday, context=None):
|
||||
_weekdays = {1:_('Mon'), 2:_('Tue'), 3:_('Wed'), 4:_('Thu'), 5:_('Fri'), 6:_('Sat'), 7:_('Sun')}
|
||||
return _weekdays[weekday]
|
||||
|
||||
|
@ -54,8 +54,8 @@ class report_custom(report_rml):
|
|||
som = datetime.date(data['form']['year'], data['form']['month'], 1)
|
||||
eom = som + datetime.timedelta(lengthmonth(som.year, som.month))
|
||||
|
||||
date_xml = ['<date month="%s" year="%d" />' % (self.get_month_name(cr, uid, som.month), som.year), '<days>']
|
||||
date_xml += ['<day number="%d" name="%s" weekday="%d" />' % (x, self.get_weekday_name(cr, uid, som.replace(day=x).weekday()+1), som.replace(day=x).weekday()+1) for x in range(1, lengthmonth(som.year, som.month)+1)]
|
||||
date_xml = ['<date month="%s" year="%d" />' % (self.get_month_name(cr, uid, som.month, context=context), som.year), '<days>']
|
||||
date_xml += ['<day number="%d" name="%s" weekday="%d" />' % (x, self.get_weekday_name(cr, uid, som.replace(day=x).weekday()+1, context=context), som.replace(day=x).weekday()+1) for x in range(1, lengthmonth(som.year, som.month)+1)]
|
||||
|
||||
date_xml.append('</days>')
|
||||
date_xml.append('<cols>2.5cm%s,2cm</cols>\n' % (',0.7cm' * lengthmonth(som.year, som.month)))
|
||||
|
|
|
@ -68,11 +68,11 @@ def emp_create_xml(cr, id, som, eom, emp):
|
|||
|
||||
class report_custom(report_rml):
|
||||
|
||||
def get_month_name(self, cr, uid, month):
|
||||
def get_month_name(self, cr, uid, month, context=None):
|
||||
_months = {1:_("January"), 2:_("February"), 3:_("March"), 4:_("April"), 5:_("May"), 6:_("June"), 7:_("July"), 8:_("August"), 9:_("September"), 10:_("October"), 11:_("November"), 12:_("December")}
|
||||
return _months[month]
|
||||
|
||||
def get_weekday_name(self, cr, uid, weekday):
|
||||
def get_weekday_name(self, cr, uid, weekday, context=None):
|
||||
_weekdays = {1:_('Mon'), 2:_('Tue'), 3:_('Wed'), 4:_('Thu'), 5:_('Fri'), 6:_('Sat'), 7:_('Sun')}
|
||||
return _weekdays[weekday]
|
||||
|
||||
|
@ -81,8 +81,8 @@ class report_custom(report_rml):
|
|||
# Computing the dates (start of month: som, and end of month: eom)
|
||||
som = datetime.date(data['form']['year'], data['form']['month'], 1)
|
||||
eom = som + datetime.timedelta(lengthmonth(som.year, som.month))
|
||||
date_xml = ['<date month="%s" year="%d" />' % (self.get_month_name(cr, uid, som.month), som.year), '<days>']
|
||||
date_xml += ['<day number="%d" name="%s" weekday="%d" />' % (x, self.get_weekday_name(cr, uid, som.replace(day=x).weekday()+1), som.replace(day=x).weekday()+1) for x in range(1, lengthmonth(som.year, som.month)+1)]
|
||||
date_xml = ['<date month="%s" year="%d" />' % (self.get_month_name(cr, uid, som.month, context=context), som.year), '<days>']
|
||||
date_xml += ['<day number="%d" name="%s" weekday="%d" />' % (x, self.get_weekday_name(cr, uid, som.replace(day=x).weekday()+1, context=context), som.replace(day=x).weekday()+1) for x in range(1, lengthmonth(som.year, som.month)+1)]
|
||||
date_xml.append('</days>')
|
||||
date_xml.append('<cols>2.5cm%s,2cm</cols>\n' % (',0.7cm' * lengthmonth(som.year, som.month)))
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue