From f3dfb5481bd5209772ace8523a53c904dda5a56f Mon Sep 17 00:00:00 2001 From: Vinay Rana Date: Mon, 29 Sep 2008 11:54:46 +0530 Subject: [PATCH 03/24] modified some chenges in invoice sxw and rml file in account module bzr revid: vinusoft85@gmail.com-20080929062446-aj0grlmuelp34ae7 --- addons/account/report/invoice.rml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/addons/account/report/invoice.rml b/addons/account/report/invoice.rml index 7b82cb44bd9..37b6872dece 100644 --- a/addons/account/report/invoice.rml +++ b/addons/account/report/invoice.rml @@ -350,9 +350,6 @@ [[ format(l.note or removeParentNode('tr')) ]] - - - @@ -466,19 +463,16 @@ - Tax + Tax - Base + Base - Amount + Amount - - - From 6a057519f8ba642319216f2cab35595f27b42680 Mon Sep 17 00:00:00 2001 From: Vinay Rana Date: Tue, 30 Sep 2008 14:18:03 +0530 Subject: [PATCH 04/24] modified account_analytic_profit.sxw and rml in hr_timesheet_invoice module bzr revid: vinusoft85@gmail.com-20080930084803-cjjtmc1g8vlzxzvq --- .../report/account_analytic_profit.rml | 343 +++++++----------- 1 file changed, 139 insertions(+), 204 deletions(-) diff --git a/addons/hr_timesheet_invoice/report/account_analytic_profit.rml b/addons/hr_timesheet_invoice/report/account_analytic_profit.rml index 0fc27c8c1a1..1e3a7972fda 100644 --- a/addons/hr_timesheet_invoice/report/account_analytic_profit.rml +++ b/addons/hr_timesheet_invoice/report/account_analytic_profit.rml @@ -10,11 +10,11 @@ - + - + @@ -28,7 +28,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -52,37 +52,37 @@ - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + - - - - - - - - @@ -92,7 +92,6 @@ - @@ -113,15 +112,18 @@ - + + + + - + - + @@ -129,240 +131,173 @@ Invoice rate by user - + - + - + - + - Period from startdate + Period from startdate - Period to enddate + Period to enddate - Currency + Currency - + - [[ data['form']['date_from'] ]] + [[ data['form']['date_from'] ]] - [[ data['form']['date_to'] ]] + [[ data['form']['date_to'] ]] - [[ company.currency_id.name ]] + [[ company.currency_id.name ]] - + - + - + - Employee + Employee or Journal Name - + Units + + + Theorical + + + Income + + + Cost + + + Profit + + + Eff. + + + + + + + + + + Totals: + + + [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] + + + - Units + [[ reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - Theorical + [[ reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - Income + [[ reduce(lambda x, y: x+y['profit'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - Cost - - - Profit - - - Eff. + [[ round(reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)/reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)* -100, 2)]] % - +
- [[ repeatIn(user_ids(lines(data['form'])), 'e') ]] - + [[ repeatIn(user_ids(lines(data['form'])), 'e') ]] + - [[ e.name ]] + [[ e.name ]] + [[ repeatIn(journal_ids(data['form'], e.id), 'j') ]] + + + [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], [j.id], [e.id]), 0) ]] + + + [[ reduce(lambda x, y: x+y['amount_th'], line(data['form'], [j.id], [e.id]), 0) ]] + + + [[ reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) ]] + + + [[ reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) ]] + + + [[ reduce(lambda x, y: x+y['profit'], line(data['form'], [j.id], [e.id]), 0) ]] + + + [[ '%d' % (reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) / reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) * 100.0,)]] % - [[ repeatIn(journal_ids(data['form'], e.id), 'j') ]] [[ j.name ]] - - - - - - - - - [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], [j.id], [e.id]), 0) ]] - - - [[ reduce(lambda x, y: x+y['amount_th'], line(data['form'], [j.id], [e.id]), 0) ]] - - - [[ reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) ]] - - - [[ reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) ]] - - - [[ reduce(lambda x, y: x+y['profit'], line(data['form'], [j.id], [e.id]), 0) ]] - - - [[ '%d' % (reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) / reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) * 100.0,)]] % - - - - - [[ repeatIn(line(data['form'], [j.id], [e.id]), 'l') ]] - [[ l['name'] ]] - - - [[ l['unit_amount'] ]] - - - [[ l['amount_th'] ]] - - - [[ l['amount'] ]] - - - [[ l['cost'] ]] - - - [[ l['profit'] ]] - - - [[ l['eff'] ]] % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Totals - - - - - - - - - - - [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - - - - - - - - [[ reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - - - [[ reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - - - [[ reduce(lambda x, y: x+y['profit'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - - - [[ round(reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)/reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)* -100, 2)]] % - - - - - - - - - - - - -
+ + + + [[ repeatIn(line(data['form'], [j.id],[e.id]), 'l') ]] + + + + [[ l['name'] ]] + + + [[ l['unit_amount'] ]] + + + [[ l['amount_th'] ]] + + + [[ l['amount'] ]] + + + [[ l['cost'] ]] + + + [[ l['profit'] ]] + + + [[ l['eff'] ]] % + + +
+ + +
From c45d17392bb0e6b0b147d12c89d45f5299c10497 Mon Sep 17 00:00:00 2001 From: Vinay Rana Date: Tue, 30 Sep 2008 17:06:04 +0530 Subject: [PATCH 05/24] modified account_analytic_profit.sxw and rml in hr_timesheet_invoice module bzr revid: vinusoft85@gmail.com-20080930113604-fcuc6kidr1jsy26s --- .../report/account_analytic_profit.rml | 84 +++++++++++++------ 1 file changed, 57 insertions(+), 27 deletions(-) diff --git a/addons/hr_timesheet_invoice/report/account_analytic_profit.rml b/addons/hr_timesheet_invoice/report/account_analytic_profit.rml index 1e3a7972fda..fe783c3c79f 100644 --- a/addons/hr_timesheet_invoice/report/account_analytic_profit.rml +++ b/addons/hr_timesheet_invoice/report/account_analytic_profit.rml @@ -67,18 +67,16 @@ - + + - + + + + + - - - - - - - @@ -217,29 +215,29 @@
- [[ reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] + [[ reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - [[ reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] + [[ reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - [[ reduce(lambda x, y: x+y['profit'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] + [[ reduce(lambda x, y: x+y['profit'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] - [[ round(reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)/reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)* -100, 2)]] % + [[ round(reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)/reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)* -100, 2)]] % - - - +
[[ repeatIn(user_ids(lines(data['form'])), 'e') ]] - + [[ e.name ]] - [[ repeatIn(journal_ids(data['form'], e.id), 'j') ]] + + + [[ repeatIn(journal_ids(data['form'], e.id), 'j') ]] [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], [j.id], [e.id]), 0) ]] @@ -248,29 +246,58 @@ [[ reduce(lambda x, y: x+y['amount_th'], line(data['form'], [j.id], [e.id]), 0) ]] - [[ reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) ]] + [[ reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) ]] - [[ reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) ]] + [[ reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) ]] - [[ reduce(lambda x, y: x+y['profit'], line(data['form'], [j.id], [e.id]), 0) ]] + [[ reduce(lambda x, y: x+y['profit'], line(data['form'], [j.id], [e.id]), 0) ]] - [[ '%d' % (reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) / reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) * 100.0,)]] % + [[ '%d' % (reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) / reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) * 100.0,)]] % + + [[ j.name ]] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - [[ repeatIn(line(data['form'], [j.id],[e.id]), 'l') ]] - + [[ l['name'] ]] @@ -295,9 +322,12 @@ + + +
- + \ No newline at end of file From 735fc82f7bc5555e86ee45dd571896f75ff3b80a Mon Sep 17 00:00:00 2001 From: Vinay Rana Date: Tue, 30 Sep 2008 17:58:15 +0530 Subject: [PATCH 06/24] doing some changes account_analytic_profit.sxw and rml in hr_timesheet_invoice module bzr revid: vinusoft85@gmail.com-20080930122815-0nb9ae1m5exa6ig1 --- .../hr_timesheet_invoice/report/account_analytic_profit.rml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/hr_timesheet_invoice/report/account_analytic_profit.rml b/addons/hr_timesheet_invoice/report/account_analytic_profit.rml index fe783c3c79f..897bb26da55 100644 --- a/addons/hr_timesheet_invoice/report/account_analytic_profit.rml +++ b/addons/hr_timesheet_invoice/report/account_analytic_profit.rml @@ -207,7 +207,7 @@ Totals: - [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] + [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]] @@ -240,10 +240,10 @@ [[ repeatIn(journal_ids(data['form'], e.id), 'j') ]] - [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], [j.id], [e.id]), 0) ]] + [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], [j.id], [e.id]), 0) ]] - [[ reduce(lambda x, y: x+y['amount_th'], line(data['form'], [j.id], [e.id]), 0) ]] + [[ reduce(lambda x, y: x+y['amount_th'], line(data['form'], [j.id], [e.id]), 0) ]] [[ reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) ]] From bd689b530d1ac47056fde893b9591d370066e35b Mon Sep 17 00:00:00 2001 From: Vinay Rana Date: Tue, 30 Sep 2008 19:05:17 +0530 Subject: [PATCH 07/24] modified hr expense report sxw and rml in hr expense module bzr revid: vinusoft85@gmail.com-20080930133517-cik7kwytqnj71ec0 --- addons/hr_expense/report/expense.rml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_expense/report/expense.rml b/addons/hr_expense/report/expense.rml index e39874f84f3..7ab564bf011 100644 --- a/addons/hr_expense/report/expense.rml +++ b/addons/hr_expense/report/expense.rml @@ -159,13 +159,13 @@ Ref. - Unit Price + Unit Price Qty - Total + Total Price From 2a18ecb3389c510d7b238a1911e6d38f3954dd1f Mon Sep 17 00:00:00 2001 From: Vinay Rana Date: Fri, 3 Oct 2008 15:29:21 +0530 Subject: [PATCH 08/24] doing some changes in account_balance report py and rml file in account module bzr revid: vinusoft85@gmail.com-20081003095921-yd5tjxwerhxvwpyj --- addons/account/report/account_balance.py | 10 ++++++++- addons/account/report/account_balance.rml | 27 ++++++++++++----------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py index 5ff60c44a18..1ecb0869876 100644 --- a/addons/account/report/account_balance.py +++ b/addons/account/report/account_balance.py @@ -71,7 +71,10 @@ class account_balance(report_sxw.rml_parse): self.cr.execute("select name from account_period where id in (%s)" % (period_ids)) res=self.cr.fetchall() for r in res: - result+=r[0]+", " + if (r == res[res.__len__()-1]): + result+=r[0]+". " + else: + result+=r[0]+", " return str(result and result[:-1]) or '' def lines(self, form, ids={}, done=None, level=1): @@ -118,6 +121,7 @@ class account_balance(report_sxw.rml_parse): 'credit': account.credit, 'balance': account.balance, 'leef': not bool(account.child_id), + 'bal_type':'', } self.sum_debit += account.debit self.sum_credit += account.credit @@ -177,6 +181,10 @@ class account_balance(report_sxw.rml_parse): r['credit']='' r['balance']='' r['leef']='' + if sum > 0.0: + r['bal_type']=" Dr." + else: + r['bal_type']=" Cr." return res or '' def date_range(self,start,end): diff --git a/addons/account/report/account_balance.rml b/addons/account/report/account_balance.rml index 462a7bd1744..0b614106551 100644 --- a/addons/account/report/account_balance.rml +++ b/addons/account/report/account_balance.rml @@ -61,15 +61,14 @@ - - + - - + + - + @@ -94,7 +93,7 @@ fontSize="8.0" /> [[ setTag('para','para',{'style':('Level'+str(a['level']))}) ]][[ (a['level']<6 and removeParentNode('font') or '... '*(a['level']-4)) ]][[ setTag('blockTable','blockTable',{'style':'TrLevel'+str(a['level'])}) ]][[ a['name'] ]] - [[ formatLang(a['debit']) and '%.2f'%a['debit'] or '']] + [[ (a['level']<4) and setTag('para','para',{'style':'P3'}) ]][[ (a['leef'] and removeParentNode('para')) or formatLang(a['debit']) and '%.2f'%a['debit'] or '0.00' ]] + [[ ((not a['leef']) and removeParentNode('para')) or formatLang(a['debit']) and '%.2f'%a['debit'] or '0.00' ]] - [[ formatLang(a['credit']) and '%.2f'%a['credit'] or '']] + [[ (a['level']<4) and setTag('para','para',{'style':'P3'}) ]][[ (a['leef'] and removeParentNode('para')) or formatLang(a['credit']) and '%.2f'%a['credit'] or '0.00' ]] + [[ ((not a['leef']) and removeParentNode('para')) or formatLang(a['credit']) and '%.2f'%a['credit'] or '0.00' ]] - [[ (a['level']<4) and setTag('para','para',{'style':'P3a'}) ]][[ (a['leef'] and removeParentNode('para')) or formatLang(a['balance']) and '%.2f'%a['balance'] or '' ]] - [[ ((not a['leef']) and removeParentNode('para')) or formatLang(a['balance']) and formatLang(a['balance']) or '' ]] + [[ (a['level']<4) and setTag('para','para',{'style':'P3a'}) ]][[ (a['leef'] and removeParentNode('para')) or formatLang(a['balance']) and '%.2f'%a['balance'] or '0.00' ]] + [[ ((not a['leef']) and removeParentNode('para')) or formatLang(a['balance']) and formatLang(a['balance']) or '0.00' ]] @@ -166,13 +167,13 @@ [[ '... '*(a['level']-3) ]][[ a['lname'] ]] - [[ formatLang(a['debit1']) and '%.2f'%a['debit1'] or '']] + [[ formatLang(a['debit1']) and '%.2f'%a['debit1'] or '0.00']] - [[ formatLang(a['credit1']) and '%.2f'%a['credit1'] or '']] + [[ formatLang(a['credit1']) and '%.2f'%a['credit1'] or '0.00']] - [[ formatLang(a['balance1']) and '%.2f'%a['balance1'] or '']] + [[ formatLang(a['balance1']) and '%.2f'%a['balance1'] or '0.00' ]] From 79da75376d73067ae93da5b51abd607f6c43fe4a Mon Sep 17 00:00:00 2001 From: Vinay Rana Date: Mon, 6 Oct 2008 19:42:47 +0530 Subject: [PATCH 09/24] done some changes in account balance report rml file in account module bzr revid: vinusoft85@gmail.com-20081006141247-9oeze2t4l4d1p92a --- addons/account/report/account_balance.rml | 138 +++++++++++++++++++--- 1 file changed, 123 insertions(+), 15 deletions(-) diff --git a/addons/account/report/account_balance.rml b/addons/account/report/account_balance.rml index 0b614106551..7ba0204caa4 100644 --- a/addons/account/report/account_balance.rml +++ b/addons/account/report/account_balance.rml @@ -19,6 +19,7 @@ 1cm 27.7cm 20cm 27.7cm + @@ -51,12 +52,15 @@ + + + - + @@ -75,6 +79,11 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -146,34 +254,34 @@ [[ setTag('para','para',{'style':('Level'+str(a['level']))}) ]][[ a['code'] or removeParentNode('tr') ]] - [[ setTag('para','para',{'style':('Level'+str(a['level']))}) ]][[ (a['level']<6 and removeParentNode('font') or '... '*(a['level']-4)) ]][[ setTag('blockTable','blockTable',{'style':'TrLevel'+str(a['level'])}) ]][[ a['name'] ]] + [[ setTag('para','para',{'style':('Level'+str(a['level']))}) ]][[ setTag('blockTable','blockTable',{'style':'TrLevel'+str(a['level'])}) ]][[ a['name'] ]] - [[ (a['level']<4) and setTag('para','para',{'style':'P3'}) ]][[ (a['leef'] and removeParentNode('para')) or formatLang(a['debit']) and '%.2f'%a['debit'] or '0.00' ]] - [[ ((not a['leef']) and removeParentNode('para')) or formatLang(a['debit']) and '%.2f'%a['debit'] or '0.00' ]] + [[ a['level']>3 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['debit']) and '%.2f'%a['debit'] or '0.00' ]] + [[ a['level']<4 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['debit']) and '%.2f'%a['debit'] or '0.00' ]] - [[ (a['level']<4) and setTag('para','para',{'style':'P3'}) ]][[ (a['leef'] and removeParentNode('para')) or formatLang(a['credit']) and '%.2f'%a['credit'] or '0.00' ]] - [[ ((not a['leef']) and removeParentNode('para')) or formatLang(a['credit']) and '%.2f'%a['credit'] or '0.00' ]] + [[ a['level']>3 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['credit']) and '%.2f'%a['credit'] or '0.00' ]] + [[ a['level']<4 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['credit']) and '%.2f'%a['credit'] or '0.00' ]] - [[ (a['level']<4) and setTag('para','para',{'style':'P3a'}) ]][[ (a['leef'] and removeParentNode('para')) or formatLang(a['balance']) and '%.2f'%a['balance'] or '0.00' ]] - [[ ((not a['leef']) and removeParentNode('para')) or formatLang(a['balance']) and formatLang(a['balance']) or '0.00' ]] + [[ a['level']>3 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['balance']) and '%.2f'%a['balance'] or '0.00' ]] + [[ a['level']<4 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['balance']) and '%.2f'%a['balance'] or '0.00' ]] - [[ a['jname'] or removeParentNode('tr') ]] + [[ setTag('para','para',{'style':('Det_Level'+str(a['level']))}) ]][[ a['jname'] or removeParentNode('tr') ]] - [[ '... '*(a['level']-3) ]][[ a['lname'] ]] + [[ a['level']<4 and removeParentNode('font') or '...'*(2) ]][[ setTag('para','para',{'style':('Det_Level'+str(a['level']))}) ]][[ a['lname'] ]] - [[ formatLang(a['debit1']) and '%.2f'%a['debit1'] or '0.00']] + [[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['debit1']) and '%.2f'%a['debit1'] or '0.00']] - [[ formatLang(a['credit1']) and '%.2f'%a['credit1'] or '0.00']] + [[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['credit1']) and '%.2f'%a['credit1'] or '0.00']] - [[ formatLang(a['balance1']) and '%.2f'%a['balance1'] or '0.00' ]] + [[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['balance1']) and '%.2f'%a['balance1'] or '0.00' ]] From 06036274da564939fef7603d9a764e92869afe4a Mon Sep 17 00:00:00 2001 From: Vinay Rana Date: Tue, 7 Oct 2008 11:47:53 +0530 Subject: [PATCH 10/24] done some changes in account balance report rml and py file in account module bzr revid: vinusoft85@gmail.com-20081007061753-c6gjwxa60idzgibq --- addons/account/report/account_balance.py | 2 +- addons/account/report/account_balance.rml | 91 ++++++++++------------- 2 files changed, 40 insertions(+), 53 deletions(-) diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py index 1ecb0869876..624f49ebdfa 100644 --- a/addons/account/report/account_balance.py +++ b/addons/account/report/account_balance.py @@ -224,5 +224,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=2) +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 7ba0204caa4..eb0d023302e 100644 --- a/addons/account/report/account_balance.rml +++ b/addons/account/report/account_balance.rml @@ -41,7 +41,7 @@ - + @@ -82,19 +82,19 @@ - - - @@ -247,46 +244,36 @@ Balance - - - - [[ repeatIn(lines(data['form']), 'a') ]] - - [[ setTag('para','para',{'style':('Level'+str(a['level']))}) ]][[ a['code'] or removeParentNode('tr') ]] - - [[ setTag('para','para',{'style':('Level'+str(a['level']))}) ]][[ setTag('blockTable','blockTable',{'style':'TrLevel'+str(a['level'])}) ]][[ a['name'] ]] - - - [[ a['level']>3 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['debit']) and '%.2f'%a['debit'] or '0.00' ]] - [[ a['level']<4 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['debit']) and '%.2f'%a['debit'] or '0.00' ]] - - - [[ a['level']>3 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['credit']) and '%.2f'%a['credit'] or '0.00' ]] - [[ a['level']<4 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['credit']) and '%.2f'%a['credit'] or '0.00' ]] - - - [[ a['level']>3 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['balance']) and '%.2f'%a['balance'] or '0.00' ]] - [[ a['level']<4 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['balance']) and '%.2f'%a['balance'] or '0.00' ]] - - - - [[ 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']))}) ]][[ 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' ]] - - - - - + + + + [[ repeatIn(lines(data['form']), 'a') ]] + + [[ setTag('para','para',{'style':('Level'+str(a['level']))}) ]][[ a['code'] or removeParentNode('tr') ]] + [[ setTag('para','para',{'style':('Level'+str(a['level']))}) ]][[ setTag('blockTable','blockTable',{'style':'TrLevel'+str(a['level'])}) ]][[ a['name'] ]] + + [[ a['level']>3 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['debit']) and '%.2f'%a['debit'] or '0.00' ]] + [[ a['level']<4 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['debit']) and '%.2f'%a['debit'] or '0.00' ]] + + + [[ a['level']>3 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['credit']) and '%.2f'%a['credit'] or '0.00' ]] + [[ a['level']<4 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['credit']) and '%.2f'%a['credit'] or '0.00' ]] + + + [[ a['level']>3 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['balance']) and '%.2f'%a['balance'] or '0.00' ]] + [[ a['level']<4 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['balance']) and '%.2f'%a['balance'] or '0.00' ]] + + + + [[ 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_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' ]] + + + + From 149975a69a589d2cabe69c52161f1c86eedfd879 Mon Sep 17 00:00:00 2001 From: Vinay Rana Date: Tue, 7 Oct 2008 12:44:29 +0530 Subject: [PATCH 11/24] done some changes in account balance report rml file in account module bzr revid: vinusoft85@gmail.com-20081007071429-q0hob8o2xzpwu8gu --- addons/account/report/account_balance.rml | 34 +++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/addons/account/report/account_balance.rml b/addons/account/report/account_balance.rml index eb0d023302e..cfabf9d545f 100644 --- a/addons/account/report/account_balance.rml +++ b/addons/account/report/account_balance.rml @@ -149,67 +149,67 @@ + fontSize="8.0" leading="5"/> + fontSize="8.0" leading="5"/> + fontSize="8.0" leading="5"/> + fontSize="8.0" leading="5"/> + fontSize="8.0" leading="5"/> + fontSize="8.0" leading="5"/> + fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/> + fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/> + fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/> + fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/> + fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/> + fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/> From 03a8f3bfe9a2638aec9bed316efd2b750def451a Mon Sep 17 00:00:00 2001 From: Naresh Choksy Date: Fri, 10 Oct 2008 14:29:13 +0530 Subject: [PATCH 12/24] Merged mrp_bom_hyerarchy into BoM module. Changed the tree view of a BoM so that it uses the child_complete_id instead of the current one2many. bzr revid: nch@tinyerp.com-20081010085913-6pev3fjzf0ag0j89 --- addons/mrp/__terp__.py | 3 +- addons/mrp/mrp.py | 34 +++++++++++++------ addons/mrp/mrp_view.xml | 75 ++++++++++++++++++++--------------------- 3 files changed, 62 insertions(+), 50 deletions(-) diff --git a/addons/mrp/__terp__.py b/addons/mrp/__terp__.py index 3f4b301fe11..cbba88cd2bf 100644 --- a/addons/mrp/__terp__.py +++ b/addons/mrp/__terp__.py @@ -47,7 +47,8 @@ * Cost method by product: standard price, average price * Easy analysis of troubles or needs * Very flexible - + * Allows to browse Bill of Materials in complete structure + that include child and phantom BoMs It supports complete integration and planification of stockable goods, consumable of services. Services are completly integrated with the rest of the software. For instance, you can set up a sub-contracting service diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index ecb383363d9..4891ea146b9 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -39,7 +39,7 @@ from mx import DateTime #---------------------------------------------------------- # Workcenters #---------------------------------------------------------- -# capacity_hour : capacity per hour. default: 1.0. +# capacity_hour : capacity per hour. default: 1.0. # Eg: If 5 concurrent operations at one time: capacity = 5 (because 5 employees) # unit_per_cycle : how many units are produced for one cycle # @@ -115,7 +115,7 @@ class mrp_routing(osv.osv): 'note': fields.text('Description'), 'workcenter_lines': fields.one2many('mrp.routing.workcenter', 'routing_id', 'Workcenters'), - 'location_id': fields.many2one('stock.location', 'Production Location', + 'location_id': fields.many2one('stock.location', 'Production Location', help="Keep empty if you produce at the location where the finnished products are needed." \ "Put a location if you produce at a fixed location. This can be a partner location " \ "if you subcontract the manufacturing operations." @@ -147,6 +147,17 @@ mrp_routing_workcenter() class mrp_bom(osv.osv): _name = 'mrp.bom' _description = 'Bill of Material' + def _child_compute(self, cr, uid, ids, name, arg, context={}): + result = {} + for bom in self.browse(cr, uid, ids, context=context): + result[bom.id] = map(lambda x: x.id, bom.bom_lines) + ok = ((name=='child_complete_ids') and (bom.product_id.supply_method=='produce')) + if bom.type=='phantom' or ok: + sids = self.pool.get('mrp.bom').search(cr, uid, [('bom_id','=',False),('product_id','=',bom.product_id.id)]) + if sids: + bom2 = self.pool.get('mrp.bom').browse(cr, uid, sids[0], context=context) + result[bom.id] += map(lambda x: x.id, bom2.bom_lines) + return result def _compute_type(self, cr, uid, ids, field_name, arg, context): res = dict(map(lambda x: (x,''), ids)) for line in self.browse(cr, uid, ids): @@ -185,7 +196,9 @@ class mrp_bom(osv.osv): 'routing_id': fields.many2one('mrp.routing', 'Routing', help="The list of operations (list of workcenters) to produce the finnished product. The routing is mainly used to compute workcenter costs during operations and to plan futur loads on workcenters based on production plannification."), 'property_ids': fields.many2many('mrp.property', 'mrp_bom_property_rel', 'bom_id','property_id', 'Properties'), 'revision_ids': fields.one2many('mrp.bom.revision', 'bom_id', 'BoM Revisions'), - 'revision_type': fields.selection([('numeric','numeric indices'),('alpha','alphabetical indices')], 'indice type') + 'revision_type': fields.selection([('numeric','numeric indices'),('alpha','alphabetical indices')], 'indice type'), + 'child_ids': fields.function(_child_compute,relation='mrp.bom', method=True, string="BoM Hyerarchy", type='many2many'), + 'child_complete_ids': fields.function(_child_compute,relation='mrp.bom', method=True, string="BoM Hyerarchy", type='many2many') } _defaults = { 'active': lambda *a: 1, @@ -198,6 +211,7 @@ class mrp_bom(osv.osv): _sql_constraints = [ ('bom_qty_zero', 'CHECK (product_qty>0)', 'All product quantities must be greater than 0 !'), ] + def _check_recursion(self, cr, uid, ids): level = 500 while len(ids): @@ -211,7 +225,7 @@ class mrp_bom(osv.osv): (_check_recursion, 'Error ! You can not create recursive BoM.', ['parent_id']) ] - + def onchange_product_id(self, cr, uid, ids, product_id, name, context={}): if product_id: prod=self.pool.get('product.product').browse(cr,uid,[product_id])[0] @@ -283,7 +297,7 @@ class mrp_bom(osv.osv): def set_indices(self, cr, uid, ids, context = {}): if not ids or (ids and not ids[0]): - return True + return True res = self.read(cr, uid, ids, ['revision_ids', 'revision_type']) rev_ids = res[0]['revision_ids'] idx = 1 @@ -310,7 +324,7 @@ class mrp_bom_revision(osv.osv): 'author_id': fields.many2one('res.users', 'Author'), 'bom_id': fields.many2one('mrp.bom', 'BoM', select=True), } - + _defaults = { 'author_id': lambda x,y,z,c: z, 'date': lambda *a: time.strftime('%Y-%m-%d'), @@ -603,7 +617,7 @@ class mrp_production(osv.osv): 'state': 'waiting' } res_final_id = self.pool.get('stock.move').create(cr, uid, data) - + self.write(cr, uid, [production.id], {'move_created_ids': [(6, 'WTF', [res_final_id])]}) moves = [] for line in production.product_lines: @@ -973,14 +987,14 @@ class mrp_procurement(osv.osv): newdate = newdate - DateTime.RelativeDateTime(days=company.po_lead) context.update({'lang':partner.lang}) product=self.pool.get('product.product').browse(cr,uid,procurement.product_id.id,context=context) - + line = { 'name': product.name, 'product_qty': qty, 'product_id': procurement.product_id.id, 'product_uom': uom_id, 'price_unit': price, - 'date_planned': newdate.strftime('%Y-%m-%d %H:%M:%S'), + 'date_planned': newdate.strftime('%Y-%m-%d %H:%M:%S'), 'move_dest_id': res_id, 'notes':product.description_purchase, } @@ -991,7 +1005,7 @@ class mrp_procurement(osv.osv): if partner_id: taxep_id = self.pool.get('res.partner').property_get(cr, uid,partner_id,property_pref=['property_account_supplier_tax']).get('property_account_supplier_tax',False) if taxep_id: - taxep=self.pool.get('account.tax').browse(cr, uid,taxep_id) + taxep=self.pool.get('account.tax').browse(cr, uid,taxep_id) if not taxep or not taxep.id: taxes_ids = [x.id for x in procurement.product_id.product_tmpl_id.supplier_taxes_id] else: diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index ab7d23c3d27..b22ca8ec6b6 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -1,13 +1,13 @@ - + - + - + mrp.property.group.form mrp.property.group @@ -30,7 +30,7 @@ - + mrp.property.tree mrp.property @@ -66,11 +66,11 @@ tree,form - + - + mrp.workcenter.tree mrp.workcenter @@ -129,11 +129,11 @@ - + - + mrp.routing.workcenter.tree mrp.routing.workcenter @@ -147,7 +147,7 @@ - + mrp.routing.workcenter.form mrp.routing.workcenter @@ -164,7 +164,7 @@ - + mrp.routing.form mrp.routing @@ -203,11 +203,11 @@ - + - + mrp.bom.form mrp.bom @@ -237,7 +237,7 @@ - + @@ -248,11 +248,12 @@ - + + mrp.bom.tree mrp.bom tree - bom_lines + child_complete_ids @@ -274,7 +275,7 @@ - + Bill of Material Structure ir.actions.act_window @@ -293,7 +294,7 @@ [('bom_id','=',False)] - + Bill of Materials Components ir.actions.act_window @@ -311,14 +312,14 @@ tree - + Bill of Materials Structure - + mrp.bom.revision mrp.bom.revision @@ -346,11 +347,11 @@ - + - + mrp.production.tree mrp.production @@ -367,8 +368,7 @@ - - + mrp.production.calendar mrp.production @@ -393,8 +393,7 @@ - - + mrp.production.form mrp.production @@ -490,7 +489,7 @@ [('state','=','confirmed')] - + New Production Order ir.actions.act_window @@ -499,7 +498,7 @@ form,tree,calendar,graph - + mrp.production.workcenter.line.form mrp.production.workcenter.line @@ -528,7 +527,7 @@ - + mrp.production.lot.line.form mrp.production.lot.line @@ -561,9 +560,7 @@ - - - + mrp.production.product.line.form mrp.production.product.line @@ -593,11 +590,11 @@ - + - + mrp.procurement.tree mrp.procurement @@ -677,7 +674,7 @@ - + Draft procurements ir.actions.act_window @@ -696,7 +693,7 @@ [('state','=','confirmed')] - + Exceptions procurements ir.actions.act_window @@ -706,7 +703,7 @@ [('state','=','exception')] - + Exceptions procurements to fix ir.actions.act_window @@ -716,7 +713,7 @@ [('state','=','exception'), ('message', '<>', '')] - + Temporary Procurement Exceptions ir.actions.act_window @@ -726,7 +723,7 @@ [('state','=','exception'), ('message', '=', '')] - + New Procurement ir.actions.act_window @@ -735,7 +732,7 @@ form,tree - + stock.warehouse.orderpoint.tree From 89b9a827d03e54b4929b2d8dc9356a7865050160 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Fri, 10 Oct 2008 12:04:21 +0200 Subject: [PATCH 13/24] Patch from Xavier ALT lp bug: https://launchpad.net/bugs/270826 fixed bzr revid: stephane@tinyerp.com-20081010100421-o7bgtbemo57yzqxt --- addons/crm/scripts/tinyerp-mailgate/tinyerp-mailgate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/scripts/tinyerp-mailgate/tinyerp-mailgate.py b/addons/crm/scripts/tinyerp-mailgate/tinyerp-mailgate.py index 18cf12879c9..7b075a270f0 100644 --- a/addons/crm/scripts/tinyerp-mailgate/tinyerp-mailgate.py +++ b/addons/crm/scripts/tinyerp-mailgate/tinyerp-mailgate.py @@ -60,7 +60,7 @@ priorities = { class rpc_proxy(object): def __init__(self, uid, passwd, host='localhost', port=8069, path='object', dbname='terp'): - self.rpc = xmlrpclib.ServerProxy('http://%s:%s/%s' % (host, port, path)) + self.rpc = xmlrpclib.ServerProxy('http://%s:%s/xmlrpc/%s' % (host, port, path)) self.user_id = uid self.passwd = passwd self.dbname = dbname From 958fb6a4cecba5befab02581e62182a7fd6fa71c Mon Sep 17 00:00:00 2001 From: Najlaa Date: Fri, 10 Oct 2008 12:22:05 +0200 Subject: [PATCH 14/24] modif on purchase order bzr revid: nel@silver-20081010102205-249p2t7up1m6wgp3 --- addons/purchase/report/order.rml | 107 +++++++++++++++++++++---------- 1 file changed, 72 insertions(+), 35 deletions(-) diff --git a/addons/purchase/report/order.rml b/addons/purchase/report/order.rml index f46c47e6a6b..86fb8008807 100644 --- a/addons/purchase/report/order.rml +++ b/addons/purchase/report/order.rml @@ -10,7 +10,11 @@ - + + + + + @@ -95,8 +99,11 @@ - - + + + + + @@ -133,40 +140,70 @@ [[ repeatIn(objects,'o') ]] - + - + - [[ repeatIn(o.dest_address_id and [o.dest_address_id] or [],'addr') ]] - Shipping address : - [[ addr.partner_id.title or '' ]][[ addr.partner_id.name ]] - [[ addr.title or '' ]][[ addr.name ]] - [[ addr.street ]] - [[ addr.street2 or '' ]] - [[ addr.zip or '' ]] [[ addr.city or '' ]] - [[ addr.state_id and addr.state_id.name or '' ]] - [[ addr.country_id and addr.country_id.name or '' ]] - - - [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] - [[ o.partner_address_id.title or '' ]] [[ o.partner_address_id.name ]] - [[ o.partner_address_id.street ]] - [[ o.partner_address_id.street2 or '' ]] - [[ o.partner_address_id.zip or '' ]] [[ o.partner_address_id.city or '' ]] - [[ o.partner_address_id.state_id and o.partner_address_id.state_id.name or '' ]] - [[ o.partner_address_id.country_id and o.partner_address_id.country_id.name or '' ]] - + + + + + + + + + + + [[ repeatIn(o.dest_address_id and [o.dest_address_id] or [],'addr') ]] + Shipping address : + [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] + [[ addr.title or '' ]] [[ addr.name ]] + [[ addr.street ]] + [[ addr.street2 or '' ]] + [[ addr.zip or '' ]] [[ addr.city or '' ]] + [[ addr.state_id and addr.state_id.name or '' ]] + [[ addr.country_id and addr.country_id.name or '' ]] + + + + - Tél. : [[ o.partner_address_id.phone or '' ]] - Fax : [[ o.partner_address_id.fax or '' ]] - TVA :[[ o.partner_id.vat or '' ]] + + + + + + + + [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] + [[ o.partner_address_id.title or '' ]] [[ o.partner_address_id.name ]] + [[ o.partner_address_id.street ]] + [[ o.partner_address_id.street2 or '' ]] + [[ o.partner_address_id.zip or '' ]] [[ o.partner_address_id.city or '' ]] + [[ o.partner_address_id.state_id and o.partner_address_id.state_id.name or '' ]] + [[ o.partner_address_id.country_id and o.partner_address_id.country_id.name or '' ]] + + + + Tel. : [[ o.partner_address_id.phone or '' ]] + Fax : [[ o.partner_address_id.fax or '' ]] + TVA : [[ o.partner_id.vat or '' ]] - Request for Quotation [[ (o.state=='draft' or removeParentNode('font')) and '' ]] Order [[ (o.state<>'draft' or removeParentNode('font')) and '' ]] N° :[[ o.name ]] + + + + + + + + + + [[ (o.state=='draft' or removeParentNode('font')) and 'Request for Quotation' ]] [[ (o.state<>'draft' or removeParentNode('font')) and 'Purchase Order Confirmation' ]] N° [[ o.name ]] @@ -198,7 +235,7 @@ [[ o.partner_ref or '' ]] - [[ time.strftime('%d/%m/%Y', time.strptime(o.date_order, '%Y-%m-%d')) ]] + [[ time.strftime('%d/%m/%Y', time.strptime(line.date_planned, '%Y-%m-%d %H:%M:%S')) ]] [[ o.validator and o.validator.name or '' ]] @@ -208,7 +245,7 @@ - + Description @@ -232,7 +269,7 @@
[[ repeatIn(o.order_line,'line') ]] - + [[ line.name ]] @@ -241,7 +278,7 @@ [[ ', '.join(map(lambda x: x.name, line.taxes_id)) ]] - [[ time.strftime('%d/%m/%Y', time.strptime(line.date_planned, '%Y-%m-%d %H:%M:%S')) ]] + [[ time.strftime('%d/%m/%Y', time.strptime( line.date_planned, '%Y-%m-%d')) ]] [[ line.product_qty ]] @@ -258,7 +295,7 @@ - [[ line.notes or removeParentNode('tr') ]] + [[ line.notes or removeParentNode('tr') ]] @@ -293,7 +330,7 @@
- + @@ -333,7 +370,7 @@ - Total : + Total : [[ o.amount_total ]] From 0d90d87730ac4459a7fba78b43dbb7caa9fb8b1c Mon Sep 17 00:00:00 2001 From: Vinay Rana Date: Fri, 10 Oct 2008 16:21:55 +0530 Subject: [PATCH 15/24] modified Cost Ledger report rml and sxw file of Analytical account in account module. bzr revid: vinusoft85@gmail.com-20081010105155-z51b7it49e215wiw --- addons/account/project/report/cost_ledger.rml | 438 ++++++++++-------- 1 file changed, 240 insertions(+), 198 deletions(-) diff --git a/addons/account/project/report/cost_ledger.rml b/addons/account/project/report/cost_ledger.rml index b9a8dfeac27..9b62c559a12 100644 --- a/addons/account/project/report/cost_ledger.rml +++ b/addons/account/project/report/cost_ledger.rml @@ -3,6 +3,30 @@ @@ -10,75 +34,71 @@
- - - - - - - - - - - - - - - - - - - - - + - + + + + + + + + + + + - + + + + + + + + + + + - + - - - - + - + - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - @@ -86,195 +106,217 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + - [[ company.name ]] + Period from - Period from [[ data['form']['date1'] ]] - - to [[ data['form']['date2'] ]] - + Period to - Currency: [[ company.currency_id.name ]] + Printing date - - - - Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] - - - - + - Date + [[ data['form']['date1'] ]] - J.C. + [[ data['form']['date2'] ]] - Code - - - Move name - - - Debit - - - Credit - - - Balance + [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] - +
- [[ repeatIn(objects,'o') ]] - - - - - - - [[ o.code ]] [[ o.complete_name ]] - - - - - - -
- [[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2']),'move_g') ]] - - - - - - - [[ move_g['code'] ]] [[ move_g['name'] ]] - - - - - - - [[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2']),'move_a') ]] - [[ move_a['date'] ]] - - - [[ move_a['cj'] ]] - - - [[ move_a['code'] ]] - - - [[ move_a['name'] ]] - - - [[ '%.2f' % move_a['debit'] ]] - - - [[ '%.2f' % move_a['credit'] ]] - - - [[ '%.2f' % move_a['balance'] ]] - - - - - - - Total ([[ move_g['code'] ]]) - - - [[ '%.2f' % move_g['debit'] ]] - - - [[ '%.2f' % move_g['credit'] ]] - - - [[ '%.2f' % move_g['balance'] ]] - - - - - - -
- - - - - - - Total ([[ o.code ]]) - - - [[ '%.2f' % (account_sum_debit(o.id,data['form']['date1'],data['form']['date2']) or 0.0) ]] - - - [[ '%.2f' % (account_sum_credit(o.id,data['form']['date1'],data['form']['date2']) or 0.0) ]] - - - [[ '%.2f' % (account_sum_balance(o.id,data['form']['date1'],data['form']['date2']) or 0.0)]] - - - - - - -
- - - - + - Total + Code / Date - [[ '%.2f' % (sum_debit(objects,data['form']['date1'],data['form']['date2']) or 0.0) ]] + J.C. / Move name - [[ '%.2f' % (sum_credit(objects,data['form']['date1'],data['form']['date2']) or 0.0) ]] + Debit - [[ '%.2f' % (sum_balance(objects,data['form']['date1'],data['form']['date2']) or 0.0) ]] + Credit + + + Balance - - + + + + + + + + + + + Total: + + + [[ '%.2f' % (sum_debit(objects,data['form']['date1'],data['form']['date2']) or 0.0) ]] + + + [[ '%.2f' % (sum_credit(objects,data['form']['date1'],data['form']['date2']) or 0.0) ]] + + + [[ '%.2f' % (sum_balance(objects,data['form']['date1'],data['form']['date2']) or 0.0) ]] + + + + + + + + [[ repeatIn(objects,'o') ]] + + + + [[ o.code ]] + + + [[ o.complete_name ]] + + + [[ '%.2f' % (account_sum_debit(o.id,data['form']['date1'],data['form']['date2']) or 0.0) ]] + + + [[ '%.2f' % (account_sum_credit(o.id,data['form']['date1'],data['form']['date2']) or 0.0) ]] + + + [[ '%.2f' % (account_sum_balance(o.id,data['form']['date1'],data['form']['date2']) or 0.0)]] + + + + + + [[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2']),'move_g') ]] + + + + [[ move_g['code'] ]] + + + [[ move_g['name'] ]] + + + [[ '%.2f' % move_g['debit'] ]] + + + [[ '%.2f' % move_g['credit'] ]] + + + [[ '%.2f' % move_g['balance'] ]] + + + + + [[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2']),'move_a') ]] + + + + [[ move_a['date'] ]] + + + [[ move_a['cj'] ]] + + + [[ move_a['name'] ]] + + + [[ '%.2f' % move_a['debit'] ]] + + + [[ '%.2f' % move_a['credit'] ]] + + + [[ '%.2f' % move_a['balance'] ]] + + + + + + + + + + + + + + + + +
- From c3afe326daf4c7e7fecb2e6bee0de65a43100cd0 Mon Sep 17 00:00:00 2001 From: Vinay Rana Date: Fri, 10 Oct 2008 16:24:20 +0530 Subject: [PATCH 16/24] modified Qty Cost Ledger (Only Quantities) report rml and sxw file of Analytical account in account module. bzr revid: vinusoft85@gmail.com-20081010105420-nfdj6t57qusd2ckr --- .../project/report/quantity_cost_ledger.rml | 306 +++++++++++++++++- 1 file changed, 305 insertions(+), 1 deletion(-) diff --git a/addons/account/project/report/quantity_cost_ledger.rml b/addons/account/project/report/quantity_cost_ledger.rml index 31d8d578ee4..755ed501fd3 100644 --- a/addons/account/project/report/quantity_cost_ledger.rml +++ b/addons/account/project/report/quantity_cost_ledger.rml @@ -1,3 +1,307 @@ - Cost Ledger [[ company.name ]]Period from [[ data['form']['date1'] ]]to [[ data['form']['date2'] ]]Currency: [[ company.currency_id.name ]] Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] DateJ.C.CodeMove nameQuantity
[[ repeatIn(objects,'o') ]] [[ o.code ]] [[ o.complete_name ]]Maximal quantity: [[ '%.2f' % (o.quantity_max or 0.0)]]
[[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_g') ]] [[ move_g['code'] ]] [[ move_g['name'] ]][[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_a') ]][[ move_a['date'] ]][[ move_a['cj'] ]][[ move_a['code'] ]][[ move_a['name'] ]][[ '%.2f' % (move_a['quantity'] or 0.0 )]]Total ([[ move_g['code'] ]])[[ '%.2f' % (move_g['quantity'] or 0.0) ]]
Total ([[ o.code ]])[[ '%.2f' % (account_sum_quantity(o.id,data['form']['date1'],data['form']['date2'], data['form']['journal']) or 0.0 )]]
Total[[ '%.2f' % (sum_quantity(objects,data['form']['date1'],data['form']['date2'], data['form']['journal']) or 0.0) ]]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Period from + + + Period to + + + Printing date + + + + + + + [[ data['form']['date1'] ]] + + + [[ data['form']['date2'] ]] + + + [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] + + + + + + + + + +
+ + + + Code/Date + + + J.C./Move name + + + Quantity + + + Total + + + + + + + + + + + + + + Total: + + + [[ '%.2f' % (sum_quantity(objects,data['form']['date1'],data['form']['date2'], data['form']['journal']) or 0.0) ]] + + + + + + + + + [[ repeatIn(objects,'o') ]] + + + + [[ o.code ]] + + + [[ o.complete_name ]] + + + Max.qty:[[ '%.2f' % (o.quantity_max or 0.0)]] + + + [[ '%.2f' % (account_sum_quantity(o.id,data['form']['date1'],data['form']['date2'], data['form']['journal']) or 0.0 )]] + + + + + + [[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_g') ]] + + + + [[ move_g['code'] ]] + + + [[ move_g['name'] ]] + + + + + + + + [[ '%.2f' % (move_g['quantity'] or 0.0) ]] + + + + + + + + + [[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_a') ]][[ move_a['date'] ]] + + + [[ move_a['cj'] ]] + + + [[ move_a['name'] ]] + + + [[ '%.2f' % (move_a['quantity'] or 0.0 )]] + + + + + + + + + + + + + + + +
+
+
From 8ebb7ae4770835aea03c5a014dba84ca8235bd49 Mon Sep 17 00:00:00 2001 From: Jay Vora Date: Fri, 10 Oct 2008 17:28:17 +0530 Subject: [PATCH 17/24] Added wizard for printing indicators and minor modifications. bzr revid: jvo@tinyerp.com-20081010115817-i1lf5k3rqonmicxz --- addons/account_report/__init__.py | 1 + addons/account_report/__terp__.py | 1 + addons/account_report/account.py | 3 + addons/account_report/account_report.xml | 3 + addons/account_report/account_wizard.xml | 7 ++ addons/account_report/wizard/__init__.py | 33 ++++++++ .../wizard/wizard_print_indicators.py | 81 +++++++++++++++++++ 7 files changed, 129 insertions(+) create mode 100644 addons/account_report/account_wizard.xml create mode 100644 addons/account_report/wizard/__init__.py create mode 100644 addons/account_report/wizard/wizard_print_indicators.py diff --git a/addons/account_report/__init__.py b/addons/account_report/__init__.py index e4816074891..a06b62c4ee7 100644 --- a/addons/account_report/__init__.py +++ b/addons/account_report/__init__.py @@ -30,6 +30,7 @@ import account import report +import wizard # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_report/__terp__.py b/addons/account_report/__terp__.py index 852bc422fef..2bcbde6bab7 100644 --- a/addons/account_report/__terp__.py +++ b/addons/account_report/__terp__.py @@ -40,6 +40,7 @@ "security/ir.model.access.csv", "account_view.xml", "account_report.xml", + "account_wizard.xml", ], # "translations" : { # "fr": "i18n/french_fr.csv" diff --git a/addons/account_report/account.py b/addons/account_report/account.py index 29bc590556a..25c1ed56e39 100644 --- a/addons/account_report/account.py +++ b/addons/account_report/account.py @@ -210,6 +210,9 @@ class account_report_history(osv.osv): def init(self, cr): cr.execute('''create or replace view account_report as (select ar.id as tmp,((pr.id*100000)+ar.id) as id,ar.id as name,pr.id as period_id,pr.fiscalyear_id as fiscalyear_id from account_report_report as ar cross join account_period as pr group by ar.id,pr.id,pr.fiscalyear_id)''') + def unlink(self, cr, uid, ids, context={}): + raise osv.except_osv(_('Error !'), _('You can not delete an indicator history record. You may have to delete the concerned Indicator!')) + account_report_history() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_report/account_report.xml b/addons/account_report/account_report.xml index 50464753f8b..082c15f139f 100755 --- a/addons/account_report/account_report.xml +++ b/addons/account_report/account_report.xml @@ -2,5 +2,8 @@ + + + diff --git a/addons/account_report/account_wizard.xml b/addons/account_report/account_wizard.xml new file mode 100644 index 00000000000..63d4303f0c5 --- /dev/null +++ b/addons/account_report/account_wizard.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/addons/account_report/wizard/__init__.py b/addons/account_report/wizard/__init__.py new file mode 100644 index 00000000000..5194e21e5d3 --- /dev/null +++ b/addons/account_report/wizard/__init__.py @@ -0,0 +1,33 @@ +# -*- 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_print_indicators + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_report/wizard/wizard_print_indicators.py b/addons/account_report/wizard/wizard_print_indicators.py new file mode 100644 index 00000000000..373b86fd914 --- /dev/null +++ b/addons/account_report/wizard/wizard_print_indicators.py @@ -0,0 +1,81 @@ +# -*- 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 = { + '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,}, +} + +next_form = ''' +
+ +''' + +next_fields = { + 'base_selection': {'string':'Select Criteria', 'type':'many2many','required':True,}, +} + +def _load(self, cr, uid, data, context): + data['form']['select_base'] = 'year' + return data['form'] + +def _load_base(self, cr, uid, data, context): + next_fields['base_selection']['relation']='account.fiscalyear' + if data['form']['select_base']=='periods': + next_fields['base_selection']['relation']='account.period' + return data['form'] + +class wizard_print_indicators(wizard.interface): + states = { + 'init': { + 'actions': [_load], + 'result': {'type': 'form', 'arch':form, 'fields':fields, 'state':[('end','Cancel'),('next','Next')]} + }, + 'next': { + 'actions': [_load_base], + 'result': {'type':'form', 'arch':next_form, 'fields':next_fields, 'state':[('end','Cancel'),('print','Print')]} + }, + 'print': { + 'actions':[], + 'result' :{'type':'print','report':'report.print.indicators', 'state':'end'} + } + } +wizard_print_indicators('print.indicators') + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 7fa02832323a52298727b7a90a6b0b49b5940e9d Mon Sep 17 00:00:00 2001 From: Harshad Modi Date: Fri, 10 Oct 2008 17:57:44 +0530 Subject: [PATCH 18/24] Improvement on product_margin * remove sale & purchase dependacy * graph view for turnover , total cost * add a sum="..." on the fields: turnover, total margin, sales gap in the tree * By default the wizard propose to report on the latest year. (not empty fields) The title of the tab must be Margins instead of Margin. Put tooltips on all fields that explain how they are computed. * made new form view and set high priority * modify states : (paid,open_paid,draft_open_paid) bzr revid: hmo@tinyerp.com-20081010122744-5sw8yfbopt0zr04k --- addons/product_margin/__terp__.py | 2 +- addons/product_margin/product_margin.py | 54 +++++++++---------- addons/product_margin/product_margin_view.xml | 47 +++++++++++----- .../wizard/wizard_product_margin.py | 18 ++++--- 4 files changed, 69 insertions(+), 52 deletions(-) diff --git a/addons/product_margin/__terp__.py b/addons/product_margin/__terp__.py index 5aac7a747fd..7341e7e498f 100644 --- a/addons/product_margin/__terp__.py +++ b/addons/product_margin/__terp__.py @@ -4,7 +4,7 @@ "version":"1.0", "author":"Tiny", "category":"Custom", - "depends":["product"], + "depends":["base","product","account"], "demo_xml":[], "update_xml":["product_margin_view.xml"], "active": False, diff --git a/addons/product_margin/product_margin.py b/addons/product_margin/product_margin.py index a785f1e17b8..484204c4c86 100644 --- a/addons/product_margin/product_margin.py +++ b/addons/product_margin/product_margin.py @@ -43,7 +43,7 @@ class product_product(osv.osv): res[val.id] = {} date_from=context.get('date_from', time.strftime('%Y-01-01')) date_to=context.get('date_to', time.strftime('%Y-12-31')) - invoice_state=context.get('invoice_state', 'open') + invoice_state=context.get('invoice_state', 'open_paid') if 'date_from' in field_names: res[val.id]['date_from']=date_from if 'date_to' in field_names: @@ -54,12 +54,12 @@ class product_product(osv.osv): invoice_types=[] states=[] - if invoice_state=='draft_open': - states=['draft','open'] - elif invoice_state=='paid': + if invoice_state=='paid': states=['paid'] - elif invoice_state=='open': - states=['open'] + elif invoice_state=='open_paid': + states=['open','paid'] + elif invoice_state=='draft_open_paid': + states=['draft','open','paid'] if 'sale_avg_price' in field_names or 'sale_num_invoiced' in field_names or 'turnover' in field_names or 'sale_expected' in field_names: invoice_types=['out_invoice','in_refund'] @@ -71,15 +71,11 @@ class product_product(osv.osv): avg(l.price_unit) as avg_unit_price, sum(l.quantity) as num_qty, sum(l.quantity * l.price_unit) as total, - sum(sale_line.product_uom_qty * sale_line.price_unit) as sale_expected, - sum(purchase_line.product_qty * purchase_line.price_unit) as normal_cost + sum(l.quantity * product.list_price) as sale_expected, + sum(l.quantity * product.standard_price) as normal_cost from account_invoice_line l left join account_invoice i on (l.invoice_id = i.id) - left join sale_order_invoice_rel sale_invoice on (i.id=sale_invoice.invoice_id) - left join sale_order sale on sale.id=sale_invoice.order_id - left join sale_order_line sale_line on sale.id=sale_line.order_id - left join purchase_order purchase on purchase.invoice_id=i.id - left join purchase_order_line purchase_line on purchase_line.order_id=purchase.id + left join product_template product on (product.id=l.product_id) where l.product_id = %s and i.state in ('%s') and i.type in ('%s') """%(val.id,"','".join(states),"','".join(invoice_types)) cr.execute(sql) @@ -111,24 +107,22 @@ class product_product(osv.osv): 'date_from': fields.function(_product_margin, method=True, type='date', string='From Date', multi=True), 'date_to': fields.function(_product_margin, method=True, type='date', string='To Date', multi=True), 'invoice_state': fields.function(_product_margin, method=True, type='selection', selection=[ - ('paid','Paid'), - ('open','All Open'), - ('draft_open','Draft and Open') + ('paid','Paid'),('open_paid','Open and Paid'),('draft_open_paid','Draft, Open and Paid') ], string='Invoice State',multi=True, readonly=True), - 'sale_avg_price' : fields.function(_product_margin, method=True, type='float', string='Avg. Unit Price', multi='sale'), - 'purchase_avg_price' : fields.function(_product_margin, method=True, type='float', string='Avg. Unit Price', multi='purchase'), - 'sale_num_invoiced' : fields.function(_product_margin, method=True, type='float', string='# Invoiced', multi='sale'), - 'purchase_num_invoiced' : fields.function(_product_margin, method=True, type='float', string='# Invoiced', multi='purchase'), - 'sales_gap' : fields.function(_product_margin, method=True, type='float', string='Sales Gap', multi='sale'), - 'purchase_gap' : fields.function(_product_margin, method=True, type='float', string='Purchase Gap', multi='purchase'), - 'turnover' : fields.function(_product_margin, method=True, type='float', string='Turnover' ,multi='sale'), - 'total_cost' : fields.function(_product_margin, method=True, type='float', string='Total Cost', multi='purchase'), - 'sale_expected' : fields.function(_product_margin, method=True, type='float', string='Expected Sale', multi='sale'), - 'normal_cost' : fields.function(_product_margin, method=True, type='float', string='Normal Cost', multi='purchase'), - 'total_margin' : fields.function(_product_margin, method=True, type='float', string='Total Margin', multi='total'), - 'expected_margin' : fields.function(_product_margin, method=True, type='float', string='Expected Margin', multi='total'), - 'total_margin_rate' : fields.function(_product_margin, method=True, type='float', string='Total Margin (%)', multi='margin'), - 'expected_margin_rate' : fields.function(_product_margin, method=True, type='float', string='Expected Margin (%)', multi='margin'), + 'sale_avg_price' : fields.function(_product_margin, method=True, type='float', string='Avg. Unit Price', multi='sale',help="Avg. Price in Customer Invoices)"), + 'purchase_avg_price' : fields.function(_product_margin, method=True, type='float', string='Avg. Unit Price', multi='purchase',help="Avg. Price in Supplier Invoices "), + 'sale_num_invoiced' : fields.function(_product_margin, method=True, type='float', string='# Invoiced', multi='sale',help="Sum of Quantity in Customer Invoices"), + 'purchase_num_invoiced' : fields.function(_product_margin, method=True, type='float', string='# Invoiced', multi='purchase',help="Sum of Quantity in Supplier Invoices"), + 'sales_gap' : fields.function(_product_margin, method=True, type='float', string='Sales Gap', multi='sale',help="Excepted Sale - Turn Over"), + 'purchase_gap' : fields.function(_product_margin, method=True, type='float', string='Purchase Gap', multi='purchase',help="Normal Cost - Total Cost"), + 'turnover' : fields.function(_product_margin, method=True, type='float', string='Turnover' ,multi='sale',help="Sum of Multification of Invoice price and quantity of Customer Invoices"), + 'total_cost' : fields.function(_product_margin, method=True, type='float', string='Total Cost', multi='purchase',help="Sum of Multification of Invoice price and quantity of Supplier Invoices "), + 'sale_expected' : fields.function(_product_margin, method=True, type='float', string='Expected Sale', multi='sale',help="Sum of Multification of Sale Catalog price and quantity of Customer Invoices"), + 'normal_cost' : fields.function(_product_margin, method=True, type='float', string='Normal Cost', multi='purchase',help="Sum of Multification of Cost price and quantity of Supplier Invoices"), + 'total_margin' : fields.function(_product_margin, method=True, type='float', string='Total Margin', multi='total',help="Turnorder - Total Cost"), + 'expected_margin' : fields.function(_product_margin, method=True, type='float', string='Expected Margin', multi='total',help="Excepted Sale - Normal Cost"), + 'total_margin_rate' : fields.function(_product_margin, method=True, type='float', string='Total Margin (%)', multi='margin',help="Total margin * 100 / Turnover"), + 'expected_margin_rate' : fields.function(_product_margin, method=True, type='float', string='Expected Margin (%)', multi='margin',help="Expected margin * 100 / Expected Sale"), } diff --git a/addons/product_margin/product_margin_view.xml b/addons/product_margin/product_margin_view.xml index d625c251dce..12f2d436903 100644 --- a/addons/product_margin/product_margin_view.xml +++ b/addons/product_margin/product_margin_view.xml @@ -2,21 +2,38 @@ - + + + product.margin.graph + product.product + graph + + + + + + + + + product.margin.form.inherit product.product - form - - 10 - - - + form + 5 + +
+ + + + + + @@ -42,11 +59,12 @@ - + - - + + +
@@ -55,18 +73,19 @@ product.product tree - + - - - + + + +
diff --git a/addons/product_margin/wizard/wizard_product_margin.py b/addons/product_margin/wizard/wizard_product_margin.py index 09df17da294..1c7376d38c1 100644 --- a/addons/product_margin/wizard/wizard_product_margin.py +++ b/addons/product_margin/wizard/wizard_product_margin.py @@ -36,17 +36,17 @@ def _action_open_window(self, cr, uid, data, context): cr.execute('select id,name from ir_ui_view where name=%s and type=%s', ('product.margin.tree', 'tree')) view_res = cr.fetchone() return { - 'name': 'Product Margin', + 'name': 'Product Margins', 'context':{'date_from':data['form']['from_date'],'date_to':data['form']['to_date'],'invoice_state' : data['form']['invoice_state']}, 'view_type': 'form', - "view_mode": 'tree,form', + "view_mode": 'tree,form,graph', 'res_model':'product.product', 'type': 'ir.actions.act_window', 'view_id': view_res, } -class product_margin(wizard.interface): +class product_margins(wizard.interface): form1 = '''
@@ -58,28 +58,32 @@ class product_margin(wizard.interface): 'from_date': { 'string': 'From', 'type': 'date', + 'default': lambda *a:time.strftime('%Y-01-01'), + }, 'to_date': { 'string': 'To', 'type': 'date', + 'default': lambda *a:time.strftime('%Y-12-31'), + }, 'invoice_state': { 'string': 'Invoice State', 'type': 'selection', - 'selection': [('paid','Paid'),('open','All Open'),('draft_open','Draft and Open')], + 'selection': [('paid','Paid'),('open_paid','Open and Paid'),('draft_open_paid','Draft, Open and Paid'),], 'required': True, - 'default': lambda *a:"open", + 'default': lambda *a:"open_paid", }, } states = { 'init': { 'actions': [], - 'result': {'type': 'form', 'arch':form1, 'fields':form1_fields, 'state': [('end', 'Cancel','gtk-cancel'),('open', 'Open Margin','gtk-ok')]} + 'result': {'type': 'form', 'arch':form1, 'fields':form1_fields, 'state': [('end', 'Cancel','gtk-cancel'),('open', 'Open Margins','gtk-ok')]} }, 'open': { 'actions': [], 'result': {'type': 'action', 'action': _action_open_window, 'state':'end'} } } -product_margin('product.margin') +product_margins('product.margins') From a39c3fb57f4cdbc7dc065c2849c599671c174f32 Mon Sep 17 00:00:00 2001 From: Amit Mendapara Date: Fri, 10 Oct 2008 18:13:15 +0530 Subject: [PATCH 19/24] * Added simple Gantt view for project.task bzr revid: ame@tinyerp.com-20081010124315-810jnd85rdo3pelh --- addons/project/project_view.xml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index bfb85802320..0f518ab67b2 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -310,13 +310,28 @@ calendar - + - + + + project.task.gantt + project.task + gantt + + + + + + + + + + + project.task.graph project.task graph @@ -333,7 +348,7 @@ All Tasks project.task form - tree,form,calendar,graph + tree,form,calendar,gantt,graph @@ -342,7 +357,7 @@ My Tasks project.task form - tree,form,calendar,graph + tree,form,calendar,gantt,graph [('user_id', '=', uid)] From 430b794aac1ea7c5cb56b19a06fa71508c646cd0 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 10 Oct 2008 18:33:33 +0530 Subject: [PATCH 20/24] add two reports account balance and general ledger to new menu item generic report in account bzr revid: mra@tinyerp.com-20081010130333-v39h7n1glvnbiwtf --- addons/account/account_menuitem.xml | 1 + addons/account/account_wizard.xml | 9 ++++ addons/account/report/account_balance.py | 45 ++++++++++--------- .../wizard/wizard_account_balance_report.py | 12 ++--- .../wizard/wizard_general_ledger_report.py | 8 ++-- 5 files changed, 44 insertions(+), 31 deletions(-) diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml index 299e5928353..9b3726b5c40 100644 --- a/addons/account/account_menuitem.xml +++ b/addons/account/account_menuitem.xml @@ -16,5 +16,6 @@ + diff --git a/addons/account/account_wizard.xml b/addons/account/account_wizard.xml index d53ddc5adee..f2573a71f9b 100644 --- a/addons/account/account_wizard.xml +++ b/addons/account/account_wizard.xml @@ -78,5 +78,14 @@ + + + + + + + + + diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py index 624f49ebdfa..044315c538c 100755 --- a/addons/account/report/account_balance.py +++ b/addons/account/report/account_balance.py @@ -35,7 +35,7 @@ import datetime from report import report_sxw class account_balance(report_sxw.rml_parse): - + _name = 'report.account.account.balance' def __init__(self, cr, uid, name, context): super(account_balance, self).__init__(cr, uid, name, context) @@ -53,20 +53,20 @@ class account_balance(report_sxw.rml_parse): 'get_periods':self.get_periods, }) self.context = context - + def get_fiscalyear(self, form): res=[] - if form.has_key('fiscalyear'): + if form.has_key('fiscalyear'): fisc_id = form['fiscalyear'] if not (fisc_id): return '' self.cr.execute("select name from account_fiscalyear where id = %d" %(int(fisc_id))) res=self.cr.fetchone() return res and res[0] or '' - + def get_periods(self, form): result='' - if form.has_key('periods'): + if form.has_key('periods'): period_ids = ",".join([str(x) for x in form['periods'][0][2] if x]) self.cr.execute("select name from account_period where id in (%s)" % (period_ids)) res=self.cr.fetchall() @@ -76,7 +76,7 @@ class account_balance(report_sxw.rml_parse): else: result+=r[0]+", " return str(result and result[:-1]) or '' - + def lines(self, form, ids={}, done=None, level=1): if not ids: ids = self.ids @@ -84,10 +84,13 @@ class account_balance(report_sxw.rml_parse): return [] if not done: done={} + if form.has_key('Account_list') and form['Account_list']: + ids = [form['Account_list']] + del form['Account_list'] res={} result_acc=[] ctx = self.context.copy() - if form.has_key('fiscalyear'): + if form.has_key('fiscalyear'): self.transform_period_into_date_array(form) ctx['fiscalyear'] = form['fiscalyear'] ctx['periods'] = form['periods'][0][2] @@ -95,7 +98,7 @@ class account_balance(report_sxw.rml_parse): self.transform_date_into_date_array(form) ctx['date_from'] = form['date_from'] ctx['date_to'] = form['date_to'] - + accounts = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx) def cmp_code(x, y): return cmp(x.code, y.code) @@ -103,7 +106,7 @@ class account_balance(report_sxw.rml_parse): for account in accounts: if account.id in done: continue - done[account.id] = 1 + done[account.id] = 1 res = { 'lid' :'', 'date':'', @@ -140,7 +143,7 @@ class account_balance(report_sxw.rml_parse): if form['display_account'] == 'bal_mouvement': if res['credit'] <> 0 or res['debit'] <> 0 or res['balance'] <> 0: result_acc.append(res) - elif form['display_account'] == 'bal_solde': + elif form['display_account'] == 'bal_solde': if res['balance'] <> 0: result_acc.append(res) else: @@ -156,7 +159,7 @@ class account_balance(report_sxw.rml_parse): ids2.sort() result_acc += self.lines(form, [x[1] for x in ids2], done, level+1) return result_acc - + def moveline(self,form,ids,level): res={} self.date_lst_string = '\'' + '\',\''.join(map(str,self.date_lst)) + '\'' @@ -168,7 +171,7 @@ class account_balance(report_sxw.rml_parse): "WHERE l.account_id = '"+str(ids)+"' " \ "AND l.date IN (" + self.date_lst_string + ") " \ "ORDER BY l.id") - res = self.cr.dictfetchall() + res = self.cr.dictfetchall() sum = 0.0 for r in res: sum = r['debit1'] - r['credit1'] @@ -186,7 +189,7 @@ class account_balance(report_sxw.rml_parse): else: r['bal_type']=" Cr." return res or '' - + def date_range(self,start,end): start = datetime.date.fromtimestamp(time.mktime(time.strptime(start,"%Y-%m-%d"))) end = datetime.date.fromtimestamp(time.mktime(time.strptime(end,"%Y-%m-%d"))) @@ -198,7 +201,7 @@ class account_balance(report_sxw.rml_parse): for date in date_array: full_str_date.append(str(date)) return full_str_date - + # def transform_period_into_date_array(self,form): ## Get All Period Date @@ -206,23 +209,23 @@ class account_balance(report_sxw.rml_parse): periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',form['fiscalyear'])]) else: periods_id = form['periods'][0][2] - date_array = [] + 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) - + self.date_lst = date_array self.date_lst.sort() - + def transform_date_into_date_array(self,form): return_array = self.date_range(form['date_from'],form['date_to']) self.date_lst = return_array self.date_lst.sort() - + def _sum_credit(self): - return self.sum_credit - + return self.sum_credit + def _sum_debit(self): - return self.sum_debit + 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) diff --git a/addons/account/wizard/wizard_account_balance_report.py b/addons/account/wizard/wizard_account_balance_report.py index f038ce2bd68..431e183f156 100644 --- a/addons/account/wizard/wizard_account_balance_report.py +++ b/addons/account/wizard/wizard_account_balance_report.py @@ -40,7 +40,7 @@ dates_form = ''' - + ''' dates_fields = { @@ -55,7 +55,7 @@ period_form = ''' - + ''' @@ -73,7 +73,7 @@ account_form = ''' ''' account_fields = { - 'Account_list': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True}, + 'Account_list': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]}, } @@ -97,7 +97,7 @@ class wizard_report(wizard.interface): else: return 'account_selection' - + 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']) @@ -108,12 +108,12 @@ 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') states = { - + 'init': { 'actions': [], 'result': {'type':'choice','next_state':_check_path} diff --git a/addons/account/wizard/wizard_general_ledger_report.py b/addons/account/wizard/wizard_general_ledger_report.py index 80a25dde35e..c4a2f2a7438 100644 --- a/addons/account/wizard/wizard_general_ledger_report.py +++ b/addons/account/wizard/wizard_general_ledger_report.py @@ -61,7 +61,7 @@ account_form = ''' ''' account_fields = { - 'Account_list': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True}, + 'Account_list': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]}, } @@ -110,7 +110,7 @@ def _check_date(self, cr, uid, data, context): raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop']) else: return 'checkreport' - + else: raise wizard.except_wizard('UserError','Date not in a defined fiscal year') @@ -119,13 +119,13 @@ 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']['sortbydate'] = 'sort_date' + 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']['sortbydate'] = 'sort_date' data['form']['display_account']='bal_all' data['form']['landscape']=True data['form']['amount_currency'] = True From 8c307d7b1d2347e1598b9d0f52069951135d63f4 Mon Sep 17 00:00:00 2001 From: Naresh Choksy Date: Fri, 10 Oct 2008 19:06:46 +0530 Subject: [PATCH 21/24] designed a module mrp_subproduct, that adds a tab on the mrp.bom object called 'sub product' with a one2many in editable list with a few fields: * product_id * product_qty * product_uom When creating the mrp.production, added these products, in the finnished products tab. kept this module in the profile_manufacturing configuration wizard. bzr revid: nch@tinyerp.com-20081010133646-v2eb3s4p0yjy4fd8 --- addons/mrp_subproduct/__init__.py | 1 + addons/mrp_subproduct/__terp__.py | 46 +++++++++ addons/mrp_subproduct/mrp_subproduct.py | 94 +++++++++++++++++++ addons/mrp_subproduct/mrp_subproduct_view.xml | 29 ++++++ .../profile_manufacturing.py | 4 +- .../profile_manufacturing.xml | 1 + 6 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 addons/mrp_subproduct/__init__.py create mode 100644 addons/mrp_subproduct/__terp__.py create mode 100644 addons/mrp_subproduct/mrp_subproduct.py create mode 100644 addons/mrp_subproduct/mrp_subproduct_view.xml diff --git a/addons/mrp_subproduct/__init__.py b/addons/mrp_subproduct/__init__.py new file mode 100644 index 00000000000..5314d207ad6 --- /dev/null +++ b/addons/mrp_subproduct/__init__.py @@ -0,0 +1 @@ +import mrp_subproduct \ No newline at end of file diff --git a/addons/mrp_subproduct/__terp__.py b/addons/mrp_subproduct/__terp__.py new file mode 100644 index 00000000000..22b022baa8a --- /dev/null +++ b/addons/mrp_subproduct/__terp__.py @@ -0,0 +1,46 @@ +# -*- 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. +############################################################################### +{ + "name" : "MRP Sub Product", + "version" : "1.0", + "author" : "Tiny", + "website" : "http://tinyerp.com/module_stock.html", + "depends" : ["base","mrp"], + "category" : "Generic Modules/Production", + "init_xml" : [], + "demo_xml" : [], + "update_xml" : [ + "mrp_subproduct_view.xml", + ], + "active": False, + "installable": True +} + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/mrp_subproduct/mrp_subproduct.py b/addons/mrp_subproduct/mrp_subproduct.py new file mode 100644 index 00000000000..464642f7bea --- /dev/null +++ b/addons/mrp_subproduct/mrp_subproduct.py @@ -0,0 +1,94 @@ +# -*- 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. +# +############################################################################## + +from osv import fields +from osv import osv + +class mrp_subproduct(osv.osv): + _name = 'mrp.subproduct' + _description = 'Mrp Sub Product' + _columns={ + 'product_id': fields.many2one('product.product', 'Product', required=True), + 'product_qty': fields.float('Product Qty', required=True), + 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True), + 'bom_id': fields.many2one('mrp.bom', 'BoM'), + } + def onchange_product_id(self, cr, uid, ids, product_id,context={}): + if product_id: + prod=self.pool.get('product.product').browse(cr,uid,product_id) + v = {'product_uom':prod.uom_id.id} + return {'value': v} + return {} + +mrp_subproduct() + +class mrp_bom(osv.osv): + _name = 'mrp.bom' + _description = 'Bill of Material' + _inherit='mrp.bom' + _columns={ + 'sub_products':fields.one2many('mrp.subproduct', 'bom_id', 'sub_products'), + } + + +mrp_bom() + +class mrp_production(osv.osv): + _name = 'mrp.production' + _description = 'Production' + _inherit= 'mrp.production' + _columns={ + } + + def action_confirm(self, cr, uid, ids): + picking_id=super(mrp_production,self).action_confirm(cr, uid, ids) + for production in self.browse(cr, uid, ids): + source = production.product_id.product_tmpl_id.property_stock_production.id + for sub_product in production.bom_id.sub_products: + print "::::::::",sub_product.product_id.id,sub_product.product_uom.id,sub_product.product_qty,production.id + + data = { + 'name':'PROD:'+production.name, + 'date_planned': production.date_planned, + 'product_id': sub_product.product_id.id, + 'product_qty': sub_product.product_qty, + 'product_uom': sub_product.product_uom.id, + 'product_uos_qty': production.product_uos and production.product_uos_qty or False, + 'product_uos': production.product_uos and production.product_uos.id or False, + 'location_id': source, + 'location_dest_id': production.location_dest_id.id, + 'move_dest_id': production.move_prod_id.id, + 'state': 'waiting', + 'production_id':production.id + } + sub_prod_ids=self.pool.get('stock.move').create(cr, uid,data) + return picking_id + +mrp_production() diff --git a/addons/mrp_subproduct/mrp_subproduct_view.xml b/addons/mrp_subproduct/mrp_subproduct_view.xml new file mode 100644 index 00000000000..4239c05edbf --- /dev/null +++ b/addons/mrp_subproduct/mrp_subproduct_view.xml @@ -0,0 +1,29 @@ + + + + + mrp.bom.sub.product + mrp.bom + + form + + + + + + + + + +
+ + + + + +
+
+
+
+
+
\ No newline at end of file diff --git a/addons/profile_manufacturing/profile_manufacturing.py b/addons/profile_manufacturing/profile_manufacturing.py index 3ea2adbb230..817d06a91f7 100644 --- a/addons/profile_manufacturing/profile_manufacturing.py +++ b/addons/profile_manufacturing/profile_manufacturing.py @@ -69,7 +69,9 @@ class profile_manufacturing_config_install_modules_wizard(osv.osv_memory): "our frontend point of sale for a perfect ergonomy with touchscreen "\ "materials and payment processing hardware."), 'portal': fields.boolean('Portal', - help="This module allows you to manage a Portal system.") + help="This module allows you to manage a Portal system."), + 'mrp_subproduct': fields.boolean('Mrp Sub Product', + help="This module allows you to add sub poducts in mrp bom.") } def action_cancel(self,cr,uid,ids,conect=None): return { diff --git a/addons/profile_manufacturing/profile_manufacturing.xml b/addons/profile_manufacturing/profile_manufacturing.xml index f4f917afe97..a8f5945fd98 100644 --- a/addons/profile_manufacturing/profile_manufacturing.xml +++ b/addons/profile_manufacturing/profile_manufacturing.xml @@ -11,6 +11,7 @@ + From 8332dd1cb92205e5f2137c3dee1f8d64e04ab774 Mon Sep 17 00:00:00 2001 From: Najlaa Date: Fri, 10 Oct 2008 15:45:28 +0200 Subject: [PATCH 22/24] Production order, vir changes bzr revid: nel@silver-20081010134528-zkmply66g9lgbk70 --- addons/mrp/report/order.py | 2 +- addons/mrp/report/order.rml | 235 ++++++++++++++++++++++++------------ 2 files changed, 159 insertions(+), 78 deletions(-) diff --git a/addons/mrp/report/order.py b/addons/mrp/report/order.py index 1d801b3aa2e..98f4bf1c0fb 100644 --- a/addons/mrp/report/order.py +++ b/addons/mrp/report/order.py @@ -39,4 +39,4 @@ class order(report_sxw.rml_parse): }) -report_sxw.report_sxw('report.mrp.production.order','mrp.production','addons/mrp/report/order.rml',parser=order) +report_sxw.report_sxw('report.mrp.production.order','mrp.production','addons/mrp/report/order.rml',parser=order, header=2) diff --git a/addons/mrp/report/order.rml b/addons/mrp/report/order.rml index cc1b0bf34b3..35a7351371f 100644 --- a/addons/mrp/report/order.rml +++ b/addons/mrp/report/order.rml @@ -3,6 +3,36 @@ @@ -13,42 +43,80 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + @@ -60,76 +128,89 @@ - [[ repeatIn(objects,'o') ]] - - - - - - - Production Order N° : [[ o.name ]] - - - - Printing date : [[ time.strftime('%d/%m/%Y') ]] - Partner Order reference : [[ o.sale_ref or ' ' ]] - SO number : [[ o.sale_name or '' ]] - - - - - - - Product Name - - - Product Description - - - Qty - - - -
- - - - [[ '['+ o.product_id.code +']' ]] [[ o.product_id.name ]] - - - [[ o.product_id.description ]] - - - [[ '%.2f' % o.product_qty ]] [[ o.product_uom.name ]] - - - -
+ [[ repeatIn(objects,'o') ]] - ......... - ......... + - + Production Order N° : [[ o.name ]] + + + + - Planned Date + Printing date - : + Planned Date - [[ time.strftime('%d/%m/%Y', time.strptime(o.date_planned, '%Y-%m-%d %H:%M:%S')) ]] - - - + Partner Ref + + + SO Number + + + Product Name - - +
+ + + + [[ time.strftime('%d/%m/%Y') ]] + + + [[ time.strftime('%d/%m/%Y', time.strptime(o.date_planned, '%Y-%m-%d %H:%M:%S')) ]] + + + [[ o.sale_ref or ' ' ]] + + + [[ o.sale_name or '' ]] + + + [[ '['+ o.product_id.code +']' ]] [[ o.product_id.name ]] + + + +
+ + + + [[ o.product_id.description ]] + + + + + + + Product + + + Qty + + + + + [[ repeatIn(o.move_lines,'line') ]] + [[ '['+line.product_id.code +']' ]][[ line.product_id.name ]] + + + [[ '%.2f' % line.product_qty ]] [[line.product_uom.name]] + + + + + ......... + ......... + + +
From 7df75ba0342aec94fb50503033214f569f21d446 Mon Sep 17 00:00:00 2001 From: Najlaa Date: Fri, 10 Oct 2008 16:04:22 +0200 Subject: [PATCH 23/24] few changes bzr revid: nel@silver-20081010140422-jgph11nw3h6972pt --- addons/mrp/report/order.rml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/addons/mrp/report/order.rml b/addons/mrp/report/order.rml index 35a7351371f..b9d62c5138f 100644 --- a/addons/mrp/report/order.rml +++ b/addons/mrp/report/order.rml @@ -93,7 +93,7 @@ - + @@ -104,6 +104,7 @@ + @@ -120,6 +121,7 @@ + @@ -142,19 +144,19 @@ - Printing date + Printing date - Planned Date + Planned Date - Partner Ref + Partner Ref - SO Number + SO Number - Product Name + Product Name @@ -162,19 +164,19 @@ - [[ time.strftime('%d/%m/%Y') ]] + [[ time.strftime('%d/%m/%Y') ]] - [[ time.strftime('%d/%m/%Y', time.strptime(o.date_planned, '%Y-%m-%d %H:%M:%S')) ]] + [[ time.strftime('%d/%m/%Y', time.strptime(o.date_planned, '%Y-%m-%d %H:%M:%S')) ]] - [[ o.sale_ref or ' ' ]] + [[ o.sale_ref or ' ' ]] - [[ o.sale_name or '' ]] + [[ o.sale_name or '' ]] - [[ '['+ o.product_id.code +']' ]] [[ o.product_id.name ]] + [[ '['+ o.product_id.code +']' ]] [[ o.product_id.name ]] @@ -201,7 +203,7 @@ [[ '['+line.product_id.code +']' ]][[ line.product_id.name ]] - [[ '%.2f' % line.product_qty ]] [[line.product_uom.name]] + [[ line.product_qty ]] [[line.product_uom.name]] From cb5f16bd17e3245ccd2c70e26a9bcf071b871f7e Mon Sep 17 00:00:00 2001 From: Harshad Modi Date: Fri, 10 Oct 2008 20:26:59 +0530 Subject: [PATCH 24/24] fixed bug bzr revid: hmo@tinyerp.com-20081010145659-f52i8be3dhfptk83 --- addons/stock/product.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/stock/product.py b/addons/stock/product.py index e9ed8b32944..f9eeef4f907 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -69,10 +69,11 @@ class product_product(osv.osv): location_ids = context['location'] else: cr.execute("select lot_stock_id from stock_warehouse") - location_ids = [id for (id,) in cr.fetchall()] + location_ids = [id for (id,) in cr.fetchall()] # build the list of ids of children of the location given by id - location_ids = self.pool.get('stock.location').search(cr, uid, [('location_id', 'child_of', location_ids)]) + child_location_ids = self.pool.get('stock.location').search(cr, uid, [('location_id', 'child_of', location_ids)]) + location_ids= len(child_location_ids) and child_location_ids or location_ids states_str = ','.join(map(lambda s: "'%s'" % s, states))