-
+
- Total :
+ Total :
@@ -236,10 +239,10 @@
[[ repeatIn(objects,'o') ]]
-
+
- [[ o.code ]]
+ [[ o.code ]]
[[ o.complete_name ]]
@@ -258,10 +261,10 @@
[[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2']),'move_g') ]]
-
+
- [[ move_g['code'] ]]
+ [[ move_g['code'] ]]
[[ move_g['name'] ]]
@@ -279,7 +282,7 @@
[[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2']),'move_a') ]]
-
+
[[ move_a['date'] ]]
@@ -315,4 +318,4 @@
-
+
\ No newline at end of file
diff --git a/addons/account/project/report/quantity_cost_ledger.rml b/addons/account/project/report/quantity_cost_ledger.rml
index f87c74f4d69..42fb7330a07 100644
--- a/addons/account/project/report/quantity_cost_ledger.rml
+++ b/addons/account/project/report/quantity_cost_ledger.rml
@@ -10,7 +10,7 @@
[[ company.name ]]
- Cost Ledger-[[ company.currency_id.name ]]
+ Cost Ledger - [[ company.currency_id.name ]]
@@ -114,13 +114,13 @@
-
+
-
-
+
+
@@ -181,13 +181,13 @@
- [[ data['form']['date1'] ]]
+ [[ data['form']['date1'] ]]
- [[ data['form']['date2'] ]]
+ [[ data['form']['date2'] ]]
- [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]
+ [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]
diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py
index 044315c538c..1f3440c1357 100755
--- a/addons/account/report/account_balance.py
+++ b/addons/account/report/account_balance.py
@@ -77,6 +77,47 @@ class account_balance(report_sxw.rml_parse):
result+=r[0]+", "
return str(result and result[:-1]) or ''
+ def transform_both_into_date_array(self,data):
+ if not data['periods'][0][2] :
+ periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
+ else:
+ periods_id = data['periods'][0][2]
+ date_array = []
+ for period_id in periods_id:
+ period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
+ date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
+
+ period_start_date = date_array[0]
+ date_start_date = data['date_from']
+ period_stop_date = date_array[-1]
+ date_stop_date = data['date_to']
+
+ if period_start_date= '"+self.date_lst[0]+"' " \
+ "AND l.date <= '"+self.date_lst[-1]+"' " \
"ORDER BY l.id")
+
res = self.cr.dictfetchall()
+
sum = 0.0
for r in res:
sum = r['debit1'] - r['credit1']
@@ -227,5 +275,5 @@ class account_balance(report_sxw.rml_parse):
def _sum_debit(self):
return self.sum_debit
-report_sxw.report_sxw('report.account.account.balance', 'account.account', 'addons/account/report/account_balance.rml', parser=account_balance, header=False)
+report_sxw.report_sxw('report.account.account.balance', 'account.account', 'addons/account/report/account_balance.rml', parser=account_balance, header=False)
diff --git a/addons/account/report/account_balance.rml b/addons/account/report/account_balance.rml
index cfabf9d545f..8178d8fa399 100755
--- a/addons/account/report/account_balance.rml
+++ b/addons/account/report/account_balance.rml
@@ -42,7 +42,7 @@
-
+
@@ -50,7 +50,7 @@
-
+
@@ -80,6 +80,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
[[ setTag('para','para',{'style':('Det_Level'+str(a['level']))}) ]][[ a['jname'] or removeParentNode('tr') ]]
- [[ a['level']<4 and removeParentNode('font') or '...'*(2) ]] [[ setTag('para','para',{'style':('Det_Level'+str(a['level']))}) ]][ref: [[ a['ref'] or removeParentNode('font') ]] ] [[ a['lname'] ]]
+ [[ setTag('para','para',{'style':('Det_Level'+str(a['level']))}) ]] [[ setTag('tr','tr',{'style':('TrLevel_Name'+str(a['level']))}) ]][ref: [[ a['ref'] or removeParentNode('font') ]] ] [[ a['lname'] ]]
[[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['debit1']) and '%.2f'%a['debit1'] or '0.00']]
[[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['credit1']) and '%.2f'%a['credit1'] or '0.00']]
[[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['balance1']) and '%.2f'%a['balance1'] or '0.00' ]]
@@ -277,4 +302,3 @@
-
diff --git a/addons/account/report/account_journal.py b/addons/account/report/account_journal.py
index 5076fbaba87..11252b0707a 100644
--- a/addons/account/report/account_journal.py
+++ b/addons/account/report/account_journal.py
@@ -45,12 +45,28 @@ class journal_print(report_sxw.rml_parse):
'sum_credit': self._sum_credit
})
- def lines(self, period_id, journal_id, *args):
+ def lines(self, period_id, journal_id, sort_selection='date', *args):
+ if type(period_id)==type([]):
+ ids_final = []
+ for journal in journal_id:
+ for period in period_id:
+ ids_journal_period = self.pool.get('account.journal.period').search(self.cr,self.uid, [('journal_id','=',journal),('period_id','=',period)])
+ if ids_journal_period:
+ self.cr.execute('update account_journal_period set state=%s where journal_id=%d and period_id=%d and state=%s', ('printed',journal,period,'draft'))
+ self.cr.commit()
+ self.cr.execute('select id from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\' order by ('+ sort_selection +'),id', (period, journal))
+ ids = map(lambda x: x[0], self.cr.fetchall())
+ ids_final.append(ids)
+ line_ids = []
+ for line_id in ids_final:
+ a = self.pool.get('account.move.line').browse(self.cr, self.uid, line_id )
+ line_ids.append(a)
+ return line_ids
self.cr.execute('update account_journal_period set state=%s where journal_id=%d and period_id=%d and state=%s', ('printed',journal_id,period_id,'draft'))
self.cr.commit()
self.cr.execute('select id from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\' order by date,id', (period_id, journal_id))
ids = map(lambda x: x[0], self.cr.fetchall())
- return self.pool.get('account.move.line').browse(self.cr, self.uid, ids)
+ return self.pool.get('account.move.line').browse(self.cr, self.uid, ids )
def _sum_debit(self, period_id, journal_id):
self.cr.execute('select sum(debit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id))
@@ -60,7 +76,7 @@ class journal_print(report_sxw.rml_parse):
self.cr.execute('select sum(credit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id))
return self.cr.fetchone()[0] or 0.0
report_sxw.report_sxw('report.account.journal.period.print', 'account.journal.period', 'addons/account/report/account_journal.rml', parser=journal_print,header=False)
-
+report_sxw.report_sxw('report.account.journal.period.print.wiz', 'account.journal.period', 'addons/account/report/wizard_account_journal.rml', parser=journal_print,header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/aged_trial_balance.py b/addons/account/report/aged_trial_balance.py
index bd04138c8bf..ee7f5555ae9 100755
--- a/addons/account/report/aged_trial_balance.py
+++ b/addons/account/report/aged_trial_balance.py
@@ -31,13 +31,13 @@ import rml_parse
from report import report_sxw
class aged_trial_report(rml_parse.rml_parse):
-
+
def __init__(self, cr, uid, name, context):
super(aged_trial_report, self).__init__(cr, uid, name, context)
self.line_query = ''
self.total_account = []
-
-
+
+
self.localcontext.update({
'time': time,
'get_lines': self._get_lines,
@@ -46,19 +46,19 @@ class aged_trial_report(rml_parse.rml_parse):
'get_for_period': self._get_for_period,
'get_company': self._get_company,
'get_currency': self._get_currency,
-
+
})
-
-
+
+
def _get_lines(self, form):
-
+
if (form['result_selection'] == 'customer' ):
self.ACCOUNT_TYPE = "('receivable')"
elif (form['result_selection'] == 'supplier'):
self.ACCOUNT_TYPE = "('payable')"
else:
self.ACCOUNT_TYPE = "('payable','receivable')"
-
+
res = []
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
@@ -78,7 +78,7 @@ class aged_trial_report(rml_parse.rml_parse):
for i in range(7):
self.total_account.append(0)
#
-
+
for partner in partners:
values = {}
## If choise selection is in the future
@@ -94,7 +94,7 @@ class aged_trial_report(rml_parse.rml_parse):
"AND account_account.active",
(form['date1'], partner['id'],form['date1'], form['company_id']))
before = self.cr.fetchone()
-
+
self.total_account[6] = self.total_account[6] + (before and before[0] or 0.0)
values['direction'] = before and before[0] or 0.0
@@ -112,7 +112,6 @@ class aged_trial_report(rml_parse.rml_parse):
after = self.cr.fetchone()
self.total_account[6] = self.total_account[6] + (after and after[0] or 0.0)
values['direction'] = after and after[0] or ""
- #print str(values['direction'])
for i in range(5):
self.cr.execute("SELECT SUM(debit-credit) " \
"FROM account_move_line AS line, account_account " \
@@ -128,8 +127,6 @@ class aged_trial_report(rml_parse.rml_parse):
during = self.cr.fetchone()
# Ajout du compteur
self.total_account[(i)] = self.total_account[(i)] + (during and during[0] or 0)
-
- #print str(during)
values[str(i)] = during and during[0] or ""
self.cr.execute("SELECT SUM(debit-credit) " \
"FROM account_move_line AS line, account_account " \
@@ -145,19 +142,16 @@ class aged_trial_report(rml_parse.rml_parse):
values['total'] = total and total[0] or 0.0
## Add for total
self.total_account[(i+1)] = self.total_account[(i+1)] + (total and total[0] or 0.0)
- print self.total_account,">>>>>>>>>>>>>Total>>>>>>>>>>>>>>>>"
values['name'] = partner['name']
#t = 0.0
#for i in range(5)+['direction']:
# t+= float(values.get(str(i), 0.0) or 0.0)
#values['total'] = t
-
+
if values['total']:
-
res.append(values)
-
+
total = 0.0
-
totals = {}
for r in res:
total += float(r['total'] or 0.0)
@@ -166,24 +160,17 @@ class aged_trial_report(rml_parse.rml_parse):
totals[str(i)] += float(r[str(i)] or 0.0)
return res
-
-
-
def _get_total(self,pos):
- print self.total_account,"========_get_total========"
period = self.total_account[int(pos)]
- return period
+ return period
-
def _get_direction(self,pos):
-
period = self.total_account[int(pos)]
- return period
+ return period
def _get_for_period(self,pos):
-
period = self.total_account[int(pos)]
- return period
+ return period
def _get_company(self, form):
return pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, form['company_id']).name
@@ -194,5 +181,5 @@ class aged_trial_report(rml_parse.rml_parse):
report_sxw.report_sxw('report.account.aged_trial_balance', 'res.partner',
'addons/account/report/aged_trial_balance.rml',parser=aged_trial_report,header=False)
-
+
diff --git a/addons/account/report/central_journal.py b/addons/account/report/central_journal.py
index 7b595a311a7..35cd4f83f30 100644
--- a/addons/account/report/central_journal.py
+++ b/addons/account/report/central_journal.py
@@ -43,20 +43,33 @@ class journal_print(report_sxw.rml_parse):
'sum_debit': self._sum_debit,
'sum_credit': self._sum_credit
})
-
+
def lines(self, period_id, journal_id, *args):
+ if type(period_id)==type([]):
+ ids_final = []
+ for journal in journal_id:
+ for period in period_id:
+ ids_journal_period = self.pool.get('account.journal.period').search(self.cr,self.uid, [('journal_id','=',journal),('period_id','=',period)])
+ if ids_journal_period:
+ self.cr.execute('select a.code, a.name, sum(debit) as debit, sum(credit) as credit from account_move_line l left join account_account a on (l.account_id=a.id) where l.period_id=%d and l.journal_id=%d and l.state<>\'draft\' group by a.id, a.code, a.name, l.journal_id, l.period_id', (period, journal))
+ res = self.cr.dictfetchall()
+ a = {'journal':self.pool.get('account.journal').browse(self.cr, self.uid, journal),'period':self.pool.get('account.period').browse(self.cr, self.uid, period)}
+ res[0].update(a)
+ ids_final.append(res)
+ return ids_final
self.cr.execute('select a.code, a.name, sum(debit) as debit, sum(credit) as credit from account_move_line l left join account_account a on (l.account_id=a.id) where l.period_id=%d and l.journal_id=%d and l.state<>\'draft\' group by a.id, a.code, a.name', (period_id, journal_id))
- return self.cr.dictfetchall()
-
+ res = self.cr.dictfetchall()
+ return res
+
def _sum_debit(self, period_id, journal_id):
self.cr.execute('select sum(debit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id))
return self.cr.fetchone()[0] or 0.0
-
+
def _sum_credit(self, period_id, journal_id):
self.cr.execute('select sum(credit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id))
return self.cr.fetchone()[0] or 0.0
report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml',parser=journal_print, header=False)
-
+report_sxw.report_sxw('report.account.central.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_central_journal.rml',parser=journal_print, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/central_journal.rml b/addons/account/report/central_journal.rml
index ade1659de58..92ed232beff 100644
--- a/addons/account/report/central_journal.rml
+++ b/addons/account/report/central_journal.rml
@@ -10,7 +10,7 @@
[[ company.name ]]
- Central Journal-[[ company.currency_id.name ]]
+ Central Journal - [[ company.currency_id.name ]]
@@ -103,13 +103,13 @@
-
+
-
-
+
+
@@ -162,13 +162,13 @@
- [[ o.journal_id.code or '' ]]
+ [[ o.journal_id.code or '' ]]
- [[ o.journal_id.name ]]
+ [[ o.journal_id.name ]]
- [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]
+ [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]
diff --git a/addons/account/report/general_journal.py b/addons/account/report/general_journal.py
index 8899977e17a..621f870361c 100644
--- a/addons/account/report/general_journal.py
+++ b/addons/account/report/general_journal.py
@@ -66,38 +66,73 @@ class journal_print(report_sxw.rml_parse):
return not res
filtered_objs = filter(filter_unique, journal_period_objs)
return map(lambda x: x.period_id, filtered_objs)
-
- def lines(self, period_id):
+
+ def lines(self, period_id, journal_id=[]):
+ if type(period_id)==type([]):
+ ids_final = []
+ for journal in journal_id:
+ for period in period_id:
+ ids_journal_period = self.pool.get('account.journal.period').search(self.cr,self.uid, [('journal_id','=',journal),('period_id','=',period)])
+ if ids_journal_period:
+ ids_final.append(ids_journal_period[0])
+ data_jour_period = self.pool.get('account.journal.period').browse(self.cr, self.uid, ids_final)
+ lines_data = []
+ periods = []
+ for data in data_jour_period:
+ if not data.period_id.id in periods:
+ periods.append(data.period_id.id)
+ for period in periods:
+ period_data = self.pool.get('account.period').browse(self.cr, self.uid, period)
+ self.cr.execute('select j.code, j.name, sum(l.debit) as debit, sum(l.credit) as credit from account_move_line l left join account_journal j on (l.journal_id=j.id) where period_id=%d and journal_id in (' + ','.join(map(str, journal_id)) + ') and l.state<>\'draft\' group by j.id, j.code, j.name', (period,))
+ res = self.cr.dictfetchall()
+ res[0].update({'period_name':period_data.name})
+ res[0].update({'pid':period})
+ lines_data.append(res)
+ return lines_data
if not self.journal_ids:
return []
self.cr.execute('select j.code, j.name, sum(l.debit) as debit, sum(l.credit) as credit from account_move_line l left join account_journal j on (l.journal_id=j.id) where period_id=%d and journal_id in (' + self.journal_ids + ') and l.state<>\'draft\' group by j.id, j.code, j.name', (period_id,))
- return self.cr.dictfetchall()
-
- def _sum_debit_period(self, period_id):
+ res = self.cr.dictfetchall()
+ return res
+
+ def _sum_debit_period(self, period_id,journal_id=None):
+ if type(journal_id)==type([]):
+ self.cr.execute('select sum(debit) from account_move_line where period_id=%d and journal_id in (' + ','.join(map(str, journal_id)) + ') and state<>\'draft\'', (period_id,))
+ return self.cr.fetchone()[0] or 0.0
if not self.journal_ids:
return 0.0
self.cr.execute('select sum(debit) from account_move_line where period_id=%d and journal_id in (' + self.journal_ids + ') and state<>\'draft\'', (period_id,))
+
return self.cr.fetchone()[0] or 0.0
-
- def _sum_credit_period(self, period_id):
+
+ def _sum_credit_period(self, period_id,journal_id=None):
+ if type(journal_id)==type([]):
+ self.cr.execute('select sum(credit) from account_move_line where period_id=%d and journal_id in (' + ','.join(map(str, journal_id)) + ') and state<>\'draft\'', (period_id,))
+ return self.cr.fetchone()[0] or 0.0
if not self.journal_ids:
return 0.0
self.cr.execute('select sum(credit) from account_move_line where period_id=%d and journal_id in (' + self.journal_ids + ') and state<>\'draft\'', (period_id,))
return self.cr.fetchone()[0] or 0.0
-
- def _sum_debit(self):
+
+ def _sum_debit(self,period_id=None,journal_id=None):
+ if type(period_id)==type([]):
+ self.cr.execute('select sum(debit) from account_move_line where period_id in (' + ','.join(map(str, period_id)) + ') and journal_id in (' + ','.join(map(str, journal_id)) + ') and state<>\'draft\'')
+ return self.cr.fetchone()[0] or 0.0
if not self.journal_ids or not self.period_ids:
return 0.0
self.cr.execute('select sum(debit) from account_move_line where period_id in (' + self.period_ids + ') and journal_id in (' + self.journal_ids + ') and state<>\'draft\'')
return self.cr.fetchone()[0] or 0.0
-
- def _sum_credit(self):
+
+ def _sum_credit(self,period_id=None,journal_id=None):
+ if type(period_id)==type([]):
+ self.cr.execute('select sum(credit) from account_move_line where period_id in (' + ','.join(map(str, period_id)) + ') and journal_id in (' + ','.join(map(str, journal_id)) + ') and state<>\'draft\'')
+ return self.cr.fetchone()[0] or 0.0
if not self.journal_ids or not self.period_ids:
return 0.0
self.cr.execute('select sum(credit) from account_move_line where period_id in (' + self.period_ids + ') and journal_id in (' + self.journal_ids + ') and state<>\'draft\'')
return self.cr.fetchone()[0] or 0.0
report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml',parser=journal_print, header=False)
-
+report_sxw.report_sxw('report.account.general.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_general_journal.rml',parser=journal_print, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/general_journal.rml b/addons/account/report/general_journal.rml
index f89c7d201b6..d7775dd3cbb 100644
--- a/addons/account/report/general_journal.rml
+++ b/addons/account/report/general_journal.rml
@@ -82,13 +82,13 @@
-
+
-
-
+
+
@@ -130,7 +130,7 @@
Printing Date :
- [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]
+ [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]
diff --git a/addons/account/report/general_ledger.py b/addons/account/report/general_ledger.py
index f4ff9f9ef45..e00a594f95f 100755
--- a/addons/account/report/general_ledger.py
+++ b/addons/account/report/general_ledger.py
@@ -32,6 +32,7 @@ from report import report_sxw
import xml
import rml_parse
import pooler
+from osv import osv
class general_ledger(rml_parse.rml_parse):
_name = 'report.account.general.ledger'
@@ -40,7 +41,11 @@ class general_ledger(rml_parse.rml_parse):
def preprocess(self, objects, data, ids):
##
+
+
self.borne_date = self.get_min_date(data['form'])
+
+
##
new_ids = []
if (data['model'] == 'account.account'):
@@ -54,6 +59,7 @@ class general_ledger(rml_parse.rml_parse):
def __init__(self, cr, uid, name, context):
super(general_ledger, self).__init__(cr, uid, name, context)
+ self.date_borne = {}
self.query = ""
self.child_ids = ""
self.tot_currency = 0.0
@@ -109,6 +115,7 @@ class general_ledger(rml_parse.rml_parse):
return result
def get_children_accounts(self, account, form):
+
self.child_ids = self.pool.get('account.account').search(self.cr, self.uid,
[('parent_id', 'child_of', self.ids)])
res = []
@@ -116,21 +123,25 @@ class general_ledger(rml_parse.rml_parse):
## We will make the test for period or date
## We will now make the test
#
- if form.has_key('fiscalyear'):
+ if form.has_key('fiscalyear'):
ctx['fiscalyear'] = form['fiscalyear']
ctx['periods'] = form['periods'][0][2]
else:
ctx['date_from'] = form['date_from']
ctx['date_to'] = form['date_to']
- ##
+#
#
self.query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx)
+
for child_id in self.pool.get('account.account').search(self.cr, self.uid,
[('parent_id', 'child_of', [account.id])]):
+
child_account = self.pool.get('account.account').browse(self.cr, self.uid, child_id)
+
sold_account = self._sum_solde_account(child_account,form)
self.sold_accounts[child_account.id] = sold_account
+
if form['display_account'] == 'bal_mouvement':
if child_account.type != 'view' \
and len(self.pool.get('account.move.line').search(self.cr, self.uid,
@@ -153,16 +164,24 @@ class general_ledger(rml_parse.rml_parse):
res.append(child_account)
##
- if form['soldeinit']:
- ## We will now compute solde initiaux
+
+
+ ## We will now compute solde initiaux
+ if not len(res):
+ return[account]
+ else:
for move in res:
- SOLDEINIT = "SELECT sum(l.debit) AS sum_debit, sum(l.credit) AS sum_credit FROM account_move_line l WHERE l.account_id = " + str(move.id) + " AND l.date < '" + self.borne_date['max_date'] + "'" + " AND l.date > '" + self.borne_date['min_date'] + "'"
+
+ SOLDEINIT = "SELECT sum(l.debit) AS sum_debit, sum(l.credit) AS sum_credit FROM account_move_line l WHERE l.account_id = " + str(move.id) + " AND l.date <= '" + self.borne_date['max_date'] + "'" + " AND l.date >= '" + self.borne_date['min_date'] + "'"
self.cr.execute(SOLDEINIT)
- resultat = self.cr.dictfetchall()
+ resultat = self.cr.dictfetchall()
+
if resultat[0] :
+
if resultat[0]['sum_debit'] == None:
sum_debit = 0
else:
+
sum_debit = resultat[0]['sum_debit']
if resultat[0]['sum_credit'] == None:
sum_credit = 0
@@ -175,47 +194,83 @@ class general_ledger(rml_parse.rml_parse):
else:
move.init_credit = 0
move.init_debit = 0
-
+
##
+
return res
def get_min_date(self,form):
+
## Get max born from account_fiscal year
#
- sql = """ select min(fy.date_start) from account_fiscalyear
+ sql = """ select min(fy.date_start) as start_date,max(fy.date_stop) as stop_date from account_fiscalyear
As fy where fy.state <> 'close'
"""
self.cr.execute(sql)
res = self.cr.dictfetchall()
- borne_min = res[0]['min']
- #
- ##
- if form.has_key('fiscalyear'):
+ borne_min = res[0]['start_date']
+ borne_max = res[0]['stop_date']
+ if form['state'] == 'byperiod':
## This function will return the most aged date
periods = form['periods'][0][2]
if not periods:
sql = """
- Select min(p.date_start) from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
+ Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
"""
else:
periods_id = ','.join(map(str, periods))
sql = """
- Select min(p.date_start) from account_period as p where p.id in ( """ + periods_id + """)
+ Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
"""
self.cr.execute(sql)
res = self.cr.dictfetchall()
- borne_max = res[0]['min']
- else:
- borne_max = form['date_from']
- date_borne = {
+ borne_min = res[0]['start_date']
+ borne_max = res[0]['stop_date']
+ elif form['state'] == 'bydate':
+ borne_min = form['date_from']
+ borne_max = form['date_to']
+ elif form['state'] == 'all':
+ periods = form['periods'][0][2]
+ if not periods:
+ sql = """
+ Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
+ """
+ else:
+ periods_id = ','.join(map(str, periods))
+ sql = """
+ Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
+ """
+ self.cr.execute(sql)
+ res = self.cr.dictfetchall()
+ period_min = res[0]['start_date']
+ period_max = res[0]['stop_date']
+ date_min = form['date_from']
+ date_max = form['date_to']
+ if period_min='%s'
+ ORDER by %s"""%(account.id,self.query,self.date_borne['max_date'],self.date_borne['min_date'],sorttag)
+
self.cr.execute(sql)
- res = self.cr.dictfetchall()
+
+ res = self.cr.dictfetchall()
+
sum = 0.0
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
for l in res:
diff --git a/addons/account/report/general_ledger.rml b/addons/account/report/general_ledger.rml
index e42d0368d70..17b9adccd4f 100755
--- a/addons/account/report/general_ledger.rml
+++ b/addons/account/report/general_ledger.rml
@@ -23,7 +23,7 @@
[[ time.strftime("%d-%m-%Y %H:%M", time.localtime()) ]]
Page
-
+
1cm 27.7cm 20cm 27.7cm
@@ -32,29 +32,28 @@
-
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
@@ -91,247 +90,89 @@
- [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
+
+ [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
-
- Date
-
-
- Partner
-
-
- Ref
-
-
- Mvt
-
-
- Entry Label
-
-
- Debit
-
-
- Crebit
-
-
- Balance
-
+ Date
+ Partner
+ Ref
+ Mvt
+ Entry Label
+ Debit
+ Crebit
+ Balance
+ [[ repeatIn(objects, 'a') ]]
+ [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]
- [[ repeatIn(objects, 'a') ]]
- [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]
-
-
-
-
-
-
- [[ o.code ]] [[ o.name ]]
-
-
- [[ sum_debit_account(o, data['form']) or '0.0' ]]
-
-
- [[sum_credit_account(o, data['form']) or '0.0' ]]
-
-
- [[sum_solde_account(o, data['form']) or '0.0' ]]
-
-
-
-
-
-
- [[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
-
-
-
-
-
- Balance Initial
-
-
-
-
-
-
-
-
-
-
-
- [[ o.init_debit or '0.0' ]]
-
-
- [[ o.init_credit or '0.0' ]]
-
-
- [[ (o.init_debit - o.init_credit) or '0.0' ]]
-
-
-
- [[ repeatIn(lines(o, data['form']), 'line') ]]
- [[ line['date'] ]]
-
-
-
- [[ line['partner'] ]]
-
-
- [[ line['ref'] ]]
-
-
- [[ line['move'] ]]
-
-
- [[ line['name'] ]]
-
-
- [[ line['debit'] and line['debit'] or '0.0' ]]
-
-
- [[ line['credit'] and line['credit'] or '0.0' ]]
-
-
- [[ line['progress'] and line['progress'] or '0.0' ]]
-
-
-
-
-
+
+
+ [[ o.code or '']] [[ o.name or '']]
+
+ [[ sum_debit_account(o, data['form']) or '0.0' ]]
+ [[sum_credit_account(o, data['form']) or '0.0' ]]
+ [[sum_solde_account(o, data['form']) or '0.0' ]]
+
+
+
+
+ [[ repeatIn(lines(o, data['form']), 'line') ]]
+ [[ line['date'] or '' ]]
+ [[ line['partner'] or '']]
+ [[ line['ref'] or '']]
+ [[ line['move'] or '']]
+ [[ line['name'] or '' ]]
+ [[ line['debit'] and line['debit'] or '0.0' ]]
+ [[ line['credit'] and line['credit'] or '0.0' ]]
+ [[ line['progress'] and line['progress'] or '0.0' ]]
-
- [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
-
-
- Date
-
-
- Partner
-
-
- Ref
-
-
- Mvt
-
-
- Entry Label
-
-
- Debit
-
-
- Crebit
-
-
- Balance
-
-
- Currency
-
-
-
-
- [[ repeatIn(objects, 'a') ]]
- [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]
-
-
-
-
-
-
- [[ o.code ]] [[ o.name ]]
-
-
- [[ sum_debit_account(o, data['form']) or '0.0' ]]
-
-
- [[sum_credit_account(o, data['form']) or '0.0' ]]
-
-
- [[sum_solde_account(o, data['form']) or '0.0' ]]
-
-
-
- [[ sum_currency_amount_account(a, data['form']) or '0.0' ]]
-
-
-
-
-
- [[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
-
-
-
-
-
- Balance Initial
-
-
-
-
-
-
-
-
-
-
-
- [[ o.init_debit or '0.0' ]]
-
-
- [[ o.init_credit or '0.0' ]]
-
-
- [[ (o.init_debit - o.init_credit) or '0.0' ]]
-
-
-
-
-
-
- [[ repeatIn(lines(o, data['form']), 'line') ]]
-
- [[ line['date'] ]]
-
-
- [[ line['partner'] ]]
-
-
- [[ line['ref'] ]]
-
-
- [[ line['move'] ]]
-
-
- [[ line['name'] ]]
-
-
- [[ line['debit'] and line['debit'] or '0.0' ]]
-
-
- [[ line['credit'] and line['credit'] or '0.0' ]]
-
-
- [[ line['progress'] and line['progress'] or '0.0' ]]
-
-
- [[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]]
-
-
+
+ [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
+
+ Date
+ Partner
+ Ref
+ Mvt
+ Entry Label
+ Debit
+ Crebit
+ Balance
+ Currency
-
-
+ [[ repeatIn(objects, 'a') ]]
+ [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]
+
+
+
+
+ [[ o.code or '' ]] [[ o.name or '' ]]
+
+ [[ sum_debit_account(o, data['form']) or '0.0' ]]
+ [[sum_credit_account(o, data['form']) or '0.0' ]]
+ [[sum_solde_account(o, data['form']) or '0.0' ]]
+ [[ sum_currency_amount_account(a, data['form']) or '0.0' ]]
+
+
+
-
-
+ [[ repeatIn(lines(o, data['form']), 'line') ]]
+ [[ line['date'] or '' ]]
+ [[ line['partner'] or '' ]]
+ [[ line['ref'] or '']]
+ [[ line['move'] or '' ]]
+ [[ line['name'] or '' ]]
+ [[ line['debit'] and line['debit'] or '0.0' ]]
+ [[ line['credit'] and line['credit'] or '0.0' ]]
+ [[ line['progress'] and line['progress'] or '0.0' ]]
+ [[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] or '']]
+
+
+
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/report/general_ledger_landscape.py b/addons/account/report/general_ledger_landscape.py
index f090b18c090..8fb70864e00 100755
--- a/addons/account/report/general_ledger_landscape.py
+++ b/addons/account/report/general_ledger_landscape.py
@@ -35,8 +35,8 @@ import pooler
class general_ledger_landscape(rml_parse.rml_parse):
_name = 'report.account.general.ledger_landscape'
-
-
+
+
def preprocess(self, objects, data, ids):
##
self.borne_date = self.get_min_date(data['form'])
@@ -46,18 +46,19 @@ class general_ledger_landscape(rml_parse.rml_parse):
new_ids = ids
else:
new_ids.append(data['form']['Account_list'])
-
+
objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids)
-
- super(general_ledger_landscape, self).preprocess(objects, data, new_ids)
-
+
+ super(general_ledger_landscape, self).preprocess(objects, data, new_ids)
+
def __init__(self, cr, uid, name, context):
super(general_ledger_landscape, self).__init__(cr, uid, name, context)
+ self.date_borne = {}
self.query = ""
self.child_ids = ""
self.tot_currency = 0.0
self.period_sql = ""
- self.sold_accounts = {}
+ self.sold_accounts = {}
self.localcontext.update( {
'time': time,
'lines': self.lines,
@@ -66,7 +67,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
'sum_solde_account': self._sum_solde_account,
'sum_debit': self._sum_debit,
'sum_credit': self._sum_credit,
- 'sum_solde': self._sum_solde,
+ 'sum_solde': self._sum_solde,
'get_children_accounts': self.get_children_accounts,
'sum_currency_amount_account': self._sum_currency_amount_account
})
@@ -75,7 +76,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
result = {}
#for id in ids:
# result.setdefault(id, False)
-
+
for account_line in self.pool.get('account.move.line').browse(cr, uid, ids, context):
# For avoid long text in the field we will limit it to 5 lines
#
@@ -85,7 +86,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
num_id_move = str(account_line.move_id.id)
num_id_line = str(account_line.id)
account_id = str(account_line.account_id.id)
- # search the basic account
+ # search the basic account
# We have the account ID we will search all account move line from now until this time
# We are in the case of we are on the top of the account move Line
cr.execute('SELECT distinct(ac.code) as code_rest,ac.name as name_rest from account_account AS ac, account_move_line mv\
@@ -103,68 +104,102 @@ class general_ledger_landscape(rml_parse.rml_parse):
result[account_line.id] = concat + '...'
break
rup_id+=1
-
- #print str(result)
return result
-
+
def get_min_date(self,form):
+
## Get max born from account_fiscal year
#
- sql = """ select min(fy.date_start) from account_fiscalyear
+ sql = """ select min(fy.date_start) as start_date,max(fy.date_stop) as stop_date from account_fiscalyear
As fy where fy.state <> 'close'
"""
self.cr.execute(sql)
res = self.cr.dictfetchall()
- borne_min = res[0]['min']
- #
- ##
- if form.has_key('fiscalyear'):
+ borne_min = res[0]['start_date']
+ borne_max = res[0]['stop_date']
+ if form['state'] == 'byperiod':
## This function will return the most aged date
periods = form['periods'][0][2]
if not periods:
sql = """
- Select min(p.date_start) from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
+ Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
"""
else:
periods_id = ','.join(map(str, periods))
sql = """
- Select min(p.date_start) from account_period as p where p.id in ( """ + periods_id + """)
+ Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
"""
self.cr.execute(sql)
res = self.cr.dictfetchall()
- borne_max = res[0]['min']
- else:
- borne_max = form['date_from']
- date_borne = {
+ borne_min = res[0]['start_date']
+ borne_max = res[0]['stop_date']
+ elif form['state'] == 'bydate':
+ borne_min = form['date_from']
+ borne_max = form['date_to']
+ elif form['state'] == 'all':
+ periods = form['periods'][0][2]
+ if not periods:
+ sql = """
+ Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
+ """
+ else:
+ periods_id = ','.join(map(str, periods))
+ sql = """
+ Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
+ """
+ self.cr.execute(sql)
+ res = self.cr.dictfetchall()
+ period_min = res[0]['start_date']
+ period_max = res[0]['stop_date']
+ date_min = form['date_from']
+ date_max = form['date_to']
+ if period_min 0 :
res.append(child_account)
- #print "Type de vue :" + form['display_account']
elif form['display_account'] == 'bal_solde':
if child_account.type != 'view' \
and len(self.pool.get('account.move.line').search(self.cr, self.uid,
@@ -183,14 +217,17 @@ class general_ledger_landscape(rml_parse.rml_parse):
context=ctx)) <> 0 :
if ( sold_account <> 0.0):
res.append(child_account)
- else:
+ else:
if child_account.type != 'view' \
and len(self.pool.get('account.move.line').search(self.cr, self.uid,
[('account_id','=',child_account.id)],
context=ctx)) <> 0 :
res.append(child_account)
##
- if form['soldeinit']:
+ if not len(res):
+
+ return [account]
+ else:
## We will now compute solde initiaux
for move in res:
SOLDEINIT = "SELECT sum(l.debit) AS sum_debit, sum(l.credit) AS sum_credit FROM account_move_line l WHERE l.account_id = " + str(move.id) + " AND l.date < '" + self.borne_date['max_date'] + "'" + " AND l.date > '" + self.borne_date['min_date'] + "'"
@@ -205,17 +242,17 @@ class general_ledger_landscape(rml_parse.rml_parse):
sum_credit = 0
else:
sum_credit = resultat[0]['sum_credit']
-
+
move.init_credit = sum_credit
move.init_debit = sum_debit
-
+
else:
move.init_credit = 0
move.init_debit = 0
-
- ##
+
+
return res
-
+
def lines(self, account, form):
inv_types = {
'out_invoice': 'CI: ',
@@ -229,12 +266,19 @@ class general_ledger_landscape(rml_parse.rml_parse):
else:
sorttag = 'j.code'
sql = """
- SELECT l.id, l.date, j.code,c.code AS currency_code,l.amount_currency,l.ref, l.name, l.debit, l.credit, l.period_id
- FROM account_move_line l LEFT JOIN res_currency c on (l.currency_id=c.id) JOIN account_journal j on (l.journal_id=j.id)
- AND account_id = %d AND %s
- ORDER by %s"""%(account.id,self.query,sorttag)
+ SELECT l.id, l.date, j.code,c.code AS currency_code,l.amount_currency,l.ref, l.name , l.debit, l.credit, l.period_id
+ FROM account_move_line as l
+ LEFT JOIN res_currency c on (l.currency_id=c.id)
+ JOIN account_journal j on (l.journal_id=j.id)
+ AND account_id = %d
+ AND %s
+ WHERE l.date<='%s'
+ AND l.date>='%s'
+ ORDER by %s"""%(account.id,self.query,self.date_borne['max_date'],self.date_borne['min_date'],sorttag)
+
self.cr.execute(sql)
- res = self.cr.dictfetchall()
+
+ res = self.cr.dictfetchall()
sum = 0.0
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
for l in res:
@@ -258,11 +302,11 @@ class general_ledger_landscape(rml_parse.rml_parse):
if (l['credit'] > 0):
if l['amount_currency'] != None:
l['amount_currency'] = abs(l['amount_currency']) * -1
-
+
#
if l['amount_currency'] != None:
- self.tot_currency = self.tot_currency + l['amount_currency']
-
+ self.tot_currency = self.tot_currency + l['amount_currency']
+
return res
def _sum_debit_account(self, account, form):
@@ -291,7 +335,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
sum_credit += account.init_credit
#
##
-
+
return sum_credit
def _sum_solde_account(self, account, form):
@@ -301,7 +345,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
sum_solde = self.cr.fetchone()[0] or 0.0
if form['soldeinit']:
sum_solde += account.init_debit - account.init_credit
-
+
return sum_solde
def _sum_debit(self, form):
@@ -330,31 +374,24 @@ class general_ledger_landscape(rml_parse.rml_parse):
self.cr.execute("SELECT (sum(debit) - sum(credit)) as tot_solde "\
"FROM account_move_line l "\
"WHERE l.account_id in ("+','.join(map(str, self.child_ids))+") AND "+self.query)
-# print ("SELECT (sum(debit) - sum(credit)) as Test "\
-# "FROM account_move_line l "\
-# "WHERE l.account_id in ("+','.join(map(str, child_ids))+") AND "+query+period_sql)
sum_solde = self.cr.fetchone()[0] or 0.0
return sum_solde
-
+
def _set_get_account_currency_code(self, account_id):
- print"====account_id=====",account_id
self.cr.execute("SELECT c.code as code "\
"FROM res_currency c,account_account as ac "\
"WHERE ac.id = %s AND ac.currency_id = c.id"%(account_id))
result = self.cr.fetchone()
- print"====result====",result
if result:
self.account_currency = result[0]
else:
self.account_currency = False
-
-
+
def _sum_currency_amount_account(self, account, form):
-
self._set_get_account_currency_code(account.id)
self.cr.execute("SELECT sum(aml.amount_currency) FROM account_move_line as aml,res_currency as rc WHERE aml.currency_id = rc.id AND aml.account_id= %d "%account.id)
total = self.cr.fetchone()
-
+
if self.account_currency:
return_field = str(total[0]) + self.account_currency
return return_field
diff --git a/addons/account/report/general_ledger_landscape.rml b/addons/account/report/general_ledger_landscape.rml
index a2f17d7a640..ebc0d822f2b 100755
--- a/addons/account/report/general_ledger_landscape.rml
+++ b/addons/account/report/general_ledger_landscape.rml
@@ -24,39 +24,38 @@
Page
-
+
1.3cm 24.9cm 38.3cm 24.9cm
-
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
@@ -92,335 +91,93 @@
-
-
- [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
-
-
-
-
- Date
-
-
-
- JNRL
-
-
-
- Partner
-
-
-
- Ref
-
-
-
- Mvt
-
-
-
- Entry Label
-
-
-
- Counterpart
-
-
-
- Debit
-
-
-
- Credit
-
-
-
- Balance
-
-
-
- Currency
-
-
-
- [[ repeatIn(objects, 'a') ]]
- [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]
-
-
-
-
-
-
-
-
- [[ o.code ]] [[ o.name ]]
-
-
- [[ sum_debit_account(o, data['form']) or '0.0' ]]
-
-
- [[ sum_credit_account(o, data['form']) or '0.0' ]]
-
-
- [[ sum_solde_account(o, data['form']) or '0.0' ]]
-
-
-
- [[ sum_currency_amount_account(o, data['form']) or '0.0' ]]
-
-
-
-
-
- [[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
-
- Balance Initial
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [[ o.init_debit or '0.0' ]]
-
-
- [[ o.init_credit or '0.0' ]]
-
-
- [[ (o.init_debit - o.init_credit) or '0.0' ]]
-
-
-
-
-
-
+ [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
+
+ Date
+ JNRL
+ Partner
+ Ref
+ Mvt
+ Entry Label
+ Counterpart
+ Debit
+ Credit
+ Balance
+ Currency
+
+ [[ repeatIn(objects, 'a') ]]
+ [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]
+
+
+
+
+ [[ o.code ]] [[ o.name ]]
+
+ [[ sum_debit_account(o, data['form']) or '0.0' ]]
+ [[ sum_credit_account(o, data['form']) or '0.0' ]]
+ [[ sum_solde_account(o, data['form']) or '0.0' ]]
+ [[ sum_currency_amount_account(o, data['form']) or '0.0' ]]
+
+
+
+
+
+ [[ repeatIn(lines(o, data['form']), 'line') ]]
+ [[ line['date'] ]]
+ [[ line['code'] ]]
+ [[ line['partner'] ]]
+ [[ line['ref'] ]]
+ [[ line['move'] ]]
+ [[ line['name'] ]]
+ [[ strip_name(line['line_corresp'],55) ]]
+ [[ line['debit'] and line['debit'] or '0.0' ]]
+ [[ line['credit'] and line['credit'] or '0.0' ]]
+ [[ line['progress'] and line['progress'] or '0.0' ]]
+ [[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]]
+
+
+ [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
- [[ repeatIn(lines(o, data['form']), 'line') ]]
-
-
- [[ line['date'] ]]
-
-
- [[ line['code'] ]]
-
-
- [[ line['partner'] ]]
-
-
- [[ line['ref'] ]]
-
-
- [[ line['move'] ]]
-
-
- [[ line['name'] ]]
-
-
- [[ strip_name(line['line_corresp'],55) ]]
-
-
- [[ line['debit'] and line['debit'] or '0.0' ]]
-
-
- [[ line['credit'] and line['credit'] or '0.0' ]]
-
-
- [[ line['progress'] and line['progress'] or '0.0' ]]
-
-
- [[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]]
-
+ Date
+ JNRL
+ Partner
+ Ref
+ Mvt
+ Entry Label
+ Counterpart
+ Debit
+ Credit
+ Balance
-
-
-
-
-
-
-
-
-
-
- [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
+ [[ repeatIn(objects, 'a') ]]
+ [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]
-
-
-
- Date
-
-
-
-
-
- JNRL
-
-
-
-
-
- Partner
-
-
-
-
-
- Ref
-
-
-
-
-
- Mvt
-
-
-
-
-
- Entry Label
-
-
-
-
-
- Counterpart
-
-
-
-
-
- Debit
-
-
-
-
-
- Credit
-
-
-
-
-
- Balance
-
+
+
+ [[ o.code ]] [[ o.name ]]
+
+ [[ sum_debit_account(o, data['form']) or '0.0']]
+ [[sum_credit_account(o, data['form']) or '0.0']]
+ [[sum_solde_account(o, data['form']) or '0.0' ]]
+
+
+
-
-
-
- [[ repeatIn(objects, 'a') ]]
- [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]
- [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
-
-
-
-
- [[ o.code ]] [[ o.name ]]
-
-
- [[ sum_debit_account(o, data['form']) or '0.0']]
-
-
- [[sum_credit_account(o, data['form']) or '0.0']]
-
-
- [[sum_solde_account(o, data['form']) or '0.0' ]]
-
-
-
-
-
- [[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
-
-
-
-
-
- Solde Initial
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [[ o.init_debit or '0.0' ]]
-
-
- [[ o.init_credit or '0.0' ]]
-
-
- [[ o.init_debit - o.init_credit or '0.0' ]]
-
-
+
+ [[ repeatIn(lines(o, data['form']), 'line') ]]
+ [[ line['date'] ]]
+ [[ line['code'] ]]
+ [[ line['partner'] ]]
+ [[ line['ref'] ]]
+ [[ line['move'] ]]
+ [[ line['name'] ]]
+ [[ strip_name(line['line_corresp'],55) ]]
+ [[ line['debit'] and line['debit'] or '0.0' ]]
+ [[ line['credit'] and line['credit'] or '0.0' ]]
+ [[ line['progress'] and line['progress'] or '0.0' ]]
- [[ repeatIn(lines(o, data['form']), 'line') ]]
-
- [[ line['date'] ]]
-
-
- [[ line['code'] ]]
-
-
- [[ line['partner'] ]]
-
-
- [[ line['ref'] ]]
-
-
- [[ line['move'] ]]
-
-
- [[ line['name'] ]]
-
-
- [[ strip_name(line['line_corresp'],55) ]]
-
-
- [[ line['debit'] and line['debit'] or '0.0' ]]
-
-
- [[ line['credit'] and line['credit'] or '0.0' ]]
-
-
- [[ line['progress'] and line['progress'] or '0.0' ]]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
\ No newline at end of file
diff --git a/addons/account/report/overdue.rml b/addons/account/report/overdue.rml
index f9f213f0d89..aa0d111b28f 100644
--- a/addons/account/report/overdue.rml
+++ b/addons/account/report/overdue.rml
@@ -14,195 +14,193 @@
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- [[ repeatIn(objects,'o') ]]
- [[ setLang(o.lang) ]]
+ [[ repeatIn(objects,'o') ]]
+ [[ setLang(o.lang) ]]
-
+
- [[ o.name ]]
- [[ adr_get(o, 'invoice')['name'] ]]
- [[ adr_get(o, 'invoice')['street'] ]]
- [[ adr_get(o, 'invoice')['zip'] ]] [[ adr_get(o, 'invoice')['city'] ]]
- [[ adr_get(o, 'invoice')['country_id'] and adr_get(o, 'invoice')['country_id'][1] ]]
-
+ [[ o.name ]]
+ [[ adr_get(o, 'invoice')['name'] ]]
+ [[ adr_get(o, 'invoice')['street'] ]]
+ [[ adr_get(o, 'invoice')['zip'] ]] [[ adr_get(o, 'invoice')['city'] ]]
+ [[ adr_get(o, 'invoice')['country_id'] and adr_get(o, 'invoice')['country_id'][1] ]]
+
- VAT: [[ o.vat or removeParentNode('para') ]]
+ VAT: [[ o.vat or removeParentNode('para') ]]
+
+
+
+
+
+
+ Document : Customer account statement
-
+ Date:
+ [[ time.strftime('%d/%m/%Y') ]]
-
-
-
- Document : Customer account statement
-
- Date:
- [[ time.strftime('%d/%m/%Y') ]]
-
- Customer Ref: [[ o.id ]]
-
-
-
- Dear Sir/Madam,
-
-
-
- Exception made of a mistake of our side, it seems that the following bills stay unpaid. Please, take appropriate measures in order to carry out this payment in the next 8 days.
-
-
-
- Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting departement at [[ tel_get(company.partner_id) ]].
-
-
-
- Best regards.
+ Customer Ref: [[ o.id ]]
-
+ Dear Sir/Madam,
+
+
+
+ Exception made of a mistake of our side, it seems that the following bills stay unpaid. Please, take appropriate measures in order to carry out this payment in the next 8 days.
+
+
+
+ Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting departement at +32 81 81 37 00.
+
+
+
+ Best regards.
+
+
+
+
- Date
+ Date
- Description
+ Description
- Ref
+ Ref
- Maturity date
+ Maturity date
- Due
+ Due
- Paid
+ Paid
- Maturity
+ Maturity
- Li.
+ Li.
-
+
-
- [[repeatIn(getLines(o), 'line') ]]
- [[ line['date'] ]]
-
+ Sub-Total:
+
+
+
+
+
+ [[ '%.2f' % (reduce(lambda x, y: x + (y['debit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]]
- [[ line['name'] ]]
+ [[ '%.2f' % (reduce(lambda x ,y: x + (y['credit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]]
- [[ line['ref'] ]]
+ [[ '%.2f' % (reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0)) ]]
- [[ line['date_maturity'] ]]
-
-
- [[ line['debit'] and '%.2f' % (line['debit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]]
-
-
- [[ line['credit'] and '%.2f' % (line['credit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]]
-
-
- [[ (line['date_maturity'] < time.strftime('%Y-%m-%d')) and '%.2f' % ((line['debit'] - line['credit']) * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]]
-
-
- [[ line['blocked'] and 'X' or '' ]]
-
-
-
-
-
-
- Sub-Total:
-
-
- [[ '%.2f' % (reduce(lambda x, y: x + (y['debit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]]
-
-
-
- [[ '%.2f' % (reduce(lambda x ,y: x + (y['credit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]]
-
-
-
- [[ '%.2f' % (reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0)) ]]
-
-
-
+
- Balance:
+ Balance:
+
+
+
+
+
+ [[ '%.2f' % (reduce(lambda x, y: x +((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]]
- [[ '%.2f' % (reduce(lambda x, y: x +((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]]
+
+
+
@@ -210,27 +208,52 @@
-
+
+
+
+
+
+
+ [[repeatIn(getLines(o), 'line') ]]
+ [[ line['date'] ]]
+
+
-
-
-
+ [[ line['name'] ]]
+
+
+ [[ line['ref'] ]]
+
+
+ [[ line['date_maturity'] ]]
+
+
+ [[ line['debit'] and '%.2f' % (line['debit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]]
+
+
+ [[ line['credit'] and '%.2f' % (line['credit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]]
+
+
+ [[ (line['date_maturity'] < time.strftime('%Y-%m-%d')) and '%.2f' % ((line['debit'] - line['credit']) * (line['account_id']['type'] == 'payable' and -1 or 1)) or '' ]]
+
+
+ [[ line['blocked'] and 'X' or '' ]]
-
+
-
- Total amount due:
- [[ '%.2f' % (reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] [[ company.currency_id.name ]].
+
+ Total amount due:
+ [[ '%.2f' % (reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0)) ]] [[ company.currency_id.name ]]
+ .
-
+
-
diff --git a/addons/account/report/partner_balance.py b/addons/account/report/partner_balance.py
index 0e9b0777d14..23d4e54fa55 100644
--- a/addons/account/report/partner_balance.py
+++ b/addons/account/report/partner_balance.py
@@ -67,10 +67,14 @@ class partner_balance(report_sxw.rml_parse):
return full_str_date
#
+
+
def transform_period_into_date_array(self,data):
## Get All Period Date
#
# If we have no period we will take all perdio in the FiscalYear.
+
+
if not data['form']['periods'][0][2] :
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
else:
@@ -79,18 +83,62 @@ class partner_balance(report_sxw.rml_parse):
for period_id in periods_id:
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
-
self.date_lst = date_array
self.date_lst.sort()
def transform_date_into_date_array(self,data):
-
return_array = self.date_range(data['form']['date1'],data['form']['date2'])
self.date_lst = return_array
self.date_lst.sort()
-
+ def transform_both_into_date_array(self,data):
+ if not data['form']['periods'][0][2] :
+ periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
+ else:
+ periods_id = data['form']['periods'][0][2]
+ date_array = []
+ for period_id in periods_id:
+ period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
+ date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
+
+ period_start_date = date_array[0]
+ date_start_date = data['form']['date1']
+ period_stop_date = date_array[-1]
+ date_stop_date = data['form']['date2']
+
+ if period_start_date sum(credit) " \
@@ -182,6 +245,7 @@ class partner_balance(report_sxw.rml_parse):
#
#
#
+
self.cr.execute(
"SELECT p.ref,l.account_id,ac.name as account_name,ac.code as code ,p.name, sum(debit) as debit, sum(credit) as credit, " \
"CASE WHEN sum(debit) > sum(credit) " \
@@ -461,7 +525,7 @@ class partner_balance(report_sxw.rml_parse):
'l.date IN (' + self.date_lst_string + ') ' \
'GROUP BY partner_id')
a = self.cr.fetchone()[0]
- print"====self.cr.fetchone()====",a
+
if self.cr.fetchone() != None:
result_tmp = result_tmp + (a or 0.0)
else:
@@ -493,7 +557,7 @@ class partner_balance(report_sxw.rml_parse):
(self.date_lst[0],))
if self.cr.fetchone() != None:
- result_tmp = float(self.cr.fetchone()[0])
+ result_tmp = float(self.cr.fetchone()[0]) or 0.0
else:
result_tmp = 0.0
#
diff --git a/addons/account/report/partner_balance.rml b/addons/account/report/partner_balance.rml
index 8eaf6ec5688..561eb07f505 100644
--- a/addons/account/report/partner_balance.rml
+++ b/addons/account/report/partner_balance.rml
@@ -3,6 +3,7 @@
+
@@ -16,15 +17,15 @@
[[ company.name ]]
- Partner Balance [[ data['form']['result_selection'] == 'customer' and '/ Débiteur' ]] [[ data['form']['result_selection'] == 'supplier' and '/ Créancier' ]] [[ data['form']['result_selection'] == 'all' and '/ Créancier et Débiteur' ]] - [[ get_currency(data['form']) ]]
+ Partnar Balance [[ data['form']['result_selection'] == 'customer' and '/ Débiteur' ]] [[ data['form']['result_selection'] == 'supplier' and '/ Créancier' ]] [[ data['form']['result_selection'] == 'all' and '/ Créancier et Débiteur' ]] [[ company.currency_id.name ]]
+
- [[ time.strftime("%m-%d-%y %H:%M", time.localtime()) ]]
+ [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]
Page
-
@@ -32,6 +33,7 @@
1cm 27.7cm 20cm 27.7cm
+
@@ -55,15 +57,13 @@
-
-
-
-
-
-
-
+
+
+
@@ -84,14 +84,18 @@
-
-
+
+
+
+
+
+
@@ -108,13 +112,190 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
- Code
+ [[ setTag('tr','tr',{'style':'Line1'}) ]] Code
Partner name
@@ -134,7 +315,7 @@
- Grand total
+ [[ setTag('tr','tr',{'style':'Line2'}) ]] Grand total
@@ -171,22 +352,33 @@
[[ repeatIn(lines(data), 'a') ]][[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['ref'] ]] [[ a['type']==3 and a['code'] ]]
- [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['name'] ]]
+ [[ a['type']==3 and ( setTag('tr','tr',{'style':'TrLevel0'})) ]] [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['type']==1 and ( setTag('blockTable','blockTable',{'style':'LineLevel1'})) ]] [[ a['name'] ]]
- [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['debit'] or '0.0' ]]
+
+ [[ (a['type']==3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]] [[ a['debit'] or '0.0' ]]
+ [[ (a['type']!=3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica'}) ]] [[ a['debit'] or '0.0' ]]
+
- [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['credit'] or '0.0' ]]
+
+ [[ (a['type']==3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]] [[ a['credit'] or '0.0' ]]
+ [[ (a['type']!=3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica'}) ]] [[ a['credit'] or '0.0' ]]
+
- [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['balance'] or '0.0' ]]
+
+ [[ (a['type']==3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]] [[ a['balance'] or '0.0' ]]
+ [[ (a['type']!=3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica'}) ]] [[ a['balance'] or '0.0' ]]
+
- [[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]] [[ a['enlitige'] or '0.0' ]]
+
+ [[ (a['type']==3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]] [[ a['enlitige'] or '0.0' ]]
+ [[ (a['type']!=3 or removeParentNode('font')) and setTag('para','para',{'fontName':'Helvetica'}) ]] [[ a['enlitige'] or '0.0' ]]
+
-
\ No newline at end of file
diff --git a/addons/account/report/tax_report.rml b/addons/account/report/tax_report.rml
index 3b34e3bb618..0c68e10e35b 100755
--- a/addons/account/report/tax_report.rml
+++ b/addons/account/report/tax_report.rml
@@ -102,6 +102,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -135,6 +159,39 @@
+
+
+
+
+
+
+
+
+
-
+
@@ -19,24 +19,24 @@
[[ company.name ]]
Third Party Ledger [[ data['form']['result_selection'] == 'customer' and '/ Débiteur' ]] [[ data['form']['result_selection'] == 'supplier' and '/ Créancier' ]] [[ data['form']['result_selection'] == 'all' and '/ Créancier et Débiteur' ]]
-
+
-
-
+
+
[[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]
Page
-
+
1cm 27.7cm 20cm 27.7cm
-
+
-
+
-
+
@@ -53,43 +53,43 @@
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -124,7 +124,7 @@
-
+
[[ data['form']['page_split'] == True or removeParentNode('para') ]]
@@ -133,7 +133,7 @@
-
+
Date
@@ -147,7 +147,7 @@
Debit
-
+
Credit
@@ -183,7 +183,7 @@
[[ data['form']['page_split'] == False or removeParentNode('para') ]]
[[ repeatIn(objects, 'p') ]]
-
+
[[ p.ref ]] - [[ p.name ]]
@@ -202,7 +202,7 @@
-
+
[[ repeatIn(lines(p,data), 'line') ]] [[ line['date'] ]]
@@ -211,29 +211,29 @@
[[ line['code'] ]]
- [[ line['ref'] ]]
+ [[ line['ref'] ]] / [[ line['name'] ]]
- [[ line['name'] ]]
+
- [[ (line['debit']) or '' ]]
+ [[ (line['debit']) or '0.0' ]]
- [[ (line['credit']) or '' ]]
+ [[ (line['credit']) or '0.0' ]]
- [[ (line['progress']) or '' ]]
+ [[ (line['progress']) or '0.0' ]]
-
+
-
-
-
-
+
+
+
+
-
+
\ No newline at end of file
diff --git a/addons/account/report/wizard_account_journal.rml b/addons/account/report/wizard_account_journal.rml
new file mode 100644
index 00000000000..def6acbecb8
--- /dev/null
+++ b/addons/account/report/wizard_account_journal.rml
@@ -0,0 +1,191 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[ company.name ]]
+ Print Journal - [[ company.currency_id.name ]]
+
+
+
+
+
+
+ [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]
+ Page
+
+
+
+
+ 1cm 27.7cm 20cm 27.7cm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[ repeatIn(objects, 'o') ]]
+
+ [[repeatIn(lines(data['form']['period_id'][0][2],data['form']['journal_id'][0][2],data['form']['sort_selection']), 'line') ]]
+
+
+ Date
+
+
+ Voucher No
+
+
+ A/c No.
+
+
+ Third party
+
+
+ Entry label
+
+
+ Debit
+
+
+ Credit
+
+
+
+
+ [[line[0].period_id.name ]]
+
+
+ [[line[0].journal_id.code ]]
+
+
+
+
+ [[ '%.2f' % sum_debit(line[0].period_id.id, line[0].journal_id.id) or '0.00' ]]
+
+
+ [[ '%.2f' % sum_credit(line[0].period_id.id, line[0].journal_id.id) or '0.00' ]]
+
+
+
+ [[repeatIn(line,'l')]]
+
+ [[ l.date ]]
+
+
+ [[ l.ref ]]
+
+
+ [[ l.account_id.code ]]
+
+
+ [[ l.partner_id and l.partner_id.name ]]
+
+
+ [[ l.name ]]
+
+
+ [[ l.debit and '%.2f' % l.debit or '0.00' ]]
+
+
+ [[ l.credit and '%.2f' % l.credit or '0.00' ]]
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account/report/wizard_central_journal.rml b/addons/account/report/wizard_central_journal.rml
new file mode 100644
index 00000000000..4c0b037971a
--- /dev/null
+++ b/addons/account/report/wizard_central_journal.rml
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+ [[ company.name ]]
+ Central Journal-[[ company.currency_id.name ]]
+
+
+
+
+
+ [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]
+ Page
+
+
+
+
+ 1cm 27.7cm 20cm 27.7cm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[ repeatIn(objects, 'o') ]]
+ [[ repeatIn(lines(data['form']['period_id'][0][2],data['form']['journal_id'][0][2]), 'line') ]]
+
+
+
+ Journal Code
+
+
+ Journal Name
+
+
+ Printing Date
+
+
+
+
+
+
+ [[ line[0]['journal'].code or '' ]]
+
+
+ [[ line[0]['journal'].name ]]
+
+
+ [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]
+
+
+
+
+
+
+
+
+
+
+
+
+ Account Num.
+
+
+ Account Name
+
+
+ Debit
+
+
+ Credit
+
+
+
+
+
+
+
+
+ Total:
+
+
+
+
+
+
+
+ [[ '%.2f' % sum_debit(line[0]['period'].id, line[0]['journal'].id) ]]
+
+
+ [[ '%.2f' % sum_credit(line[0]['period'].id, line[0]['journal'].id) ]]
+
+
+
+
+
+
+
+
+
+ [[repeatIn(line,'l')]]
+
+
+ [[ l['code'] ]]
+
+
+ [[ l['name'] ]]
+
+
+ [[ formatLang(l['debit']) and '%.2f' % l['debit'] or '0.00' ]]
+
+
+ [[ formatLang(l['credit']) and '%.2f' % l['credit'] or '0.00' ]]
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/account/report/wizard_general_journal.rml b/addons/account/report/wizard_general_journal.rml
new file mode 100644
index 00000000000..e61aa9b2267
--- /dev/null
+++ b/addons/account/report/wizard_general_journal.rml
@@ -0,0 +1,250 @@
+
+
+
+
+
+
+
+
+
+
+
+ [[ company.name ]]
+ General Journal - [[ company.currency_id.name ]]
+
+
+
+
+
+ [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]
+ Page
+
+
+
+
+ 1cm 27.7cm 20cm 27.7cm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Printing Date :
+
+
+ [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Jrl Code
+
+
+ Journal Name
+
+
+ Period
+
+
+ Debit Trans.
+
+
+ Credit Trans.
+
+
+
+
+
+
+
+ Total:
+
+
+
+
+
+
+
+
+
+
+
+
+ [[ '%.2f' % sum_debit(data['form']['period_id'][0][2],data['form']['journal_id'][0][2]) ]]
+
+
+ [[ '%.2f' % sum_credit(data['form']['period_id'][0][2],data['form']['journal_id'][0][2]) ]]
+
+
+
+
+
+
+
+
+
+ [[ repeatIn( lines( data['form']['period_id'][0][2], data['form']['journal_id'][0][2] ),'line')]]
+
+
+
+ [[ line[0]['period_name'] ]] :
+
+
+
+
+
+
+
+
+
+
+
+
+ [[ '%.2f' % sum_debit_period( line[0]['pid'],data['form']['journal_id'][0][2]) ]]
+
+
+ [[ '%.2f' % sum_credit_period(line[0]['pid'],data['form']['journal_id'][0][2]) ]]
+
+
+
+
+
+
+
+ [[ repeatIn(line,'l') ]]
+ [[ l['code'] ]]
+
+
+ [[ l['name'] ]]
+
+
+ [[ line[0]['period_name'] ]]
+
+
+ [[ l['debit'] and ('%.2f' % l['debit']) or '' ]]
+
+
+ [[ l['credit'] and ('%.2f' % l['credit']) or '' ]]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml
index 3860447ff9d..7f441b1b551 100644
--- a/addons/account/security/account_security.xml
+++ b/addons/account/security/account_security.xml
@@ -1,4 +1,4 @@
-
+
Finance / Invoice
@@ -11,4 +11,29 @@
Finance / Manager
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv
index 67bbe0f197e..d231315c175 100644
--- a/addons/account/security/ir.model.access.csv
+++ b/addons/account/security/ir.model.access.csv
@@ -4,15 +4,19 @@
"access_account_account_type","account.account.type","model_account_account_type","account.group_account_user",1,0,0,0
"access_account_tax","account.tax","model_account_tax","account.group_account_user",1,0,0,0
"access_account_account","account.account","model_account_account","account.group_account_user",1,0,0,0
+"access_account_account_user","account.account user","model_account_account","base.group_user",1,0,0,0
+"access_account_account_partner_manager","account.account partner manager","model_account_account","base.group_partner_manager",1,0,0,0
"access_account_journal_view","account.journal.view","model_account_journal_view","account.group_account_user",1,0,0,0
"access_account_journal_column","account.journal.column","model_account_journal_column","account.group_account_user",1,0,0,0
"access_account_journal","account.journal","model_account_journal","account.group_account_user",1,0,0,0
"access_account_period","account.period","model_account_period","account.group_account_user",1,0,0,0
+"access_account_journal_period_manager","account.journal.period manager","model_account_journal_period","account.group_account_manager",1,1,1,1
"access_account_journal_period","account.journal.period","model_account_journal_period","account.group_account_user",1,1,1,1
"access_account_move","account.move","model_account_move","account.group_account_user",1,1,1,1
+"access_account_move_line","account.move.line","model_account_move_line","account.group_account_user",1,1,1,1
"access_account_move_reconcile","account.move.reconcile","model_account_move_reconcile","account.group_account_user",1,1,1,1
-"access_account_tax_code","account.tax.code","model_account_tax_code","account.group_account_user",1,0,0,0
-"access_account_tax","account.tax","model_account_tax","account.group_account_user",1,0,0,0
+"access_account_tax_code","account.tax.code","model_account_tax_code",,1,0,0,0
+"access_account_tax","account.tax","model_account_tax",,1,0,0,0
"access_account_model","account.model","model_account_model","account.group_account_user",1,1,1,1
"access_account_model_line","account.model.line","model_account_model_line","account.group_account_user",1,1,1,1
"access_account_subscription","account.subscription","model_account_subscription","account.group_account_user",1,1,1,1
@@ -24,25 +28,22 @@
"access_account_tax_template","account.tax.template","model_account_tax_template","account.group_account_manager",1,1,1,1
"access_wizard_multi_charts_accounts","wizard.multi.charts.accounts","model_wizard_multi_charts_accounts","account.group_account_manager",1,1,1,1
"access_account_bank_accounts_wizard","account.bank.accounts.wizard","model_account_bank_accounts_wizard","account.group_account_manager",1,1,1,1
-"access_account_move_line","account.move.line","model_account_move_line","account.group_account_user",1,1,1,1
"access_account_bank_statement","account.bank.statement","model_account_bank_statement","account.group_account_user",1,1,1,1
"access_account_bank_statement_reconcile","account.bank.statement.reconcile","model_account_bank_statement_reconcile","account.group_account_user",1,1,1,1
"access_account_bank_statement_reconcile_line","account.bank.statement.reconcile.line","model_account_bank_statement_reconcile_line","account.group_account_user",1,1,1,1
"access_account_bank_statement_line","account.bank.statement.line","model_account_bank_statement_line","account.group_account_user",1,1,1,1
"access_account_analytic_line","account.analytic.line","model_account_analytic_line","account.group_account_user",1,1,1,1
"access_report_hr_timesheet_invoice_journal","report.hr.timesheet.invoice.journal","model_report_hr_timesheet_invoice_journal","account.group_account_manager",1,0,0,0
-"access_account_invoice","account.invoice","model_account_invoice","account.group_account_user",1,0,0,0
-"access_account_invoice_line","account.invoice.line","model_account_invoice_line","account.group_account_user",1,0,0,0
-"access_account_invoice_tax","account.invoice.tax","model_account_invoice_tax","account.group_account_user",1,0,0,0
-"access_account_analytic_account","account.analytic.account","model_account_analytic_account","account.group_account_user",1,0,0,0
+"access_account_analytic_account","account.analytic.account","model_account_analytic_account","base.group_user",1,0,0,0
"access_account_analytic_journal","account.analytic.journal","model_account_analytic_journal","account.group_account_user",1,0,0,0
-"access_account_invoice_uinvoice","account.invoice","model_account_invoice","account.group_account_user",1,1,1,1
-"access_account_invoice_line_uinvoice","account.invoice.line","model_account_invoice_line","account.group_account_user",1,1,1,1
-"access_account_invoice_tax_uinvoice","account.invoice.tax","model_account_invoice_tax","account.group_account_user",1,1,1,1
+"access_account_invoice_uinvoice","account.invoice","model_account_invoice","account.group_account_invoice",1,1,1,1
+"access_account_invoice_line_uinvoice","account.invoice.line","model_account_invoice_line","account.group_account_invoice",1,1,1,1
+"access_account_invoice_tax_uinvoice","account.invoice.tax","model_account_invoice_tax","account.group_account_invoice",1,1,1,1
"access_account_analytic_line_uinvoice","account.analytic.line","model_account_analytic_line","account.group_account_user",1,1,1,1
-"access_account_move_uinvoice","account.move","model_account_move","account.group_account_user",1,1,1,1
-"access_account_move_reconcile_uinvoice","account.move.reconcile","model_account_move_reconcile","account.group_account_user",1,1,1,1
-"access_account_journal_period_uinvoice","account.journal.period","model_account_journal_period","account.group_account_user",1,1,1,1
+"access_account_move_uinvoice","account.move","model_account_move","account.group_account_invoice",1,1,1,1
+"access_account_move_line_uinvoice","account.move.line invoice","model_account_move_line","account.group_account_invoice",1,1,1,1
+"access_account_move_reconcile_uinvoice","account.move.reconcile","model_account_move_reconcile","account.group_account_invoice",1,1,1,1
+"access_account_journal_period_uinvoice","account.journal.period","model_account_journal_period","account.group_account_invoice",1,1,1,1
"access_account_payment_term_manager","account.payment.term","model_account_payment_term","account.group_account_manager",1,1,1,1
"access_account_payment_term_line_manager","account.payment.term.line","model_account_payment_term_line","account.group_account_manager",1,1,1,1
"access_account_account_type_manager","account.account.type","model_account_account_type","account.group_account_manager",1,1,1,1
@@ -51,14 +52,29 @@
"access_account_journal_view_manager","account.journal.view","model_account_journal_view","account.group_account_manager",1,1,1,1
"access_account_journal_column_manager","account.journal.column","model_account_journal_column","account.group_account_manager",1,1,1,1
"access_account_journal_manager","account.journal","model_account_journal","account.group_account_manager",1,1,1,1
+"access_account_journal_invoice","account.journal invoice","model_account_journal","account.group_account_invoice",1,0,0,0
"access_account_period_manager","account.period","model_account_period","account.group_account_manager",1,1,1,1
+"access_account_period_invoice","account.period invoice","model_account_period","account.group_account_invoice",1,0,0,0
"access_account_tax_code_manager","account.tax.code","model_account_tax_code","account.group_account_manager",1,1,1,1
"access_account_tax_manager","account.tax","model_account_tax","account.group_account_manager",1,1,1,1
-"access_account_invoice_manager","account.invoice","model_account_invoice","account.group_account_manager",1,1,1,1
-"access_account_invoice_line_manager","account.invoice.line","model_account_invoice_line","account.group_account_manager",1,1,1,1
-"access_account_invoice_tax_manager","account.invoice.tax","model_account_invoice_tax","account.group_account_manager",1,1,1,1
+"access_account_invoice_group_invoice","account.invoice group invoice","model_account_invoice","account.group_account_invoice",1,1,1,1
"access_account_analytic_account_manager","account.analytic.account","model_account_analytic_account","account.group_account_manager",1,1,1,1
"access_account_analytic_journal_manager","account.analytic.journal","model_account_analytic_journal","account.group_account_manager",1,1,1,1
"access_account_fiscalyear","account.fiscalyear","model_account_fiscalyear","account.group_account_manager",1,1,1,1
"access_account_fiscalyear_user","account.fiscalyear.user","model_account_fiscalyear","account.group_account_user",1,0,0,0
"access_account_fiscalyear_invoice","account.fiscalyear.invoice","model_account_fiscalyear","account.group_account_invoice",1,0,0,0
+"access_res_currency_account_manager","res.currency account manager","base.model_res_currency","group_account_manager",1,1,1,1
+"access_res_currency_rate_account_manager","res.currency.rate account manager","base.model_res_currency_rate","group_account_manager",1,1,1,1
+"access_account_config_wizard_account_manager","account.config.wizard account manager","model_account_config_wizard","group_account_manager",1,1,1,1
+"access_account_config_wizard_system_manager","account.config.wizard system manager","model_account_config_wizard","base.group_system",1,1,1,1
+"access_account_invoice_user","account.invoice user","model_account_invoice","base.group_user",1,0,0,0
+"access_account_invoice_user","account.invoice.line user","model_account_invoice_line","base.group_user",1,0,0,0
+"access_account_invoice_user","account.invoice.tax user","model_account_invoice_tax","base.group_user",1,0,0,0
+"access_account_payment_term_partner_manager","account.payment.term partner manager","model_account_payment_term","base.group_user",1,0,0,0
+"access_account_payment_term_line_partner_manager","account.payment.term.line partner manager","model_account_payment_term_line","base.group_user",1,0,0,0
+"access_account_account_product_manager","account.account product manager","model_account_account","product.group_product_manager",1,0,0,0
+"access_account_journal_product_manager","account.journal product manager","model_account_journal","product.group_product_manager",1,0,0,0
+"access_account_fiscal_position_product_manager","account.fiscal.position account.manager","model_account_fiscal_position","account.group_account_manager",1,1,1,1
+"access_account_fiscal_position_account_product_manager","account.fiscal.position account.manager","model_account_fiscal_position_account","account.group_account_manager",1,1,1,1
+"access_account_fiscal_position","account.fiscal.position all","model_account_fiscal_position","base.group_user",1,0,0,0
+"access_account_fiscal_position_account","account.fiscal.position all","model_account_fiscal_position_account","base.group_user",1,0,0,0
diff --git a/addons/account/wizard/__init__.py b/addons/account/wizard/__init__.py
index 6ecd2040756..aa26e3f8e9d 100644
--- a/addons/account/wizard/__init__.py
+++ b/addons/account/wizard/__init__.py
@@ -64,6 +64,9 @@ import wizard_use_model
import wizard_state_open
import wizard_statement_from_invoice
+import wizard_print_journal
+import wizard_central_journal
+import wizard_general_journal
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/wizard_account_balance_report.py b/addons/account/wizard/wizard_account_balance_report.py
index 431e183f156..d02907f72cc 100644
--- a/addons/account/wizard/wizard_account_balance_report.py
+++ b/addons/account/wizard/wizard_account_balance_report.py
@@ -30,41 +30,48 @@ import wizard
import pooler
import time
-report_type = '''
-'''
-
-
-dates_form = '''
-'''
-
-dates_fields = {
- 'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
- 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
- 'display_account':{'string':"Display accounts",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]}
-}
-
-
period_form = '''
'''
-
-
period_fields = {
- 'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
- 'help': 'Keep empty for all open fiscal year'},
+ 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
+ 'state':{
+ 'string':"Date/Period Filter",
+ 'type':'selection',
+ 'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
+ 'default': lambda *a:'bydate'
+ },
+ 'fiscalyear': {
+ 'string':'Fiscal year',
+ 'type':'many2one',
+ 'relation':'account.fiscalyear',
+ 'help':'Keep empty for all open fiscal year'
+ },
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'},
- 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]}
+ 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With Movements'),('bal_solde','With Balance != 0'),('bal_all','All')]},
+ 'date_from': {'string':" Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
+ 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
}
account_form = '''
@@ -76,9 +83,14 @@ account_fields = {
'Account_list': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]},
}
-
class wizard_report(wizard.interface):
def _get_defaults(self, cr, uid, data, context):
+ user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
+ if user.company_id:
+ company_id = user.company_id.id
+ else:
+ company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
+ data['form']['company_id'] = company_id
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
periods_obj=pooler.get_pool(cr.dbname).get('account.period')
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
@@ -86,17 +98,20 @@ class wizard_report(wizard.interface):
data['form']['display_account']='bal_all'
return data['form']
- def _get_defaults_fordate(self, cr, uid, data, context):
- data['form']['display_account']='bal_all'
+ def _check_state(self, cr, uid, data, context):
+
+ if data['form']['state'] == 'bydate':
+ self._check_date(cr, uid, data, context)
+ data['form']['fiscalyear'] = 0
+ else :
+ data['form']['fiscalyear'] = 1
return data['form']
-
-
+
def _check_path(self, cr, uid, data, context):
if data['model'] == 'account.account':
- return 'checktype'
+ return 'checktype'
else:
- return 'account_selection'
-
+ return 'account_selection'
def _check_date(self, cr, uid, data, context):
sql = """
@@ -108,7 +123,6 @@ class wizard_report(wizard.interface):
raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop'])
else:
return 'report'
-
else:
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
@@ -123,27 +137,12 @@ class wizard_report(wizard.interface):
'result': {'type':'form', 'arch':account_form,'fields':account_fields, 'state':[('end','Cancel'),('checktype','Print')]}
},
'checktype': {
- 'actions': [],
- 'result': {'type':'form', 'arch':report_type,'fields':{}, 'state':[('with_period','Use with Period'),('with_date','Use with Date')]}
- },
- 'with_period': {
'actions': [_get_defaults],
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('report','Print')]}
},
- 'with_date': {
- 'actions': [_get_defaults_fordate],
- 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('checkdate','Print')]}
- },
- 'checkdate': {
- 'actions': [],
- 'result': {'type':'choice','next_state':_check_date}
- },
-
'report': {
- 'actions': [],
+ 'actions': [_check_state],
'result': {'type':'print', 'report':'account.account.balance', 'state':'end'}
}
}
wizard_report('account.account.balance.report')
-
-
diff --git a/addons/account/wizard/wizard_aged_trial_balance.py b/addons/account/wizard/wizard_aged_trial_balance.py
index ce95c2c8ab1..7e8bcc6048c 100755
--- a/addons/account/wizard/wizard_aged_trial_balance.py
+++ b/addons/account/wizard/wizard_aged_trial_balance.py
@@ -35,76 +35,84 @@ from mx.DateTime import *
_aged_trial_form = """
"""
_aged_trial_fields = {
- 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
- 'period_length': {'string': 'Period length (days)', 'type': 'integer', 'required': True, 'default': lambda *a:30},
- 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
- 'result_selection':{'string':"Display partner",'type':'selection','selection':[('customer','Debiteur'),('supplier','Creancier'),('all','Tous')]},
- 'direction_selection':{'string':"Display aged balance of",'type':'selection','selection':[('past','Due amount'),('future','Not due amount')]},
- }
+ 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
+ 'period_length': {'string': 'Period length (days)', 'type': 'integer', 'required': True, 'default': lambda *a:30},
+ 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
+ 'result_selection':{
+ 'string':"Filter on Partners",
+ 'type':'selection',
+ 'selection':[('customer','Customer'),('supplier','Supplier'),('all','All')],
+ 'required':True,
+ 'default': lambda *a: 'customer',
+ },
+ 'direction_selection':{
+ 'string':"Analysis Direction",
+ 'type':'selection',
+ 'selection':[('past','Past'),('future','Future')],
+ 'required':True,
+ 'default': lambda *a: 'past',
+ },
+}
def _calc_dates(self, cr, uid, data, context):
- res = {}
- period_length = data['form']['period_length']
- if period_length<=0:
- raise wizard.except_wizard('UserError', 'You must enter a period length that cannot be 0 or below !')
- start = datetime.date.fromtimestamp(time.mktime(time.strptime(data['form']['date1'],"%Y-%m-%d")))
- start = DateTime(int(start.year),int(start.month),int(start.day))
- if data['form']['direction_selection'] == 'past':
- for i in range(5)[::-1]:
- stop = start - RelativeDateTime(days=period_length)
- res[str(i)] = {
- 'name' : str((5-(i+1))*period_length) + '-' + str((5-i)*period_length),
-
- 'stop': start.strftime('%Y-%m-%d'),
- 'start' : stop.strftime('%Y-%m-%d'),
- }
- start = stop - RelativeDateTime(days=1)
- else:
- for i in range(5):
- stop = start + RelativeDateTime(days=period_length)
- res[str(5-(i+1))] = {
- 'name' : str((i)*period_length)+'-'+str((i+1)*period_length),
- 'start': start.strftime('%Y-%m-%d'),
- 'stop' : stop.strftime('%Y-%m-%d'),
- }
- start = stop + RelativeDateTime(days=1)
- return res
+ res = {}
+ period_length = data['form']['period_length']
+ if period_length<=0:
+ raise wizard.except_wizard('UserError', 'You must enter a period length that cannot be 0 or below !')
+ start = datetime.date.fromtimestamp(time.mktime(time.strptime(data['form']['date1'],"%Y-%m-%d")))
+ start = DateTime(int(start.year),int(start.month),int(start.day))
+ if data['form']['direction_selection'] == 'past':
+ for i in range(5)[::-1]:
+ stop = start - RelativeDateTime(days=period_length)
+ res[str(i)] = {
+ 'name' : str((5-(i+1))*period_length) + '-' + str((5-i)*period_length),
+
+ 'stop': start.strftime('%Y-%m-%d'),
+ 'start' : stop.strftime('%Y-%m-%d'),
+ }
+ start = stop - RelativeDateTime(days=1)
+ else:
+ for i in range(5):
+ stop = start + RelativeDateTime(days=period_length)
+ res[str(5-(i+1))] = {
+ 'name' : str((i)*period_length)+'-'+str((i+1)*period_length),
+ 'start': start.strftime('%Y-%m-%d'),
+ 'stop' : stop.strftime('%Y-%m-%d'),
+ }
+ start = stop + RelativeDateTime(days=1)
+ return res
class wizard_report(wizard.interface):
- def _get_defaults(self, cr, uid, data, context):
- fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
- data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
-
- user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
- if user.company_id:
- company_id = user.company_id.id
- else:
- company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
- data['form']['company_id'] = company_id
-
- return data['form']
-
-
- states = {
- 'init': {
- 'actions': [_get_defaults],
- 'result': {'type':'form', 'arch':_aged_trial_form, 'fields':_aged_trial_fields, 'state':[('end','Cancel'),('print','Print Aged Trial Balance')]},
- },
- 'print': {
- 'actions': [_calc_dates],
- 'result': {'type':'print', 'report':'account.aged_trial_balance', 'state':'end'},
- },
- }
+ def _get_defaults(self, cr, uid, data, context):
+ fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
+ data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
+ user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
+ if user.company_id:
+ company_id = user.company_id.id
+ else:
+ company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
+ data['form']['company_id'] = company_id
+ return data['form']
+ states = {
+ 'init': {
+ 'actions': [_get_defaults],
+ 'result': {'type':'form', 'arch':_aged_trial_form, 'fields':_aged_trial_fields, 'state':[('end','Cancel'),('print','Print Aged Trial Balance')]},
+ },
+ 'print': {
+ 'actions': [_calc_dates],
+ 'result': {'type':'print', 'report':'account.aged_trial_balance', 'state':'end'},
+ },
+ }
wizard_report('account.aged.trial.balance')
diff --git a/addons/account/wizard/wizard_central_journal.py b/addons/account/wizard/wizard_central_journal.py
new file mode 100644
index 00000000000..db4002bc084
--- /dev/null
+++ b/addons/account/wizard/wizard_central_journal.py
@@ -0,0 +1,60 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+#
+# $Id$
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+import wizard
+import pooler
+
+form = '''
+'''
+
+fields = {
+ 'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
+ 'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
+}
+
+
+class wizard_print_journal(wizard.interface):
+ states = {
+ 'init': {
+ 'actions': [],
+ 'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel'), ('print', 'Print'))},
+ },
+ 'print': {
+ 'actions': [],
+ 'result': {'type':'print', 'report':'account.central.journal.wiz', 'state':'end'},
+ },
+ }
+wizard_print_journal('account.central.journal.report')
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/account/wizard/wizard_general_journal.py b/addons/account/wizard/wizard_general_journal.py
new file mode 100644
index 00000000000..5b72a944ea1
--- /dev/null
+++ b/addons/account/wizard/wizard_general_journal.py
@@ -0,0 +1,60 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+#
+# $Id$
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+import wizard
+import pooler
+
+form = '''
+'''
+
+fields = {
+ 'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
+ 'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
+}
+
+
+class wizard_print_journal(wizard.interface):
+ states = {
+ 'init': {
+ 'actions': [],
+ 'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel'), ('print', 'Print'))},
+ },
+ 'print': {
+ 'actions': [],
+ 'result': {'type':'print', 'report':'account.general.journal.wiz', 'state':'end'},
+ },
+ }
+wizard_print_journal('account.general.journal.report')
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/account/wizard/wizard_general_ledger_report.py b/addons/account/wizard/wizard_general_ledger_report.py
index c4a2f2a7438..2ba3b2b0a1f 100644
--- a/addons/account/wizard/wizard_general_ledger_report.py
+++ b/addons/account/wizard/wizard_general_ledger_report.py
@@ -29,64 +29,94 @@ import pooler
import locale
import time
-report_type = '''
-'''
-
-dates_form = '''
-'''
-
-dates_fields = {
- 'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
- 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
- 'sortbydate':{'string':"Sort by",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Mouvement')]},
- 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
- 'landscape':{'string':"Print in Landscape Mode",'type':'boolean'},
- 'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
- 'amount_currency':{'string':"with amount in currency",'type':'boolean'}
-
-}
+#report_type = '''
+#'''
+#
+#dates_form = '''
+#'''
+#
+#dates_fields = {
+# 'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
+# 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
+# 'sortbydate':{'string':"Sort by",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Mouvement')]},
+# 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
+# 'landscape':{'string':"Print in Landscape Mode",'type':'boolean'},
+# 'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
+# 'amount_currency':{'string':"with amount in currency",'type':'boolean'}
+#
+#}
account_form = '''
-'''
account_fields = {
- 'Account_list': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]},
+ 'Account_list': {'string':'Chart of Accounts', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]},
}
-
-
-
period_form = '''
-'''
period_fields = {
+ 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
+ 'state':{
+ 'string':"Date/Period Filter",
+ 'type':'selection',
+ 'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
+ 'default': lambda *a:'bydate'
+ },
'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
'help': 'Keep empty for all open fiscal year'},
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'},
'sortbydate':{'string':"Sort by:",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Mouvement')]},
'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
- 'landscape':{'string':"Print in Landscape Mode",'type':'boolean'},
+ 'landscape':{'string':"Landscape Mode",'type':'boolean'},
'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
- 'amount_currency':{'string':"with amount in currency",'type':'boolean'}
+ 'amount_currency':{'string':"With Currency",'type':'boolean'},
+ 'date_from': {'string':" Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
+ 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
+
}
def _check_path(self, cr, uid, data, context):
if data['model'] == 'account.account':
@@ -101,6 +131,7 @@ def _check(self, cr, uid, data, context):
return 'report'
def _check_date(self, cr, uid, data, context):
+
sql = """
SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where '%s' between f.date_start and f.date_stop """%(data['form']['date_from'])
cr.execute(sql)
@@ -113,24 +144,36 @@ def _check_date(self, cr, uid, data, context):
else:
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
+
+def _check_state(self, cr, uid, data, context):
+
+ if data['form']['state'] == 'bydate':
+ _check_date(self, cr, uid, data, context)
+ data['form']['fiscalyear'] = 0
+ else :
+
+ data['form']['fiscalyear'] = 1
+ return data['form']
class wizard_report(wizard.interface):
def _get_defaults(self, cr, uid, data, context):
+ user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
+ if user.company_id:
+ company_id = user.company_id.id
+ else:
+ company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
+ data['form']['company_id'] = company_id
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
+
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
+ periods_obj=pooler.get_pool(cr.dbname).get('account.period')
+ data['form']['periods'] =periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
data['form']['sortbydate'] = 'sort_date'
data['form']['display_account']='bal_all'
data['form']['landscape']=True
data['form']['amount_currency'] = True
return data['form']
- def _get_defaults_fordate(self, cr, uid, data, context):
- data['form']['sortbydate'] = 'sort_date'
- data['form']['display_account']='bal_all'
- data['form']['landscape']=True
- data['form']['amount_currency'] = True
- return data['form']
-
states = {
'init': {
@@ -142,31 +185,19 @@ class wizard_report(wizard.interface):
'result': {'type':'form', 'arch':account_form,'fields':account_fields, 'state':[('end','Cancel'),('checktype','Print')]}
},
'checktype': {
- 'actions': [],
- 'result': {'type':'form', 'arch':report_type,'fields':{}, 'state':[('with_period','Use with Period'),('with_date','Use with Date')]}
- },
- 'with_period': {
'actions': [_get_defaults],
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('checkreport','Print')]}
},
- 'with_date': {
- 'actions': [_get_defaults_fordate],
- 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('checkdate','Print')]}
- },
- 'checkdate': {
- 'actions': [],
- 'result': {'type':'choice','next_state':_check_date}
- },
'checkreport': {
'actions': [],
'result': {'type':'choice','next_state':_check}
},
'report_landscape': {
- 'actions': [],
+ 'actions': [_check_state],
'result': {'type':'print', 'report':'account.general.ledger_landscape', 'state':'end'}
},
'report': {
- 'actions': [],
+ 'actions': [_check_state],
'result': {'type':'print', 'report':'account.general.ledger', 'state':'end'}
}
}
diff --git a/addons/account/wizard/wizard_partner_balance_report.py b/addons/account/wizard/wizard_partner_balance_report.py
index 7334bfc56fc..470e3e23955 100644
--- a/addons/account/wizard/wizard_partner_balance_report.py
+++ b/addons/account/wizard/wizard_partner_balance_report.py
@@ -29,64 +29,57 @@ import time
import wizard
import pooler
-#report_type = '''
-#'''
-#
-#
-#dates_form = '''
-#'''
-#
-#dates_fields = {
-# 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
-# 'result_selection':{'string':"Display partner ",'type':'selection','selection':[('customer','Debiteur'),('supplier','Creancier'),('all','Tous')]},
-# 'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
-# 'date1': {'string':'Start date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
-# 'date2': {'string':'End date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
-#}
-
period_form = '''
-'''
period_fields = {
'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
- 'state':{'string':"Select Report Type",'type':'selection','selection':[('none','None'),('bydate','By Date'),('byperiod','By Period')],'default': lambda *a:'none' },
- 'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
- 'help': 'Keep empty for all open fiscal year','states':{'none':[('readonly',True)],'bydate':[('readonly',True)]}},
+ 'state':{
+ 'string':"Date/Period Filter",
+ 'type':'selection',
+ 'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
+ 'default': lambda *a:'bydate'
+ },
+ 'fiscalyear': {
+ 'string':'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
+ 'help': 'Keep empty for all open fiscal year'
+ },
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty','states':{'none':[('readonly',True)],'bydate':[('readonly',True)]}},
- 'result_selection':{'string':"Display partner",'type':'selection','selection':[('customer','Debiteur'),('supplier','Creancier'),('all','Tous')]},
- 'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
- 'date1': {'string':'Start date', 'type':'date', 'required':True,'default': lambda *a: time.strftime('%Y-01-01')},
+ 'result_selection':{
+ 'string':"Partner",
+ 'type':'selection',
+ 'selection':[('customer','Receivable Accounts'),('supplier','Payable Accounts'),('all','Receivable and Payable Accounts')],
+ 'required':True
+ },
+ 'soldeinit':{'string':" Inclure les soldes initiaux",'type':'boolean'},
+ 'date1': {'string':' Start date', 'type':'date', 'required':True,'default': lambda *a: time.strftime('%Y-01-01')},
'date2': {'string':'End date', 'type':'date', 'required':True,'default': lambda *a: time.strftime('%Y-%m-%d')},
}
-
class wizard_report(wizard.interface):
- def _get_load(self,cr,uid,data,context):
+ def _get_defaults(self,cr,uid,data,context):
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
if user.company_id:
company_id = user.company_id.id
@@ -102,30 +95,12 @@ class wizard_report(wizard.interface):
data['form']['result_selection'] = 'all'
return data['form']
- def _get_defaults(self, cr, uid, data, context):
+ def _check_state(self, cr, uid, data, context):
- if data['form']['state'] == 'none':
- return 'report'
- else :
- if data['form']['state'] == 'byperiod':
- data['form']['fiscalyear'] = True
- else :
- self._check_date(cr, uid, data, context)
- data['form']['fiscalyear'] = False
-
+ if data['form']['state'] == 'bydate' :
+ self._check_date(cr, uid, data, context)
return data['form']
-
-# def _get_defaults_fordate(self, cr, uid, data, context):
-# user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
-# if user.company_id:
-# company_id = user.company_id.id
-# else:
-# company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
-# data['form']['company_id'] = company_id
-# data['form']['soldeinit'] = True
-# data['form']['result_selection'] = 'all'
-# return data['form']
-
+
def _check_date(self, cr, uid, data, context):
sql = """
@@ -141,27 +116,14 @@ class wizard_report(wizard.interface):
else:
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
-
states = {
'init': {
- 'actions': [_get_load],
+ 'actions': [_get_defaults],
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('report','Print')]}
},
-# 'with_period': {
-# 'actions': [_get_defaults],
-# 'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('report','Print')]}
-# },
-# 'with_date': {
-# 'actions': [_get_defaults_fordate],
-# 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('checkdate','Print')]}
-# },
-## 'checkdate': {
-## 'actions': [],
-## 'result': {'type':'choice','next_state':_check_date}
-## },
'report': {
- 'actions': [_get_defaults],
+ 'actions': [_check_state],
'result': {'type':'print', 'report':'account.partner.balance', 'state':'end'}
}
}
diff --git a/addons/account/wizard/wizard_print_journal.py b/addons/account/wizard/wizard_print_journal.py
new file mode 100644
index 00000000000..c288e096dee
--- /dev/null
+++ b/addons/account/wizard/wizard_print_journal.py
@@ -0,0 +1,68 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+#
+# $Id$
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+import wizard
+import pooler
+
+form = '''
+'''
+
+fields = {
+ 'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
+ 'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
+ 'sort_selection':{
+ 'string':"Entries Sorted By",
+ 'type':'selection',
+ 'selection':[('date','By date'),('ref','Reference Number')],
+ 'required':True,
+ 'default': lambda *a: 'date',
+ },
+
+}
+
+class wizard_print_journal(wizard.interface):
+ states = {
+ 'init': {
+ 'actions': [],
+ 'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel'), ('print', 'Print'))},
+ },
+ 'print': {
+ 'actions': [],
+ 'result': {'type':'print', 'report':'account.journal.period.print.wiz', 'state':'end'},
+ },
+ }
+wizard_print_journal('account.print.journal.report')
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/account/wizard/wizard_third_party_ledger.py b/addons/account/wizard/wizard_third_party_ledger.py
index e9f2daf4b01..96720083f53 100755
--- a/addons/account/wizard/wizard_third_party_ledger.py
+++ b/addons/account/wizard/wizard_third_party_ledger.py
@@ -30,65 +30,65 @@ import wizard
import pooler
-report_type = '''
-'''
-
-
-dates_form = '''
-'''
-
-dates_fields = {
- 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
- 'date1': {'string':'Start date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
- 'date2': {'string':'End date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
- 'result_selection':{'string':"Display partners",'type':'selection','selection':[('customer','Debiteur'),('supplier','Creancier'),('all','Tous')]},
- 'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
- 'reconcil':{'string':"Inclure les ecritures reconsiliees",'type':'boolean'},
- 'page_split':{'string':"Un partenaire par page",'type':'boolean'},
-}
-
period_form = '''
-'''
period_fields = {
'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
- 'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
- 'help': 'Keep empty for all open fiscal year'},
- 'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'},
- 'result_selection':{'string':"Display partners",'type':'selection','selection':[('customer','Debiteur'),('supplier','Creancier'),('all','Tous')]},
+ 'state':{
+ 'string':"Date/Period Filter",
+ 'type':'selection',
+ 'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
+ 'default': lambda *a:'bydate'
+ },
+ 'fiscalyear': {
+ 'string':'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
+ 'help': 'Keep empty for all open fiscal year'
+ },
+ 'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty','states':{'none':[('readonly',True)],'bydate':[('readonly',True)]}},
+ 'result_selection':{
+ 'string':"Partner",
+ 'type':'selection',
+ 'selection':[('customer','Receivable Accounts'),('supplier','Payable Accounts'),('all','Receivable and Payable Accounts')],
+ 'required':True
+ },
'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
- 'reconcil':{'string':"Inclure les ecritures reconsiliees",'type':'boolean'},
- 'page_split':{'string':"Un partenaire par page",'type':'boolean'},
+ 'reconcil':{'string':" Include Reconciled Entries",'type':'boolean'},
+ 'page_split':{'string':"One Partner Per Page",'type':'boolean'},
+ 'date1': {'string':' Start date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
+ 'date2': {'string':'End date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
}
class wizard_report(wizard.interface):
def _get_defaults(self, cr, uid, data, context):
-
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
data['form']['display_account']='bal_all'
@@ -100,26 +100,15 @@ class wizard_report(wizard.interface):
else:
company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
data['form']['company_id'] = company_id
+ periods_obj=pooler.get_pool(cr.dbname).get('account.period')
+ data['form']['periods'] =periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
data['form']['page_split'] = False
data['form']['reconcil'] = False
data['form']['soldeinit'] = True
return data['form']
- def _get_defaults_fordate(self, cr, uid, data, context):
- data['form']['result_selection'] = 'all'
- user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
- if user.company_id:
- company_id = user.company_id.id
- else:
- company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
- data['form']['company_id'] = company_id
- data['form']['page_split'] = False
- data['form']['reconcil'] = False
- data['form']['soldeinit'] = True
- return data['form']
-
-
def _check_date(self, cr, uid, data, context):
+
sql = """
SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where '%s' between f.date_start and f.date_stop """%(data['form']['date1'])
cr.execute(sql)
@@ -132,27 +121,24 @@ class wizard_report(wizard.interface):
else:
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
+
+
+ def _check_state(self, cr, uid, data, context):
+ if data['form']['state'] == 'byperiod':
+ data['form']['fiscalyear'] = True
+ else :
+ self._check_date(cr, uid, data, context)
+ data['form']['fiscalyear'] = False
+ return data['form']
states = {
'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':report_type,'fields':{}, 'state':[('with_period','Use with Period'),('with_date','Use with Date')]}
- },
- 'with_period': {
'actions': [_get_defaults],
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('report','Print')]}
},
- 'with_date': {
- 'actions': [_get_defaults_fordate],
- 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('checkdate','Print')]}
- },
- 'checkdate': {
- 'actions': [],
- 'result': {'type':'choice','next_state':_check_date}
- },
'report': {
- 'actions': [],
+ 'actions': [_check_state],
'result': {'type':'print', 'report':'account.third_party_ledger', 'state':'end'}
}
}
diff --git a/addons/account_analytic_plans/security/ir.model.access.csv b/addons/account_analytic_plans/security/ir.model.access.csv
index fe56cde8939..f7f141ac15a 100644
--- a/addons/account_analytic_plans/security/ir.model.access.csv
+++ b/addons/account_analytic_plans/security/ir.model.access.csv
@@ -1,7 +1,8 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_account_analytic_plan_line,account.analytic.plan.line,model_account_analytic_plan_line,account.group_account_user,1,1,1,1
-access_account_analytic_plan_instance,account.analytic.plan.instance,model_account_analytic_plan_instance,account.group_account_user,1,1,1,1
-access_account_analytic_plan_instance_line,account.analytic.plan.instance.line,model_account_analytic_plan_instance_line,account.group_account_user,1,1,1,1
-access_account_analytic_plan_line_invoice,account.analytic.plan.line.invoice,model_account_analytic_plan_line,account.group_account_user,1,1,1,1
-access_account_analytic_plan_instance_invoice,account.analytic.plan.instance.invoice,model_account_analytic_plan_instance,account.group_account_user,1,1,1,1
-access_account_analytic_plan_instance_line_invoice,account.analytic.plan.instance.line.invoice,model_account_analytic_plan_instance_line,account.group_account_user,1,1,1,1
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_account_analytic_plan","account.analytic.plan","model_account_analytic_plan","account.group_account_user",1,1,1,1
+"access_account_analytic_plan_line","account.analytic.plan.line","model_account_analytic_plan_line","account.group_account_user",1,1,1,1
+"access_account_analytic_plan_instance","account.analytic.plan.instance","model_account_analytic_plan_instance","account.group_account_user",1,1,1,1
+"access_account_analytic_plan_instance_line","account.analytic.plan.instance.line","model_account_analytic_plan_instance_line","account.group_account_user",1,1,1,1
+"access_account_analytic_plan_line_invoice","account.analytic.plan.line.invoice","model_account_analytic_plan_line","account.group_account_user",1,1,1,1
+"access_account_analytic_plan_instance_manager","account.analytic.plan.instance manager","model_account_analytic_plan_instance","account.group_account_manager",1,1,1,1
+"access_account_analytic_plan_instance_line_manager","account.analytic.plan.instance.line manager","model_account_analytic_plan_instance_line","account.group_account_manager",1,1,1,1
diff --git a/addons/account_followup/__terp__.py b/addons/account_followup/__terp__.py
index a1b6713ca83..392df34f11a 100644
--- a/addons/account_followup/__terp__.py
+++ b/addons/account_followup/__terp__.py
@@ -50,8 +50,9 @@
"demo_xml" : ["followup_demo.xml"],
"update_xml" : [
"security/ir.model.access.csv",
+ "wizard/wizard_view.xml",
"followup_view.xml",
- "followup_report_view.xml"
+ "followup_report_view.xml",
],
"active": False,
"installable": True
diff --git a/addons/account_followup/followup_view.xml b/addons/account_followup/followup_view.xml
index 8739a94372a..81298dbf24d 100644
--- a/addons/account_followup/followup_view.xml
+++ b/addons/account_followup/followup_view.xml
@@ -42,12 +42,6 @@
-
- Send followups
- account_followup.followup.print.all
-
-
-
account.move.line.partner.tree
diff --git a/addons/account_followup/wizard/wizard_view.xml b/addons/account_followup/wizard/wizard_view.xml
new file mode 100644
index 00000000000..643265ddca2
--- /dev/null
+++ b/addons/account_followup/wizard/wizard_view.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/addons/account_payment/security/ir.model.access.csv b/addons/account_payment/security/ir.model.access.csv
index d5d97f5cbdc..09ee2170239 100644
--- a/addons/account_payment/security/ir.model.access.csv
+++ b/addons/account_payment/security/ir.model.access.csv
@@ -1,5 +1,8 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_payment_type,payment.type,model_payment_type,group_account_payment,1,1,1,1
-access_payment_mode,payment.mode,model_payment_mode,group_account_payment,1,1,1,1
-access_payment_order,payment.order,model_payment_order,group_account_payment,1,1,1,1
-access_payment_line,payment.line,model_payment_line,group_account_payment,1,1,1,1
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_payment_type","payment.type","model_payment_type","group_account_payment",1,1,1,1
+"access_payment_mode","payment.mode","model_payment_mode","group_account_payment",1,1,1,1
+"access_payment_order","payment.order","model_payment_order","group_account_payment",1,1,1,1
+"access_payment_line","payment.line","model_payment_line","group_account_payment",1,1,1,1
+"access_account_journal_payement","account.journal payment","account.model_account_journal","group_account_payment",1,0,0,0
+"access_account_invoice_payment","account.invoice payment","account.model_account_invoice","group_account_payment",1,0,0,0
+"access_account_move_line_payment","account.move.line payment","account.model_account_move_line","group_account_payment",1,0,0,0
diff --git a/addons/account_report/report/print_indicator.py b/addons/account_report/report/print_indicator.py
index ec0e84fb314..203f249178b 100644
--- a/addons/account_report/report/print_indicator.py
+++ b/addons/account_report/report/print_indicator.py
@@ -32,19 +32,22 @@
import pooler
import time
from report import report_sxw
-from crm.report import report_businessopp
-from report.interface import report_int
-from reportlab.graphics.shapes import Drawing
-from reportlab.graphics.charts.barcharts import VerticalBarChart
-import reportlab.lib.colors as colors
+
+#from report.interface import report_int
+#from reportlab.graphics.shapes import Drawing
+#from reportlab.graphics.charts.barcharts import VerticalBarChart
+#import reportlab.lib.colors as colors
#from reportlab.graphics.widgetbase import Widget, TypedPropertyCollection
#from reportlab.graphics.charts.textlabels import BarChartLabel
#from reportlab.graphics import renderPM
-from report.render import render
-from report.interface import report_int
+#from report.render import render
+#from report.interface import report_int
from pychart import *
import StringIO
theme.use_color = 1
+theme.default_font_family = "Helvetica-Bold"
+theme.default_font_size = 18
+theme.default_line_width = 1.0
import tools
@@ -78,7 +81,7 @@ class accounting_report_indicator(report_sxw.rml_parse):
if not name=='array':
return super(accounting_report_indicator,self).repeatIn(lst, name, nodes_parent=False)
- value=['X-Axis']
+ value=['Data']
value.extend(self.header_name)
type=['string'].extend(['float']*len(self.header_name))
width=[40]*(len(self.header_name)+1)
@@ -123,18 +126,19 @@ class accounting_report_indicator(report_sxw.rml_parse):
def lines(self,data):
res={}
result=[]
- obj_inds=self.pool.get('account.report.report').browse(self.cr,self.uid,data['indicator_id'])
+ ind_ids=self.pool.get('account.report.report').search(self.cr,self.uid,[])
+ obj_inds=self.pool.get('account.report.report').browse(self.cr,self.uid,ind_ids)
- def find_child(obj):
- self.list.append(obj)
- if obj.child_ids:
- for child in obj.child_ids:
- find_child(child)
- return True
+# def find_child(obj):
+# self.list.append(obj)
+# if obj.child_ids:
+# for child in obj.child_ids:
+# find_child(child)
+# return True
+#
+# find_child(obj_inds)
- find_child(obj_inds)
-
- for obj_ind in self.list:
+ for obj_ind in obj_inds:
res = {
'id':obj_ind.id,
'name':obj_ind.name,
@@ -143,10 +147,8 @@ class accounting_report_indicator(report_sxw.rml_parse):
'disp_graph':obj_ind.disp_graph,
'note':obj_ind.note,
'type':obj_ind.type,
- 'last':False,
}
result.append(res)
- result[-1]['last']=True
return result
def getarray(self,data,object):
@@ -156,28 +158,40 @@ class accounting_report_indicator(report_sxw.rml_parse):
self.header_val=[str(x) for x in self.header_val]
temp_dict=zip(self.header_name,self.header_val)
res=dict(temp_dict)
- res['X-Axis']='Value'
+ res['Data']='Value'
result.append(res)
return result
def test1(self,data,object,intercall=False):
- path=tools.config['root_path']+"/Temp_images/Image"
obj_history=self.pool.get('account.report.history')
if data['select_base']=='year':
tuple_search=('fiscalyear_id','in',data['base_selection'][0][2])
+ base='year'
else:
tuple_search=('period_id','in',data['base_selection'][0][2])
+ base='period'
history_ids=obj_history.search(self.cr,self.uid,[('name','=',object['id']),tuple_search])
+ history_ids.sort()
obj_his=obj_history.browse(self.cr,self.uid,history_ids)
data_val=[]
data_period=[]
- for item in obj_his:
- data_val.append(item.val)
- data_period.append(item.period_id.name)
+ if base=='period':
+ for item in obj_his:
+ data_val.append(item.val)
+ data_period.append(item.period_id.name)
+ else:
+ for i in data['base_selection'][0][2]:
+ val_temp=[]
+ data_period.append(self.pool.get('account.fiscalyear').browse(self.cr,self.uid,i).name)
+ for item in obj_his:
+ if item.fiscalyear_id.id==i:
+ val_temp.append(item.val)
+ data_val.append(sum(val_temp))
+
self.header_name=data_period
self.header_val=data_val
@@ -218,25 +232,28 @@ class accounting_report_indicator(report_sxw.rml_parse):
# drawing.save(formats=['png'],fnRoot=path+str(self.count),title="helo")
# renderPM.drawToFile(drawing1, 'example1.jpg','jpg')
import os
- dirname ='Temp_images'
- if not os.path.isdir('./' + dirname + '/'):
- os.mkdir('./' + dirname + '/')
- pdf_string = StringIO.StringIO()
- can = canvas.init('Image'+str(self.count)+".png")
- chart_object.set_defaults(line_plot.T, line_style=None)
+ path=tools.config['addons_path']+"/account_report/tmp_images/image"
+
+ dirname =tools.config['addons_path']+'/account_report/tmp_images/'
+ if not os.path.isdir(dirname):
+ os.mkdir(dirname)
+
+ can = canvas.init('image'+str(self.count)+".png")
+# can.clip(0,0,600,400)
+
data=zip(self.header_name,self.header_val)
- ar = area.T(size = (400,200),x_coord = category_coord.T(data, 0), y_range = (0, None),
- x_axis = axis.X(label="Period//Year",format="/a-30{}%s"),
+ ar = area.T(size = (650,450),x_coord = category_coord.T(data, 0), y_range = (None, None),
+ x_axis = axis.X(label="Period // Year",format="/a-30{}%s"),
y_axis = axis.Y(label="Value"))
-
- ar.add_plot(bar_plot.T(data = data, label = "Value",fill_style=fill_style.red))
+ ar.add_plot(bar_plot.T(data = data,width=15, data_label_format="/o/15{}%s",label = "Value",fill_style=fill_style.red))
ar.draw()
can.close()
- os.system('cp '+'Image'+str(self.count)+'.png ' +path+str(self.count)+'.png')
- os.system('rm '+'Image'+str(self.count)+'.png')
+ os.system('cp '+'image'+str(self.count)+'.png ' +path+str(self.count)+'.png')
+ os.system('rm '+'image'+str(self.count)+'.png')
+# can.endclip()
return path+str(self.count)+'.png'
report_sxw.report_sxw('report.print.indicators', 'account.report.history',
diff --git a/addons/account_report/report/print_indicator.rml b/addons/account_report/report/print_indicator.rml
index 6727812fc6f..6134b48dea1 100644
--- a/addons/account_report/report/print_indicator.rml
+++ b/addons/account_report/report/print_indicator.rml
@@ -3,6 +3,12 @@
+
+
+
+
+
+
@@ -17,90 +23,75 @@
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-Indicators
-
-
-
-
-
-
-
-
-
-[[ company.name ]]
-
-
-
-
-
-
-
-Currency: [[ company.currency_id.name]]
-
-
-
+
+
+
+ Indicators
+
+
+
+
+
+
+ [[ company.name ]]
+
+
+ Currency: [[ company.currency_id.name]]
+
+
+
-Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]
-
+Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]
+
Name
@@ -113,22 +104,23 @@
+
[[ repeatIn(lines(data['form']),'o')]]
-[[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]][[ o['name'] ]]
+( ) [[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold','fontSize':'10.5'}) ]][[ o['name'] ]]
-[[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]][[ o['code'] ]]
+[[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold','fontSize':'10.5'}) ]][[ o['code'] ]]
-[[ o['disp_graph'] and setTag('para','image',{'file':test(data['form'],o)}) or removeParentNode('para') ]]
+[[ o['disp_graph'] and setTag('para','image',{'width':'450.00','height':'215.00','file':test(data['form'],o)}) or removeParentNode('para') ]]
@@ -139,48 +131,50 @@
-
+
-
+
-
+
-
+
-Expression : [[ o['expression'] ]]
+
+
+
+Expression : [[ o['expression'] ]]
+
+
+
-
+
-Notes : [[ o['note'] ]]
+
+
+
+Notes : [[ o['note'] ]]
+
+
+
-[[ o['last'] and removeParentNode('pageBreak')]]
-
-
-
-Name[[ o['last'] and removeParentNode('blockTable')]]
-
-
-Code
-
-
-
+
diff --git a/addons/account_report/security/ir.model.access.csv b/addons/account_report/security/ir.model.access.csv
index e74efd16f3b..ace4bc06db0 100644
--- a/addons/account_report/security/ir.model.access.csv
+++ b/addons/account_report/security/ir.model.access.csv
@@ -1,2 +1,3 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_account_report_report,account.report.report,model_account_report_report,base.group_user,1,0,0,0
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_account_report_report","account.report.report","model_account_report_report","account.group_account_manager",1,0,0,0
+"access_account_report_history","account.report.history","model_account_report_history","account.group_account_manager",1,0,0,0
diff --git a/addons/account_report/wizard/wizard_print_indicators.py b/addons/account_report/wizard/wizard_print_indicators.py
index 2870c29e61c..17252e8b3c8 100644
--- a/addons/account_report/wizard/wizard_print_indicators.py
+++ b/addons/account_report/wizard/wizard_print_indicators.py
@@ -33,12 +33,12 @@ import pooler
form = '''
'''
fields = {
- 'indicator_id': {'string':'Choose Indicator', 'type':'many2one', 'relation': 'account.report.report','required':True,},
'select_base': {'string':'Choose Criteria', 'type':'selection','selection':[('year','Based On Fiscal Years'),('periods','Based on Fiscal Periods')],'required':True,},
}
@@ -61,6 +61,11 @@ def _load_base(self, cr, uid, data, context):
next_fields['base_selection']['relation']='account.period'
return data['form']
+def _check_len(self, cr, uid, data, context):
+ if len(data['form']['base_selection'][0][2])>12:
+ raise wizard.except_wizard('User Error!',"Please select maximum 12 records to fit the page-width.")
+ return data['form']
+
class wizard_print_indicators(wizard.interface):
states = {
'init': {
@@ -72,7 +77,7 @@ class wizard_print_indicators(wizard.interface):
'result': {'type':'form', 'arch':next_form, 'fields':next_fields, 'state':[('end','Cancel'),('print','Print')]}
},
'print': {
- 'actions':[],
+ 'actions':[_check_len],
'result' :{'type':'print','report':'print.indicators', 'state':'end'}
}
}
diff --git a/addons/account_voucher/__init__.py b/addons/account_voucher/__init__.py
new file mode 100755
index 00000000000..71118c9f783
--- /dev/null
+++ b/addons/account_voucher/__init__.py
@@ -0,0 +1,3 @@
+import voucher
+import voucher_account
+import report
\ No newline at end of file
diff --git a/addons/account_voucher/__terp__.py b/addons/account_voucher/__terp__.py
new file mode 100755
index 00000000000..97105b77379
--- /dev/null
+++ b/addons/account_voucher/__terp__.py
@@ -0,0 +1,33 @@
+{
+ "name" : "India Accounting",
+ "version" : "1.0",
+ "author" : "Tiny",
+ "description": """
+ India Accounting module includes all the basic requirenment of
+ Basic Accounting, plus new things which available are
+ * Indian Account Chart
+ * New Invoice - (Local, Retail)
+ * Invoice Report
+ * Tax structure
+ * Journals
+ * VAT Declaration report
+ * Accounting Periods
+ """,
+ "category" : "Generic Modules/Accounting",
+ "website" : "http://tinyerp.com",
+ "depends" : ["base", "account"],
+ "init_xml" : [
+ ],
+
+ "demo_xml" : [
+ ],
+
+ "update_xml" : [
+ "account_voucher_sequence.xml",
+ "account_view.xml",
+ "account_report.xml",
+ "voucher_view.xml",
+ ],
+ "active": False,
+ "installable": True
+}
\ No newline at end of file
diff --git a/addons/account_voucher/account_report.xml b/addons/account_voucher/account_report.xml
new file mode 100755
index 00000000000..134581c8816
--- /dev/null
+++ b/addons/account_voucher/account_report.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account_voucher/account_view.xml b/addons/account_voucher/account_view.xml
new file mode 100755
index 00000000000..572a0d34095
--- /dev/null
+++ b/addons/account_voucher/account_view.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+ account.form
+
+ account.account
+ form
+
+
+
+
+
+
+
+
+
+
+
+ account.form
+
+ account.account
+ form
+
+
+
+
+
+
+
+ account.form
+
+ account.account
+ form
+
+
+
+
+
+
+
+
+ account.form
+
+ account.account
+ form
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account_voucher/account_voucher_sequence.xml b/addons/account_voucher/account_voucher_sequence.xml
new file mode 100644
index 00000000000..70e804de8c6
--- /dev/null
+++ b/addons/account_voucher/account_voucher_sequence.xml
@@ -0,0 +1,110 @@
+
+
+
+
+
+ Voucher
+ account.voucher
+
+
+
+
+ Account Cash Received Voucher
+ account.voucher.rec_voucher
+
+
+
+ Account Cash Payble Voucher
+ account.voucher.pay_voucher
+
+
+ Account Bank Received Voucher
+ account.voucher.bank_rec_voucher
+
+
+ Account Bank Payble Voucher
+ account.voucher.bank_pay_voucher
+
+
+ Account Contra Voucher
+ account.voucher.cont_voucher
+
+
+ Account Journal Voucher
+ account.voucher.journal_sale_vou
+
+
+ Account Journal Voucher
+ account.voucher.journal_pur_vou
+
+
+
+
+ Account Cash Received Voucher
+ account.voucher.rec_voucher
+
+ %(year)s/
+
+
+
+ Account Cash Payble Voucher
+ account.voucher.pay_voucher
+
+ %(year)s/
+
+
+ Account Bank Received Voucher
+ account.voucher.bank_rec_voucher
+
+ %(year)s/
+
+
+ Account Bank Payble Voucher
+ account.voucher.bank_pay_voucher
+
+ %(year)s/
+
+
+ Account Contra Voucher
+ account.voucher.cont_voucher
+
+ %(year)s/
+
+
+ Account Journal Voucher
+ account.voucher.journal_sale_vou
+
+ %(year)s/
+
+
+ Account Journal Voucher
+ account.voucher.journal_pur_vou
+
+ %(year)s/
+
+
+
+
+
+
diff --git a/addons/account_voucher/account_voucher_wizard.xml b/addons/account_voucher/account_voucher_wizard.xml
new file mode 100644
index 00000000000..ffe7b25c87c
--- /dev/null
+++ b/addons/account_voucher/account_voucher_wizard.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account_voucher/account_voucher_workflow.xml b/addons/account_voucher/account_voucher_workflow.xml
new file mode 100644
index 00000000000..0299c79997d
--- /dev/null
+++ b/addons/account_voucher/account_voucher_workflow.xml
@@ -0,0 +1,75 @@
+
+
+
+
+
+ account.voucher.basic
+ account.voucher
+ True
+
+
+
+
+ True
+ draft
+
+
+
+
+ performa
+ open_voucher()
+ function
+
+
+
+
+ posted
+ proforma_voucher()
+ True
+ function
+
+
+
+
+ cancel
+ cancel_voucher()
+ function
+
+
+
+
+
+ open_voucher
+
+
+
+
+
+ proforma_voucher
+
+
+
+
+
+ cancel_voucher
+
+
+
+
+
+ cancel_voucher
+
+
+
+
+
+ cancel_voucher
+
+
+
+
+
+ open_voucher
+
+
+
\ No newline at end of file
diff --git a/addons/account_voucher/report/__init__.py b/addons/account_voucher/report/__init__.py
new file mode 100755
index 00000000000..c55dad59fef
--- /dev/null
+++ b/addons/account_voucher/report/__init__.py
@@ -0,0 +1,2 @@
+import report_voucher
+import report_voucher_amount
\ No newline at end of file
diff --git a/addons/account_voucher/report/report_voucher.py b/addons/account_voucher/report/report_voucher.py
new file mode 100755
index 00000000000..b3e3c686f58
--- /dev/null
+++ b/addons/account_voucher/report/report_voucher.py
@@ -0,0 +1,72 @@
+##############################################################################
+#
+# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+import time
+from report import report_sxw
+from tools import amount_to_text_en
+
+
+class report_voucher(report_sxw.rml_parse):
+ def __init__(self, cr, uid, name, context):
+ super(report_voucher, self).__init__(cr, uid, name, context)
+ self.localcontext.update({
+ 'time': time,
+ 'convert':self.convert,
+ 'debit':self.debit,
+ 'credit':self.credit,
+ 'get_ref' : self._get_ref
+ })
+
+ def convert(self,amount, cur):
+ amt_en = amount_to_text_en.amount_to_text(amount,'en',cur);
+ return amt_en
+
+ def debit(self, move_ids):
+ debit = 0.0
+ for move in move_ids:#self.pool.get('account.move.line').browse(self.cr, self.uid, move_ids):
+ debit +=move.debit
+ return debit
+
+ def credit(self, move_ids):
+ credit = 0.0
+ for move in move_ids:#self.pool.get('account.move.line').browse(self.cr, self.uid, move_ids):
+ credit +=move.credit
+ return credit
+
+ def _get_ref(self, voucher_id, move_ids):
+ voucher_line = self.pool.get('account.voucher.line').search(self.cr, self.uid, [('partner_id','=',move_ids.partner_id.id), ('voucher_id','=',voucher_id)])
+ if voucher_line:
+ voucher = self.pool.get('account.voucher.line').browse(self.cr, self.uid, voucher_line)[0]
+ return voucher.ref
+ else:
+ return
+report_sxw.report_sxw(
+ 'report.voucher.cash_receipt',
+ 'account.voucher',
+ 'addons/account_voucher/report/report_voucher.rml',
+ parser=report_voucher,header=False
+)
\ No newline at end of file
diff --git a/addons/account_voucher/report/report_voucher.rml b/addons/account_voucher/report/report_voucher.rml
new file mode 100755
index 00000000000..685983045ae
--- /dev/null
+++ b/addons/account_voucher/report/report_voucher.rml
@@ -0,0 +1,381 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[ repeatIn(objects,'voucher') ]]
+ [[ company.name ]]
+ [[ company.partner_id.address and company.partner_id.address[0].street ]]
+ [[ company.partner_id.address and company.partner_id.address[0].zip ]] [[ company.partner_id.address and company.partner_id.address[0].city ]] - [[ company.partner_id.address and company.partner_id.address[0].country_id and company.partner_id.address[0].country_id.name ]]
+ [[ company.partner_id.address and company.partner_id.address[0].phone ]]
+ [[ company.partner_id.address and company.partner_id.address[0].email ]]
+
+
+
+ Cash Receipt Voucher [[ (voucher.type == 'rec_voucher' or removeParentNode('para')) and '' ]]
+ Cash Payment Voucher [[ (voucher.type == 'pay_voucher' or removeParentNode('para')) and '' ]]
+ Bank Receipt Voucher [[ (voucher.type == 'bank_rec_voucher' or removeParentNode('para')) and '' ]]
+ Bank Payment Voucher [[ (voucher.type == 'bank_pay_voucher' or removeParentNode('para')) and '' ]]
+
+
+
+
+
+
+ No.
+
+
+ [[ voucher.number ]]
+
+
+
+
+
+
+
+ Dated :
+
+
+ [[ time.strftime('%d %B,%Y', time.strptime(voucher.date , '%Y-%m-%d')) or '' ]]
+
+
+
+
+ State :
+
+
+ PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]
+ Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]
+ Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]
+ Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]
+
+
+
+
+
+
+
+ Ref. :
+
+
+ [[ voucher.reference ]]
+
+
+
+
+
+
+
+
+
+
+
+
+ Particulars
+
+
+ Debit
+
+
+ Credit
+
+
+
+
+
+
+
+ [[ repeatIn(voucher.move_ids,'move_ids') ]]
+
+
+
+ [[ (move_ids.partner_id and move_ids.partner_id.name) or '']] :
+ [[ move_ids.account_id.name ]]
+ [[ get_ref(voucher.id,move_ids) ]]
+
+
+ [[ move_ids.debit ]]
+
+
+ [[ move_ids.credit ]]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Through :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[ voucher.narration or '']]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ On Account of :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[ voucher.name ]]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Amount (in words) :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[ convert(voucher.amount,voucher.currency_id.name) ]]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[ debit(voucher.move_ids)]]
+
+
+ [[ credit(voucher.move_ids) ]]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Receiver's Signature
+
+
+
+
+
+
+
+
+
+
+
+
+ Authorised Signatory
+
+
+
+
+
+
+
+
diff --git a/addons/account_voucher/report/report_voucher_amount.py b/addons/account_voucher/report/report_voucher_amount.py
new file mode 100755
index 00000000000..3b67ff7a9ac
--- /dev/null
+++ b/addons/account_voucher/report/report_voucher_amount.py
@@ -0,0 +1,51 @@
+##############################################################################
+#
+# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+import time
+from report import report_sxw
+from tools import amount_to_text_en
+
+
+class report_voucher_amount(report_sxw.rml_parse):
+ def __init__(self, cr, uid, name, context):
+ super(report_voucher_amount, self).__init__(cr, uid, name, context)
+ self.localcontext.update({
+ 'time': time,
+ 'convert':self.convert
+ })
+
+ def convert(self,amount, cur):
+ amt_en = amount_to_text_en.amount_to_text(amount,'en',cur);
+ return amt_en
+
+
+report_sxw.report_sxw(
+ 'report.voucher.cash_amount',
+ 'account.voucher',
+ 'addons/account_voucher/report/report_voucher_amount.rml',
+ parser=report_voucher_amount,header=False
+)
\ No newline at end of file
diff --git a/addons/account_voucher/report/report_voucher_amount.rml b/addons/account_voucher/report/report_voucher_amount.rml
new file mode 100755
index 00000000000..8adec4c6712
--- /dev/null
+++ b/addons/account_voucher/report/report_voucher_amount.rml
@@ -0,0 +1,353 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[ repeatIn(objects,'voucher') ]]
+ [[ company.name ]]
+ [[ company.partner_id.address and company.partner_id.address[0].street ]]
+ [[ company.partner_id.address and company.partner_id.address[0].zip ]] [[ company.partner_id.address and company.partner_id.address[0].city ]] - [[ company.partner_id.address and company.partner_id.address[0].country_id and company.partner_id.address[0].country_id.name ]]
+ [[ company.partner_id.address and company.partner_id.address[0].phone ]]
+ [[ company.partner_id.address and company.partner_id.address[0].email ]]
+
+
+
+ Cash Receipt Voucher [[ (voucher.type == 'rec_voucher' or removeParentNode('para')) and '' ]]
+ Cash Payment Voucher [[ (voucher.type == 'pay_voucher' or removeParentNode('para')) and '' ]]
+ Bank Receipt Voucher [[ (voucher.type == 'bank_rec_voucher' or removeParentNode('para')) and '' ]]
+ Bank Payment Voucher [[ (voucher.type == 'bank_pay_voucher' or removeParentNode('para')) and '' ]]
+
+
+
+
+
+
+ No.
+
+
+ [[ voucher.number ]]
+
+
+
+
+
+
+
+ Dated :
+
+
+ [[ time.strftime('%d %B,%Y', time.strptime(voucher.date , '%Y-%m-%d')) or '' ]]
+
+
+
+
+ State :
+
+
+ PRO-FORMA [[ ((voucher.state == 'proforma') or removeParentNode('para')) and '' ]]
+ Draft[[ ((voucher.state == 'draft') or removeParentNode('para')) and '' ]]
+ Canceled [[ ((voucher.state == 'cancel') or removeParentNode('para')) and '' ]]
+ Posted [[ ((voucher.state == 'posted') or removeParentNode('para')) and '' ]]
+
+
+
+
+
+
+
+ Ref. :
+
+
+ [[ voucher.reference ]]
+
+
+
+
+ Account :
+
+
+ [[ voucher.account_id.name ]]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Particulars
+
+
+ Amount
+
+
+
+
+
+
+
+
+
+ [[ repeatIn(voucher.payment_ids,'payment_ids') ]]
+
+
+
+ [[ payment_ids.partner_id.name ]] :
+ [[ payment_ids.account_id.name ]]
+ [[ payment_ids.ref ]] [[ payment_ids.amount ]] [[ payment_ids.type ]]
+
+
+ [[ payment_ids.amount ]]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Through :
+
+
+
+
+
+
+
+
+
+ [[ voucher.narration or '' ]]
+
+
+
+
+
+
+
+
+
+ On Account of :
+
+
+
+
+
+
+
+
+
+ [[ voucher.name ]]
+
+
+
+
+
+
+
+
+
+ Amount (in words) :
+
+
+
+
+
+
+
+
+
+ [[ convert(voucher.amount,voucher.currency_id.name) ]]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[ voucher.amount ]]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Receiver's Signature
+
+
+
+
+
+
+
+
+
+
+
+
+ Authorised Signatory
+
+
+
+
+
+
+
+
diff --git a/addons/account_voucher/voucher.py b/addons/account_voucher/voucher.py
new file mode 100755
index 00000000000..d3b3343395c
--- /dev/null
+++ b/addons/account_voucher/voucher.py
@@ -0,0 +1,537 @@
+import time
+import netsvc
+from osv import fields, osv
+import ir
+import pooler
+import mx.DateTime
+from mx.DateTime import RelativeDateTime
+
+from tools import config
+
+
+class account_voucher(osv.osv):
+ def _get_period(self, cr, uid, context):
+ periods = self.pool.get('account.period').find(cr, uid)
+ if periods:
+ return periods[0]
+ else:
+ return False
+
+ def _get_type(self, cr, uid, context={}):
+ type = context.get('type', 'rec_voucher')
+ return type
+
+ def _get_reference_type(self, cursor, user, context=None):
+ return [('none', 'Free Reference')]
+
+
+
+ def _get_journal(self, cr, uid, context):
+ type_inv = context.get('type', 'rec_voucher')
+ type2journal = {'rec_voucher': 'cash', 'bank_rec_voucher': 'cash','pay_voucher': 'cash','bank_pay_voucher': 'cash', 'cont_voucher': 'cash','journal_sale_voucher': 'sale','journal_pur_voucher': 'purchase' }
+ journal_obj = self.pool.get('account.journal')
+ res = journal_obj.search(cr, uid, [('type', '=', type2journal.get(type_inv, 'cash'))], limit=1)
+ if res:
+ return res[0]
+ else:
+ return False
+
+ def _get_currency(self, cr, uid, context):
+ user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, [uid])[0]
+ if user.company_id:
+ return user.company_id.currency_id.id
+ else:
+ return pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('rate','=',1.0)])[0]
+
+ _name = 'account.voucher'
+ _description = 'Accounting Voucher'
+ _order = "number"
+ _columns = {
+ 'name':fields.char('Name', size=256, required=True, readonly=True, states={'draft':[('readonly',False)]}),
+ 'type': fields.selection([
+ ('pay_voucher','Cash Payment Voucher'),
+ ('bank_pay_voucher','Bank Payment Voucher'),
+ ('rec_voucher','Cash Receipt Voucher'),
+ ('bank_rec_voucher','Bank Receipt Voucher'),
+ ('cont_voucher','Contra Voucher'),
+ ('journal_sale_vou','Journal Sale Voucher'),
+ ('journal_pur_voucher','Journal Purchase Voucher'),
+ ],'Type', readonly=True, select=True),
+ 'date':fields.date('Date', readonly=True, states={'draft':[('readonly',False)]}),
+ 'journal_id':fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}),
+ 'account_id':fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}),
+ 'payment_ids':fields.one2many('account.voucher.line','voucher_id','Voucher Lines', readonly=False, states={'proforma':[('readonly',True)]}),
+ 'period_id': fields.many2one('account.period', 'Period', required=True, states={'posted':[('readonly',True)]}),
+ 'narration':fields.text('Narration', readonly=True, states={'draft':[('readonly',False)]}),
+ 'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}),
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ 'state':fields.selection(
+ [('draft','Draft'),
+ ('proforma','Pro-forma'),
+ ('posted','Posted'),
+ ('cancel','Cancel')
+ ], 'State',
+ readonly=True),
+ 'amount':fields.float('Amount', readonly=True),
+# , states={'draft':[('readonly',False)]}
+ 'number':fields.char('Number', size=32, readonly=True),
+ 'reference': fields.char('Voucher Reference', size=64),
+ 'reference_type': fields.selection(_get_reference_type, 'Reference Type',
+ required=True),
+ 'move_id':fields.many2one('account.move', 'Account Entry'),
+ 'move_ids':fields.many2many('account.move.line', 'voucher_id', 'account_id', 'rel_account_move', 'Real Entry'),
+ }
+
+# def get_bank(self, cr, uid, context={}):
+# type = context.get('type', 'bank_payment')
+# journal = self.pool.get('account.journal')
+# if type == 'bank_payment':
+# id = journal.search(cr, uid, [('name','ilike','Bank')])
+# return id
+# elif type == 'cash_payment':
+# id = journal.search(cr, uid, [('name','ilike','Cash')])
+# return id
+#
+# return 3
+
+ _defaults = {
+ #'journal_id':get_bank,
+ 'state': lambda *a: 'draft',
+ 'date' : lambda *a: time.strftime('%Y-%m-%d'),
+ 'period_id': _get_period,
+ 'type': _get_type,
+ 'reference_type': lambda *a: 'none',
+ 'journal_id':_get_journal,
+ 'company_id': lambda self, cr, uid, context: \
+ self.pool.get('res.users').browse(cr, uid, uid,
+ context=context).company_id.id,
+ 'currency_id': _get_currency,
+
+
+ }
+
+ def _get_analityc_lines(self, cr, uid, id):
+ inv = self.browse(cr, uid, [id])[0]
+ cur_obj = self.pool.get('res.currency')
+
+ def onchange_account(self, cr, uid, ids, account_id):
+ if not account_id:
+ return {'value':{'amount':False}}
+ account = self.pool.get('account.account').browse(cr,uid,account_id)
+ balance=account.balance
+ return {'value':{'amount':balance}}
+
+
+ def onchange_journal(self, cr, uid, ids, journal_id,type):
+ if not journal_id:
+ return {'value':{'account_id':False}}
+ journal = self.pool.get('account.journal')
+ if journal_id and (type in ('rec_voucher','bank_rec_voucher','journal_pur_voucher')):
+ account_id = journal.browse(cr, uid, journal_id).default_debit_account_id
+ return {'value':{'account_id':account_id.id}}
+ elif journal_id and (type in ('pay_voucher','bank_pay_voucher','journal_sale_vou')) :
+ account_id = journal.browse(cr, uid, journal_id).default_credit_account_id
+ return {'value':{'account_id':account_id.id}}
+ else:
+ account_id = journal.browse(cr, uid, journal_id).default_credit_account_id
+ return {'value':{'account_id':account_id.id}}
+
+
+
+
+ def open_voucher(self, cr, uid, ids, context={}):
+ obj=self.pool.get('account.voucher').browse(cr,uid,ids)
+ total=0
+ for i in obj[0].payment_ids:
+ total+=i.amount
+ self.write(cr,uid,ids,{'amount':total})
+ self.write(cr, uid, ids, {'state':'proforma'})
+ return True
+ def proforma_voucher(self, cr, uid, ids, context={}):
+ self.action_move_line_create(cr, uid, ids)
+ self.action_number(cr, uid, ids)
+ self.write(cr, uid, ids, {'state':'posted'})
+ return True
+ def cancel_voucher(self,cr,uid,ids,context={}):
+ self.action_cancel(cr, uid, ids)
+ self.write(cr, uid, ids, {'state':'cancel'})
+ return True
+
+ def action_cancel_draft(self, cr, uid, ids, *args):
+ self.write(cr, uid, ids, {'state':'draft'})
+ return True
+
+
+ def unlink(self, cr, uid, ids):
+ vouchers = self.read(cr, uid, ids, ['state'])
+ unlink_ids = []
+ for t in vouchers:
+ if t['state'] in ('draft', 'cancel'):
+ unlink_ids.append(t['id'])
+ else:
+ raise osv.except_osv('Invalid action !', 'Cannot delete invoice(s) which are already opened or paid !')
+ osv.osv.unlink(self, cr, uid, unlink_ids)
+ return True
+
+
+ def _get_analityc_lines(self, cr, uid, id):
+ inv = self.browse(cr, uid, [id])[0]
+ cur_obj = self.pool.get('res.currency')
+
+ company_currency = inv.company_id.currency_id.id
+ if inv.type in ('rec_voucher'):
+ sign = 1
+ else:
+ sign = -1
+
+ iml = self.pool.get('account.voucher.line').move_line_get(cr, uid, inv.id)
+
+ for il in iml:
+ if il['account_analytic_id']:
+ if inv.type in ('pay_voucher', 'rec_voucher','cont_voucher','bank_pay_voucher','bank_rec_voucher','journal_sale_vou','journal_pur_voucher'):
+ ref = inv.reference
+ else:
+ ref = self._convert_ref(cr, uid, inv.number)
+ il['analytic_lines'] = [(0,0, {
+ 'name': il['name'],
+ 'date': inv['date'],
+ 'account_id': il['account_analytic_id'],
+ 'amount': inv['amount'] * sign,
+ 'partner_id': il['partner_id'] or False,
+ 'general_account_id': il['account_id'] or False,
+ 'journal_id': self._get_journal(cr, uid, inv.type),
+ 'ref': ref,
+ })]
+
+ return iml
+
+ def action_move_line_create(self, cr, uid, ids, *args):
+ for inv in self.browse(cr, uid, ids):
+ if inv.move_id:
+ continue
+ company_currency = inv.company_id.currency_id.id
+ # create the analytical lines
+ line_ids = self.read(cr, uid, [inv.id], ['payment_ids'])[0]['payment_ids']
+ ils = self.pool.get('account.voucher.line').read(cr, uid, line_ids)
+ # one move line per invoice line
+ iml = self._get_analityc_lines(cr, uid, inv.id)
+ # check if taxes are all computed
+ diff_currency_p = inv.currency_id.id <> company_currency
+ # create one move line for the total and possibly adjust the other lines amount
+ total = 0
+ if inv.type in ('pay_voucher', 'rec_voucher','cont_voucher','bank_pay_voucher','bank_rec_voucher','journal_sale_vou','journal_pur_voucher'):
+ ref = inv.reference
+ else:
+ ref = self._convert_ref(cr, uid, inv.number)
+ date = inv.date
+ total_currency = 0
+ for i in iml:
+ if inv.currency_id.id != company_currency:
+ i['currency_id'] = inv.currency_id.id
+ i['amount_currency'] = i['amount']
+
+ else:
+ i['amount_currency'] = False
+ i['currency_id'] = False
+ i['ref'] = ref
+ if inv.type in ('rec_voucher','bank_rec_voucher','journal_pur_voucher'):
+ total += i['amount']
+ total_currency += i['amount_currency'] or i['amount']
+ i['amount'] = - i['amount']
+ else:
+ total -= i['amount']
+ total_currency -= i['amount_currency'] or i['amount']
+ acc_id = inv.account_id.id
+
+ name = inv['name'] or '/'
+ totlines = False
+
+ iml.append({
+ 'type': 'dest',
+ 'name': name,
+ 'amount': total,
+ 'account_id': acc_id,
+ 'amount_currency': diff_currency_p \
+ and total_currency or False,
+ 'currency_id': diff_currency_p \
+ and inv.currency_id.id or False,
+ 'ref': ref
+ })
+
+ date = inv.date
+ inv.amount=total
+
+
+ line = map(lambda x:(0,0,self.line_get_convert(cr, uid, x,date, context={})) ,iml)
+
+ journal_id = inv.journal_id.id #self._get_journal(cr, uid, {'type': inv['type']})
+ journal = self.pool.get('account.journal').browse(cr, uid, journal_id)
+ if journal.sequence_id:
+ name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id)
+
+ move = {'name': name, 'line_id': line, 'journal_id': journal_id}
+ if inv.period_id:
+ move['period_id'] = inv.period_id.id
+ for i in line:
+ i[2]['period_id'] = inv.period_id.id
+ move_id = self.pool.get('account.move').create(cr, uid, move)
+ # make the invoice point to that move
+ self.write(cr, uid, [inv.id], {'move_id': move_id})
+ obj=self.pool.get('account.move').browse(cr,uid,move_id)
+ for line in obj.line_id :
+ cr.execute('insert into voucher_id (account_id,rel_account_move) values (%d, %d)',(int(ids[0]),int(line.id)))
+# self.pool.get('account.move').post(cr, uid, [move_id])
+# self._log_event(cr, uid, ids)
+ return True
+
+
+
+ def line_get_convert(self, cr, uid, x, date, context={}):
+ return {
+ 'date':date,
+ 'date_maturity': x.get('date_maturity', False),
+ 'partner_id':x.get('partner_id',False),
+ 'name':x['name'][:64],
+ 'debit':x['amount']>0 and x['amount'],
+ 'credit':x['amount']<0 and -x['amount'],
+ 'account_id':x['account_id'],
+ 'analytic_lines':x.get('analytic_lines', []),
+ 'amount_currency':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)
+ }
+ def _convert_ref(self, cr, uid, ref):
+ return (ref or '').replace('/','')
+
+
+ def action_number(self, cr, uid, ids, *args):
+ cr.execute('SELECT id, type, number, move_id, reference ' \
+ 'FROM account_voucher ' \
+ 'WHERE id IN ('+','.join(map(str,ids))+')')
+ for (id, invtype, number, move_id, reference) in cr.fetchall():
+ if not number:
+ number = self.pool.get('ir.sequence').get(cr, uid,
+ 'account.voucher.' + invtype)
+
+ if type in ('pay_voucher', 'rec_voucher','cont_voucher','bank_pay_voucher','bank_rec_voucher','journal_sale_vou','journal_pur_voucher'):
+ ref = reference
+ else:
+ ref = self._convert_ref(cr, uid, number)
+ cr.execute('UPDATE account_voucher SET number=%s ' \
+ 'WHERE id=%d', (number, id))
+ cr.execute('UPDATE account_move_line SET ref=%s ' \
+ 'WHERE move_id=%d AND (ref is null OR ref = \'\')',
+ (ref, move_id))
+ cr.execute('UPDATE account_analytic_line SET ref=%s ' \
+ 'FROM account_move_line ' \
+ 'WHERE account_move_line.move_id = %d ' \
+ 'AND account_analytic_line.move_id = account_move_line.id',
+ (ref, move_id))
+ return True
+
+
+
+ def name_get(self, cr, uid, ids, context={}):
+ if not len(ids):
+ return []
+ types = {
+ 'pay_voucher': 'CPV: ',
+ 'rec_voucher': 'CRV: ',
+ 'cont_voucher': 'CV: ',
+ 'bank_pay_voucher': 'BPV: ',
+ 'bank_rec_voucher': 'BRV: ',
+ 'journal_sale_vou': 'JSV: ',
+ 'journal_pur_voucher': 'JPV: ',
+
+ }
+ return [(r['id'], types[r['type']]+(r['number'] or '')+' '+(r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')]
+
+ def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
+ if not args:
+ args=[]
+ if not context:
+ context={}
+ ids = []
+ if name:
+ ids = self.search(cr, user, [('number','=',name)]+ args, limit=limit, context=context)
+ if not ids:
+ ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit, context=context)
+ return self.name_get(cr, user, ids, context)
+
+ def copy(self, cr, uid, id, default=None, context=None):
+ if default is None:
+ default = {}
+ default = default.copy()
+ default.update({'state':'draft', 'number':False, 'move_id':False, 'move_ids':False})
+ if 'date' not in default:
+ default['date'] = time.strftime('%Y-%m-%d')
+ return super(account_voucher, self).copy(cr, uid, id, default, context)
+
+ def action_cancel(self, cr, uid, ids, *args):
+ account_move_obj = self.pool.get('account.move')
+ voucher = self.read(cr, uid, ids, ['move_id'])
+ for i in voucher:
+ if i['move_id']:
+ account_move_obj.button_cancel(cr, uid, [i['move_id'][0]])
+ # delete the move this invoice was pointing to
+ # Note that the corresponding move_lines and move_reconciles
+ # will be automatically deleted too
+ account_move_obj.unlink(cr, uid, [i['move_id'][0]])
+ self.write(cr, uid, ids, {'state':'cancel', 'move_id':False})
+# self._log_event(cr, uid, ids,-1.0, 'Cancel Invoice')
+ return True
+
+account_voucher()
+
+class VoucherLine(osv.osv):
+ _name = 'account.voucher.line'
+ _description = 'Voucher Line'
+ _columns = {
+ 'voucher_id':fields.many2one('account.voucher', 'Voucher'),
+ 'name':fields.char('Description', size=256, required=True),
+ 'account_id':fields.many2one('account.account','Account', required=True),
+ 'partner_id': fields.many2one('res.partner', 'Partner', change_default=True, required=True, ),
+ 'amount':fields.float('Amount'),
+ 'type':fields.selection([('dr','Debit'),('cr','Credit')], 'Type'),
+ 'ref':fields.char('Ref.', size=32),
+ 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account')
+ }
+ _defaults = {
+ 'type': lambda *a: 'cr'
+ }
+ def move_line_get(self, cr, uid, voucher_id, context={}):
+ res = []
+
+ cur_obj = self.pool.get('res.currency')
+ inv = self.pool.get('account.voucher').browse(cr, uid, voucher_id)
+ company_currency = inv.company_id.currency_id.id
+ cur = inv.currency_id
+
+ for line in inv.payment_ids:
+ res.append(self.move_line_get_item(cr, uid, line, context))
+ return res
+
+ def onchange_partner(self, cr, uid, ids, partner_id, type,type1):
+ if not partner_id:
+ return {'value' : {'account_id' : False, 'type' : False ,'amount':False}}
+ obj = self.pool.get('res.partner')
+ account_id = False
+
+ if type1 in ('rec_voucher','bank_rec_voucher'):
+ account_id = obj.browse(cr, uid, partner_id).property_account_receivable
+ balance=obj.browse(cr,uid,partner_id).credit
+ type = 'cr'
+ elif type1 in ('pay_voucher','bank_pay_voucher','cont_voucher') :
+ account_id = obj.browse(cr, uid, partner_id).property_account_payable
+ balance=obj.browse(cr,uid,partner_id).debit
+ type = 'dr'
+ elif type1 in ('journal_sale_vou') :
+ account_id = obj.browse(cr, uid, partner_id).property_account_receivable
+ balance=obj.browse(cr,uid,partner_id).credit
+ type = 'dr'
+
+ elif type1 in ('journal_pur_vou') :
+ account_id = obj.browse(cr, uid, partner_id).property_account_payable
+ balance=obj.browse(cr,uid,partner_id).debit
+ type = 'cr'
+
+ return {
+ 'value' : {'account_id' : account_id.id, 'type' : type, 'amount':balance}
+ }
+
+ def onchange_amount(self, cr, uid, ids,partner_id,amount, type,type1):
+ if not amount:
+ return {'value' : {'type' : False}}
+ obj = self.pool.get('res.partner')
+ if type1 in ('rec_voucher','bank_rec_voucher'):
+ if amount < 0 :
+ account_id = obj.browse(cr, uid, partner_id).property_account_payable
+ type = 'dr'
+ else:
+ account_id = obj.browse(cr, uid, partner_id).property_account_receivable
+ type = 'cr'
+
+ elif type1 in ('pay_voucher','bank_pay_voucher','cont_voucher') :
+ if amount < 0 :
+ account_id = obj.browse(cr, uid, partner_id).property_account_receivable
+ type = 'cr'
+ else:
+ account_id = obj.browse(cr, uid, partner_id).property_account_payable
+ type = 'dr'
+
+ elif type1 in ('journal_sale_vou') :
+ if amount < 0 :
+ account_id = obj.browse(cr, uid, partner_id).property_account_payable
+ type = 'cr'
+ else:
+ account_id = obj.browse(cr, uid, partner_id).property_account_receivable
+ type = 'dr'
+
+ elif type1 in ('journal_pur_vou') :
+ if amount< 0 :
+ account_id = obj.browse(cr, uid, partner_id).property_account_receivable
+ type = 'dr'
+ else:
+ account_id = obj.browse(cr, uid, partner_id).property_account_payable
+ type = 'cr'
+
+ return {
+ 'value' : { 'type' : type , 'amount':amount}
+ }
+
+
+ def onchange_type(self, cr, uid, ids,partner_id,amount,type,type1):
+ if not partner_id:
+ return {'value' : {'type' : False}}
+ obj = self.pool.get('res.partner')
+
+ if type1 in ('rec_voucher','bank_rec_voucher'):
+ if type == 'dr' :
+ account_id = obj.browse(cr, uid, partner_id).property_account_payable
+ total=amount*(-1)
+ else:
+ account_id = obj.browse(cr, uid, partner_id).property_account_receivable
+ total=amount*1
+
+ elif type1 in ('pay_voucher','bank_pay_voucher','cont_voucher') :
+ if type == 'cr' :
+ account_id = obj.browse(cr, uid, partner_id).property_account_receivable
+ amount*=-1
+ else:
+ account_id = obj.browse(cr, uid, partner_id).property_account_payable
+ amount*=1
+
+ elif type1 in ('journal_sale_vou') :
+ if type == 'cr' :
+ account_id = obj.browse(cr, uid, partner_id).property_account_payable
+ amount*=-1
+ else:
+ account_id = obj.browse(cr, uid, partner_id).property_account_receivable
+ amount*=1
+
+ elif type1 in ('journal_pur_vou') :
+ if type == 'dr' :
+ account_id = obj.browse(cr, uid, partner_id).property_account_receivable
+ amount*=-1
+ else:
+ account_id = obj.browse(cr, uid, partner_id).property_account_payable
+ amount*=1
+
+ return {
+ 'value' : {'type' : type , 'amount':total}
+ }
+
+
+ def move_line_get_item(self, cr, uid, line, context={}):
+ return {
+ 'type':'src',
+ 'name': line.name[:64],
+ 'amount':line.amount,
+ 'account_id':line.account_id.id,
+ 'partner_id':line.partner_id.id or False ,
+ 'account_analytic_id':line.account_analytic_id.id or False,
+ }
+VoucherLine()
+
diff --git a/addons/account_voucher/voucher_account.py b/addons/account_voucher/voucher_account.py
new file mode 100644
index 00000000000..928a546145d
--- /dev/null
+++ b/addons/account_voucher/voucher_account.py
@@ -0,0 +1,125 @@
+import time
+import netsvc
+from osv import fields, osv
+import ir
+import pooler
+import mx.DateTime
+from mx.DateTime import RelativeDateTime
+
+from tools import config
+
+class Account(osv.osv):
+ _inherit = "account.account"
+
+ def __compute(self, cr, uid, ids, field_names, arg, context={}, query=''):
+ #compute the balance/debit/credit accordingly to the value of field_name for the given account ids
+ mapping = {
+ 'balance': "COALESCE(SUM(l.debit) - SUM(l.credit) , 0) as balance ",
+ 'debit': "COALESCE(SUM(l.debit), 0) as debit ",
+ 'credit': "COALESCE(SUM(l.credit), 0) as credit "
+ }
+ #get all the necessary accounts
+ ids2 = self._get_children_and_consol(cr, uid, ids, context)
+ acc_set = ",".join(map(str, ids2))
+ #compute for each account the balance/debit/credit from the move lines
+ accounts = {}
+ if ids2:
+ query = self.pool.get('account.move.line')._query_get(cr, uid,
+ context=context)
+ cr.execute(("SELECT l.account_id as id, " +\
+ ' , '.join(map(lambda x: mapping[x], field_names)) +
+ "FROM " \
+ "account_move_line l " \
+ "WHERE " \
+ "l.account_id IN (%s) " \
+ "AND " + query + " " \
+ "GROUP BY l.account_id") % (acc_set, ))
+
+ for res in cr.dictfetchall():
+ accounts[res['id']] = res
+
+ #for the asked accounts, get from the dictionnary 'accounts' the value of it
+ res = {}
+ for id in ids:
+ res[id] = self._get_account_values(cr, uid, id, accounts, field_names, context)
+ for id in ids:
+ open=self.browse(cr, uid, id, context)
+ type_id=open.user_type
+ obj=self.pool.get('account.account.type').browse(cr,uid,type_id.id)
+ open_balance=open.open_bal
+ if obj.code in ('cash','asset','expense'):
+ res[id]['balance']+=open_balance
+ elif obj.code in ('equity','income','liability'):
+ total=open_balance*(-1)
+ res[id]['balance']+=total
+ else:
+ res[id]=res[id]
+ return res
+
+ def _get_account_values(self, cr, uid, id, accounts, field_names, context={}):
+ res = {}.fromkeys(field_names, 0.0)
+ browse_rec = self.browse(cr, uid, id)
+ if browse_rec.type == 'consolidation':
+ ids2 = self.read(cr, uid, [browse_rec.id], ['child_consol_ids'], context)[0]['child_consol_ids']
+ for t in self.search(cr, uid, [('parent_id', 'child_of', [browse_rec.id])]):
+ if t not in ids2 and t != browse_rec.id:
+ ids2.append(t)
+ for i in ids2:
+ tmp = self._get_account_values(cr, uid, i, accounts, field_names, context)
+ for a in field_names:
+ res[a] += tmp[a]
+ else:
+ ids2 = self.search(cr, uid, [('parent_id', 'child_of', [browse_rec.id])])
+ for i in ids2:
+ for a in field_names:
+ res[a] += accounts.get(i, {}).get(a, 0.0)
+ return res
+
+ def _diff(self, cr, uid, ids, field_name, arg, context={}):
+
+ res={}
+ dr_total=0.0
+ cr_total=0.0
+ difference=0.0
+ for id in ids:
+ open=self.browse(cr, uid, id, context)
+ if open.type1 == 'dr':
+ dr_total+=open.open_bal
+ elif open.type1 == 'cr':
+ cr_total+=open.open_bal
+ else:
+ difference=0.0
+ difference=dr_total-cr_total
+ for id in ids:
+ res[id]=difference
+ return res
+
+ _columns = {
+ 'open_bal' : fields.float('Opening Balance',digits=(16,2)),
+ 'diff' : fields.function(_diff, digits=(16,2),method=True,string='Difference of Opening Bal.'),
+ 'type1':fields.selection([('dr','Debit'),('cr','Credit'),('none','None')], 'Dr/Cr',store=True),
+ 'balance': fields.function(__compute, digits=(16,2), method=True, string='Closing Balance', multi='balance'),
+ 'credit': fields.function(__compute, digits=(16,2), method=True, string='Credit', multi='balance'),
+ 'debit': fields.function(__compute, digits=(16,2), method=True, string='Debit', multi='balance'),
+
+
+ }
+
+
+ def onchange_type(self, cr, uid, ids,user_type,type1):
+ obj=self.pool.get('account.account.type').browse(cr,uid,user_type)
+ account_type=obj.code
+ if not account_type:
+ return {'value' : {}}
+ if account_type in ('cash','asset','expense'):
+ type1 = 'dr'
+ elif account_type in ('equity','income','liability') :
+ type1 = 'cr'
+ else:
+ type1 = 'none'
+
+ return {
+ 'value' : {'type1' : type1}
+ }
+
+Account()
diff --git a/addons/account_voucher/voucher_view.xml b/addons/account_voucher/voucher_view.xml
new file mode 100755
index 00000000000..5b625f1c267
--- /dev/null
+++ b/addons/account_voucher/voucher_view.xml
@@ -0,0 +1,295 @@
+
+
+
+
+ account.voucher.tree
+ account.voucher
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+ account.voucher.form
+ account.voucher
+ form
+
+
+
+
+
+
+ Vouchers
+ account.voucher
+ form
+ tree,form
+
+
+
+
+
+
+ Receipt Vouchers
+ account.voucher
+ form
+ tree,form
+
+ [('type','like','rec_voucher')]
+ {'type':'rec_voucher'}
+
+
+
+
+ Cash Receipt
+ account.voucher
+ form
+ tree,form
+
+ [('type','=','rec_voucher')]
+ {'type':'rec_voucher'}
+
+
+
+
+ Cash Receipt Voucher
+ account.voucher
+ form
+ tree,form
+
+ [('type','=','rec_voucher'),('state','=','draft')]
+ {'type':'rec_voucher'}
+
+
+
+
+ Cash Receipt Voucher
+ account.voucher
+ form
+ tree,form
+
+ [('type','=','rec_voucher'),('state','=','proforma')]
+ {'type':'rec_voucher'}
+
+
+
+
+ Cash Receipt Voucher
+ account.voucher
+ form
+ tree,form
+
+ [('type','=','rec_voucher'),('state','=','posted')]
+ {'type':'rec_voucher'}
+
+
+
+
+ Cash Receipt Voucher
+ account.voucher
+ form
+ tree,form
+
+ [('type','=','rec_voucher'),('state','=','cancel')]
+ {'type':'rec_voucher'}
+
+
+
+
+
+ Cash Receipt Voucher
+ account.voucher
+ form
+ form,tree
+
+ [('type','=','rec_voucher')]
+ {'type':'rec_voucher'}
+
+
+
+
+ Bank Receipt
+ account.voucher
+ form
+ tree,form
+
+ [('type','=','bank_rec_voucher')]
+ {'type':'rec_voucher'}
+
+
+
+
+ Bank Receipt Voucher
+ account.voucher
+ form
+ form,tree
+
+ [('type','=','bank_rec_voucher')]
+ {'type':'bank_rec_voucher'}
+
+
+
+
+
+
+
+
+
+ Payment Vouchers
+ account.voucher
+ form
+ tree,form
+
+ [('type','like','pay_voucher')]
+ {'type':'rec_voucher'}
+
+
+
+
+ Payment Vouchers
+ account.voucher
+ form
+ tree,form
+
+ [('type','=','pay_voucher')]
+ {'type':'rec_voucher'}
+
+
+
+
+ Cash Payment Voucher
+ account.voucher
+ form
+ form,tree
+
+ [('type','=','pay_voucher')]
+ {'type':'pay_voucher'}
+
+
+
+
+ Payment Vouchers
+ account.voucher
+ form
+ tree,form
+
+ [('type','=','bank_pay_voucher')]
+ {'type':'rec_voucher'}
+
+
+
+
+ Bank Payment Voucher
+ account.voucher
+ form
+ form,tree
+
+ [('type','=','bank_pay_voucher')]
+ {'type':'bank_pay_voucher'}
+
+
+
+
+
+
+
+ Other Vouchers
+ account.voucher
+ form
+ tree,form
+
+
+
+
+
+ Contra Voucher
+ account.voucher
+ form
+ form,tree
+
+ [('type','=','cont_voucher')]
+ {'type':'cont_voucher'}
+
+
+
+ Journal Sale Voucher
+ account.voucher
+ form
+ form,tree
+
+ [('type','=','journal_sale_voucher')]
+ {'type':'journal_sale_voucher'}
+
+
+
+ Journal Purchase Voucher
+ account.voucher
+ form
+ form,tree
+
+ [('type','=','journal_pur_voucher')]
+ {'type':'journal_pur_voucher'}
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/account_voucher/wizard/__init__.py b/addons/account_voucher/wizard/__init__.py
new file mode 100644
index 00000000000..e347d6dc636
--- /dev/null
+++ b/addons/account_voucher/wizard/__init__.py
@@ -0,0 +1 @@
+import open_voucher
\ No newline at end of file
diff --git a/addons/account_voucher/wizard/open_voucher.py b/addons/account_voucher/wizard/open_voucher.py
new file mode 100644
index 00000000000..e0c592fe2e7
--- /dev/null
+++ b/addons/account_voucher/wizard/open_voucher.py
@@ -0,0 +1,113 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+#
+# $Id$
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+import wizard
+from tools.translate import _
+import pooler
+
+_voucher_form = '''
+'''
+
+_types = {
+ 'pay_voucher':'Cash Payment Voucher',
+ 'bank_pay_voucher':'Bank Payment Voucher',
+ 'rec_voucher':'Cash Receipt Voucher',
+ 'bank_rec_voucher':'Bank Receipt Voucher',
+ 'cont_voucher':'Contra Voucher',
+ 'journal_sale_voucher':'Journal Sale Voucher',
+ 'journal_pur_voucher':'Journal Purchase Voucher'
+}
+_states = {
+ 'draft':'Draft',
+ 'proforma':'Pro-forma',
+ 'posted':'Posted',
+ 'cancel':'Cancel'
+}
+
+_voucher_fields = {
+ 'type': {'string':'Voucher Type', 'type':'selection', 'selection':[
+ ('pay_voucher','Cash Payment Voucher'),
+ ('bank_pay_voucher','Bank Payment Voucher'),
+ ('rec_voucher','Cash Receipt Voucher'),
+ ('bank_rec_voucher','Bank Receipt Voucher'),
+ ('cont_voucher','Contra Voucher'),
+ ('journal_sale_voucher','Journal Sale Voucher'),
+ ('journal_pur_voucher','Journal Purchase Voucher')], 'required':True},
+ 'state': {'string':'State', 'type':'selection', 'selection':[
+ ('draft','Draft'),
+ ('proforma','Pro-forma'),
+ ('posted','Posted'),
+ ('cancel','Cancel')], 'required':True},
+ 'period_ids': {'string':'Periods', 'type':'many2many', 'relation':'account.period'},
+}
+
+def _action_open_window(self, cr, uid, data, context):
+ form = data['form']
+ periods = []
+
+ if not form['period_ids'][0][2]:
+ pool = pooler.get_pool(cr.dbname)
+ period = pool.get('account.period')
+ year = pool.get('account.fiscalyear')
+
+ year = year.find(cr, uid)
+ periods = period.search(cr, uid, [('fiscalyear_id','=',year)])
+ else:
+ periods = form['period_ids'][0][2]
+
+ return {
+ 'domain': "[('type','=','%s'), ('state','=','%s'), ('period_id','in',%s)]" % (form['type'], form['state'], periods),
+ 'name': "%s - %s" % (_types[form['type']], _states[form['state']]),
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'account.voucher',
+ 'view_id': False,
+ 'context': "{'type':'%s', 'state':'%s', 'period_id':%s}" % (form['type'], form['state'], periods),
+ 'type': 'ir.actions.act_window'
+ }
+
+class OpenVoucherEntries(wizard.interface):
+ states = {
+ 'init': {
+ 'actions': [],
+ 'result': {'type': 'form', 'arch':_voucher_form, 'fields':_voucher_fields, 'state':[('end','Cancel'),('open','Open Voucher Entries')]}
+ },
+ 'open': {
+ 'actions': [],
+ 'result': {'type': 'action', 'action': _action_open_window, 'state':'end'}
+ }
+ }
+OpenVoucherEntries('account.voucher.open')
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/analytic_journal_billing_rate/__terp__.py b/addons/analytic_journal_billing_rate/__terp__.py
index 5ee1e35b8a8..b7293fd4c77 100644
--- a/addons/analytic_journal_billing_rate/__terp__.py
+++ b/addons/analytic_journal_billing_rate/__terp__.py
@@ -17,6 +17,7 @@
"demo_xml" : [],
"update_xml" : [
"analytic_journal_billing_rate_view.xml",
+ "security/ir.model.access.csv",
],
"active": False,
"installable": True
diff --git a/addons/analytic_journal_billing_rate/security/ir.model.access.csv b/addons/analytic_journal_billing_rate/security/ir.model.access.csv
new file mode 100644
index 00000000000..cf13af205ba
--- /dev/null
+++ b/addons/analytic_journal_billing_rate/security/ir.model.access.csv
@@ -0,0 +1,4 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_analytic_journal_rate_user","analytic journal rate user","model_analytic_journal_rate_grid","project.group_project_user",1,0,0,0
+"access_analytic_journal_rate_manager","analytic journal rate manager","model_analytic_journal_rate_grid","project.group_project_manager",1,1,1,1
+"access_analytic_journal_rate_account_manager","analytic journal rateaccount manager","model_analytic_journal_rate_grid","account.group_account_manager",1,1,1,1
diff --git a/addons/analytic_user_function/__terp__.py b/addons/analytic_user_function/__terp__.py
index 6208cd43226..1a71adee8d6 100644
--- a/addons/analytic_user_function/__terp__.py
+++ b/addons/analytic_user_function/__terp__.py
@@ -17,6 +17,7 @@
"demo_xml" : [],
"update_xml" : [
"analytic_user_function_view.xml",
+ "security/ir.model.access.csv",
],
"active": False,
"installable": True
diff --git a/addons/analytic_user_function/security/ir.model.access.csv b/addons/analytic_user_function/security/ir.model.access.csv
new file mode 100644
index 00000000000..b2fb45404e8
--- /dev/null
+++ b/addons/analytic_user_function/security/ir.model.access.csv
@@ -0,0 +1,4 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_analytic_user_funct_user","analytic user funct user","model_analytic_user_funct_grid","project.group_project_user",1,0,0,0
+"access_analytic_user_funct_manager","analytic user funct manager","model_analytic_user_funct_grid","project.group_project_manager",1,1,1,1
+"access_analytic_user_funct_account_manager","analytic user funct account manager","model_analytic_user_funct_grid","account.group_account_manager",1,1,1,1
diff --git a/addons/association_vertical/aso_vertical_view.xml b/addons/association_vertical/aso_vertical_view.xml
index cb810f113d1..219cea03776 100644
--- a/addons/association_vertical/aso_vertical_view.xml
+++ b/addons/association_vertical/aso_vertical_view.xml
@@ -6,15 +6,15 @@
-
-
-
- Functions
- ir.actions.act_window
- res.partner.job
- form
-
-
-
-
+
+
+ Functions
+ ir.actions.act_window
+ res.partner.job
+ form
+
+
+
+
diff --git a/addons/base_contact/security/ir.model.access.csv b/addons/base_contact/security/ir.model.access.csv
index f6605186bed..fdf7e700c3c 100644
--- a/addons/base_contact/security/ir.model.access.csv
+++ b/addons/base_contact/security/ir.model.access.csv
@@ -1,3 +1,5 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_res_partner_contact,res.partner.contact,model_res_partner_contact,base.group_user,1,1,1,1
-access_res_partner_job,res.partner.job,model_res_partner_job,base.group_user,1,1,1,1
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_res_partner_contact","res.partner.contact","model_res_partner_contact","base.group_partner_manager",1,1,1,1
+"access_res_partner_job","res.partner.job","model_res_partner_job","base.group_partner_manager",1,1,1,1
+"access_res_partner_contact_all","res.partner.contact all","model_res_partner_contact",,1,0,0,0
+"access_res_partner_job_all","res.partner.job all","model_res_partner_job",,1,0,0,0
diff --git a/addons/base_module_record/base_module_record.py b/addons/base_module_record/base_module_record.py
index 32e6a827e24..6e5160e5d98 100644
--- a/addons/base_module_record/base_module_record.py
+++ b/addons/base_module_record/base_module_record.py
@@ -51,7 +51,10 @@ class base_module_record(osv.osv):
def _create_id(self, cr, uid, model, data):
i = 0
while True:
- name = filter(lambda x: x in string.letters, (data.get('name','') or '').lower())
+ try:
+ name = filter(lambda x: x in string.letters, (data.get('name','') or '').lower())
+ except:
+ name=''
val = model.replace('.','_')+'_'+name+ str(i)
i+=1
if val not in self.ids.values():
@@ -79,11 +82,7 @@ class base_module_record(osv.osv):
self.depends[res[0]['module']]=True
record_list = [record]
fields = self.pool.get(model).fields_get(cr, uid)
-# print "before>>>>",fields
-# fields = self.pool.get(model).fields_view_get(cr, uid, context={})['fields']
-# print "after>>>>",fields
for key,val in data.items():
- print key,val
if not (val or (fields[key]['type']=='boolean')):
continue
if fields[key]['type'] in ('integer','float'):
@@ -107,7 +106,8 @@ class base_module_record(osv.osv):
if not id:
field.setAttribute("model", fields[key]['relation'])
name = self.pool.get(fields[key]['relation']).browse(cr, uid, val).name
- print name
+ if isinstance(name, basestring):
+ name = name.decode('utf8')
field.setAttribute("search", "[('name','=','"+name+"')]")
else:
field.setAttribute("ref", id)
@@ -115,7 +115,10 @@ class base_module_record(osv.osv):
elif fields[key]['type'] in ('one2many',):
for valitem in (val or []):
if valitem[0]==0:
- fname = self.pool.get(model)._columns[key]._fields_id
+ if key in self.pool.get(model)._columns:
+ fname = self.pool.get(model)._columns[key]._fields_id
+ else:
+ fname = self.pool.get(model)._inherit_fields[key][2]._fields_id
valitem[2][fname] = record_id
newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2])
childrecord, update = self._create_record(cr, uid, doc, fields[key]['relation'],valitem[2], newid)
@@ -153,7 +156,6 @@ class base_module_record(osv.osv):
return record_list, noupdate
def _generate_object_xml(self, cr, uid, rec, recv, doc, result=None):
- print "_generate_object_xml>>>",rec,recv,doc
record_list = []
noupdate = False
if rec[4]=='write':
diff --git a/addons/base_setup/wizard/wizard_base_setup.py b/addons/base_setup/wizard/wizard_base_setup.py
index f8de1e6bfa8..d469ef9d072 100644
--- a/addons/base_setup/wizard/wizard_base_setup.py
+++ b/addons/base_setup/wizard/wizard_base_setup.py
@@ -52,6 +52,8 @@ view_form_profit = """
view_form_company = """
"""
view_form_update = """
@@ -110,8 +118,6 @@ class wizard_base_setup(wizard.interface):
res.sort()
return res
-
-
def _get_company(self, cr, uid, data, context):
pool=pooler.get_pool(cr.dbname)
company_obj=pool.get('res.company')
@@ -121,28 +127,10 @@ class wizard_base_setup(wizard.interface):
company=company_obj.browse(cr, uid, ids)[0]
self.fields['name']['default']=company.name
self.fields['currency']['default']=company.currency_id.id
+ serv_pro_id = pooler.get_pool(cr.dbname).get('ir.module.module').search(cr, uid, [('name','=','profile_service')]) or False
+ if serv_pro_id:
+ return {'profile':serv_pro_id[0]}
return {}
- #self.fields['rml_header1']['default']=company.rml_header1
- #self.fields['rml_footer1']['default']=company.rml_footer1
- #self.fields['rml_footer2']['default']=company.rml_footer2
- #if not company.partner_id.address:
- # return {}
- #address=company.partner_id.address[0]
- #self.fields['street']['default']=address.street
- #self.fields['street2']['default']=address.street2
- #self.fields['zip']['default']=address.zip
- #self.fields['city']['default']=address.city
- #self.fields['email']['default']=address.email
- #self.fields['phone']['default']=address.phone
- #if address.state_id:
- # self.fields['state_id']['default']=address.state_id.id
- #else:
- # self.fields['state_id']['default']=-1
- #if address.country_id:
- # self.fields['country_id']['default']=address.country_id.id
- #else:
- # self.fields['country_id']['default']=-1
- #return {}
def _get_states(self, cr, uid, context):
pool=pooler.get_pool(cr.dbname)
@@ -161,6 +149,14 @@ class wizard_base_setup(wizard.interface):
res.sort(lambda x,y: cmp(x[1],y[1]))
return res
+ def _get_currency(self, cr, uid, context):
+ pool=pooler.get_pool(cr.dbname)
+ currency_obj=pool.get('res.currency')
+ ids=currency_obj.search(cr, uid, [])
+ res=[(currency.id, currency.name) for currency in currency_obj.browse(cr, uid, ids)]
+ res.sort(lambda x,y: cmp(x[1],y[1]))
+ return res
+
def _update(self, cr, uid, data, context):
pool=pooler.get_pool(cr.dbname)
form=data['form']
@@ -168,7 +164,6 @@ class wizard_base_setup(wizard.interface):
module_obj=pool.get('ir.module.module')
module_obj.state_update(cr, uid, [data['form']['profile']], 'to install', ['uninstalled'], context)
-
company_obj=pool.get('res.company')
partner_obj=pool.get('res.partner')
address_obj=pool.get('res.partner.address')
@@ -180,6 +175,7 @@ class wizard_base_setup(wizard.interface):
'rml_footer1': form['rml_footer1'],
'rml_footer2': form['rml_footer2'],
'currency_id': form['currency'],
+ 'logo': form['logo'],
})
partner_obj.write(cr, uid, [company.partner_id.id], {
'name': form['name'],
@@ -275,7 +271,7 @@ class wizard_base_setup(wizard.interface):
'string':'Profile',
'type':'selection',
'selection':_get_profiles,
- 'default': -1,
+# 'default': _get_service_profile,
'required': True,
},
@@ -326,8 +322,8 @@ class wizard_base_setup(wizard.interface):
},
'currency': {
'string': 'Currency',
- 'type': 'many2one',
- 'relation': 'res.currency',
+ 'type': 'selection',
+ 'selection':_get_currency,
'required': True,
},
'rml_header1':{
@@ -354,6 +350,10 @@ IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701""",
'type': 'char',
'size': 200,
},
+ 'logo':{
+ 'string': 'Logo',
+ 'type': 'binary',
+ },
}
states={
'init':{
diff --git a/addons/base_vat/base_vat_data.xml b/addons/base_vat/base_vat_data.xml
index d61201f93d8..d0f1de72732 100644
--- a/addons/base_vat/base_vat_data.xml
+++ b/addons/base_vat/base_vat_data.xml
@@ -7,7 +7,7 @@
res.partner
-
+
diff --git a/addons/board/i18n/fr_FR.po b/addons/board/i18n/fr_FR.po
index c324587edbd..e88317f66d2 100644
--- a/addons/board/i18n/fr_FR.po
+++ b/addons/board/i18n/fr_FR.po
@@ -18,6 +18,7 @@ msgstr ""
#. module: board
#: constraint:ir.model:0
+
msgid "The Object name must start with x_ and not contain any special character !"
msgstr "Le nom de l'objet doit commencer avec x_ et ne pas contenir de charactères spéciaux !"
diff --git a/addons/crm/__terp__.py b/addons/crm/__terp__.py
index 8932a7c2131..42a1f9113a9 100644
--- a/addons/crm/__terp__.py
+++ b/addons/crm/__terp__.py
@@ -53,11 +53,11 @@ between mails and Tiny ERP.""",
"init_xml" : ["crm_data.xml"],
"demo_xml" : ["crm_demo.xml"],
"update_xml" : [
- "security/crm_security.xml",
- "security/ir.model.access.csv",
"crm_view.xml",
"crm_report.xml",
"crm_wizard.xml",
+ "security/crm_security.xml",
+ "security/ir.model.access.csv",
],
"active": False,
"installable": True
diff --git a/addons/crm/security/crm_security.xml b/addons/crm/security/crm_security.xml
index 9e73b1a0e84..aa91246e872 100644
--- a/addons/crm/security/crm_security.xml
+++ b/addons/crm/security/crm_security.xml
@@ -1,6 +1,6 @@
-
+
CRM / Manager
@@ -10,5 +10,13 @@
CRM / User
+
+
+
+
diff --git a/addons/crm/security/ir.model.access.csv b/addons/crm/security/ir.model.access.csv
index afe76960dff..4e8284927d6 100644
--- a/addons/crm/security/ir.model.access.csv
+++ b/addons/crm/security/ir.model.access.csv
@@ -1,12 +1,15 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_crm_segmentation,crm.segmentation,model_crm_segmentation,crm.group_crm_manager,1,1,1,1
-access_crm_segmentation_line,crm.segmentation.line,model_crm_segmentation_line,crm.group_crm_manager,1,1,1,1
-access_crm_case_section,crm.case.section,model_crm_case_section,crm.group_crm_user,1,0,0,0
-access_crm_case_categ,crm.case.categ,model_crm_case_categ,crm.group_crm_user,1,0,0,0
-access_crm_case_rule,crm.case.rule,model_crm_case_rule,crm.group_crm_user,1,0,0,0
-access_crm_case,crm.case,model_crm_case,crm.group_crm_user,1,1,1,1
-access_crm_case_log,crm.case.log,model_crm_case_log,crm.group_crm_user,1,1,1,1
-access_crm_case_history,crm.case.history,model_crm_case_history,crm.group_crm_user,1,1,1,1
-access_crm_case_section_manager,crm.case.section.manager,model_crm_case_section,crm.group_crm_manager,1,1,1,1
-access_crm_case_categ_manager,crm.case.categ.manager,model_crm_case_categ,crm.group_crm_manager,1,1,1,1
-access_crm_case_rule_manager,crm.case.rule.manager,model_crm_case_rule,crm.group_crm_manager,1,1,1,1
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_crm_segmentation","crm.segmentation","model_crm_segmentation","crm.group_crm_manager",1,1,1,1
+"access_crm_segmentation_line","crm.segmentation.line","model_crm_segmentation_line","crm.group_crm_manager",1,1,1,1
+"access_crm_case_section","crm.case.section","model_crm_case_section","crm.group_crm_user",1,0,0,0
+"access_crm_case_categ","crm.case.categ","model_crm_case_categ","crm.group_crm_user",1,0,0,0
+"access_crm_case_rule","crm.case.rule","model_crm_case_rule","crm.group_crm_user",1,0,0,0
+"access_crm_case_manger","crm.case manager","model_crm_case","crm.group_crm_user",1,1,1,1
+"access_crm_case","crm.case","model_crm_case","crm.group_crm_manager",1,1,1,1
+"access_crm_case_log","crm.case.log","model_crm_case_log","crm.group_crm_user",1,1,1,1
+"access_crm_case_history","crm.case.history","model_crm_case_history","crm.group_crm_user",1,1,1,1
+"access_crm_case_section_manager","crm.case.section.manager","model_crm_case_section","crm.group_crm_manager",1,1,1,1
+"access_crm_case_categ_manager","crm.case.categ.manager","model_crm_case_categ","crm.group_crm_manager",1,1,1,1
+"access_crm_case_rule_manager","crm.case.rule.manager","model_crm_case_rule","crm.group_crm_manager",1,1,1,1
+"access_crm_case_log_manager","crm.case.log manager","model_crm_case_log","crm.group_crm_manager",1,1,1,1
+"access_crm_case_history_manager","crm.case.history manager","model_crm_case_history","crm.group_crm_manager",1,1,1,1
diff --git a/addons/crm_configuration/__terp__.py b/addons/crm_configuration/__terp__.py
index 5b6f8e9de21..0f6ccf2cabf 100644
--- a/addons/crm_configuration/__terp__.py
+++ b/addons/crm_configuration/__terp__.py
@@ -9,7 +9,7 @@
people to intelligently and efficiently manage tasks, issues,
and requests. It manages key tasks such as communication,
identification, prioritization, assignment, resolution and notification.""",
- "depends" : ["crm","report_crm", "process"],
+ "depends" : ["crm","report_crm", "process", "account"],
"init_xml" : [
"crm_config_view.xml",
"crm_bugs_view.xml",
@@ -39,7 +39,8 @@
"crm_jobs_menu.xml", "crm_opportunity_menu.xml",
"crm_helpdesk_menu.xml", "crm_lead_menu.xml",
"crm_meeting_menu.xml",
-# "process/crm_configuration_process.xml",
+ "security/ir.model.access.csv",
+ "process/crm_configuration_process.xml",
],
"active": False,
"installable": True
diff --git a/addons/crm_configuration/crm_meeting_view.xml b/addons/crm_configuration/crm_meeting_view.xml
index b0d186e2b97..5e2de1d0de4 100644
--- a/addons/crm_configuration/crm_meeting_view.xml
+++ b/addons/crm_configuration/crm_meeting_view.xml
@@ -1,144 +1,143 @@
-
- # ------------------------------------------------------
- # Meetings
- # ------------------------------------------------------
+
+ # ------------------------------------------------------
+ # Meetings
+ # ------------------------------------------------------
-
- CRM - Meetings Form
- crm.case
- form
-
-
-
-
-
- CRM - Meetings Tree
- crm.case
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- CRM - Meetings Calendar
- crm.case
- calendar
-
-
-
-
-
-
-
-
-
+
+ CRM - Meetings Form
+ crm.case
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CRM - Meetings Tree
+ crm.case
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CRM - Meetings Calendar
+ crm.case
+ calendar
+
+
+
+
+
+
+
+
+
diff --git a/addons/crm_configuration/process/crm_configuration_process.xml b/addons/crm_configuration/process/crm_configuration_process.xml
new file mode 100644
index 00000000000..b7fa5202017
--- /dev/null
+++ b/addons/crm_configuration/process/crm_configuration_process.xml
@@ -0,0 +1,113 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/crm_configuration/security/ir.model.access.csv b/addons/crm_configuration/security/ir.model.access.csv
index 2697ccbdfe1..fd579c8cef4 100644
--- a/addons/crm_configuration/security/ir.model.access.csv
+++ b/addons/crm_configuration/security/ir.model.access.csv
@@ -1,5 +1,11 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_crm_case_stage,crm.case.stage,model_crm_case_stage,crm.group_crm_user,1,0,0,0
-access_report_crm_case_section_stage,report.crm.case.section.stage,model_report_crm_case_section_stage,crm.group_crm_manager,1,0,0,0
-access_report_crm_case_section_categ_stage,report.crm.case.section.categ.stage,model_report_crm_case_section_categ_stage,crm.group_crm_manager,1,0,0,0
-access_crm_case_stage_manager,crm.case.stage,model_crm_case_stage,crm.group_crm_manager,1,1,1,1
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_crm_case_stage","crm.case.stage","model_crm_case_stage","crm.group_crm_user",1,0,0,0
+"access_report_crm_case_section_stage","report.crm.case.section.stage","model_report_crm_case_section_stage","crm.group_crm_manager",1,0,0,0
+"access_report_crm_case_section_categ_stage","report.crm.case.section.categ.stage","model_report_crm_case_section_categ_stage","crm.group_crm_manager",1,0,0,0
+"access_report_crm_case_section_categ_categ2","report.crm.case.section.categ.categ2","model_report_crm_case_section_categ_categ2","crm.group_crm_manager",1,0,0,
+"access_report_crm_case_section_categ2","report.crm.case.section.categ2","model_report_crm_case_section_categ2","crm.group_crm_manager",1,0,0,
+"access_crm_case_stage_manager","crm.case.stage","model_crm_case_stage","crm.group_crm_manager",1,1,1,1
+"access_crm_menu_config_wizard","crm config wizard manager","model_crm_menu_config_wizard","crm.group_crm_manager",1,1,1,1
+"access_crm_menu_config_wizard system","crm config wizard manager system","model_crm_menu_config_wizard","base.group_system",1,1,1,1
+"access_crm_case_category2_user","crm_case_category2 user","model_crm_case_category2","crm.group_crm_user",1,0,0,0
+"access_crm_case_category2_manager","crm_case_category2 manager","model_crm_case_category2","crm.group_crm_manager",1,1,1,1
diff --git a/addons/crm_profiling/security/ir.model.access.csv b/addons/crm_profiling/security/ir.model.access.csv
index 5b8fcad458e..a52b8fd4e7b 100644
--- a/addons/crm_profiling/security/ir.model.access.csv
+++ b/addons/crm_profiling/security/ir.model.access.csv
@@ -1,6 +1,8 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_crm_profiling_question,crm_profiling.question,model_crm_profiling_question,crm.group_crm_user,1,0,0,0
-access_crm_profiling_questionnaire,crm_profiling.questionnaire,model_crm_profiling_questionnaire,crm.group_crm_user,1,0,0,0
-access_crm_profiling_answer,crm_profiling.answer,model_crm_profiling_answer,crm.group_crm_user,1,1,1,1
-access_crm_profiling_question_manager,crm_profiling.question,model_crm_profiling_question,crm.group_crm_manager,1,1,1,1
-access_crm_profiling_questionnaire_manager,crm_profiling.questionnaire,model_crm_profiling_questionnaire,crm.group_crm_manager,1,1,1,1
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_crm_profiling_question","crm_profiling.question","model_crm_profiling_question",,1,0,0,0
+"access_crm_profiling_questionnaire","crm_profiling.questionnaire","model_crm_profiling_questionnaire",,1,0,0,0
+"access_crm_profiling_answer_all","crm_profiling.answer all","model_crm_profiling_answer",,1,0,0,0
+"access_crm_profiling_answer","crm_profiling.answer","model_crm_profiling_answer","crm.group_crm_user",1,1,1,1
+"access_crm_profiling_question_manager","crm_profiling.question manager","model_crm_profiling_question","crm.group_crm_manager",1,1,1,1
+"access_crm_profiling_questionnaire_manager","crm_profiling.questionnaire manager","model_crm_profiling_questionnaire","crm.group_crm_manager",1,1,1,1
+"access_crm_profiling_answer_manager","crm_profiling.answer manager","model_crm_profiling_answer","crm.group_crm_manager",1,1,1,1
diff --git a/addons/delivery/security/ir.model.access.csv b/addons/delivery/security/ir.model.access.csv
index b69c00a80aa..948a85c35c7 100644
--- a/addons/delivery/security/ir.model.access.csv
+++ b/addons/delivery/security/ir.model.access.csv
@@ -1,7 +1,9 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_delivery_carrier,delivery.carrier,model_delivery_carrier,sale.group_sale_user,1,0,0,0
-access_delivery_grid,delivery.grid,model_delivery_grid,sale.group_sale_user,1,0,0,0
-access_delivery_grid_line,delivery.grid.line,model_delivery_grid_line,sale.group_sale_user,1,0,0,0
-access_delivery_carrier_manager,delivery.carrier,model_delivery_carrier,sale.group_sale_manager,1,1,1,1
-access_delivery_grid_manager,delivery.grid,model_delivery_grid,sale.group_sale_manager,1,1,1,1
-access_delivery_grid_line_manager,delivery.grid.line,model_delivery_grid_line,sale.group_sale_manager,1,1,1,1
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_delivery_carrier","delivery.carrier","model_delivery_carrier","sale.group_sale_user",1,0,0,0
+"access_delivery_grid","delivery.grid","model_delivery_grid","sale.group_sale_user",1,0,0,0
+"access_delivery_grid_line","delivery.grid.line","model_delivery_grid_line","sale.group_sale_user",1,0,0,0
+"access_delivery_carrier_manager","delivery.carrier","model_delivery_carrier","sale.group_sale_manager",1,1,1,1
+"access_delivery_grid_manager","delivery.grid","model_delivery_grid","sale.group_sale_manager",1,1,1,1
+"access_delivery_grid_line_manager","delivery.grid.line","model_delivery_grid_line","sale.group_sale_manager",1,1,1,1
+"access_delivery_carrier_partner_manager","delivery.carrier partner_manager","model_delivery_carrier","base.group_partner_manager",1,0,0,0
+"access_delivery_carrier_stock_worker","delivery.carrier stock_worker","model_delivery_carrier","stock.group_stock_user",1,0,0,0
diff --git a/addons/delivery/stock.py b/addons/delivery/stock.py
index d76b711e8d8..5ac19b1c0e4 100644
--- a/addons/delivery/stock.py
+++ b/addons/delivery/stock.py
@@ -83,23 +83,14 @@ class stock_picking(osv.osv):
account_id = picking.carrier_id.product_id.categ_id\
.property_account_income_categ.id
- taxes = self.pool.get('account.tax').browse(cursor, user,
- [x.id for x in picking.carrier_id.product_id.taxes_id])
- taxep = None
- partner_id=picking.address_id.partner_id and picking.address_id.partner_id.id or False
- if partner_id:
- taxep_id = self.pool.get('res.partner').property_get(cursor, user,partner_id,property_pref=['property_account_tax']).get('property_account_tax',False)
- if taxep_id:
- taxep=self.pool.get('account.tax').browse(cursor, user,taxep_id)
- if not taxep or not taxep.id:
- taxes_ids = [x.id for x in picking.carrier_id.product_id.taxes_id]
- else:
- res5 = [taxep.id]
- for t in taxes:
- if not t.tax_group==taxep.tax_group:
- res5.append(t.id)
- taxes_ids = res5
+ taxes = picking.carrier_id.product_id.taxes_id
+ partner_id=picking.address_id.partner_id and picking.address_id.partner_id.id or False
+ taxes_ids = [x.id for x in picking.carrier_id.product_id.taxes_id]
+ if partner_id:
+ partner = picking.address_id.partner_id
+ account_id = self.pool.get('account.fiscal.position').map_account(cursor, user, partner, account_id)
+ taxes_ids = self.pool.get('account.fiscal.position').map_tax(cursor, user, partner, taxes)
invoice_line_obj.create(cursor, user, {
'name': picking.carrier_id.name,
diff --git a/addons/delivery/wizard/delivery_sale_order.py b/addons/delivery/wizard/delivery_sale_order.py
index 54a48f4ac54..ca630ddcf4f 100644
--- a/addons/delivery/wizard/delivery_sale_order.py
+++ b/addons/delivery/wizard/delivery_sale_order.py
@@ -68,23 +68,9 @@ def _delivery_set(self, cr, uid, data, context):
grid_obj=pooler.get_pool(cr.dbname).get('delivery.grid')
grid = grid_obj.browse(cr, uid, [grid_id])[0]
- taxes = pooler.get_pool(cr.dbname).get('account.tax').browse(cr, uid,
- [x.id for x in grid.carrier_id.product_id.taxes_id])
- taxep = None
- partner_id=order.partner_id and order.partner_id.id or False
- if partner_id:
- taxep_id = pooler.get_pool(cr.dbname).get('res.partner').property_get(cr, uid,partner_id,property_pref=['property_account_tax']).get('property_account_tax',False)
- if taxep_id:
- taxep=pooler.get_pool(cr.dbname).get('account.tax').browse(cr, uid,taxep_id)
- if not taxep or not taxep.id:
- taxes_ids = [x.id for x in grid.carrier_id.product_id.taxes_id]
- else:
- res5 = [taxep.id]
- for t in taxes:
- if not t.tax_group==taxep.tax_group:
- res5.append(t.id)
- taxes_ids = res5
-
+ taxes = grid.carrier_id.product_id.taxes_id
+ taxes_ids = pooler.get_pool(cr.dbname).get('account.fiscal.position').map_tax(cr, uid, order.partner_id, taxes)
+
line_obj.create(cr, uid, {
'order_id': order.id,
'name': grid.carrier_id.name,
diff --git a/addons/document/__terp__.py b/addons/document/__terp__.py
index 0e1c845cff6..aafdbebdb1a 100644
--- a/addons/document/__terp__.py
+++ b/addons/document/__terp__.py
@@ -12,9 +12,14 @@
* User Authentification
* Document Indexation
""",
- "depends" : ["base", "process"],
+ "depends" : ["base", "process", "hr"],
"init_xml" : ["document_data.xml"],
- "update_xml" : ["document_view.xml"],
+ "update_xml" : [
+ "document_view.xml",
+ "security/document_security.xml",
+ "security/ir.model.access.csv",
+ "process/document_process.xml"
+ ],
"demo_xml" : ["document_demo.xml"],
"active": False,
"installable": True
diff --git a/addons/document/document.py b/addons/document/document.py
index d7904d31285..9778ec5b316 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -59,374 +59,374 @@ from content_index import content_index
#
INVALID_CHARS={'*':str(hash('*')), '|':str(hash('|')) , "\\":str(hash("\\")), '/':'__', ':':str(hash(':')), '"':str(hash('"')), '<':str(hash('<')) , '>':str(hash('>')) , '?':str(hash('?'))}
class node_class(object):
- def __init__(self, cr, uid, path,object,object2=False, context={}, content=False, type='collection', root=False):
- self.cr = cr
- self.uid = uid
- self.path = path
- self.object = object
- self.object2 = object2
- self.context = context
- self.content = content
- self.type=type
- self.root=root
+ def __init__(self, cr, uid, path,object,object2=False, context={}, content=False, type='collection', root=False):
+ self.cr = cr
+ self.uid = uid
+ self.path = path
+ self.object = object
+ self.object2 = object2
+ self.context = context
+ self.content = content
+ self.type=type
+ self.root=root
- def _file_get(self, nodename=False):
- if not self.object:
- return []
- pool = pooler.get_pool(self.cr.dbname)
- fobj = pool.get('ir.attachment')
- res2 = []
- where = []
- if self.object2:
- where.append( ('res_model','=',self.object2._name) )
- where.append( ('res_id','=',self.object2.id) )
- for content in self.object.content_ids:
- test_nodename = self.object2.name + (content.suffix or '') + (content.extension or '')
- if test_nodename.find('/'):
- test_nodename=test_nodename.replace('/', '_')
- path = self.path+'/'+test_nodename
- #path = self.path+'/'+self.object2.name + (content.suffix or '') + (content.extension or '')
- if not nodename:
- n = node_class(self.cr, self.uid,path, self.object2, False, content=content, type='content', root=False)
- res2.append( n)
- else:
- if nodename == test_nodename:
- n = node_class(self.cr, self.uid, path, self.object2, False, content=content, type='content', root=False)
- res2.append(n)
- else:
- where.append( ('parent_id','=',self.object.id) )
- where.append( ('res_id','=',False) )
- if nodename:
- where.append( (fobj._rec_name,'=',nodename) )
- ids = fobj.search(self.cr, self.uid, where+[ ('parent_id','=',self.object and self.object.id or False) ], context=self.context)
- if self.object and self.root and (self.object.type=='ressource'):
- ids += fobj.search(self.cr, self.uid, where+[ ('parent_id','=',False) ], context=self.context)
- res = fobj.browse(self.cr, self.uid, ids, context=self.context)
- return map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name, x, False, type='file', root=False), res) + res2
+ def _file_get(self, nodename=False):
+ if not self.object:
+ return []
+ pool = pooler.get_pool(self.cr.dbname)
+ fobj = pool.get('ir.attachment')
+ res2 = []
+ where = []
+ if self.object2:
+ where.append( ('res_model','=',self.object2._name) )
+ where.append( ('res_id','=',self.object2.id) )
+ for content in self.object.content_ids:
+ test_nodename = self.object2.name + (content.suffix or '') + (content.extension or '')
+ if test_nodename.find('/'):
+ test_nodename=test_nodename.replace('/', '_')
+ path = self.path+'/'+test_nodename
+ #path = self.path+'/'+self.object2.name + (content.suffix or '') + (content.extension or '')
+ if not nodename:
+ n = node_class(self.cr, self.uid,path, self.object2, False, content=content, type='content', root=False)
+ res2.append( n)
+ else:
+ if nodename == test_nodename:
+ n = node_class(self.cr, self.uid, path, self.object2, False, content=content, type='content', root=False)
+ res2.append(n)
+ else:
+ where.append( ('parent_id','=',self.object.id) )
+ where.append( ('res_id','=',False) )
+ if nodename:
+ where.append( (fobj._rec_name,'=',nodename) )
+ ids = fobj.search(self.cr, self.uid, where+[ ('parent_id','=',self.object and self.object.id or False) ], context=self.context)
+ if self.object and self.root and (self.object.type=='ressource'):
+ ids += fobj.search(self.cr, self.uid, where+[ ('parent_id','=',False) ], context=self.context)
+ res = fobj.browse(self.cr, self.uid, ids, context=self.context)
+ return map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name, x, False, type='file', root=False), res) + res2
- def directory_list_for_child(self,nodename,parent=False):
- pool = pooler.get_pool(self.cr.dbname)
- where = []
- if nodename:
- where.append(('name','=',nodename))
- if (self.object and self.object.type=='directory') or not self.object2:
- where.append(('parent_id','=',self.object and self.object.id or False))
- else:
- where.append(('parent_id','=',False))
- if self.object:
- where.append(('ressource_parent_type_id','=',self.object.ressource_type_id.id))
- else:
- where.append(('ressource_parent_type_id','=',False))
+ def directory_list_for_child(self,nodename,parent=False):
+ pool = pooler.get_pool(self.cr.dbname)
+ where = []
+ if nodename:
+ where.append(('name','=',nodename))
+ if (self.object and self.object.type=='directory') or not self.object2:
+ where.append(('parent_id','=',self.object and self.object.id or False))
+ else:
+ where.append(('parent_id','=',False))
+ if self.object:
+ where.append(('ressource_parent_type_id','=',self.object.ressource_type_id.id))
+ else:
+ where.append(('ressource_parent_type_id','=',False))
- ids = pool.get('document.directory').search(self.cr, self.uid, where+[('ressource_id','=',0)], self.context)
- if self.object2:
- ids += pool.get('document.directory').search(self.cr, self.uid, where+[('ressource_id','=',self.object2.id)], self.context)
- res = pool.get('document.directory').browse(self.cr, self.uid, ids,self.context)
- return res
+ ids = pool.get('document.directory').search(self.cr, self.uid, where+[('ressource_id','=',0)], self.context)
+ if self.object2:
+ ids += pool.get('document.directory').search(self.cr, self.uid, where+[('ressource_id','=',self.object2.id)], self.context)
+ res = pool.get('document.directory').browse(self.cr, self.uid, ids,self.context)
+ return res
- def _child_get(self, nodename=False):
- if self.type not in ('collection','database'):
- return []
- res = self.directory_list_for_child(nodename)
- result= map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name, x, x.type=='directory' and self.object2 or False, root=self.root), res)
- if self.type=='database':
- pool = pooler.get_pool(self.cr.dbname)
- fobj = pool.get('ir.attachment')
- vargs = [('parent_id','=',False),('res_id','=',False)]
- if nodename:
- vargs.append(('name','=',nodename))
- file_ids=fobj.search(self.cr,self.uid,vargs)
+ def _child_get(self, nodename=False):
+ if self.type not in ('collection','database'):
+ return []
+ res = self.directory_list_for_child(nodename)
+ result= map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name, x, x.type=='directory' and self.object2 or False, root=self.root), res)
+ if self.type=='database':
+ pool = pooler.get_pool(self.cr.dbname)
+ fobj = pool.get('ir.attachment')
+ vargs = [('parent_id','=',False),('res_id','=',False)]
+ if nodename:
+ vargs.append(('name','=',nodename))
+ file_ids=fobj.search(self.cr,self.uid,vargs)
- res = fobj.browse(self.cr, self.uid, file_ids, context=self.context)
- result +=map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name, x, False, type='file', root=self.root), res)
- if self.type=='collection' and self.object.type=="ressource":
- where = self.object.domain and eval(self.object.domain, {'active_id':self.root}) or []
- pool = pooler.get_pool(self.cr.dbname)
- obj = pool.get(self.object.ressource_type_id.model)
+ res = fobj.browse(self.cr, self.uid, file_ids, context=self.context)
+ result +=map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name, x, False, type='file', root=self.root), res)
+ if self.type=='collection' and self.object.type=="ressource":
+ where = self.object.domain and eval(self.object.domain, {'active_id':self.root}) or []
+ pool = pooler.get_pool(self.cr.dbname)
+ obj = pool.get(self.object.ressource_type_id.model)
- if self.object.ressource_tree:
- if obj._parent_name in obj.fields_get(self.cr,self.uid):
- where.append((obj._parent_name,'=',self.object2 and self.object2.id or False))
- else :
- if self.object2:
- return result
- else:
- if self.object2:
- return result
+ if self.object.ressource_tree:
+ if obj._parent_name in obj.fields_get(self.cr,self.uid):
+ where.append((obj._parent_name,'=',self.object2 and self.object2.id or False))
+ else :
+ if self.object2:
+ return result
+ else:
+ if self.object2:
+ return result
- name_for = obj._name.split('.')[-1]
- if nodename and nodename.find(name_for) == 0 :
- id = int(nodename.replace(name_for,''))
- where.append(('id','=',id))
- elif nodename:
- if nodename.find('__') :
- nodename=nodename.replace('__','/')
- for invalid in INVALID_CHARS:
- if nodename.find(INVALID_CHARS[invalid]) :
- nodename=nodename.replace(INVALID_CHARS[invalid],invalid)
- where.append(('name','=',nodename))
- ids = obj.search(self.cr, self.uid, where, self.context)
- res = obj.browse(self.cr, self.uid, ids,self.context)
- for r in res:
- if not r.name:
- r.name = name_for+'%d'%r.id
- for invalid in INVALID_CHARS:
- if r.name.find(invalid) :
- r.name=r.name.replace(invalid,INVALID_CHARS[invalid])
- result2 = map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name.replace('/','__'), self.object, x, root=r.id), res)
- if result2:
- result = result2
- return result
+ name_for = obj._name.split('.')[-1]
+ if nodename and nodename.find(name_for) == 0 :
+ id = int(nodename.replace(name_for,''))
+ where.append(('id','=',id))
+ elif nodename:
+ if nodename.find('__') :
+ nodename=nodename.replace('__','/')
+ for invalid in INVALID_CHARS:
+ if nodename.find(INVALID_CHARS[invalid]) :
+ nodename=nodename.replace(INVALID_CHARS[invalid],invalid)
+ where.append(('name','=',nodename))
+ ids = obj.search(self.cr, self.uid, where, self.context)
+ res = obj.browse(self.cr, self.uid, ids,self.context)
+ for r in res:
+ if not r.name:
+ r.name = name_for+'%d'%r.id
+ for invalid in INVALID_CHARS:
+ if r.name.find(invalid) :
+ r.name=r.name.replace(invalid,INVALID_CHARS[invalid])
+ result2 = map(lambda x: node_class(self.cr, self.uid, self.path+'/'+x.name.replace('/','__'), self.object, x, root=r.id), res)
+ if result2:
+ result = result2
+ return result
- def children(self):
- return self._child_get() + self._file_get()
+ def children(self):
+ return self._child_get() + self._file_get()
- def child(self, name):
- res = self._child_get(name)
- if res:
- return res[0]
- res = self._file_get(name)
- if res:
- return res[0]
- return None
+ def child(self, name):
+ res = self._child_get(name)
+ if res:
+ return res[0]
+ res = self._file_get(name)
+ if res:
+ return res[0]
+ return None
- def path_get(self):
- path = self.path
- if self.path[0]=='/':
- path = self.path[1:]
- return path
+ def path_get(self):
+ path = self.path
+ if self.path[0]=='/':
+ path = self.path[1:]
+ return path
class document_directory(osv.osv):
- _name = 'document.directory'
- _description = 'Document directory'
- _columns = {
- 'name': fields.char('Name', size=64, required=True, select=1),
- 'write_date': fields.datetime('Date Modified', readonly=True),
- 'write_uid': fields.many2one('res.users', 'Last Modification User', readonly=True),
- 'create_date': fields.datetime('Date Created', readonly=True),
- 'create_uid': fields.many2one('res.users', 'Creator', readonly=True),
- 'file_type': fields.char('Content Type', size=32),
- 'domain': fields.char('Domain', size=128),
- 'user_id': fields.many2one('res.users', 'Owner'),
- 'group_ids': fields.many2many('res.groups', 'document_directory_group_rel', 'item_id', 'group_id', 'Groups'),
- 'parent_id': fields.many2one('document.directory', 'Parent Item'),
- 'child_ids': fields.one2many('document.directory', 'parent_id', 'Childs'),
- 'file_ids': fields.one2many('ir.attachment', 'parent_id', 'Files'),
- 'content_ids': fields.one2many('document.directory.content', 'directory_id', 'Virtual Files'),
- 'type': fields.selection([('directory','Static Directory'),('ressource','Other Ressources')], 'Type', required=True),
- 'ressource_type_id': fields.many2one('ir.model', 'Childs Model'),
- 'ressource_parent_type_id': fields.many2one('ir.model', 'Linked Model'),
- 'ressource_id': fields.integer('Ressource ID'),
- 'ressource_tree': fields.boolean('Tree Structure'),
- }
- _defaults = {
- 'user_id': lambda self,cr,uid,ctx: uid,
- 'domain': lambda self,cr,uid,ctx: '[]',
- 'type': lambda *args: 'directory',
- }
- _sql_constraints = [
- ('dirname_uniq', 'unique (name,parent_id,ressource_id,ressource_parent_type_id)', 'The directory name must be unique !')
- ]
+ _name = 'document.directory'
+ _description = 'Document directory'
+ _columns = {
+ 'name': fields.char('Name', size=64, required=True, select=1),
+ 'write_date': fields.datetime('Date Modified', readonly=True),
+ 'write_uid': fields.many2one('res.users', 'Last Modification User', readonly=True),
+ 'create_date': fields.datetime('Date Created', readonly=True),
+ 'create_uid': fields.many2one('res.users', 'Creator', readonly=True),
+ 'file_type': fields.char('Content Type', size=32),
+ 'domain': fields.char('Domain', size=128),
+ 'user_id': fields.many2one('res.users', 'Owner'),
+ 'group_ids': fields.many2many('res.groups', 'document_directory_group_rel', 'item_id', 'group_id', 'Groups'),
+ 'parent_id': fields.many2one('document.directory', 'Parent Item'),
+ 'child_ids': fields.one2many('document.directory', 'parent_id', 'Childs'),
+ 'file_ids': fields.one2many('ir.attachment', 'parent_id', 'Files'),
+ 'content_ids': fields.one2many('document.directory.content', 'directory_id', 'Virtual Files'),
+ 'type': fields.selection([('directory','Static Directory'),('ressource','Other Ressources')], 'Type', required=True),
+ 'ressource_type_id': fields.many2one('ir.model', 'Childs Model'),
+ 'ressource_parent_type_id': fields.many2one('ir.model', 'Linked Model'),
+ 'ressource_id': fields.integer('Ressource ID'),
+ 'ressource_tree': fields.boolean('Tree Structure'),
+ }
+ _defaults = {
+ 'user_id': lambda self,cr,uid,ctx: uid,
+ 'domain': lambda self,cr,uid,ctx: '[]',
+ 'type': lambda *args: 'directory',
+ }
+ _sql_constraints = [
+ ('dirname_uniq', 'unique (name,parent_id,ressource_id,ressource_parent_type_id)', 'The directory name must be unique !')
+ ]
- def get_resource_path(self,cr,uid,dir_id,res_model,res_id):
- # this method will be used in process module
- # to be need test and Improvement if resource dir has parent resource (link resource)
- path=[]
- def _parent(dir_id,path):
- parent=self.browse(cr,uid,dir_id)
- if parent.parent_id and not parent.ressource_parent_type_id:
- _parent(parent.parent_id.id,path)
- path.append(parent.name)
- else:
- path.append(parent.name)
- return path
+ def get_resource_path(self,cr,uid,dir_id,res_model,res_id):
+ # this method will be used in process module
+ # to be need test and Improvement if resource dir has parent resource (link resource)
+ path=[]
+ def _parent(dir_id,path):
+ parent=self.browse(cr,uid,dir_id)
+ if parent.parent_id and not parent.ressource_parent_type_id:
+ _parent(parent.parent_id.id,path)
+ path.append(parent.name)
+ else:
+ path.append(parent.name)
+ return path
- directory=self.browse(cr,uid,dir_id)
- model_ids=self.pool.get('ir.model').search(cr,uid,[('model','=',res_model)])
- if directory:
- _parent(dir_id,path)
- path.append(self.pool.get(directory.ressource_type_id.model).browse(cr,uid,res_id).name)
- user=self.pool.get('res.users').browse(cr,uid,uid)
- #print "ftp://%s:%s@localhost:8021/%s/%s"%(user.login,user.password,cr.dbname,'/'.join(path))
- return "ftp://%s:%s@localhost:8021/%s/%s"%(user.login,user.password,cr.dbname,'/'.join(path))
- return False
- def _check_duplication(self, cr, uid,vals):
- if 'name' in vals:
- where=" name='%s'"% (vals['name'])
- if not 'parent_id' in vals or not vals['parent_id']:
- where+=' and parent_id is null'
- else:
- where+=' and parent_id=%d'%(vals['parent_id'])
- if not 'ressource_parent_type_id' in vals or not vals['ressource_parent_type_id']:
- where+= ' and ressource_parent_type_id is null'
- else:
- where+=" and ressource_parent_type_id='%s'"%(vals['ressource_parent_type_id'])
-# if not 'ressource_id' in vals or not vals['ressource_id']:
-# where+= ' and ressource_id is null'
-# else:
-# where+=" and ressource_id=%d"%(vals['ressource_id'])
- cr.execute("select id from document_directory where" + where)
- res = cr.fetchall()
- if len(res):
- return False
- return True
- def _check_recursion(self, cr, uid, ids):
- level = 100
- while len(ids):
- cr.execute('select distinct parent_id from document_directory where id in ('+','.join(map(str,ids))+')')
- ids = filter(None, map(lambda x:x[0], cr.fetchall()))
- if not level:
- return False
- level -= 1
- return True
+ directory=self.browse(cr,uid,dir_id)
+ model_ids=self.pool.get('ir.model').search(cr,uid,[('model','=',res_model)])
+ if directory:
+ _parent(dir_id,path)
+ path.append(self.pool.get(directory.ressource_type_id.model).browse(cr,uid,res_id).name)
+ user=self.pool.get('res.users').browse(cr,uid,uid)
+ #print "ftp://%s:%s@localhost:8021/%s/%s"%(user.login,user.password,cr.dbname,'/'.join(path))
+ return "ftp://%s:%s@localhost:8021/%s/%s"%(user.login,user.password,cr.dbname,'/'.join(path))
+ return False
+ def _check_duplication(self, cr, uid,vals):
+ if 'name' in vals:
+ where=" name='%s'"% (vals['name'])
+ if not 'parent_id' in vals or not vals['parent_id']:
+ where+=' and parent_id is null'
+ else:
+ where+=' and parent_id=%d'%(vals['parent_id'])
+ if not 'ressource_parent_type_id' in vals or not vals['ressource_parent_type_id']:
+ where+= ' and ressource_parent_type_id is null'
+ else:
+ where+=" and ressource_parent_type_id='%s'"%(vals['ressource_parent_type_id'])
+# if not 'ressource_id' in vals or not vals['ressource_id']:
+# where+= ' and ressource_id is null'
+# else:
+# where+=" and ressource_id=%d"%(vals['ressource_id'])
+ cr.execute("select id from document_directory where" + where)
+ res = cr.fetchall()
+ if len(res):
+ return False
+ return True
+ def _check_recursion(self, cr, uid, ids):
+ level = 100
+ while len(ids):
+ cr.execute('select distinct parent_id from document_directory where id in ('+','.join(map(str,ids))+')')
+ ids = filter(None, map(lambda x:x[0], cr.fetchall()))
+ if not level:
+ return False
+ level -= 1
+ return True
- _constraints = [
- (_check_recursion, 'Error! You can not create recursive Directories.', ['parent_id'])
- ]
- def __init__(self, *args, **kwargs):
- res = super(document_directory, self).__init__(*args, **kwargs)
- self._cache = {}
- return res
+ _constraints = [
+ (_check_recursion, 'Error! You can not create recursive Directories.', ['parent_id'])
+ ]
+ def __init__(self, *args, **kwargs):
+ res = super(document_directory, self).__init__(*args, **kwargs)
+ self._cache = {}
+ return res
- def onchange_content_id(self, cr, uid, ids, ressource_type_id):
- return {}
+ def onchange_content_id(self, cr, uid, ids, ressource_type_id):
+ return {}
- def _get_childs(self, cr, uid, node, nodename=False, context={}):
- where = []
- if nodename:
- where.append(('name','=',nodename))
- if object:
- where.append(('parent_id','=',object.id))
- ids = self.search(cr, uid, where, context)
- return self.browse(cr, uid, ids, context), False
+ def _get_childs(self, cr, uid, node, nodename=False, context={}):
+ where = []
+ if nodename:
+ where.append(('name','=',nodename))
+ if object:
+ where.append(('parent_id','=',object.id))
+ ids = self.search(cr, uid, where, context)
+ return self.browse(cr, uid, ids, context), False
- """
- PRE:
- uri: of the form "Sales Order/SO001"
- PORT:
- uri
- object: the object.directory or object.directory.content
- object2: the other object linked (if object.directory.content)
- """
- def get_object(self, cr, uid, uri, context={}):
- if not uri:
- return node_class(cr, uid, '', False, type='database')
- turi = tuple(uri)
- if False and (turi in self._cache):
- (path, oo, oo2, content,type,root) = self._cache[turi]
- if oo:
- object = self.pool.get(oo[0]).browse(cr, uid, oo[1], context)
- else:
- object = False
- if oo2:
- object2 = self.pool.get(oo2[0]).browse(cr, uid, oo2[1], context)
- else:
- object2 = False
- node = node_class(cr, uid, path, object,object2, context, content, type, root)
- return node
+ """
+ PRE:
+ uri: of the form "Sales Order/SO001"
+ PORT:
+ uri
+ object: the object.directory or object.directory.content
+ object2: the other object linked (if object.directory.content)
+ """
+ def get_object(self, cr, uid, uri, context={}):
+ if not uri:
+ return node_class(cr, uid, '', False, type='database')
+ turi = tuple(uri)
+ if False and (turi in self._cache):
+ (path, oo, oo2, content,type,root) = self._cache[turi]
+ if oo:
+ object = self.pool.get(oo[0]).browse(cr, uid, oo[1], context)
+ else:
+ object = False
+ if oo2:
+ object2 = self.pool.get(oo2[0]).browse(cr, uid, oo2[1], context)
+ else:
+ object2 = False
+ node = node_class(cr, uid, path, object,object2, context, content, type, root)
+ return node
- node = node_class(cr, uid, '/', False, type='database')
- for path in uri[:]:
- if path:
- node = node.child(path)
- if not node:
- return False
- oo = node.object and (node.object._name, node.object.id) or False
- oo2 = node.object2 and (node.object2._name, node.object2.id) or False
- self._cache[turi] = (node.path, oo, oo2, node.content,node.type,node.root)
- return node
+ node = node_class(cr, uid, '/', False, type='database')
+ for path in uri[:]:
+ if path:
+ node = node.child(path)
+ if not node:
+ return False
+ oo = node.object and (node.object._name, node.object.id) or False
+ oo2 = node.object2 and (node.object2._name, node.object2.id) or False
+ self._cache[turi] = (node.path, oo, oo2, node.content,node.type,node.root)
+ return node
- def get_childs(self, cr, uid, uri, context={}):
- node = self.get_object(cr, uid, uri, context)
- if uri:
- children = node.children()
- else:
- children= [node]
- result = map(lambda node: node.path_get(), children)
- #childs,object2 = self._get_childs(cr, uid, object, False, context)
- #result = map(lambda x: urlparse.urljoin(path+'/',x.name), childs)
- return result
+ def get_childs(self, cr, uid, uri, context={}):
+ node = self.get_object(cr, uid, uri, context)
+ if uri:
+ children = node.children()
+ else:
+ children= [node]
+ result = map(lambda node: node.path_get(), children)
+ #childs,object2 = self._get_childs(cr, uid, object, False, context)
+ #result = map(lambda x: urlparse.urljoin(path+'/',x.name), childs)
+ return result
- def write(self, cr, uid, ids, vals, context=None):
- # need to make constraints to checking duplicate
- #if not self._check_duplication(cr,uid,vals):
- # raise except_orm('ValidateError', 'Directory name must be unique!')
- return super(document_directory,self).write(cr,uid,ids,vals,context=context)
+ def write(self, cr, uid, ids, vals, context=None):
+ # need to make constraints to checking duplicate
+ #if not self._check_duplication(cr,uid,vals):
+ # raise except_orm('ValidateError', 'Directory name must be unique!')
+ return super(document_directory,self).write(cr,uid,ids,vals,context=context)
- def copy(self, cr, uid, id, default=None, context=None):
- if not default:
- default ={}
- name = self.read(cr, uid, [id])[0]['name']
- default.update({'name': name+ " (copy)"})
- return super(document_directory,self).copy(cr,uid,id,default,context)
+ def copy(self, cr, uid, id, default=None, context=None):
+ if not default:
+ default ={}
+ name = self.read(cr, uid, [id])[0]['name']
+ default.update({'name': name+ " (copy)"})
+ return super(document_directory,self).copy(cr,uid,id,default,context)
- def create(self, cr, uid, vals, context=None):
- if not self._check_duplication(cr,uid,vals):
- raise except_orm('ValidateError', 'Directory name must be unique!')
- if vals.get('name',False) and (vals.get('name').find('/')+1 or vals.get('name').find('@')+1 or vals.get('name').find('$')+1 or vals.get('name').find('#')+1) :
- raise 'Error'
- return super(document_directory,self).create(cr, uid, vals, context)
+ def create(self, cr, uid, vals, context=None):
+ if not self._check_duplication(cr,uid,vals):
+ raise except_orm('ValidateError', 'Directory name must be unique!')
+ if vals.get('name',False) and (vals.get('name').find('/')+1 or vals.get('name').find('@')+1 or vals.get('name').find('$')+1 or vals.get('name').find('#')+1) :
+ raise 'Error'
+ return super(document_directory,self).create(cr, uid, vals, context)
document_directory()
class document_directory_node(osv.osv):
- _inherit = 'process.node'
- _columns = {
- 'directory_id': fields.many2one('document.directory', 'Document directory', ondelete="set null"),
- }
+ _inherit = 'process.node'
+ _columns = {
+ 'directory_id': fields.many2one('document.directory', 'Document directory', ondelete="set null"),
+ }
document_directory_node()
class document_directory_content(osv.osv):
- _name = 'document.directory.content'
- _description = 'Directory Content'
- _order = "sequence"
- _columns = {
- 'name': fields.char('Content Name', size=64, required=True),
- 'sequence': fields.integer('Sequence', size=16),
- 'suffix': fields.char('Suffix', size=16),
- 'versioning': fields.boolean('Versioning'),
- 'report_id': fields.many2one('ir.actions.report.xml', 'Report', required=True),
- 'extension': fields.selection([('.pdf','.pdf'),('','None')], 'Extension', required=True),
- 'directory_id': fields.many2one('document.directory', 'Directory')
- }
- _defaults = {
- 'extension': lambda *args: '',
- 'sequence': lambda *args: 1
- }
+ _name = 'document.directory.content'
+ _description = 'Directory Content'
+ _order = "sequence"
+ _columns = {
+ 'name': fields.char('Content Name', size=64, required=True),
+ 'sequence': fields.integer('Sequence', size=16),
+ 'suffix': fields.char('Suffix', size=16),
+ 'versioning': fields.boolean('Versioning'),
+ 'report_id': fields.many2one('ir.actions.report.xml', 'Report', required=True),
+ 'extension': fields.selection([('.pdf','.pdf'),('','None')], 'Extension', required=True),
+ 'directory_id': fields.many2one('document.directory', 'Directory')
+ }
+ _defaults = {
+ 'extension': lambda *args: '',
+ 'sequence': lambda *args: 1
+ }
document_directory_content()
class ir_action_report_xml(osv.osv):
- _name="ir.actions.report.xml"
- _inherit ="ir.actions.report.xml"
+ _name="ir.actions.report.xml"
+ _inherit ="ir.actions.report.xml"
- def _model_get(self, cr, uid, ids, name, arg, context):
- res = {}
- model_pool = self.pool.get('ir.model')
- for data in self.read(cr,uid,ids,['model']):
- model = data.get('model',False)
- if model:
- model_id =model_pool.search(cr,uid,[('model','=',model)])
- if model_id:
- res[data.get('id')] = model_id[0]
- else:
- res[data.get('id')] = False
- return res
+ def _model_get(self, cr, uid, ids, name, arg, context):
+ res = {}
+ model_pool = self.pool.get('ir.model')
+ for data in self.read(cr,uid,ids,['model']):
+ model = data.get('model',False)
+ if model:
+ model_id =model_pool.search(cr,uid,[('model','=',model)])
+ if model_id:
+ res[data.get('id')] = model_id[0]
+ else:
+ res[data.get('id')] = False
+ return res
- def _model_search(self, cr, uid, obj, name, args):
- if not len(args):
- return []
- model_id= args[0][2]
- if not model_id:
- return []
- model = self.pool.get('ir.model').read(cr,uid,[model_id])[0]['model']
- report_id = self.search(cr,uid,[('model','=',model)])
- if not report_id:
- return [('id','=','0')]
- return [('id','in',report_id)]
+ def _model_search(self, cr, uid, obj, name, args):
+ if not len(args):
+ return []
+ model_id= args[0][2]
+ if not model_id:
+ return []
+ model = self.pool.get('ir.model').read(cr,uid,[model_id])[0]['model']
+ report_id = self.search(cr,uid,[('model','=',model)])
+ if not report_id:
+ return [('id','=','0')]
+ return [('id','in',report_id)]
- _columns={
- 'model_id' : fields.function(_model_get,fnct_search=_model_search,method=True,string='Model Id'),
- }
+ _columns={
+ 'model_id' : fields.function(_model_get,fnct_search=_model_search,method=True,string='Model Id'),
+ }
ir_action_report_xml()
@@ -436,174 +436,174 @@ import string
def random_name():
- random.seed()
- d = [random.choice(string.letters) for x in xrange(10) ]
- name = "".join(d)
- return name
+ random.seed()
+ d = [random.choice(string.letters) for x in xrange(10) ]
+ name = "".join(d)
+ return name
def create_directory(path):
- dir_name = random_name()
- path = os.path.join(path,dir_name)
- os.mkdir(path)
- return dir_name
+ dir_name = random_name()
+ path = os.path.join(path,dir_name)
+ os.mkdir(path)
+ return dir_name
class document_file(osv.osv):
- _inherit = 'ir.attachment'
- def _data_get(self, cr, uid, ids, name, arg, context):
- result = {}
- cr.execute('select id,store_method,datas,store_fname,link from ir_attachment where id in ('+','.join(map(str,ids))+')')
- for id,m,d,r,l in cr.fetchall():
- if m=='db':
- result[id] = d
- elif m=='fs':
- try:
- path = os.path.join(os.getcwd(),'filestore')
- value = file(os.path.join(path,r), 'rb').read()
- result[id] = base64.encodestring(value)
- except:
- result[id]=''
- else:
- result[id] = ''
- return result
+ _inherit = 'ir.attachment'
+ def _data_get(self, cr, uid, ids, name, arg, context):
+ result = {}
+ cr.execute('select id,store_method,datas,store_fname,link from ir_attachment where id in ('+','.join(map(str,ids))+')')
+ for id,m,d,r,l in cr.fetchall():
+ if m=='db':
+ result[id] = d
+ elif m=='fs':
+ try:
+ path = os.path.join(os.getcwd(),'filestore')
+ value = file(os.path.join(path,r), 'rb').read()
+ result[id] = base64.encodestring(value)
+ except:
+ result[id]=''
+ else:
+ result[id] = ''
+ return result
- #
- # This code can be improved
- #
- def _data_set(self, cr, obj, id, name, value, uid=None, context={}):
- if not value:
- return True
- if (not context) or context.get('store_method','fs')=='fs':
- path = os.path.join(os.getcwd(), "filestore")
- if not os.path.isdir(path):
- os.mkdir(path)
- flag = None
- # This can be improved
- for dirs in os.listdir(path):
- if os.path.isdir(os.path.join(path,dirs)) and len(os.listdir(os.path.join(path,dirs)))<4000:
- flag = dirs
- break
- flag = flag or create_directory(path)
- filename = random_name()
- fname = os.path.join(path, flag, filename)
- fp = file(fname,'wb')
- v = base64.decodestring(value)
- fp.write(v)
- filesize = os.stat(fname).st_size
- cr.execute('update ir_attachment set store_fname=%s,store_method=%s,file_size=%d where id=%d', (os.path.join(flag,filename),'fs',len(v),id))
- else:
- cr.execute('update ir_attachment set datas=%s,store_method=%s where id=%d', (psycopg.Binary(value),'db',id))
- return True
+ #
+ # This code can be improved
+ #
+ def _data_set(self, cr, obj, id, name, value, uid=None, context={}):
+ if not value:
+ return True
+ if (not context) or context.get('store_method','fs')=='fs':
+ path = os.path.join(os.getcwd(), "filestore")
+ if not os.path.isdir(path):
+ os.mkdir(path)
+ flag = None
+ # This can be improved
+ for dirs in os.listdir(path):
+ if os.path.isdir(os.path.join(path,dirs)) and len(os.listdir(os.path.join(path,dirs)))<4000:
+ flag = dirs
+ break
+ flag = flag or create_directory(path)
+ filename = random_name()
+ fname = os.path.join(path, flag, filename)
+ fp = file(fname,'wb')
+ v = base64.decodestring(value)
+ fp.write(v)
+ filesize = os.stat(fname).st_size
+ cr.execute('update ir_attachment set store_fname=%s,store_method=%s,file_size=%d where id=%d', (os.path.join(flag,filename),'fs',len(v),id))
+ else:
+ cr.execute('update ir_attachment set datas=%s,store_method=%s where id=%d', (psycopg.Binary(value),'db',id))
+ return True
- _columns = {
- 'user_id': fields.many2one('res.users', 'Owner', select=1),
- 'group_ids': fields.many2many('res.groups', 'document_directory_group_rel', 'item_id', 'group_id', 'Groups'),
- 'parent_id': fields.many2one('document.directory', 'Directory', select=1),
- 'file_size': fields.integer('File Size', required=True),
- 'file_type': fields.char('Content Type', size=32),
- 'index_content': fields.text('Indexed Content'),
- 'write_date': fields.datetime('Date Modified', readonly=True),
- 'write_uid': fields.many2one('res.users', 'Last Modification User', readonly=True),
- 'create_date': fields.datetime('Date Created', readonly=True),
- 'create_uid': fields.many2one('res.users', 'Creator', readonly=True),
- 'store_method': fields.selection([('db','Database'),('fs','Filesystem'),('link','Link')], "Storing Method"),
- 'datas': fields.function(_data_get,method=True,store=True,fnct_inv=_data_set,string='File Content',type="binary"),
- 'store_fname': fields.char('Stored Filename', size=200),
- 'res_model': fields.char('Attached Model', size=64), #res_model
- 'res_id': fields.integer('Attached ID'), #res_id
- 'partner_id':fields.many2one('res.partner', 'Partner', select=1),
- 'title': fields.char('Resource Title',size=64),
- }
+ _columns = {
+ 'user_id': fields.many2one('res.users', 'Owner', select=1),
+ 'group_ids': fields.many2many('res.groups', 'document_directory_group_rel', 'item_id', 'group_id', 'Groups'),
+ 'parent_id': fields.many2one('document.directory', 'Directory', select=1),
+ 'file_size': fields.integer('File Size', required=True),
+ 'file_type': fields.char('Content Type', size=32),
+ 'index_content': fields.text('Indexed Content'),
+ 'write_date': fields.datetime('Date Modified', readonly=True),
+ 'write_uid': fields.many2one('res.users', 'Last Modification User', readonly=True),
+ 'create_date': fields.datetime('Date Created', readonly=True),
+ 'create_uid': fields.many2one('res.users', 'Creator', readonly=True),
+ 'store_method': fields.selection([('db','Database'),('fs','Filesystem'),('link','Link')], "Storing Method"),
+ 'datas': fields.function(_data_get,method=True,store=True,fnct_inv=_data_set,string='File Content',type="binary"),
+ 'store_fname': fields.char('Stored Filename', size=200),
+ 'res_model': fields.char('Attached Model', size=64), #res_model
+ 'res_id': fields.integer('Attached ID'), #res_id
+ 'partner_id':fields.many2one('res.partner', 'Partner', select=1),
+ 'title': fields.char('Resource Title',size=64),
+ }
- _defaults = {
- 'user_id': lambda self,cr,uid,ctx:uid,
- 'file_size': lambda self,cr,uid,ctx:0,
- 'store_method': lambda *args: 'db'
- }
- _sql_constraints = [
- ('filename_uniq', 'unique (name,parent_id,res_id,res_model)', 'The file name must be unique !')
- ]
+ _defaults = {
+ 'user_id': lambda self,cr,uid,ctx:uid,
+ 'file_size': lambda self,cr,uid,ctx:0,
+ 'store_method': lambda *args: 'db'
+ }
+ _sql_constraints = [
+ ('filename_uniq', 'unique (name,parent_id,res_id,res_model)', 'The file name must be unique !')
+ ]
- def _check_duplication(self, cr, uid,vals):
- if 'name' in vals:
- res=self.search(cr,uid,[('name','=',vals['name']),('parent_id','=','parent_id' in vals and vals['parent_id'] or False),('res_id','=','res_id' in vals and vals['res_id'] or False),('res_model','=','res_model' in vals and vals['res_model']) or False])
- if len(res):
- return False
- return True
+ def _check_duplication(self, cr, uid,vals):
+ if 'name' in vals:
+ res=self.search(cr,uid,[('name','=',vals['name']),('parent_id','=','parent_id' in vals and vals['parent_id'] or False),('res_id','=','res_id' in vals and vals['res_id'] or False),('res_model','=','res_model' in vals and vals['res_model']) or False])
+ if len(res):
+ return False
+ return True
- def write(self, cr, uid, ids, vals, context=None):
- if not self._check_duplication(cr,uid,vals):
- raise except_orm('ValidateError', 'File name must be unique!')
- result = super(document_file,self).write(cr,uid,ids,vals,context=context)
- try:
- for f in self.browse(cr, uid, ids, context=context):
- if 'datas' not in vals:
- vals['datas']=f.datas
- res = content_index(base64.decodestring(vals['datas']), f.datas_fname, f.file_type or None)
- super(document_file,self).write(cr, uid, ids, {
- 'index_content': res
- })
- except:
- pass
- return result
+ def write(self, cr, uid, ids, vals, context=None):
+ if not self._check_duplication(cr,uid,vals):
+ raise except_orm('ValidateError', 'File name must be unique!')
+ result = super(document_file,self).write(cr,uid,ids,vals,context=context)
+ try:
+ for f in self.browse(cr, uid, ids, context=context):
+ if 'datas' not in vals:
+ vals['datas']=f.datas
+ res = content_index(base64.decodestring(vals['datas']), f.datas_fname, f.file_type or None)
+ super(document_file,self).write(cr, uid, ids, {
+ 'index_content': res
+ })
+ except:
+ pass
+ return result
- def create(self, cr, uid, vals, context={}):
- vals['title']=vals['name']
- if vals.get('res_id', False) and vals.get('res_model',False):
- obj_model=self.pool.get(vals['res_model'])
- result = obj_model.read(cr, uid, [vals['res_id']], context=context)
- if len(result):
- obj=result[0]
- vals['title'] = (obj['name'] or '')[:60]
- if obj_model._name=='res.partner':
- vals['partner_id']=obj['id']
- elif 'address_id' in obj:
- address=self.pool.get('res.partner.address').read(cr,uid,[obj['address_id']],context=context)
- if len(address):
- vals['partner_id']=address[0]['partner_id'] or False
- elif 'partner_id' in obj:
- if isinstance(obj['partner_id'],tuple) or isinstance(obj['partner_id'],list):
- vals['partner_id']=obj['partner_id'][0]
- else:
- vals['partner_id']=obj['partner_id']
+ def create(self, cr, uid, vals, context={}):
+ vals['title']=vals['name']
+ if vals.get('res_id', False) and vals.get('res_model',False):
+ obj_model=self.pool.get(vals['res_model'])
+ result = obj_model.read(cr, uid, [vals['res_id']], context=context)
+ if len(result):
+ obj=result[0]
+ vals['title'] = (obj['name'] or '')[:60]
+ if obj_model._name=='res.partner':
+ vals['partner_id']=obj['id']
+ elif 'address_id' in obj:
+ address=self.pool.get('res.partner.address').read(cr,uid,[obj['address_id']],context=context)
+ if len(address):
+ vals['partner_id']=address[0]['partner_id'] or False
+ elif 'partner_id' in obj:
+ if isinstance(obj['partner_id'],tuple) or isinstance(obj['partner_id'],list):
+ vals['partner_id']=obj['partner_id'][0]
+ else:
+ vals['partner_id']=obj['partner_id']
- datas=None
- if 'datas' not in vals:
- import urllib
- datas=base64.encodestring(urllib.urlopen(vals['link']).read())
- else:
- datas=vals['datas']
- vals['file_size']= len(datas)
- if not self._check_duplication(cr,uid,vals):
- raise except_orm('ValidateError', 'File name must be unique!')
- result = super(document_file,self).create(cr, uid, vals, context)
- cr.commit()
- try:
- res = content_index(base64.decodestring(datas), vals['datas_fname'], vals.get('content_type', None))
- super(document_file,self).write(cr, uid, [result], {
- 'index_content': res,
- })
- cr.commit()
- except:
- pass
- return result
+ datas=None
+ if 'datas' not in vals:
+ import urllib
+ datas=base64.encodestring(urllib.urlopen(vals['link']).read())
+ else:
+ datas=vals['datas']
+ vals['file_size']= len(datas)
+ if not self._check_duplication(cr,uid,vals):
+ raise except_orm('ValidateError', 'File name must be unique!')
+ result = super(document_file,self).create(cr, uid, vals, context)
+ cr.commit()
+ try:
+ res = content_index(base64.decodestring(datas), vals['datas_fname'], vals.get('content_type', None))
+ super(document_file,self).write(cr, uid, [result], {
+ 'index_content': res,
+ })
+ cr.commit()
+ except:
+ pass
+ return result
- def unlink(self,cr, uid, ids, context={}):
- for f in self.browse(cr, uid, ids, context):
- if f.store_method=='fs':
- try:
- path = os.path.join(os.getcwd(),'filestore',f.store_fname)
- os.unlink(path)
- except:
- pass
- return super(document_file, self).unlink(cr, uid, ids, context)
+ def unlink(self,cr, uid, ids, context={}):
+ for f in self.browse(cr, uid, ids, context):
+ if f.store_method=='fs':
+ try:
+ path = os.path.join(os.getcwd(),'filestore',f.store_fname)
+ os.unlink(path)
+ except:
+ pass
+ return super(document_file, self).unlink(cr, uid, ids, context)
document_file()
class document_configuration_wizard(osv.osv_memory):
_name='document.configuration.wizard'
_rec_name = 'Auto Directory configuration'
_columns = {
- }
+ }
def action_cancel(self,cr,uid,ids,conect=None):
return {
'view_type': 'form',
@@ -614,51 +614,51 @@ class document_configuration_wizard(osv.osv_memory):
}
def action_config(self, cr, uid, ids, context=None):
- obj=self.pool.get('document.directory')
- search_ids=obj.search(cr,uid,[])
- browse_lst=obj.browse(cr,uid,search_ids)
- model_obj=self.pool.get('ir.model')
+ obj=self.pool.get('document.directory')
+ search_ids=obj.search(cr,uid,[])
+ browse_lst=obj.browse(cr,uid,search_ids)
+ model_obj=self.pool.get('ir.model')
- for doc_obj in browse_lst:
- if doc_obj.name in ('Partner','Contacts','Personnal Folders','Partner Category','Sales Order','All Sales Order','Sales by Salesman','Projects'):
- res={}
- id=[]
- if doc_obj.name=='Partner':
- id=model_obj.search(cr,uid,[('model','=','res.partner')])
+ for doc_obj in browse_lst:
+ if doc_obj.name in ('Partner','Contacts','Personnal Folders','Partner Category','Sales Order','All Sales Order','Sales by Salesman','Projects'):
+ res={}
+ id=[]
+ if doc_obj.name=='Partner':
+ id=model_obj.search(cr,uid,[('model','=','res.partner')])
- if doc_obj.name=='Contacts':
- id=model_obj.search(cr,uid,[('model','=','res.partner.address')])
+ if doc_obj.name=='Contacts':
+ id=model_obj.search(cr,uid,[('model','=','res.partner.address')])
- if doc_obj.name=='Partner Category':
- id=model_obj.search(cr,uid,[('model','=','res.partner.category')])
+ if doc_obj.name=='Partner Category':
+ id=model_obj.search(cr,uid,[('model','=','res.partner.category')])
- if doc_obj.name=='All Sales Order':
- val={}
- id=model_obj.search(cr,uid,[('model','=','sale.order')])
- if not len(doc_obj.content_ids):
- val['name']='Sale Report'
- val['suffix']='_report'
- val['report_id']=self.pool.get('ir.actions.report.xml').search(cr,uid,[('report_name','=','sale.order')])[0]
- val['extension']='.pdf'
- val['directory_id']=doc_obj.id
- self.pool.get('document.directory.content').create(cr,uid,val)
+ if doc_obj.name=='All Sales Order':
+ val={}
+ id=model_obj.search(cr,uid,[('model','=','sale.order')])
+ if id and not len(doc_obj.content_ids):
+ val['name']='Sale Report'
+ val['suffix']='_report'
+ val['report_id']=self.pool.get('ir.actions.report.xml').search(cr,uid,[('report_name','=','sale.order')])[0]
+ val['extension']='.pdf'
+ val['directory_id']=doc_obj.id
+ self.pool.get('document.directory.content').create(cr,uid,val)
- if doc_obj.name=='Sales by Salesman':
- id=model_obj.search(cr,uid,[('model','=','res.users')])
+ if doc_obj.name=='Sales by Salesman':
+ id=model_obj.search(cr,uid,[('model','=','res.users')])
- if doc_obj.name=='Personnal Folders':
- id=model_obj.search(cr,uid,[('model','=','res.users')])
+ if doc_obj.name=='Personnal Folders':
+ id=model_obj.search(cr,uid,[('model','=','res.users')])
- if doc_obj.name=='Projects':
- id=model_obj.search(cr,uid,[('model','=','account.analytic.account')])
- res['ressource_tree']=True
+ if doc_obj.name=='Projects':
+ id=model_obj.search(cr,uid,[('model','=','account.analytic.account')])
+ res['ressource_tree']=True
- if id:
- res['ressource_type_id']=id[0]
- res['type']='ressource'
- obj.write(cr,uid,doc_obj.id,res)
- self.create_folder(cr, uid, ids, context=None)
- return {
+ if id:
+ res['ressource_type_id']=id[0]
+ res['type']='ressource'
+ obj.write(cr,uid,doc_obj.id,res)
+ self.create_folder(cr, uid, ids, context=None)
+ return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
@@ -667,26 +667,26 @@ class document_configuration_wizard(osv.osv_memory):
}
def create_folder(self, cr, uid, ids, context=None):
- doc_obj=self.pool.get('document.directory')
- model_obj=self.pool.get('ir.model')
- for name in ('Sales','Quotation','Meetings','Analysis Reports'):
- res={}
- if name=='Sales':
- child_model=model_obj.search(cr,uid,[('model','=','sale.order')])
- link_model=model_obj.search(cr,uid,[('model','=','res.users')])
- if child_model:
- res['type']='ressource'
- res['ressource_type_id']=child_model[0]
- res['ressource_parent_type_id']=link_model[0]
- res['domain']="[('user_id','=',active_id)]"
- else:
- link_model=model_obj.search(cr,uid,[('model','=','account.analytic.account')])
- if link_model:
- res['ressource_parent_type_id']=link_model[0]
- res['ressource_id']=0
- if res:
- res['name']=name
- doc_obj.create(cr,uid,res)
- return True
+ doc_obj=self.pool.get('document.directory')
+ model_obj=self.pool.get('ir.model')
+ for name in ('Sales','Quotation','Meetings','Analysis Reports'):
+ res={}
+ if name=='Sales':
+ child_model=model_obj.search(cr,uid,[('model','=','sale.order')])
+ link_model=model_obj.search(cr,uid,[('model','=','res.users')])
+ if child_model:
+ res['type']='ressource'
+ res['ressource_type_id']=child_model[0]
+ res['ressource_parent_type_id']=link_model[0]
+ res['domain']="[('user_id','=',active_id)]"
+ else:
+ link_model=model_obj.search(cr,uid,[('model','=','account.analytic.account')])
+ if link_model:
+ res['ressource_parent_type_id']=link_model[0]
+ res['ressource_id']=0
+ if res:
+ res['name']=name
+ doc_obj.create(cr,uid,res)
+ return True
document_configuration_wizard()
diff --git a/addons/document/document_demo.xml b/addons/document/document_demo.xml
index 94c52923556..51f7c1089e2 100644
--- a/addons/document/document_demo.xml
+++ b/addons/document/document_demo.xml
@@ -5,7 +5,7 @@
Main Repository
-
+
@@ -13,7 +13,7 @@
My Folder
-
+
@@ -23,7 +23,7 @@
1
-
+
@@ -35,7 +35,7 @@
-
+
@@ -45,48 +45,48 @@
-
+
My Folder
-
+
Personnal Folders
-
+
Sales Order
-
+
All Sales Order
-
+
Sales by Salesman
-
+
Projects
-
+
diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml
index 6e947f3f800..6b15382af63 100644
--- a/addons/document/document_view.xml
+++ b/addons/document/document_view.xml
@@ -67,11 +67,13 @@
document.directory
form
tree,form
-
+
+
+ id="menu_document_directories"
+ parent="menu_document_configuration"/>
ir.actions.act_window
@@ -80,9 +82,10 @@
[('ressource_parent_type_id','=',False),('parent_id','=',False)]
+ id="menu_document_directories_tree"
+ parent="menu_document"/>
@@ -141,9 +144,10 @@
form
+ id="menu_document_files"
+ parent="menu_document"/>
ir.actions.act_window
diff --git a/addons/document/process/document_process.xml b/addons/document/process/document_process.xml
new file mode 100644
index 00000000000..3c37c793ab4
--- /dev/null
+++ b/addons/document/process/document_process.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/document/security/document_security.xml b/addons/document/security/document_security.xml
new file mode 100644
index 00000000000..4cef19d31ed
--- /dev/null
+++ b/addons/document/security/document_security.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ Document / Manager
+
+
+
+
+
+
diff --git a/addons/document/security/ir.model.access.csv b/addons/document/security/ir.model.access.csv
new file mode 100644
index 00000000000..dfe882e49d8
--- /dev/null
+++ b/addons/document/security/ir.model.access.csv
@@ -0,0 +1,9 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_document_directory_all","document.directory all","model_document_directory",,1,0,0,0
+"access_document_directory_group_document_manager","document.directory document manager","model_document_directory","group_document_manager",1,1,1,1
+"access_document_directory_group_system","document.directory group system","model_document_directory","base.group_system",1,1,1,1
+"access_document_directory_content_all","document.directory.content all","model_document_directory_content",,1,0,0,0
+"access_document_directory_content_group_document_manager","document.directory.content document manager","model_document_directory_content","group_document_manager",1,1,1,1
+"access_document_directory_content_group_system","document.directory.content group system","model_document_directory_content","base.group_system",1,1,1,1
+"access_document_configuation_wizard","document.configuration.wizard document manager","model_document_configuration_wizard","group_document_manager",1,1,1,1
+"access_document_configuation_wizard_sytem","document.configuration.wizard group system","model_document_configuration_wizard","base.group_system",1,1,1,1
diff --git a/addons/event/__terp__.py b/addons/event/__terp__.py
index 9fd8dec7f09..705108fd7cb 100644
--- a/addons/event/__terp__.py
+++ b/addons/event/__terp__.py
@@ -24,8 +24,11 @@
"demo_xml" : ["event_demo.xml"],
"init_xml" : ["event_data.xml"],
"update_xml" : [
+ "event_wizard.xml",
+ "event_view.xml",
+ "event_sequence.xml",
+ "security/event_security.xml",
"security/ir.model.access.csv",
- "event_wizard.xml","event_view.xml","event_sequence.xml"
],
"active" : False,
"installable" : True,
diff --git a/addons/event/security/event_security.xml b/addons/event/security/event_security.xml
new file mode 100644
index 00000000000..db731e1ccd3
--- /dev/null
+++ b/addons/event/security/event_security.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
diff --git a/addons/event/security/ir.model.access.csv b/addons/event/security/ir.model.access.csv
index e7668f30c38..e38e82ef27c 100644
--- a/addons/event/security/ir.model.access.csv
+++ b/addons/event/security/ir.model.access.csv
@@ -1,6 +1,8 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_event_type,event.type,model_event_type,crm.group_crm_user,1,1,1,1
-access_event_event,event.event,model_event_event,crm.group_crm_user,1,1,1,1
-access_event_registration,event.registration,model_event_registration,crm.group_crm_user,1,1,1,1
-access_report_event_registration,report.event.registration,model_report_event_registration,crm.group_crm_user,1,1,1,1
-access_report_event_type_registration,report.event.type.registration,model_report_event_type_registration,crm.group_crm_user,1,1,1,1
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_event_type","event.type","model_event_type","crm.group_crm_user",1,0,0,0
+"access_event_type_manager","event.type manager","model_event_type","crm.group_crm_manager",1,1,1,1
+"access_event_event","event.event","model_event_event","crm.group_crm_user",1,1,1,1
+"access_event_registration","event.registration","model_event_registration","crm.group_crm_user",1,1,1,1
+"access_report_event_registration","report.event.registration","model_report_event_registration","crm.group_crm_user",1,0,0,0
+"access_report_event_type_registration","report.event.type.registration","model_report_event_type_registration","crm.group_crm_user",1,0,0,0
+"access_project_project_crm_user","project.project crm user","project.model_project_project","crm.group_crm_user",1,0,0,0
diff --git a/addons/hr/__terp__.py b/addons/hr/__terp__.py
index 7da1af96772..1e5c9ff7e12 100644
--- a/addons/hr/__terp__.py
+++ b/addons/hr/__terp__.py
@@ -40,7 +40,7 @@
Different reports are also provided, mainly for attendance statistics.
""",
- "depends" : ["base", "process"],
+ "depends" : ["base", "crm_configuration", "process"],
"init_xml" : [],
"demo_xml" : [
"hr_demo.xml",
@@ -52,6 +52,7 @@
"hr_view.xml",
"hr_wizard.xml",
"hr_department_view.xml",
+ "process/hr_process.xml"
],
"active": False,
"installable": True
diff --git a/addons/hr/process/hr_process.xml b/addons/hr/process/hr_process.xml
new file mode 100644
index 00000000000..bfb0ad21f2a
--- /dev/null
+++ b/addons/hr/process/hr_process.xml
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr/security/ir.model.access.csv b/addons/hr/security/ir.model.access.csv
index 743cbce21c2..d6e8f812590 100644
--- a/addons/hr/security/ir.model.access.csv
+++ b/addons/hr/security/ir.model.access.csv
@@ -1,9 +1,10 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_hr_timesheet_group,hr.timesheet.group,model_hr_timesheet_group,hr.group_hr_user,1,0,0,0
-access_hr_employee_category,hr.employee.category,model_hr_employee_category,hr.group_hr_user,1,0,0,0
-access_hr_employee,hr.employee,model_hr_employee,hr.group_hr_user,1,1,1,1
-access_hr_timesheet,hr.timesheet,model_hr_timesheet,hr.group_hr_user,1,1,1,1
-access_hr_department,hr.department,model_hr_department,hr.group_hr_user,1,0,0,0
-access_hr_timesheet_group_manager,hr.timesheet.group.manager,model_hr_timesheet_group,hr.group_hr_manager,1,1,1,1
-access_hr_employee_category_manager,hr.employee.category.manager,model_hr_employee_category,hr.group_hr_manager,1,1,1,1
-access_hr_department_manager,hr.department.manager,model_hr_department,hr.group_hr_manager,1,1,1,1
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_hr_timesheet_group","hr.timesheet.group","model_hr_timesheet_group","hr.group_hr_user",1,0,0,0
+"access_hr_employee_category","hr.employee.category","model_hr_employee_category","hr.group_hr_user",1,0,0,0
+"access_hr_employee","hr.employee","model_hr_employee","hr.group_hr_user",1,1,1,1
+"access_hr_timesheet_manager","hr.timesheet manager","model_hr_timesheet","hr.group_hr_manager",1,1,1,1
+"access_hr_timesheet","hr.timesheet","model_hr_timesheet","hr.group_hr_user",1,1,1,1
+"access_hr_department","hr.department","model_hr_department","hr.group_hr_user",1,0,0,0
+"access_hr_timesheet_group_manager","hr.timesheet.group.manager","model_hr_timesheet_group","hr.group_hr_manager",1,1,1,1
+"access_hr_employee_category_manager","hr.employee.category.manager","model_hr_employee_category","hr.group_hr_manager",1,1,1,1
+"access_hr_department_manager","hr.department.manager","model_hr_department","hr.group_hr_manager",1,1,1,1
diff --git a/addons/hr_attendance/__terp__.py b/addons/hr_attendance/__terp__.py
index 0dd9eff1013..c6a6162bcf9 100644
--- a/addons/hr_attendance/__terp__.py
+++ b/addons/hr_attendance/__terp__.py
@@ -9,7 +9,8 @@
"update_xml" : [
"hr_attendance_view.xml",
"hr_attendance_wizard.xml",
- "hr_attendance_report.xml"
+ "hr_attendance_report.xml",
+ "security/ir.model.access.csv",
],
"active": False,
"installable": True,
diff --git a/addons/hr_attendance/security/ir.model.access.csv b/addons/hr_attendance/security/ir.model.access.csv
new file mode 100644
index 00000000000..b96c0e6be0d
--- /dev/null
+++ b/addons/hr_attendance/security/ir.model.access.csv
@@ -0,0 +1,3 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_hr_action_reason_employee","hr action reason employee","model_hr_action_reason","hr.group_hr_user",1,1,1,1
+"access_hr_attendance_employee","hr attendance employee","model_hr_attendance","hr.group_hr_user",1,1,1,1
diff --git a/addons/hr_contract/__terp__.py b/addons/hr_contract/__terp__.py
index a03f8140f72..c07e6c55a5a 100644
--- a/addons/hr_contract/__terp__.py
+++ b/addons/hr_contract/__terp__.py
@@ -46,7 +46,7 @@
"demo_xml" : [],
"update_xml" : [
"security/hr_contract_security.xml",
-# "security/ir.model.access.csv",
+ "security/ir.model.access.csv",
"hr_contract_view.xml",
],
"active": False,
diff --git a/addons/hr_contract/security/ir.model.access.csv b/addons/hr_contract/security/ir.model.access.csv
index a9a7e3d5219..053b5c42ecd 100644
--- a/addons/hr_contract/security/ir.model.access.csv
+++ b/addons/hr_contract/security/ir.model.access.csv
@@ -1,5 +1,11 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_hr_employee_marital_status,hr.employee.marital.status,model_hr_employee_marital_status,hr.group_hr_user,1,1,1,1
-access_hr_contract_wage_type_period,hr.contract.wage.type.period,model_hr_contract_wage_type_period,hr.group_hr_manager,1,1,1,1
-access_hr_contract_wage_type,hr.contract.wage.type,model_hr_contract_wage_type,hr.group_hr_manager,1,1,1,1
-access_hr_contract,hr.contract,model_hr_contract,group_hr_contract,1,1,1,1
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_hr_employee_marital_status","hr.employee.marital.status","model_hr_employee_marital_status","hr.group_hr_user",1,1,1,1
+"access_hr_contract_wage_type_period_user","hr.contract.wage.type.period user","model_hr_contract_wage_type_period","hr.group_hr_user",1,0,0,0
+"access_hr_contract_wage_type_period","hr.contract.wage.type.period","model_hr_contract_wage_type_period","hr.group_hr_manager",1,1,1,1
+"access_hr_contract_wage_type_user","hr.contract.wage.type user","model_hr_contract_wage_type","hr.group_hr_user",1,0,0,0
+"access_hr_contract_wage_type","hr.contract.wage.type","model_hr_contract_wage_type","hr.group_hr_manager",1,1,1,1
+"access_hr_contract_wage_type_contract","hr.contract.wage.type contract","model_hr_contract_wage_type","group_hr_contract",1,1,1,1
+"access_hr_contract_wage_type_period_contract","hr.contract.wage.type.period contract","model_hr_contract_wage_type_period","group_hr_contract",1,1,1,1
+"access_hr_contract_user","hr.contract user","model_hr_contract","hr.group_hr_user",1,0,0,0
+"access_hr_contract","hr.contract","model_hr_contract","group_hr_contract",1,1,1,1
+"access_hr_employee_contract","hr.employee contract","hr.model_hr_employee","group_hr_contract",1,0,0,0
diff --git a/addons/hr_expense/report/expense.rml b/addons/hr_expense/report/expense.rml
index 7ab564bf011..82321f43dec 100644
--- a/addons/hr_expense/report/expense.rml
+++ b/addons/hr_expense/report/expense.rml
@@ -59,6 +59,14 @@
+
+
+
+
+
+
+
+
@@ -104,6 +112,7 @@
+
@@ -201,6 +210,46 @@
[[ company.currency_id.name ]]
+
+
+
+
+
+
+
+ [[ format(line.analytic_account and line.analytic_account.complete_name or removeParentNode('tr')) ]]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -248,4 +297,4 @@
This document must be dated and signed for reimbursment
-
+
\ No newline at end of file
diff --git a/addons/hr_expense/security/ir.model.access.csv b/addons/hr_expense/security/ir.model.access.csv
index ea8c924ddb6..aa00dab4fa1 100644
--- a/addons/hr_expense/security/ir.model.access.csv
+++ b/addons/hr_expense/security/ir.model.access.csv
@@ -1,3 +1,3 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_hr_expense_expense,hr.expense.expense,model_hr_expense_expense,base.group_user,1,1,1,1
-access_hr_expense_line,hr.expense.line,model_hr_expense_line,base.group_user,1,1,1,1
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_hr_expense_expense","hr.expense.expense","model_hr_expense_expense","hr.group_hr_user",1,1,1,1
+"access_hr_expense_line","hr.expense.line","model_hr_expense_line","hr.group_hr_user",1,1,1,1
diff --git a/addons/hr_holidays/__terp__.py b/addons/hr_holidays/__terp__.py
index 6f3188d6acf..982b5624c19 100644
--- a/addons/hr_holidays/__terp__.py
+++ b/addons/hr_holidays/__terp__.py
@@ -32,7 +32,7 @@
"hr_view.xml",
"hr_holidays_report.xml",
"hr_holidays_wizard.xml",
-# "process/hr_holidays_process.xml"
+ "process/hr_holidays_process.xml"
],
# "demo_xml" : ["hr_bel_holidays_2008.xml",],
"demo_xml" : [],
diff --git a/addons/hr_holidays/hr_holidays_report.xml b/addons/hr_holidays/hr_holidays_report.xml
index 85c4f69649e..2d89b467c26 100644
--- a/addons/hr_holidays/hr_holidays_report.xml
+++ b/addons/hr_holidays/hr_holidays_report.xml
@@ -9,17 +9,6 @@
auto="False"
menu="False"/>
-
-
+
diff --git a/addons/hr_holidays/hr_holidays_wizard.xml b/addons/hr_holidays/hr_holidays_wizard.xml
index 325768afbef..475da254cdf 100644
--- a/addons/hr_holidays/hr_holidays_wizard.xml
+++ b/addons/hr_holidays/hr_holidays_wizard.xml
@@ -10,6 +10,11 @@
type="wizard"
id="menu_holidays_summary"/>
+
+
+
diff --git a/addons/hr_holidays/process/hr_holidays_process.xml b/addons/hr_holidays/process/hr_holidays_process.xml
new file mode 100644
index 00000000000..4cbddc9c423
--- /dev/null
+++ b/addons/hr_holidays/process/hr_holidays_process.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_holidays/security/ir.model.access.csv b/addons/hr_holidays/security/ir.model.access.csv
index 69619dde43d..b095b8bf50d 100644
--- a/addons/hr_holidays/security/ir.model.access.csv
+++ b/addons/hr_holidays/security/ir.model.access.csv
@@ -1,2 +1,4 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_hr_holidays_per_user,hr.holidays.per.user,model_hr_holidays_per_user,base.group_user,1,1,1,1
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_hr_holidays_per_user","hr.holidays.per.user","model_hr_holidays_per_user","hr.group_hr_user",1,1,1,1
+"access_hr_holydays_status_user","hr.holidays.status user","model_hr_holidays_status","hr.group_hr_user",1,1,1,1
+"access_hr_holidays_user","hr holidays user","model_hr_holidays","hr.group_hr_user",1,1,1,1
diff --git a/addons/hr_timesheet/hr_timesheet.py b/addons/hr_timesheet/hr_timesheet.py
index 6c26b7f1c6b..143c384e1fd 100644
--- a/addons/hr_timesheet/hr_timesheet.py
+++ b/addons/hr_timesheet/hr_timesheet.py
@@ -122,9 +122,12 @@ class hr_analytic_timesheet(osv.osv):
res = super(hr_analytic_timesheet, self).create(cr, uid, vals, context)
return res
except Exception,e:
- if 'journal_id' in e.args[0]:
+ if '"journal_id" viol' in e.args[0]:
raise except_orm(_('ValidateError'),
_('No analytic journal available for this employee.\nDefine an employee for the selected user and assign an analytic journal.'))
+ elif '"account_id" viol' in e.args[0]:
+ raise except_orm(_('ValidateError'),
+ _('No analytic account defined on the project.\nPlease set one or we can not automatically fill the timesheet.'))
else:
raise
diff --git a/addons/hr_timesheet/security/ir.model.access.csv b/addons/hr_timesheet/security/ir.model.access.csv
index 6a9a08f28c0..a718d2bd4ae 100644
--- a/addons/hr_timesheet/security/ir.model.access.csv
+++ b/addons/hr_timesheet/security/ir.model.access.csv
@@ -1,2 +1,2 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_hr_analytic_timesheet,hr.analytic.timesheet,model_hr_analytic_timesheet,base.group_user,1,1,1,1
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_hr_analytic_timesheet","hr.analytic.timesheet","model_hr_analytic_timesheet","hr.group_hr_user",1,1,1,1
diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_report.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_report.xml
index 2ae672635a5..794c38abc06 100644
--- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_report.xml
+++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_report.xml
@@ -1,15 +1,29 @@
-
+
-
+
-
-
-
-
+
+
+
+
+
-
+
diff --git a/addons/hr_timesheet_invoice/security/ir.model.access.csv b/addons/hr_timesheet_invoice/security/ir.model.access.csv
index f849d88fbcb..c56f26ab3ee 100644
--- a/addons/hr_timesheet_invoice/security/ir.model.access.csv
+++ b/addons/hr_timesheet_invoice/security/ir.model.access.csv
@@ -1,3 +1,3 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_hr_timesheet_invoice_factor,hr_timesheet_invoice.factor,model_hr_timesheet_invoice_factor,base.group_user,1,0,0,0
-access_hr_timesheet_invoice_factor,hr_timesheet_invoice.factor,model_hr_timesheet_invoice_factor,account.group_account_invoice,1,1,1,1
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_hr_timesheet_invoice_factor","hr_timesheet_invoice.factor","model_hr_timesheet_invoice_factor","hr.group_hr_user",1,0,0,0
+"access_hr_timesheet_invoice_factor","hr_timesheet_invoice.factor","model_hr_timesheet_invoice_factor","account.group_account_invoice",1,1,1,1
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
index fbf625be1be..7e8a9ff3887 100644
--- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
@@ -108,15 +108,7 @@ class final_invoice_create(wizard.interface):
price = 0.0
taxes = product.taxes_id
- taxep = account.partner_id.property_account_tax
- if not taxep.id:
- tax = [x.id for x in taxes or []]
- else:
- tax = [taxep.id]
- for t in taxes:
- if not t.tax_group==taxep.tax_group:
- tax.append(t.id)
-
+ tax = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id, taxes)
account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id
curr_line = {
@@ -165,15 +157,8 @@ class final_invoice_create(wizard.interface):
taxes = product.taxes_id
else:
taxes = []
- taxep = account.partner_id.property_account_tax
- if not taxep.id:
- tax = [x.id for x in taxes or []]
- else:
- tax = [taxep.id]
- for t in taxes:
- if not t.tax_group==taxep.tax_group:
- tax.append(t.id)
+ tax = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id, taxes)
curr_line = {
'price_unit': -amount,
'quantity': 1.0,
@@ -194,15 +179,7 @@ class final_invoice_create(wizard.interface):
product = pool.get('product.product').browse(cr, uid, data['form']['balance_product'], context2)
taxes = product.taxes_id
- taxep = account.partner_id.property_account_tax
- if not taxep.id:
- tax = [x.id for x in taxes or []]
- else:
- tax = [taxep.id]
- for t in taxes:
- if not t.tax_group==taxep.tax_group:
- tax.append(t.id)
-
+ tax = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id, taxes)
account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id
curr_line = {
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
index 52cb8387aa4..1e7c328f9dd 100644
--- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
@@ -113,15 +113,7 @@ class invoice_create(wizard.interface):
price = 0.0
taxes = product.taxes_id
- taxep = account.partner_id.property_account_tax
- if not taxep.id:
- tax = [x.id for x in taxes or []]
- else:
- tax = [taxep.id]
- for t in taxes:
- if not t.tax_group==taxep.tax_group:
- tax.append(t.id)
-
+ tax = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id, taxes)
account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id
curr_line = {
diff --git a/addons/hr_timesheet_project/__terp__.py b/addons/hr_timesheet_project/__terp__.py
index 06922784d56..e3c24de5ea0 100644
--- a/addons/hr_timesheet_project/__terp__.py
+++ b/addons/hr_timesheet_project/__terp__.py
@@ -34,7 +34,9 @@
"description": """Auto-complete timesheet based on tasks made on the project management module.""",
"website" : "http://tinyerp.com/module_hr.html",
"depends" : ["project", "hr_timesheet_sheet"],
- "update_xml" : ["hr_timesheet_project_view.xml", "process/hr_timesheet_project_process.xml"],
+ "update_xml" : ["hr_timesheet_project_view.xml",
+ "process/hr_timesheet_project_process.xml",
+ ],
"active": False,
"installable": True
}
diff --git a/addons/hr_timesheet_sheet/process/hr_timesheet_sheet_process.xml b/addons/hr_timesheet_sheet/process/hr_timesheet_sheet_process.xml
index 24374c2a810..6917812bedb 100644
--- a/addons/hr_timesheet_sheet/process/hr_timesheet_sheet_process.xml
+++ b/addons/hr_timesheet_sheet/process/hr_timesheet_sheet_process.xml
@@ -89,6 +89,7 @@
+
@@ -140,6 +141,14 @@
+
+
+
+
+
+
+
+
@@ -166,6 +175,7 @@
+
@@ -222,5 +232,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/hr_timesheet_sheet/security/ir.model.access.csv b/addons/hr_timesheet_sheet/security/ir.model.access.csv
index be9d927f9a4..5b7cf40a379 100644
--- a/addons/hr_timesheet_sheet/security/ir.model.access.csv
+++ b/addons/hr_timesheet_sheet/security/ir.model.access.csv
@@ -1,4 +1,4 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_hr_timesheet_sheet_sheet,hr_timesheet_sheet.sheet,model_hr_timesheet_sheet_sheet,base.group_user,1,1,1,1
-access_hr_timesheet_sheet_sheet_day,hr_timesheet_sheet.sheet.day,model_hr_timesheet_sheet_sheet_day,base.group_user,1,1,1,1
-access_hr_timesheet_sheet_sheet_account,hr_timesheet_sheet.sheet.account,model_hr_timesheet_sheet_sheet_account,base.group_user,1,1,1,1
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_hr_timesheet_sheet_sheet","hr_timesheet_sheet.sheet","model_hr_timesheet_sheet_sheet","hr.group_hr_user",1,1,1,1
+"access_hr_timesheet_sheet_sheet_day","hr_timesheet_sheet.sheet.day","model_hr_timesheet_sheet_sheet_day","hr.group_hr_user",1,1,1,1
+"access_hr_timesheet_sheet_sheet_account","hr_timesheet_sheet.sheet.account","model_hr_timesheet_sheet_sheet_account","hr.group_hr_user",1,1,1,1
diff --git a/addons/idea/__terp__.py b/addons/idea/__terp__.py
index d31ea7441e4..6d98ef5a1e8 100644
--- a/addons/idea/__terp__.py
+++ b/addons/idea/__terp__.py
@@ -6,15 +6,16 @@
"author" : "Tiny",
"website" : "http://openerp.com",
"category" : "Tools",
- "description": """This module allows your user to easily and efficiently participate in the innovation of the enterprise. It allows everybody to express ideas about different subjects. Then, others userscan comment these ideas and vote for particular ideas. Each idea as a score based on the different votes. The managers can obtain an easy view on best ideas from all the users. Once installed, check the menu 'Ideas' in the 'Tools' main menu.""",
+ "description": """This module allows your user to easily and efficiently participate in the innovation of the enterprise. It allows everybody to express ideas about different subjects. Then, others users can comment these ideas and vote for particular ideas. Each idea as a score based on the different votes. The managers can obtain an easy view on best ideas from all the users. Once installed, check the menu 'Ideas' in the 'Tools' main menu.""",
"depends" : ['base'],
"init_xml" : [ ],
"demo_xml" : [ ],
"update_xml" : [
- "security/ir.model.access.csv",
'idea_view.xml',
- 'idea_workflow.xml'
- ],
+ 'idea_workflow.xml',
+ "security/idea_security.xml",
+ "security/ir.model.access.csv",
+ ],
"installable": True
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/idea/security/idea_security.xml b/addons/idea/security/idea_security.xml
new file mode 100644
index 00000000000..522560a0bb5
--- /dev/null
+++ b/addons/idea/security/idea_security.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
diff --git a/addons/idea/security/ir.model.access b/addons/idea/security/ir.model.access
deleted file mode 100644
index f92071265ec..00000000000
--- a/addons/idea/security/ir.model.access
+++ /dev/null
@@ -1,6 +0,0 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_idea_category,idea.category,model_idea_category,base.group_system,1,1,1,1
-access_idea_idea,idea.idea,model_idea_idea,base.group_user,1,1,1,1
-access_idea_comment,idea.comment,model_idea_comment,base.group_user,1,1,1,1
-access_idea_vote,idea.vote,model_idea_vote,base.group_user,1,1,1,1
-access_idea_vote_stat,idea.vote.stat,model_idea_vote_stat,base.group_user,1,1,1,1
diff --git a/addons/idea/security/ir.model.access.csv b/addons/idea/security/ir.model.access.csv
index 4b23bfa0540..4218f118772 100644
--- a/addons/idea/security/ir.model.access.csv
+++ b/addons/idea/security/ir.model.access.csv
@@ -1,6 +1,7 @@
-id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_idea_category,idea.category,model_idea_category,base.group_user,1,0,0,0
-access_idea_idea,idea.idea,model_idea_idea,base.group_user,1,0,0,0
-access_idea_comment,idea.comment,model_idea_comment,base.group_user,1,0,0,0
-access_idea_vote,idea.vote,model_idea_vote,base.group_user,1,0,0,0
-access_idea_vote_stat,idea.vote.stat,model_idea_vote_stat,base.group_user,1,0,0,0
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_idea_category","idea.category","model_idea_category","base.group_user",1,0,0,0
+"access_idea_idea","idea.idea","model_idea_idea","base.group_user",1,1,1,1
+"access_idea_comment","idea.comment","model_idea_comment","base.group_user",1,1,1,1
+"access_idea_vote","idea.vote","model_idea_vote","base.group_user",1,1,1,1
+"access_idea_vote_stat","idea.vote.stat","model_idea_vote_stat","base.group_user",1,0,0,0
+"access_idea_category_system","idea.category system","model_idea_category","base.group_system",1,1,1,1
diff --git a/addons/l10n_be/account_pcmn_belgium.xml b/addons/l10n_be/account_pcmn_belgium.xml
index d7252313333..1951975d618 100644
--- a/addons/l10n_be/account_pcmn_belgium.xml
+++ b/addons/l10n_be/account_pcmn_belgium.xml
@@ -59,7 +59,6 @@
none
-
@@ -6434,7 +6433,7 @@
- Plan de Taxe Belge
+ Plan de Taxes Belge
I. Valeur des operations
diff --git a/addons/l10n_be/l10n_be_wizard.xml b/addons/l10n_be/l10n_be_wizard.xml
index 453c35f1685..36c8d4768b4 100644
--- a/addons/l10n_be/l10n_be_wizard.xml
+++ b/addons/l10n_be/l10n_be_wizard.xml
@@ -15,12 +15,12 @@
id="partner_wizard_vat_menu"/>
+
+ Generate Chart of Accounts from a Chart Template
+ Generate Chart of Accounts from a Chart Template. You will be asked to pass the name of the company, the chart template to follow, the no. of digits to generate the code for your accounts and Bank account, currency to create Journals. Thus,the pure copy of chart Template is generated.
+This is the same wizard that runs from Financial Managament/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template.
+
+ open
+
diff --git a/addons/l10n_fr/plan-99-03_societe.xml b/addons/l10n_fr/plan-99-03_societe.xml
index 9c60f248f1f..5f8f9a38e0e 100644
--- a/addons/l10n_fr/plan-99-03_societe.xml
+++ b/addons/l10n_fr/plan-99-03_societe.xml
@@ -19,7049 +19,7100 @@
a_expense
a_sale
-->
-
-
- Plan Comptable
+
+
+
+ Plan Comptable Général
0
view
-
+
-
+
Comptes de bilan
Classes_1_a_5
view
-
+
-
+
Comptes de capitaux
Classe_1
view
Capitaux propres, autres fonds propres, emprunts et dettes assimilées
-
+
-
+
Capital et réserves
Comptes_10
view
-
+
-
+
Capital
101000
- asset
+ other
pour sociétés (SARL, SA) : choix statuts, montage : cf site erp-libre.info
-
+
-
+
Capital souscrit - non appelé
101100
- asset
-
+ other
+
-
+
Capital souscrit - appelé non versé
101200
- asset
-
+ other
+
-
+
Capital souscrit - appelé versé
101300
- asset
-
+ other
+
-
+
Capital non amorti
101310
- asset
-
+ other
+
-
+
Capital amorti
101320
- asset
-
+ other
+
-
+
Capital souscrit soumis à des réglementations particulières
101800
- asset
-
+ other
+
-
+
Primes liées au capital social
104000
- asset
-
+ other
+
-
+
Primes d'émission
104100
- asset
-
+ other
+
-
+
Primes de fusion
104200
- asset
-
+ other
+
-
+
Primes d'apport
104300
- asset
-
+ other
+
-
+
Primes de conversion d'obligations en actions
104400
- asset
-
+ other
+
-
+
Bons de souscription d'actions
104500
- asset
-
+ other
+
-
+
Écarts de réévaluation
105000
- asset
-
+ other
+
-
+
Réserve spéciale de réévaluation
105100
- asset
-
+ other
+
-
+
Écart de réévaluation libre
105200
- asset
-
+ other
+
-
+
Réserve de réévaluation
105300
- asset
-
+ other
+
-
+
Écarts de réévaluation (autres opérations légales)
105500
- asset
-
+ other
+
-
+
Autres écarts de réévaluation en France
105700
- asset
-
+ other
+
-
+
Autres écarts de réévaluation à l'étranger
105800
- asset
-
+ other
+
-
+
Réserves
106000
- asset
-
+ other
+
-
+
Réserve légale
106100
- asset
-
+ other
+
-
+
Réserve légale proprement dite
106110
- asset
-
+ other
+
-
+
Plus-values nettes à long terme
106120
- asset
-
+ other
+
-
+
Réserves indisponibles
106200
- asset
-
+ other
+
-
+
Réserves statutaires ou contractuelles
106300
- asset
-
+ other
+
-
+
Réserves réglementées
106400
- asset
-
+ other
+
-
+
Plus-values nettes à long terme
106410
- asset
-
+ other
+
-
+
Autres réserves réglementées
106480
- asset
-
+ other
+
-
+
Autres réserves
106800
- asset
-
+ other
+
-
+
Réserve de propre assureur
106810
- asset
-
+ other
+
-
+
Réserves diverses
106880
- asset
-
+ other
+
-
+
Écarts d'équivalence
107000
- asset
-
+ other
+
-
+
Compte de l'exploitant
108000
- asset
+ other
pour les entreprises individuelles
-
+
-
+
Actionnaires: capital souscrit - non appelé
109000
- asset
-
+ other
+
-
+
Report à nouveau (solde créditeur ou débiteur)
Comptes_11
view
-
+
-
+
Report à nouveau (solde créditeur)
110000
- asset
-
+ other
+
-
+
Report à nouveau (solde débiteur)
119000
- asset
-
+ other
+
-
+
Résultat de l'exercice (bénéfice ou perte)
Comptes_12
view
-
+
-
+
Résultat de l'exercice (bénéfice)
120000
- asset
-
+ other
+
-
+
Résultat de l'exercice (perte)
129000
- asset
-
+ other
+
-
+
Subventions d'investissement
Comptes_13
view
-
+
-
+
Subventions d'équipement
131000
- asset
-
+ other
+
-
+
État
131100
- asset
-
+ other
+
-
+
Régions
131200
- asset
-
+ other
+
-
+
Départements
131300
- asset
-
+ other
+
-
+
Communes
131400
- asset
-
+ other
+
-
+
Collectivités publiques
131500
- asset
-
+ other
+
-
+
Entreprises publiques
131600
- asset
-
+ other
+
-
+
Entreprises et organismes privés
131700
- asset
-
+ other
+
-
+
Autres
131800
- asset
-
+ other
+
-
+
Autres subventions d'investissement
138000
- asset
-
+ other
+
-
+
Subventions d'investissement inscrites au compte de résultat
139000
- asset
-
+ other
+
-
+
Subventions d'équipement
139100
- asset
-
+ other
+
-
+
Etat
139110
- asset
-
+ other
+
-
+
Régions
139120
- asset
-
+ other
+
-
+
Départements
139130
- asset
-
+ other
+
-
+
Communes
139140
- asset
-
+ other
+
-
+
Collectivités publiques
139150
- asset
-
+ other
+
-
+
Entreprises publiques
139160
- asset
-
+ other
+
-
+
Entreprises et organismes privés
139170
- asset
-
+ other
+
-
+
Autres
139180
- asset
-
+ other
+
-
+
Autres subventions d'investissement
139800
- asset
-
+ other
+
-
+
Provisions réglementées
Comptes_14
view
-
+
-
+
Provisions réglementées relatives aux immobilisations
142000
- asset
-
+ other
+
-
+
Provisions reconstitution des gisements miniers et pétroliers
142300
- asset
-
+ other
+
-
+
Provisions pour investissement (participation des salariés)
142400
- asset
-
+ other
+
-
+
Provisions réglementées relatives aux stocks
143000
- asset
-
+ other
+
-
+
Hausse des prix
143100
- asset
-
+ other
+
-
+
Fluctuation des cours
143200
- asset
-
+ other
+
-
+
Provisions réglementées relatives aux autres éléments de l'actif
144000
- asset
-
+ other
+
-
+
Amortissements dérogatoires
145000
- asset
-
+ other
+
-
+
Provision spéciale de réévaluation
146000
- asset
-
+ other
+
-
+
Plus-values réinvesties
147000
- asset
-
+ other
+
-
+
Autres provisions réglementées
148000
- asset
-
+ other
+
-
+
Provisions pour risques et charges
Comptes_15
view
-
+
-
+
Provisions pour risques
151000
- asset
-
+ other
+
-
+
Provisions pour litiges
151100
- asset
-
+ other
+
-
+
Provisions pour garanties données aux clients
151200
- asset
-
-
+ other
+
-
+
Provisions pour pertes sur marchés à terme
151300
- asset
-
+ other
+
-
+
Provisions pour amendes et pénalités
151400
- asset
-
+ other
+
-
+
Provisions pour pertes de change
151500
- asset
-
+ other
+
-
+
Provisions pour pertes sur contrats
151600
- asset
-
+ other
+
-
+
Autres provisions pour risques
151800
- asset
-
+ other
+
-
+
Provisions pour pensions et obligations similaires
153000
- asset
-
+ other
+
-
+
Provisions pour restructurations
154000
- asset
-
+ other
+
-
+
Provisions pour impôts
155000
- asset
-
+ other
+
-
+
Provisions pour renouvellement des immobilisations (entreprises concessionnaires)
156000
- asset
-
+ other
+
-
+
Provisions pour charges à répartir sur plusieurs exercices
157000
- asset
-
+ other
+
-
+
Provisions pour gros entretien ou grandes révisions
157200
- asset
-
+ other
+
-
+
Autres provisions pour charges
158000
- asset
-
+ other
+
-
+
Provisions pour remises en état
158100
- asset
-
+ other
+
-
+
Emprunts et dettes assimilées
Comptes_16
view
-
+
-
+
Emprunts obligataires convertibles
161000
- dettes
-
+ other
+
-
+
Autres emprunts obligataires
163000
- dettes
-
+ other
+
-
+
Emprunts auprès des établissements de crédit
164000
- dettes
-
+ other
+
-
+
Dépôts et cautionnements reçus
165000
- dettes
-
+ other
+
-
+
Dépôts
165100
- dettes
-
+ other
+
-
+
Cautionnements
165500
- dettes
-
+ other
+
-
+
Participation des salariés aux résultats
166000
- dettes
-
+ other
+
-
+
Comptes bloqués
166100
- dettes
-
+ other
+
-
+
Fonds de participation
166200
- dettes
-
+ other
+
-
+
Emprunts et dettes assortis de conditions particulières
167000
- dettes
-
+ other
+
-
+
Emissions de titres participatifs
167100
- dettes
-
+ other
+
-
+
Avances conditionnées de l'État
167400
- dettes
-
+ other
+
-
+
Emprunts participatifs
167500
- dettes
-
+ other
+
-
+
Autres emprunts et dettes assimilées
168000
- dettes
-
+ other
+
-
+
Autres emprunts
168100
- dettes
-
+ other
+
-
+
Rentes viagères capitalisées
168500
- dettes
-
+ other
+
-
+
Autres dettes
168700
- dettes
-
+ other
+
-
+
Intérêts courus
168800
- dettes
-
+ other
+
-
+
Sur emprunts obligataires convertibles
168810
- dettes
-
+ other
+
-
+
Sur autres emprunts obligataires
168830
- dettes
-
+ other
+
-
+
Sur emprunts auprès des établissements de crédit
168840
- dettes
-
+ other
+
-
+
Sur dépôts et cautionnements reçus
168850
- dettes
-
+ other
+
-
+
Sur participation des salariés aux résultats
168860
- dettes
-
+ other
+
-
+
Sur emprunts et dettes assortis de conditions particulières
168870
- dettes
-
+ other
+
-
+
Sur autres emprunts et dettes assimilées
168880
- dettes
-
+ other
+
-
+
Primes de remboursement des obligations
169000
- dettes
-
+ other
+
-
+
Dettes rattachées à des participations
Comptes_17
view
-
+
-
+
Dettes rattachées à des participations (groupe)
171000
- dettes
-
+ other
+
-
+
Dettes rattachées à des participations (hors groupe)
174000
- dettes
-
+ other
+
-
+
Dettes rattachées à des sociétés en participation
178000
- dettes
-
+ other
+
-
+
Principal
178100
- dettes
-
+ other
+
-
+
Intérêts courus
178800
- dettes
-
+ other
+
-
+
Comptes de liaison des établissements et sociétés en participation
Comptes_18
view
-
+
-
+
Comptes de liaison des établissements
181000
- dettes
-
+ other
+
-
+
Biens et prestations de services échangés entre établissements (charges)
186000
- dettes
-
+ other
+
-
+
Biens et prestations de services échangés entre établissements (produits)
187000
- dettes
-
+ other
+
-
+
Comptes de liaison des sociétés en participation
188000
- dettes
-
+ other
+
-
+
Comptes d'immobilisations
Classe_2
view
+
Les comptes de la classe 2 regroupent les immobilisations incorporelles, les immobilisations
-
-
+
Immobilisations incorporelles
Comptes_20
view
+
corporelles, les immobilisations financières, les amortissements et provisions relatifs aux
-
-
+
Frais d'établissement
201000
- immobilisations
+ other
immobilisations.
-
+
-
+
Frais de constitution
201100
- immobilisations
-
+ other
+
-
+
Frais de premier établissement
201200
- immobilisations
-
+ other
+
-
+
Frais de prospection
201210
- immobilisations
-
+ other
+
-
+
Frais de publicité
201220
- immobilisations
-
+ other
+
-
+
Frais d'augmentation de capital et d'opérations diverses (fusions scissions transformations)
201300
- immobilisations
-
+ other
+
-
+
Frais de recherche et de développement
203000
- immobilisations
-
+ other
+
-
+
Concessions et droits similaires brevets licences marques procédés logiciels droits et valeurs similaires
205000
- immobilisations
-
+ other
+
-
+
Droit au bail
206000
- immobilisations
-
+ other
+
-
+
Fonds commercial
207000
- immobilisations
-
+ other
+
-
+
Autres immobilisations incorporelles
208000
- immobilisations
-
+ other
+
-
+
Immobilisations corporelles
Comptes_21
view
dès valeur unitaire supérieure à 500 Euros HT
-
+
-
+
Terrains
211000
- immobilisations
-
+ other
+
-
+
Terrains nus
211100
- immobilisations
-
+ other
+
-
+
Terrains aménagés
211200
- immobilisations
-
+ other
+
-
+
Sous-sols et sur-sols
211300
- immobilisations
-
+ other
+
-
+
Terrains de gisement
211400
- immobilisations
-
+ other
+
-
+
Carrières
211410
- immobilisations
-
+ other
+
-
+
Terrains bâtis
211500
- immobilisations
-
+ other
+
-
+
Ensembles immobiliers industriels (A B)
211510
- immobilisations
-
+ other
+
-
+
Ensembles immobiliers administratifs et commerciaux (A B)
211550
- immobilisations
-
+ other
+
-
+
Autres ensembles immobiliers
211580
- immobilisations
-
+ other
+
-
+
Affectés aux opérations professionnelles (A B)
211581
- immobilisations
-
+ other
+
-
+
Affectés aux opérations non professionnelles (A B)
211588
- immobilisations
-
+ other
+
-
+
Compte d'ordre sur immobilisations (art 6 du décret n° 78-737 du 11 juillet 1978)
211600
- immobilisations
-
+ other
+
-
+
Agencements et aménagements de terrains
212000
- immobilisations
-
+ other
+
-
+
Constructions
213000
- immobilisations
-
+ other
+
-
+
Bâtiments
213100
- immobilisations
-
+ other
+
-
+
Ensembles immobiliers industriels (A B)
213110
- immobilisations
-
+ other
+
-
+
Ensembles immobiliers administratifs et commerciaux (A B)
213150
- immobilisations
-
+ other
+
-
+
Autres ensembles immobiliers
213180
- immobilisations
-
+ other
+
-
+
Affectés aux opérations professionnelles (A B)
213181
- immobilisations
-
+ other
+
-
+
Affectés aux opérations non professionnelles (A B)
213188
- immobilisations
-
+ other
+
-
+
Installations générales agencements aménagements des constructions
213500
- immobilisations
-
+ other
+
-
+
Ouvrages d'infrastructure
213800
- immobilisations
-
+ other
+
-
+
Voies de terre
213810
- immobilisations
-
+ other
+
-
+
Voies de fer
213820
- immobilisations
-
+ other
+
-
+
Voies d'eau
213830
- immobilisations
-
+ other
+
-
+
Barrages
213840
- immobilisations
-
+ other
+
-
+
Pistes d'aérodromes
213850
- immobilisations
-
+ other
+
-
+
Constructions sur sol d'autrui
214000
- immobilisations
-
+ other
+
-
+
Installations techniques matériels et outillages industriels
215000
- immobilisations
-
+ other
+
-
+
Installations complexes spécialisées
215100
- immobilisations
-
+ other
+
-
+
Sur sol propre
215110
- immobilisations
-
+ other
+
-
+
Sur sol d'autrui
215140
- immobilisations
-
+ other
+
-
+
Installations à caractère spécifique
215300
- immobilisations
-
+ other
+
-
+
Sur sol propre
215310
- immobilisations
-
+ other
+
-
+
Sur sol d'autrui
215340
- immobilisations
-
+ other
+
-
+
Matériel industriel
215400
- immobilisations
-
+ other
+
-
+
Outillage industriel
215500
- immobilisations
-
+ other
+
-
+
Agencements et aménagements du matériel et outillage industriels
215700
- immobilisations
-
+ other
+
-
+
Autres immobilisations corporelles
218000
- immobilisations
-
+ other
+
-
+
Installations générales agencements aménagements divers
218100
- immobilisations
-
+ other
+
-
+
Matériel de transport
218200
- immobilisations
-
+ other
+
-
+
Matériel de bureau et matériel informatique
218300
- immobilisations
-
+ other
+
-
+
Mobilier
218400
- immobilisations
-
+ other
+
-
+
Cheptel
218500
- immobilisations
-
+ other
+
-
+
Emballages récupérables
218600
- immobilisations
-
+ other
+
-
+
Immobilisations mises en concession
Comptes_22
view
-
+
-
+
Immobilisations en cours
Comptes_23
view
-
+
-
+
Immobilisations corporelles en cours
231000
- immobilisations
-
+ other
+
-
+
Terrains
231200
- immobilisations
+ other
ne s'amortissent pas
-
+
-
+
Constructions
231300
- immobilisations
-
+ other
+
-
+
Installations techniques matériel et outillage industriels
231500
- immobilisations
-
+ other
+
-
+
Autres immobilisations corporelles
231800
- immobilisations
-
+ other
+
-
+
Immobilisations incorporelles en cours
232000
- immobilisations
-
+ other
+
-
+
Avances et acomptes versés sur immobilisations incorporelles
237000
- immobilisations
-
+ other
+
-
+
Avances et acomptes versés sur commandes d'immobilisations corporelles
238000
- immobilisations
-
+ other
+
-
+
Terrains
238200
- immobilisations
-
+ other
+
-
+
Constructions
238300
- immobilisations
-
+ other
+
-
+
Installations techniques matériel et outillage industriels
238500
- immobilisations
-
+ other
+
-
+
Autres immobilisations corporelles
238800
- immobilisations
-
+ other
+
-
+
Parts dans des entreprises liées et créances dans des entreprises liées
Comptes_25
view
-
+
-
+
Participations et créances rattachées à des participations
Comptes_26
view
-
+
-
+
Titres de participation
261000
- immobilisations
+ other
ne s'amortissent pas
-
+
-
+
Actions
261100
- immobilisations
-
+ other
+
-
+
Autres titres
261800
- immobilisations
-
+ other
+
-
+
Autres formes de participation
266000
- immobilisations
+ other
ne s'amortissent pas
-
+
-
+
Créances rattachées à des participations
267000
- immobilisations
-
+ other
+
-
+
Créances rattachées à des participations (groupe)
267100
- immobilisations
-
+ other
+
-
+
Créances rattachées à des participations (hors groupe)
267400
- immobilisations
-
+ other
+
-
+
Versements représentatifs d'apports non capitalisés (appel de fonds)
267500
- immobilisations
-
+ other
+
-
+
Avances consolidables
267600
- immobilisations
-
+ other
+
-
+
Autres créances rattachées à des participations
267700
- immobilisations
-
+ other
+
-
+
Intérêts courus
267800
- immobilisations
-
+ other
+
-
+
Créances rattachées à des sociétés en participation
268000
- immobilisations
-
+ other
+
-
+
Principal
268100
- immobilisations
-
+ other
+
-
+
Intérêts courus
268800
- immobilisations
-
+ other
+
-
+
Versements restant à effectuer sur titres de participation non libérés
269000
- immobilisations
-
+ other
+
-
+
Autres immobilisations financières
Comptes_27
view
ne s'amortissent pas
-
+
-
+
Titres immobilisés autres que les titres immobilisés de l'activité de portefeuille (droit de propriété)
271000
- immobilisations
-
+ other
+
-
+
Actions
271100
- immobilisations
-
+ other
+
-
+
Autres titres
271800
- immobilisations
-
+ other
+
-
+
Titres immobilisés (droit de créance)
272000
- immobilisations
-
+ other
+
-
+