diff --git a/addons/account/report/account_analytic_entries_report.py b/addons/account/report/account_analytic_entries_report.py
index 2a1b4ad993b..ec813b8ecd8 100644
--- a/addons/account/report/account_analytic_entries_report.py
+++ b/addons/account/report/account_analytic_entries_report.py
@@ -35,6 +35,7 @@ class analytic_entries_report(osv.osv):
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
'user_id' : fields.many2one('res.users', 'User',readonly=True),
'name': fields.char('Description', size=64, readonly=True),
+ 'partner_id': fields.many2one('res.partner', 'Partner'),
'company_id': fields.many2one('res.company', 'Company', required=True),
'currency_id': fields.many2one('res.currency', 'Currency', required=True),
'account_id': fields.many2one('account.analytic.account', 'Account', required=True),
@@ -44,8 +45,7 @@ class analytic_entries_report(osv.osv):
'product_id': fields.many2one('product.product', 'Product', required=True),
'product_uom_id': fields.many2one('product.uom', 'Product UOM', required=True),
'amount': fields.float('Amount', readonly=True),
- 'unit_amount': fields.float('Unit Amount', readonly=True),
- 'amount_currency': fields.float('Amount Currency', readonly=True),
+ 'unit_amount': fields.float('Quantity', readonly=True),
'nbr': fields.integer('#Entries', readonly=True),
}
def init(self, cr):
@@ -61,6 +61,7 @@ class analytic_entries_report(osv.osv):
to_char(a.create_date, 'YYYY-MM-DD') as day,
a.user_id as user_id,
a.name as name,
+ analytic.partner_id as partner_id,
a.company_id as company_id,
a.currency_id as currency_id,
a.account_id as account_id,
@@ -70,12 +71,12 @@ class analytic_entries_report(osv.osv):
a.product_id as product_id,
a.product_uom_id as product_uom_id,
sum(a.amount) as amount,
- sum(a.unit_amount) as unit_amount,
- sum(a.amount_currency) as amount_currency
+ sum(a.unit_amount) as unit_amount
from
- account_analytic_line a
+ account_analytic_line a, account_analytic_account analytic
+ where analytic.id = a.account_id
group by
- a.create_date, a.user_id,a.name,company_id,a.currency_id,
+ a.create_date, a.user_id,a.name,analytic.partner_id,a.company_id,a.currency_id,
a.account_id,a.general_account_id,a.journal_id,
a.move_id,a.product_id,a.product_uom_id
)
diff --git a/addons/account/report/account_analytic_entries_report_view.xml b/addons/account/report/account_analytic_entries_report_view.xml
index b837186f23c..da08d56af0d 100644
--- a/addons/account/report/account_analytic_entries_report_view.xml
+++ b/addons/account/report/account_analytic_entries_report_view.xml
@@ -13,6 +13,7 @@
+
@@ -21,9 +22,8 @@
+
-
-
@@ -48,29 +48,14 @@
domain="[('day','<=', time.strftime('%%Y-%%m-%%d')), ('day','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Analytic Entries during last 7 days"/>
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -81,6 +66,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -91,9 +93,8 @@
-
-
+
@@ -102,7 +103,7 @@
analytic.entries.reportformtree,graph
- {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
+ {'search_default_month':1, 'group_by_no_leaf':1, 'search_default_Account':1, 'search_default_Month':1, 'group_by':[]}A tool search lets you know statistics on your analytics records that match your needs.
diff --git a/addons/account/report/account_balance.rml b/addons/account/report/account_balance.rml
index 5d71ef95c39..fac1983ef25 100644
--- a/addons/account/report/account_balance.rml
+++ b/addons/account/report/account_balance.rml
@@ -287,15 +287,15 @@
Code
Account
-
Debit([[ company.currency_id.code]])
-
Credit([[ company.currency_id.code]])
-
Balance([[ company.currency_id.code]])
+
Debit
+
Credit
+
Balance
[[ repeatIn(lines(data['form']), 'a') ]][[ (a['type']<>'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]][[ a['code'] or removeParentNode('tr') ]]
[[ (a['type']<>'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]][[ '..'*(a['level']-1) ]][[ a['name'] ]]
-
[[ (a['type']<>'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]][[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['debit']) ]] [[ company.currency_id.symbol ]][[ a['type']<>'view' and removeParentNode('font') ]] [[formatLang(a['debit']) ]] [[ company.currency_id.symbol ]]
-
[[ (a['type']<>'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font')]][[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['credit']) ]] [[ company.currency_id.symbol ]][[ a['type']<>'view' and removeParentNode('font') ]] [[ formatLang(a['credit']) ]] [[ company.currency_id.symbol ]]
+
[[ (a['type']<>'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]][[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['debit']) ]][[ a['type']<>'view' and removeParentNode('font') ]] [[formatLang(a['debit']) ]]
+
[[ (a['type']<>'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font')]][[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['credit']) ]][[ a['type']<>'view' and removeParentNode('font') ]] [[ formatLang(a['credit']) ]]
[[ (a['type']<>'view' and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]][[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['balance']) ]] [[ company.currency_id.symbol ]][[ a['type']<>'view' and removeParentNode('font') ]] [[ formatLang(a['balance']) ]] [[ company.currency_id.symbol ]]
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py
index d09be0fb331..39a1709d503 100644
--- a/addons/account/report/account_invoice_report.py
+++ b/addons/account/report/account_invoice_report.py
@@ -72,6 +72,7 @@ class account_invoice_report(osv.osv):
'partner_bank_id': fields.many2one('res.partner.bank', 'Bank Account',readonly=True),
'residual': fields.float('Total Residual', readonly=True),
'delay_to_pay': fields.float('Avg. Delay To Pay', readonly=True, group_operator="avg"),
+ 'due_delay': fields.float('Avg. Due Delay', readonly=True, group_operator="avg"),
}
_order = 'date desc'
def init(self, cr):
@@ -134,6 +135,11 @@ class account_invoice_report(osv.osv):
left join account_invoice as a ON (a.move_id=aml.move_id)
left join account_invoice_line as l ON (a.id=l.invoice_id)
where a.id=ai.id)) as delay_to_pay,
+ sum((select extract(epoch from avg(date_trunc('day',a.date_due)-date_trunc('day',a.date_invoice)))/(24*60*60)::decimal(16,2)
+ from account_move_line as aml
+ left join account_invoice as a ON (a.move_id=aml.move_id)
+ left join account_invoice_line as l ON (a.id=l.invoice_id)
+ where a.id=ai.id)) as due_delay,
(case when ai.type in ('out_refund','in_invoice') then
ai.residual * -1
else
@@ -145,7 +151,7 @@ class account_invoice_report(osv.osv):
left join account_invoice as ai ON (ai.id=ail.invoice_id)
left join product_template pt on (pt.id=ail.product_id)
left join product_uom u on (u.id=ail.uos_id),
- res_currency_rate cr
+ res_currency_rate cr
where cr.id in (select id from res_currency_rate cr2 where (cr2.currency_id = ai.currency_id)
and ((ai.date_invoice is not null and cr.name <= ai.date_invoice) or (ai.date_invoice is null and cr.name <= NOW())) limit 1)
group by ail.product_id,
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index 98dd3f64fb7..12f8b23e550 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -34,6 +34,7 @@
+
@@ -97,6 +98,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -118,17 +130,6 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/account/report/account_journal.rml b/addons/account/report/account_journal.rml
index 41261a12c1a..e153ae20adb 100644
--- a/addons/account/report/account_journal.rml
+++ b/addons/account/report/account_journal.rml
@@ -253,9 +253,9 @@
[[ repeatIn(lines(), 'a') ]][[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ a['ref'] ]] [[ a['type']==3 and a['code'] ]]
[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ a['name'] ]]
-
[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ formatLang(a['debit']) ]] [[ company.currency_id.symbol ]]
-
[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ formatLang(a['credit']) ]] [[ company.currency_id.symbol ]]
+
[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ formatLang(a['debit']) ]]
+
[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ formatLang(a['credit']) ]]
[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ formatLang(a['balance']) ]] [[ company.currency_id.symbol ]]
[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ formatLang(a['enlitige'] or 0.0) ]] [[ company.currency_id.symbol ]]
- [[ (data['form']['format_perc'] or not data['form']['show_columns']) and removeParentNode('blockTable') ]] [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]][[ a['code'] ]]
-
-
- [['...'*(a['level']-1) ]] [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]][[ a['name'] ]]
-
-
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]][[ a['pattern'] ]]
-
-
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]][[ a['debit'] ]]
-
-
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]][[ a['credit'] ]]
-
-
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]][[ a['balance'] ]]
-
-
-
-
-
-
- [[ (not data['form']['format_perc'] or not data['form']['show_columns']) and removeParentNode('blockTable') ]] [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]][[ a['code'] ]]
-
-
- [['...'*(a['level']-1) ]] [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]][[ a['name'] ]]
-
-
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]][[ a['pattern'] ]]
-
-
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]][[ a['debit'] ]]
-
-
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]][[ a['credit'] ]]
-
-
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]][[ a['balance'] ]]
-
-
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]][[ a['balance_perc'] ]]
-
-
-
-
-
-
- [[ (data['form']['format_perc'] or data['form']['show_columns']) and removeParentNode('blockTable') ]] [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]][[ a['code'] ]]
-
-
- [['...'*(a['level']-1) ]] [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]][[ a['name'] ]]
-
-
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]][[ a['pattern'] ]]
-
-
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]][[ a['balance'] ]]
-
-
-
-
-
-
- [[ (not data['form']['format_perc'] or data['form']['show_columns']) and removeParentNode('blockTable') ]][[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]] [[ a['code'] ]]
-
-
- [['...'*(a['level']-1) ]] [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]][[ a['name'] ]]
-
-
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font')]][[ a['pattern'] ]]
-
-
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]][[ a['balance'] ]]
-
-
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font')]][[ a['balance_perc'] ]]
-
-
-
-
-
-
-
-
-
-
- [[ not data['form']['show_columns'] and removeParentNode('blockTable') ]]
-
-
- Total :
-
-
- [[ total_dr() ]]
-
-
- [[ total_cr() ]]
-
-
-
-
-
-
-
-
-
-
-
- [[ data['form']['compare_pattern']!='none' and "C.S.Y.T.(C./P) : Compare Selected Years In Terms of Cash/Perc" or removeParentNode('font') ]]
-
-
\ No newline at end of file
diff --git a/addons/account/report/invoice.rml b/addons/account/report/invoice.rml
index 741e4544e7b..6c3c6fc01c3 100644
--- a/addons/account/report/invoice.rml
+++ b/addons/account/report/invoice.rml
@@ -180,7 +180,7 @@
- [[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount) ]]
+ [[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount) ]] [[ o.currency_id.symbol ]]
diff --git a/addons/account/report/overdue.rml b/addons/account/report/overdue.rml
index fad5c27ec79..a0748e281ac 100644
--- a/addons/account/report/overdue.rml
+++ b/addons/account/report/overdue.rml
@@ -151,13 +151,13 @@
Maturity date
Li.
@@ -181,10 +181,10 @@
[[ line['date_maturity'] and formatLang(line['date_maturity'],date=True) or '' ]]
- [[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]] [[ company.currency_id.symbol ]]
+ [[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]]
- [[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]] [[ company.currency_id.symbol ]]
+ [[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]]
- [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]]
- [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]]
[[ repeatIn(get_lines(data['form']['based_on'],data['form']['periods'],data['form']['company_id']), 'o') ]][[ (o['level']) ]] [[ (len(o['level'])<5 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ o['code'] ]] [[ o['name'] ]]
-
[[ len(o['level'])<5 and setTag('para','para',{'fontName':"Helvetica-Bold"}) or removeParentNode('font')]][[ o['type']=='view' and removeParentNode('font') ]][[ formatLang(o['debit']) ]] [[ company.currency_id.symbol ]][[ o['type']<>'view' and removeParentNode('font') ]][[ formatLang(o['debit']) ]] [[ company.currency_id.symbol ]]
-
[[ len(o['level'])<5 and setTag('para','para',{'fontName':"Helvetica-Bold"}) or removeParentNode('font')]][[ o['type']=='view' and removeParentNode('font') ]][[ formatLang(o['credit']) ]] [[ company.currency_id.symbol ]][[ o['type']<>'view' and removeParentNode('font') ]][[ formatLang(o['credit'])]] [[ company.currency_id.symbol ]]
+
[[ len(o['level'])<5 and setTag('para','para',{'fontName':"Helvetica-Bold"}) or removeParentNode('font')]][[ o['type']=='view' and removeParentNode('font') ]][[ formatLang(o['debit']) ]][[ o['type']<>'view' and removeParentNode('font') ]][[ formatLang(o['debit']) ]]
+
[[ len(o['level'])<5 and setTag('para','para',{'fontName':"Helvetica-Bold"}) or removeParentNode('font')]][[ o['type']=='view' and removeParentNode('font') ]][[ formatLang(o['credit']) ]][[ o['type']<>'view' and removeParentNode('font') ]][[ formatLang(o['credit'])]]
[[ len(o['level'])<5 and setTag('para','para',{'fontName':"Helvetica-Bold"}) or removeParentNode('font')]][[ o['type']=='view' and removeParentNode('font') ]][[ formatLang(o['tax_amount']) ]] [[ company.currency_id.symbol ]][[ o['type']<>'view' and removeParentNode('font') ]][[ formatLang(o['tax_amount']) ]] [[ company.currency_id.symbol ]]
diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml
index adf3571f406..326584d1b6b 100644
--- a/addons/account/security/account_security.xml
+++ b/addons/account/security/account_security.xml
@@ -19,7 +19,7 @@
-
+
@@ -35,7 +35,7 @@
-
+
@@ -87,7 +87,7 @@
-
+
@@ -138,6 +138,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Account Entry
diff --git a/addons/account/test/account_fiscalyear_close.yml b/addons/account/test/account_fiscalyear_close.yml
index 59cbfdafc0b..c69e11abd6b 100644
--- a/addons/account/test/account_fiscalyear_close.yml
+++ b/addons/account/test/account_fiscalyear_close.yml
@@ -1,21 +1,21 @@
-
- In order to test Generate Fiscalyear Opening Entries wizard of OpenERP I first create a fiscalyear "Fiscal Year 2011" to which the entries will move
+ In order to test Generate Fiscalyear Opening Entries wizard of OpenERP I first create a fiscalyear to which the entries will move
-
!record {model: account.fiscalyear, id: account_fiscalyear_fiscalyear0}:
- code: FY2011
+ code: !eval "'FY%s'% (datetime.now().year+1)"
company_id: base.main_company
- date_start: '2011-01-01'
- date_stop: '2011-12-31'
- name: Fiscal Year 2011
+ date_start: !eval "'%s-01-01' %(datetime.now().year+1)"
+ date_stop: !eval "'%s-12-31' %(datetime.now().year+1)"
+ name: !eval "'Fiscal Year %s' %(datetime.now().year+1)"
-
- I create a period "Jan2011" for the new fiscalyear
+ I create a period for the month of january for the new fiscalyear
-
!record {model: account.period, id: account_period_jan11}:
company_id: base.main_company
- date_start: '2011-01-01'
- date_stop: '2011-12-31'
+ date_start: !eval "'%s-01-01'% (datetime.now().year+1)"
+ date_stop: !eval "'%s-12-31'% (datetime.now().year+1)"
fiscalyear_id: account_fiscalyear_fiscalyear0
- name: Jan2011
+ name: !eval "'Jan%s' %(datetime.now().year+1)"
special: 1
-
@@ -25,6 +25,7 @@
name: End of Year
code: NEW
type: situation
+ analytic_journal_id: sit
sequence_id: sequence_journal
default_debit_account_id: cash
default_credit_account_id: cash
@@ -90,7 +91,4 @@
# self.action_open_window(cr, uid, [ref("account_move_journal_2")], {"lang": 'en_US',
# "active_model": "ir.ui.menu", "active_ids": [ref("account.menu_action_move_journal_line_form")],
# "tz": False, "active_id": ref("account.menu_action_move_journal_line_form"),
-# })
-
-
-
+# })
\ No newline at end of file
diff --git a/addons/account/test/account_fiscalyear_close_state.yml b/addons/account/test/account_fiscalyear_close_state.yml
index 6d4d5353a19..af4d05eba76 100644
--- a/addons/account/test/account_fiscalyear_close_state.yml
+++ b/addons/account/test/account_fiscalyear_close_state.yml
@@ -3,11 +3,11 @@
In order to check the Close a Fiscal Year wizard in OpenERP I first create a Fiscalyear
-
!record {model: account.fiscalyear, id: account_fiscalyear_fiscalyear0}:
- code: FY2011
+ code: !eval "'FY%s'% (datetime.now().year+1)"
company_id: base.main_company
- date_start: '2011-01-01'
- date_stop: '2011-12-31'
- name: Fiscal Year 2011
+ date_start: !eval "'%s-01-01' %(datetime.now().year+1)"
+ date_stop: !eval "'%s-12-31' %(datetime.now().year+1)"
+ name: !eval "'Fiscal Year %s' %(datetime.now().year+1)"
-
I create monthly Periods for this fiscalyear
-
diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml
index a02635d0fc1..bd9af0f2a34 100644
--- a/addons/account/test/account_report.yml
+++ b/addons/account/test/account_report.yml
@@ -93,27 +93,6 @@
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-aged_partner_balance.'+format), 'wb+').write(data)
--
- Print the Compare Account Balance Report in Normal mode
--
- !python {model: account.account}: |
- import netsvc, tools, os, time
- data_dict = {'model': 'account.account', 'form': {'id':ref('account.bal'),'chart_account_id':ref('account.chart0'),'select_account': False,'format_perc':0,'show_columns' :0, 'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear': [ref('account.data_fiscalyear')] ,'target_move': 'all','periods': [],'context':{'state':'all'}}}
- (data, format) = netsvc.LocalService('report.account.balance.account.balance').create(cr, uid, [ref('account.bal'),ref('account.gpf')], data_dict, {'periods': []})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-compare-account_balance.'+format), 'wb+').write(data)
-
--
- Print the Compare Account Balance Report in Landscape mode
--
- !python {model: account.account}: |
- import netsvc, tools, os, time
- data_dict = {'model': 'account.account', 'form': {'id':ref('account.bal'),'chart_account_id':ref('account.chart0'),'select_account': False,'format_perc':0,'show_columns' :0, 'compare_pattern': 'none','account_choice': 'moves','landscape':1,'period_manner': 'actual','fiscalyear': [ref('account.data_fiscalyear')] ,'target_move': 'all','periods': [],'context':{'state':'all'}}}
- (data, format) = netsvc.LocalService('report.account.account.balance.landscape').create(cr, uid, [ref('account.bal'),ref('account.gpf')], data_dict, {'periods': []})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-compare-account_balance-landscape.'+format), 'wb+').write(data)
-
-
-
Print the Account Balance Sheet in Horizontal mode
-
diff --git a/addons/account/wizard/__init__.py b/addons/account/wizard/__init__.py
index 06d77249f96..caed6fc3977 100644
--- a/addons/account/wizard/__init__.py
+++ b/addons/account/wizard/__init__.py
@@ -44,7 +44,6 @@ import account_fiscalyear_close_state
import account_vat
import account_open_closed_fiscalyear
-import account_compare_account_balance_report
import account_invoice_state
import account_chart
import account_tax_chart
@@ -56,8 +55,6 @@ import account_use_model
import account_state_open
-import account_statement_from_invoice
-
import account_report_print_journal
import account_report_central_journal
import account_report_general_journal
diff --git a/addons/account/wizard/account_automatic_reconcile.py b/addons/account/wizard/account_automatic_reconcile.py
index e9a8ab04aac..efce4bc4da4 100644
--- a/addons/account/wizard/account_automatic_reconcile.py
+++ b/addons/account/wizard/account_automatic_reconcile.py
@@ -30,8 +30,7 @@ class account_automatic_reconcile(osv.osv_memory):
_description = 'Automatic Reconcile'
_columns = {
- 'account_ids': fields.many2many('account.account', 'reconcile_account_rel', 'reconcile_id', 'account_id', 'Accounts to Reconcile', domain = [('reconcile','=',1)], \
- help = 'If no account is specified, the reconciliation will be made using every accounts that can be reconcilied'),
+ 'account_ids': fields.many2many('account.account', 'reconcile_account_rel', 'reconcile_id', 'account_id', 'Accounts to Reconcile', domain = [('reconcile','=',1)],),
'writeoff_acc_id': fields.many2one('account.account', 'Account'),
'journal_id': fields.many2one('account.journal', 'Journal'),
'period_id': fields.many2one('account.period', 'Period'),
@@ -142,25 +141,25 @@ class account_automatic_reconcile(osv.osv_memory):
if context is None:
context = {}
form = self.read(cr, uid, ids, [])[0]
- max_amount = form.get('max_amount', 0.0)
+ max_amount = form.get('max_amount', False) and form.get('max_amount') or 0.0
power = form['power']
allow_write_off = form['allow_write_off']
reconciled = unreconciled = 0
if not form['account_ids']:
raise osv.except_osv(_('UserError'), _('You must select accounts to reconcile'))
for account_id in form['account_ids']:
+ params = (account_id,)
if not allow_write_off:
- query = "SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL \
- AND state <> 'draft' GROUP BY partner_id \
- HAVING ABS(SUM(debit-credit)) = %s AND count(*)>0"%(account_id, 0.0)
-# HAVING ABS(SUM(debit-credit)) <> %s AND count(*)>0"%(account_id, 0.0)
-# HAVING count(*)>0"%(account_id,)
+ query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL
+ AND state <> 'draft' GROUP BY partner_id
+ HAVING ABS(SUM(debit-credit)) = 0.0 AND count(*)>0"""
else:
- query = "SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL \
- AND state <> 'draft' GROUP BY partner_id \
- HAVING ABS(SUM(debit-credit)) < %s AND count(*)>0"%(account_id, max_amount or 0.0)
+ query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL
+ AND state <> 'draft' GROUP BY partner_id
+ HAVING ABS(SUM(debit-credit)) < %s AND count(*)>0"""
+ params += (max_amount,)
# reconcile automatically all transactions from partners whose balance is 0
- cr.execute(query)
+ cr.execute(query, params)
partner_ids = [id for (id,) in cr.fetchall()]
for partner_id in partner_ids:
cr.execute(
@@ -176,65 +175,63 @@ class account_automatic_reconcile(osv.osv_memory):
reconciled += len(line_ids)
if allow_write_off:
move_line_obj.reconcile(cr, uid, line_ids, 'auto', form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
-# move_line_obj.reconcile_partial(cr, uid, line_ids, 'manual', context={})
else:
move_line_obj.reconcile_partial(cr, uid, line_ids, 'manual', context={})
-# move_line_obj.reconcile(cr, uid, line_ids, 'auto', form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
- # get the list of partners who have more than one unreconciled transaction
- cr.execute(
- "SELECT partner_id " \
- "FROM account_move_line " \
- "WHERE account_id=%s " \
- "AND reconcile_id IS NULL " \
- "AND state <> 'draft' " \
- "AND partner_id IS NOT NULL " \
- "GROUP BY partner_id " \
- "HAVING count(*)>1",
- (account_id,))
- partner_ids = [id for (id,) in cr.fetchall()]
- #filter?
- for partner_id in partner_ids:
- # get the list of unreconciled 'debit transactions' for this partner
- cr.execute(
- "SELECT id, debit " \
- "FROM account_move_line " \
- "WHERE account_id=%s " \
- "AND partner_id=%s " \
- "AND reconcile_id IS NULL " \
- "AND state <> 'draft' " \
- "AND debit > 0",
- (account_id, partner_id))
- debits = cr.fetchall()
+ # get the list of partners who have more than one unreconciled transaction
+ cr.execute(
+ "SELECT partner_id " \
+ "FROM account_move_line " \
+ "WHERE account_id=%s " \
+ "AND reconcile_id IS NULL " \
+ "AND state <> 'draft' " \
+ "AND partner_id IS NOT NULL " \
+ "GROUP BY partner_id " \
+ "HAVING count(*)>1",
+ (account_id,))
+ partner_ids = [id for (id,) in cr.fetchall()]
+ #filter?
+ for partner_id in partner_ids:
+ # get the list of unreconciled 'debit transactions' for this partner
+ cr.execute(
+ "SELECT id, debit " \
+ "FROM account_move_line " \
+ "WHERE account_id=%s " \
+ "AND partner_id=%s " \
+ "AND reconcile_id IS NULL " \
+ "AND state <> 'draft' " \
+ "AND debit > 0",
+ (account_id, partner_id))
+ debits = cr.fetchall()
- # get the list of unreconciled 'credit transactions' for this partner
- cr.execute(
- "SELECT id, credit " \
- "FROM account_move_line " \
- "WHERE account_id=%s " \
- "AND partner_id=%s " \
- "AND reconcile_id IS NULL " \
- "AND state <> 'draft' " \
- "AND credit > 0",
- (account_id, partner_id))
- credits = cr.fetchall()
+ # get the list of unreconciled 'credit transactions' for this partner
+ cr.execute(
+ "SELECT id, credit " \
+ "FROM account_move_line " \
+ "WHERE account_id=%s " \
+ "AND partner_id=%s " \
+ "AND reconcile_id IS NULL " \
+ "AND state <> 'draft' " \
+ "AND credit > 0",
+ (account_id, partner_id))
+ credits = cr.fetchall()
- (rec, unrec) = self.do_reconcile(cr, uid, credits, debits, max_amount, power, form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
- reconciled += rec
- unreconciled += unrec
+ (rec, unrec) = self.do_reconcile(cr, uid, credits, debits, max_amount, power, form['writeoff_acc_id'], form['period_id'], form['journal_id'], context)
+ reconciled += rec
+ unreconciled += unrec
- # add the number of transactions for partners who have only one
- # unreconciled transactions to the unreconciled count
- partner_filter = partner_ids and 'AND partner_id not in (%s)' % ','.join(map(str, filter(None, partner_ids))) or ''
- cr.execute(
- "SELECT count(*) " \
- "FROM account_move_line " \
- "WHERE account_id=%s " \
- "AND reconcile_id IS NULL " \
- "AND state <> 'draft' " + partner_filter,
- (account_id,))
- additional_unrec = cr.fetchone()[0]
- unreconciled = unreconciled + additional_unrec
+ # add the number of transactions for partners who have only one
+ # unreconciled transactions to the unreconciled count
+ partner_filter = partner_ids and 'AND partner_id not in (%s)' % ','.join(map(str, filter(None, partner_ids))) or ''
+ cr.execute(
+ "SELECT count(*) " \
+ "FROM account_move_line " \
+ "WHERE account_id=%s " \
+ "AND reconcile_id IS NULL " \
+ "AND state <> 'draft' " + partner_filter,
+ (account_id,))
+ additional_unrec = cr.fetchone()[0]
+ unreconciled = unreconciled + additional_unrec
context.update({'reconciled': reconciled, 'unreconciled': unreconciled})
model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','account_automatic_reconcile_view1')])
resource_id = obj_model.read(cr, uid, model_data_ids, fields=['res_id'])[0]['res_id']
@@ -250,4 +247,4 @@ class account_automatic_reconcile(osv.osv_memory):
account_automatic_reconcile()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_compare_account_balance_report.py b/addons/account/wizard/account_compare_account_balance_report.py
deleted file mode 100644
index 05e441c5baa..00000000000
--- a/addons/account/wizard/account_compare_account_balance_report.py
+++ /dev/null
@@ -1,135 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import time
-
-from osv import osv, fields
-from tools.translate import _
-
-class account_compare_account_balance_report(osv.osv_memory):
- """
- This wizard will provide the account balance comparision report by fiscal years.
- """
- _name = 'account.compare.account.balance.report'
- _description = 'Account Balance Report'
- _columns = {
- 'fiscalyear': fields.many2many('account.fiscalyear', 'account_fiscalyear_rel','account_id','fiscalyear_id','Fiscal year', help='Keep empty for all open fiscal year'),
- 'select_account': fields.many2one('account.account','Select Reference Account(for % comparision)',help='Keep empty for comparison to its parent'),
- 'account_choice': fields.selection([('all','All accounts'),
- ('bal_zero','With balance is not equal to 0'),
- ('moves','With movements')],'Show Accounts'),
- 'show_columns': fields.boolean('Show Debit/Credit Information'),
- 'landscape': fields.boolean('Show Report in Landscape Form'),
- 'format_perc': fields.boolean('Show Comparision in %'),
- 'compare_pattern': fields.selection([('bal_cash','Cash'),
- ('bal_perc','Percentage'),
- ('none','Don'+ "'" +'t Compare')],'Compare Selected Years In Terms Of'),
- 'period_manner': fields.selection([('actual','Financial Period'),('created','Creation Date')],'Entries Selection Based on'),
- 'periods': fields.many2many('account.period', 'period_account_balance_rel',
- 'report_id', 'period_id', 'Periods',
- help='Keep empty for all open fiscal year'),
- }
-
- _defaults={
- 'compare_pattern': 'none',
- 'account_choice': 'moves',
- 'period_manner': 'actual',
- }
-
- def check(self, cr, uid, ids, context=None):
- data={}
- if context is None:
- context = {}
- data = {
- 'ids':context['active_ids'],
- 'form': self.read(cr, uid, ids, ['fiscalyear', 'select_account', 'account_choice', 'periods', 'show_columns', 'landscape', 'format_perc','compare_pattern','period_manner'])[0],
- }
-
- data['form']['context'] = context
- if (len(data['form']['fiscalyear'])==0) or (len(data['form']['fiscalyear'])>1 and (data['form']['compare_pattern']!='none') and (data['form']['format_perc']==1) and (data['form']['show_columns']==1) and (data['form']['landscape']!=1)):
- raise osv.except_osv(_('Warning !'), _('You have to select at least 1 Fiscal Year. \nYou may have selected the compare options with more than 1 year with credit/debit columns and % option.This can lead contents to be printed out of the paper.Please try again.'))
-
-
- if ((len(data['form']['fiscalyear'])==3) and (data['form']['format_perc']!=1) and (data['form']['show_columns']!=1)):
- if data['form']['landscape']==1:
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.account.balance.landscape',
- 'datas': data,
- }
- else:
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.balance.account.balance',
- 'datas': data,
- }
- if data['form']['format_perc']==1:
- if len(data['form']['fiscalyear'])<=2:
- if data['form']['landscape']==1:
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.account.balance.landscape',
- 'datas': data,
- }
- else:
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.balance.account.balance',
- 'datas': data,
- }
- else:
- if len(data['form']['fiscalyear'])==3:
- if data['form']['landscape']==1:
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.account.balance.landscape',
- 'datas': data,
- }
- else:
- raise osv.except_osv(_('Warning !'), _('You might have done following mistakes. Please correct them and try again. \n 1. You have selected more than 3 years in any case. \n 2. You have not selected Percentage option, but you have selected more than 2 years. \n You can select maximum 3 years. Please check again. \n 3. You have selected Percentage option with more than 2 years, but you have not selected landscape format. You have to select Landscape option. Please Check it.'))
- else:
- raise osv.except_osv(_('Warning !'), _('You might have done following mistakes. Please correct them and try again. \n 1. You have selected more than 3 years in any case. \n 2. You have not selected Percentage option, but you have selected more than 2 years. \n You can select maximum 3 years. Please check again. \n 3. You have selected Percentage option with more than 2 years, but you have not selected landscape format. You have to select Landscape option. Please Check it.'))
- else:
- if len(data['form']['fiscalyear'])>2:
- if data['form']['landscape']==1:
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.account.balance.landscape',
- 'datas': data,
- }
- else:
- raise osv.except_osv(_('Warning !'), _('You might have done following mistakes. Please correct them and try again. \n 1. You have selected more than 3 years in any case. \n 2. You have not selected Percentage option, but you have selected more than 2 years. \n You can select maximum 3 years. Please check again. \n 3. You have selected Percentage option with more than 2 years, but you have not selected landscape format. You have to select Landscape option. Please Check it.'))
- else:
- if data['form']['landscape']==1:
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.account.balance.landscape',
- 'datas': data,
- }
- else:
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.balance.account.balance',
- 'datas': data,
- }
-account_compare_account_balance_report()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account/wizard/account_compare_account_balance_report_view.xml b/addons/account/wizard/account_compare_account_balance_report_view.xml
deleted file mode 100644
index 22a9ff01cc7..00000000000
--- a/addons/account/wizard/account_compare_account_balance_report_view.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
- account.compare.account.balance.report.form
- account.compare.account.balance.report
- form
-
-
-
-
-
-
-
-
-
diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py
index fb575509184..4e74774ce58 100644
--- a/addons/account/wizard/account_invoice_refund.py
+++ b/addons/account/wizard/account_invoice_refund.py
@@ -45,7 +45,7 @@ class account_invoice_refund(osv.osv_memory):
context = {}
journal = obj_journal.search(cr, uid, [('type', '=', 'sale_refund')])
if context.get('type', False):
- if context['type'] == 'in_invoice':
+ if context['type'] in ('in_invoice', 'in_refund'):
journal = obj_journal.search(cr, uid, [('type', '=', 'purchase_refund')])
return journal and journal[0] or False
@@ -55,6 +55,20 @@ class account_invoice_refund(osv.osv_memory):
'filter_refund': 'modify',
}
+ def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
+ journal_obj = self.pool.get('account.journal')
+ res = super(account_invoice_refund,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
+ type = context.get('journal_type', 'sale_refund')
+ if type in ('sale', 'sale_refund'):
+ type = 'sale_refund'
+ else:
+ type = 'purchase_refund'
+ for field in res['fields']:
+ if field == 'journal_id':
+ journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', type)], context=context, limit=None, name_get_uid=1)
+ res['fields'][field]['selection'] = journal_select
+ return res
+
def compute_refund(self, cr, uid, ids, mode='refund', context=None):
"""
@param cr: the current row, from the database cursor,
diff --git a/addons/account/wizard/account_invoice_refund_view.xml b/addons/account/wizard/account_invoice_refund_view.xml
index e26eb4e12c9..c68c9162ce4 100644
--- a/addons/account/wizard/account_invoice_refund_view.xml
+++ b/addons/account/wizard/account_invoice_refund_view.xml
@@ -11,7 +11,7 @@
-
+
diff --git a/addons/account/wizard/account_reconcile.py b/addons/account/wizard/account_reconcile.py
index e18bd9f9555..c1d9854d014 100644
--- a/addons/account/wizard/account_reconcile.py
+++ b/addons/account/wizard/account_reconcile.py
@@ -85,7 +85,19 @@ class account_move_line_reconcile(osv.osv_memory):
ids = self.pool.get('account.period').find(cr, uid, dt=date, context=context)
if len(ids):
period_id = ids[0]
- context.update({'stop_reconcile': True})
+ #stop the reconciliation process by partner (manual reconciliation) only if there is nothing more to reconcile for this partner
+ if 'active_ids' in context and context['active_ids']:
+ tmp_ml_id = account_move_line_obj.browse(cr, uid, context['active_ids'], context)[0]
+ partner_id = tmp_ml_id.partner_id and tmp_ml_id.partner_id.id or False
+ debit_ml_ids = account_move_line_obj.search(cr, uid, [('partner_id', '=', partner_id), ('account_id.reconcile', '=', True), ('reconcile_id', '=', False), ('debit', '>', 0)], context=context)
+ credit_ml_ids = account_move_line_obj.search(cr, uid, [('partner_id', '=', partner_id), ('account_id.reconcile', '=', True), ('reconcile_id', '=', False), ('credit', '>', 0)], context=context)
+ for ml_id in context['active_ids']:
+ if ml_id in debit_ml_ids:
+ debit_ml_ids.remove(ml_id)
+ if ml_id in credit_ml_ids:
+ credit_ml_ids.remove(ml_id)
+ if not (len(debit_ml_ids) and len(credit_ml_ids)):
+ context.update({'stop_reconcile': True})
account_move_line_obj.reconcile(cr, uid, context['active_ids'], 'manual', account_id,
period_id, journal_id, context=context)
return {}
diff --git a/addons/account/wizard/account_reconcile_partner_process.py b/addons/account/wizard/account_reconcile_partner_process.py
index 05a1bbd48af..6b915dfe3c9 100644
--- a/addons/account/wizard/account_reconcile_partner_process.py
+++ b/addons/account/wizard/account_reconcile_partner_process.py
@@ -28,14 +28,18 @@ class account_partner_reconcile_process(osv.osv_memory):
_description = 'Reconcilation Process partner by partner'
def _get_to_reconcile(self, cr, uid, context=None):
- cr.execute(
- "SELECT l.partner_id " \
- "FROM account_move_line AS l LEFT JOIN res_partner p ON (p.id = l.partner_id) " \
- "WHERE l.reconcile_id IS NULL " \
- "AND (%s > to_char(p.last_reconciliation_date, 'YYYY-MM-DD') " \
- "OR p.last_reconciliation_date IS NULL ) " \
- "AND l.state <> 'draft' " \
- "GROUP BY l.partner_id ",(time.strftime('%Y-%m-%d'),)
+ cr.execute("""
+ SELECT p_id FROM (SELECT l.partner_id as p_id, SUM(l.debit) AS debit, SUM(l.credit) AS credit
+ FROM account_move_line AS l LEFT JOIN account_account a ON (l.account_id = a.id)
+ LEFT JOIN res_partner p ON (p.id = l.partner_id)
+ WHERE a.reconcile = 't'
+ AND l.reconcile_id IS NULL
+ AND (%s > to_char(p.last_reconciliation_date, 'YYYY-MM-DD') OR p.last_reconciliation_date IS NULL )
+ AND l.state <> 'draft'
+ GROUP BY l.partner_id) AS tmp
+ WHERE debit > 0
+ AND credit > 0
+ """,(time.strftime('%Y-%m-%d'),)
)
return len(map(lambda x: x[0], cr.fetchall())) - 1
@@ -57,7 +61,7 @@ class account_partner_reconcile_process(osv.osv_memory):
return partner[0]
def data_get(self, cr, uid, to_reconcile, today_reconciled, context=None):
- return {'progress': (100 / float(to_reconcile + today_reconciled)) * today_reconciled}
+ return {'progress': (100 / (float(to_reconcile + today_reconciled) or 1.0)) * today_reconciled}
def default_get(self, cr, uid, fields, context=None):
res = super(account_partner_reconcile_process, self).default_get(cr, uid, fields, context=context)
diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py
index 6bd2f2138ec..5a393e1dd83 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis.py
+++ b/addons/account_analytic_analysis/account_analytic_analysis.py
@@ -126,8 +126,8 @@ class account_analytic_account(osv.osv):
where account_analytic_line.account_id IN %s \
and account_analytic_line.invoice_id is not null \
GROUP BY account_analytic_line.account_id",(parent_ids,))
- for account_id, sum in cr.fetchall():
- res[account_id] = sum
+ for account_id, lid in cr.fetchall():
+ res[account_id][f] = lid
for account in accounts:
for child in account.child_ids:
if res[account.id][f] < res.get(child.id, {}).get(f, ''):
@@ -141,8 +141,8 @@ class account_analytic_account(osv.osv):
where account_id IN %s \
and invoice_id is null \
GROUP BY account_analytic_line.account_id" ,(parent_ids,))
- for account_id, sum in cr.fetchall():
- res[account_id][f] = sum
+ for account_id, lwd in cr.fetchall():
+ res[account_id][f] = lwd
for account in accounts:
for child in account.child_ids:
if res[account.id][f] < res.get(child.id, {}).get(f, ''):
@@ -160,8 +160,8 @@ class account_analytic_account(osv.osv):
and invoice_id is null \
AND to_invoice IS NOT NULL \
GROUP BY account_analytic_line.account_id;",(parent_ids,))
- for account_id, sum in cr.fetchall():
- res[account_id][f] = round(sum, dp)
+ for account_id, sua in cr.fetchall():
+ res[account_id][f] = round(sua, dp)
for account in accounts:
for child in account.child_ids:
if account.id != child.id:
@@ -180,8 +180,8 @@ class account_analytic_account(osv.osv):
and account_analytic_journal.type='general' \
GROUP BY account_analytic_line.account_id",(parent_ids,))
ff = cr.fetchall()
- for account_id, sum in ff:
- res[account_id][f] = round(sum, dp)
+ for account_id, hq in ff:
+ res[account_id][f] = round(hq, dp)
for account in accounts:
for child in account.child_ids:
if account.id != child.id:
diff --git a/addons/account_analytic_plans/report/crossovered_analytic.rml b/addons/account_analytic_plans/report/crossovered_analytic.rml
index 73b7192e27f..1abde7093b8 100644
--- a/addons/account_analytic_plans/report/crossovered_analytic.rml
+++ b/addons/account_analytic_plans/report/crossovered_analytic.rml
@@ -197,7 +197,7 @@
Quantity
diff --git a/addons/account_payment/account_payment.py b/addons/account_payment/account_payment.py
index 718a81d5c77..1c0596ddf96 100644
--- a/addons/account_payment/account_payment.py
+++ b/addons/account_payment/account_payment.py
@@ -268,6 +268,18 @@ class payment_line(osv.osv):
else:
return self.pool.get('res.currency').search(cr, uid, [('rate','=',1.0)])[0]
+ def _get_date(self, cr, uid, context=None):
+ if context is None:
+ context = {}
+ date = False
+ if context.get('order_id') and context['order_id']:
+ order = self.pool.get('payment.order').browse(cr, uid, context['order_id'], context)
+ if order.date_prefered == 'fixed':
+ date = order.date_scheduled
+ else:
+ date = time.strftime('%Y-%m-%d')
+ return date
+
def _get_ml_inv_ref(self, cr, uid, ids, *a):
res={}
for id in self.browse(cr, uid, ids):
@@ -328,6 +340,7 @@ class payment_line(osv.osv):
'state': lambda *args: 'normal',
'currency': _get_currency,
'company_currency': _get_currency,
+ 'date': _get_date,
}
_sql_constraints = [
('name_uniq', 'UNIQUE(name)', 'The payment line name must be unique!'),
diff --git a/addons/account_payment/account_payment_demo.xml b/addons/account_payment/account_payment_demo.xml
index 25fe4a2c55b..37705a05b07 100644
--- a/addons/account_payment/account_payment_demo.xml
+++ b/addons/account_payment/account_payment_demo.xml
@@ -5,7 +5,7 @@
Reserve Bank00987654321
-
+ bankDirect Payment
diff --git a/addons/account_payment/account_payment_view.xml b/addons/account_payment/account_payment_view.xml
index 93ba4b85de0..e9238ec62f9 100644
--- a/addons/account_payment/account_payment_view.xml
+++ b/addons/account_payment/account_payment_view.xml
@@ -38,7 +38,7 @@
-
+
payment.mode.tree
@@ -88,7 +88,7 @@
-
+
@@ -203,7 +203,7 @@
-
+
New Payment Order
diff --git a/addons/account_payment/report/order.rml b/addons/account_payment/report/order.rml
index 792897fb782..c8db1e37831 100644
--- a/addons/account_payment/report/order.rml
+++ b/addons/account_payment/report/order.rml
@@ -207,7 +207,7 @@
Value Date
- Amount([[ get_company_currency() ]])
+ Amount
Currency
@@ -250,7 +250,7 @@
- Total:([[ get_company_currency() ]])
+ Total:
[[ formatLang(get_amount_total(o)) or '' ]] [[get_company_currency_symbol()]]
diff --git a/addons/account_reporting/report/account_report_bs.rml b/addons/account_reporting/report/account_report_bs.rml
index c0fa4f1e2d2..62cf193e416 100644
--- a/addons/account_reporting/report/account_report_bs.rml
+++ b/addons/account_reporting/report/account_report_bs.rml
@@ -174,7 +174,7 @@
Account Name
- Balance([[company.currency_id.code]])
+ Balance
diff --git a/addons/account_voucher/__init__.py b/addons/account_voucher/__init__.py
index 3d27cf04c78..27aee55f2d7 100644
--- a/addons/account_voucher/__init__.py
+++ b/addons/account_voucher/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,10 +15,12 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
import voucher
import report
import wizard
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py
index 752bb74f90c..3a846791c23 100644
--- a/addons/account_voucher/__openerp__.py
+++ b/addons/account_voucher/__openerp__.py
@@ -42,6 +42,7 @@
"voucher_workflow.xml",
"voucher_report.xml",
"wizard/account_voucher_unreconcile_view.xml",
+ "wizard/account_statement_from_invoice_view.xml",
"voucher_view.xml",
"voucher_payment_receipt_view.xml",
"voucher_sales_purchase_view.xml",
@@ -50,8 +51,8 @@
],
"test" : [
# "test/account_voucher.yml",
-# "test/sales_receipt.yml",
-# "test/sales_payment.yml",
+ "test/sales_receipt.yml",
+ "test/sales_payment.yml",
"test/account_voucher_report.yml"
],
'certificate': '0037580727101',
diff --git a/addons/account_voucher/test/sales_payment.yml b/addons/account_voucher/test/sales_payment.yml
index 6734b4d599c..e6e3be8f920 100644
--- a/addons/account_voucher/test/sales_payment.yml
+++ b/addons/account_voucher/test/sales_payment.yml
@@ -1,24 +1,5 @@
-
- In order to test account voucher i will create an invoice and pay it through account voucher.
--
- I create a new Partner
--
- !record {model: res.partner, id: res_partner_micropc0}:
- address:
- - country_id: base.be
- name: Jenifer
- street: 69 rue de Chimay
- type: default
- zip: '5478'
- category_id:
- - base.res_partner_category_8
- credit_limit: 0.0
- name: Micro PC
- property_account_payable: account.a_pay
- property_account_receivable: account.a_recv
-
--
- Create an invoice for the partner
+ Create an invoice for the partner Seagate with amount 450.0
-
!record {model: account.invoice, id: account_invoice_0}:
account_id: account.a_recv
@@ -34,7 +15,7 @@
product_id: product.product_product_pc1
uos_id: product.product_uom_unit
journal_id: account.sales_journal
- partner_id: res_partner_micropc0
+ partner_id: base.res_partner_seagate
-
I check that the customer invoice is in draft state
@@ -55,20 +36,20 @@
assert(acc_id.move_id)
-
- I will create and post an account voucher for the partner.
+ I will create and post an account voucher of amount 450.0 for the partner Seagate.
-
!python {model: account.voucher}: |
import netsvc
vals = {}
journal_id = self.default_get(cr, uid, ['journal_id']).get('journal_id',None)
- res = self.onchange_partner_id(cr, uid, [], ref("res_partner_micropc0"), journal_id, price=0.0, ttype='receipt')
+ res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_seagate"), journal_id, 0.0, 1, ttype='receipt')
vals = {
'account_id': ref('account.cash'),
'amount': 450.0,
'company_id': ref('base.main_company'),
'currency_id': ref('base.EUR'),
'journal_id': ref('account.bank_journal'),
- 'partner_id': ref('res_partner_micropc0'),
+ 'partner_id': ref('base.res_partner_seagate'),
'period_id': ref('account.period_8'),
'type': 'receipt',
}
diff --git a/addons/account_voucher/test/sales_receipt.yml b/addons/account_voucher/test/sales_receipt.yml
index 70539f5061f..af10d614730 100644
--- a/addons/account_voucher/test/sales_receipt.yml
+++ b/addons/account_voucher/test/sales_receipt.yml
@@ -1,74 +1,91 @@
-
--
- In order to test sales receipt i will create a sale receipt and pay it through sales payment
--
- First of all I create a voucher
--
- !record {model: account.voucher, id: account_voucher_chinaexport_0}:
+-
+ Creating a Voucher Receipt for partner Seagate with amount 30000.0
+-
+ !record {model: account.voucher, id: account_voucher_seagate_0}:
account_id: account.a_recv
- amount: 30000.0
+ amount: 0.0
company_id: base.main_company
+ currency_id: base.EUR
journal_id: account.sales_journal
line_cr_ids:
- account_id: account.a_sale
amount: 30000.0
- partner_id: base.res_partner_3
- period_id: account.period_8
+ type: cr
+ partner_id: base.res_partner_seagate
+ period_id: account.period_9
tax_amount: 0.0
type: sale
-
+
-
I check that the voucher state is Draft
-
- !assert {model: account.voucher, id: account_voucher_chinaexport_0}:
+ !assert {model: account.voucher, id: account_voucher_seagate_0}:
- state == 'draft'
-
- I clicked on post button to post the voucher
+ I click on post button to post the voucher
-
- !workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_chinaexport_0}
+ !workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_seagate_0}
-
- Check the voucher state is Posted
+ Check that the voucher state is Posted
-
- !assert {model: account.voucher, id: account_voucher_chinaexport_0}:
+ !assert {model: account.voucher, id: account_voucher_seagate_0}:
- state == 'posted'
+
+-
+ I check that move lines are validated but not reconciled
+-
+ !python {model: account.voucher}: |
+ reconciled = False
+ for l in self.browse(cr, uid, [ref("account_voucher_seagate_0")])[0].move_ids:
+ if l.reconcile_id:
+ reconciled = True
+ break
+ if not reconciled:
+ print "Info: Voucher is not paid"
+ else:
+ print "Info: Voucher is paid"
-
- I create a voucher record for the same partner
+ I create and post a voucher payment of amount 30000.0 for the partner Seagate
-
- !record {model: account.voucher, id: account_voucher_chinaexport_1}:
- account_id: account.cash
- amount: 30000.0
- company_id: base.main_company
- currency_id: base.EUR
- journal_id: account.bank_journal
- line_cr_ids:
- - account_id: account.a_recv
- amount: 0.0
- name: 2010/003
- type: cr
- - account_id: account.a_recv
- amount: 30000.0
- name: 2010/003
- type: cr
- partner_id: base.res_partner_3
- period_id: account.period_8
- type: receipt
+ !python {model: account.voucher}: |
+ import netsvc
+ vals = {}
+ journal_id = self.default_get(cr, uid, ['journal_id']).get('journal_id',None)
+ res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_seagate"), journal_id, 0.0, 1, ttype='receipt')
+ vals = {
+ 'account_id': ref('account.cash'),
+ 'amount': 30000.0,
+ 'company_id': ref('base.main_company'),
+ 'currency_id': ref('base.EUR'),
+ 'journal_id': ref('account.bank_journal'),
+ 'partner_id': ref('base.res_partner_seagate'),
+ 'period_id': ref('account.period_8'),
+ 'type': 'receipt',
+ }
+ if not res['value']['line_cr_ids']:
+ res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}]
+ res['value']['line_cr_ids'][0]['amount'] = 30000.0
+ vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']]
+ id = self.create(cr, uid, vals)
+ voucher_id = self.browse(cr, uid, id)
+ assert (voucher_id.state=='draft'), "Voucher is not in draft state"
+ wf_service = netsvc.LocalService("workflow")
+ wf_service.trg_validate(uid, 'account.voucher', voucher_id.id, 'proforma_voucher', cr)
+
-
- Check the voucher state is draft
+ I check that move lines are reconciled meaning voucher is paid
-
- !assert {model: account.voucher, id: account_voucher_chinaexport_1}:
- - state == 'draft'
-
--
- I clicked on Post button to post the voucher
--
- !workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_chinaexport_1}
-
--
- Check the voucher state is Posted
--
- !assert {model: account.voucher, id: account_voucher_chinaexport_1}:
- - state == 'posted'
+ !python {model: account.voucher}: |
+ reconciled = False
+ for l in self.browse(cr, uid, [ref("account_voucher_seagate_0")])[0].move_ids:
+ if l.reconcile_id:
+ reconciled = True
+ break
+ if not reconciled:
+ print "Info: Voucher is not paid"
+ else:
+ print "Info: Voucher is paid"
\ No newline at end of file
diff --git a/addons/account_voucher/voucher.py b/addons/account_voucher/voucher.py
index 6ef093cc935..f0a4db96910 100644
--- a/addons/account_voucher/voucher.py
+++ b/addons/account_voucher/voucher.py
@@ -20,6 +20,8 @@
##############################################################################
import time
+from lxml import etree
+
import netsvc
from osv import fields
from osv import osv
@@ -61,6 +63,8 @@ class account_voucher(osv.osv):
return context.get('search_default_journal_id')
ttype = context.get('type', 'bank')
+ if ttype in ('payment', 'receipt'):
+ ttype = 'bank'
res = journal_pool.search(cr, uid, [('type', '=', ttype)], limit=1)
return res and res[0] or False
@@ -92,21 +96,35 @@ class account_voucher(osv.osv):
if journal.currency:
currency_id = journal.currency.id
return False
-
+
def _get_partner(self, cr, uid, context={}):
return context.get('partner_id', False)
-
+
def _get_reference(self, cr, uid, context={}):
return context.get('reference', False)
-
+
def _get_narration(self, cr, uid, context={}):
return context.get('narration', False)
-
-
+
+ def name_get(self, cr, uid, ids, context=None):
+ if not len(ids):
+ return []
+ return [(r['id'], (str(r['amount']) or '')) for r in self.read(cr, uid, ids, ['amount'], context, load='_classic_write')]
+
+ def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
+ res = super(account_voucher,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
+ doc = etree.XML(res['arch'])
+ nodes = doc.xpath("//field[@name='partner_id']")
+ if context.get('type', 'sale') in ('purchase', 'payment'):
+ for node in nodes:
+ node.set('domain', "[('supplier', '=', True)]")
+ res['arch'] = etree.tostring(doc)
+ return res
+
_name = 'account.voucher'
_description = 'Accounting Voucher'
_order = "date desc, id desc"
- _rec_name = 'number'
+# _rec_name = 'number'
_columns = {
'type':fields.selection([
('sale','Sale'),
@@ -141,7 +159,7 @@ class account_voucher(osv.osv):
'amount': fields.float('Total', digits=(16, 2), required=True, readonly=True, states={'draft':[('readonly',False)]}),
'tax_amount':fields.float('Tax Amount', digits=(14,2), readonly=True, states={'draft':[('readonly',False)]}),
'reference': fields.char('Ref #', size=64, readonly=True, states={'draft':[('readonly',False)]}, help="Transaction reference number."),
- 'number': fields.related('move_id', 'name', type="char", readonly=True, string='Number'),
+ 'number': fields.char('Number', size=32, readonly=True,),
'move_id':fields.many2one('account.move', 'Account Entry'),
'move_ids': fields.related('move_id','line_id', type='one2many', relation='account.move.line', string='Journal Items', readonly=True),
'partner_id':fields.many2one('res.partner', 'Partner', change_default=1, readonly=True, states={'draft':[('readonly',False)]}),
@@ -162,10 +180,10 @@ class account_voucher(osv.osv):
'reference': _get_reference,
'narration':_get_narration,
'type':_get_type,
- 'state': lambda *a: 'draft',
- 'pay_now':lambda *a: 'pay_later',
- 'name': lambda *a: '',
- 'date' : lambda *a: time.strftime('%Y-%m-%d'),
+ 'state': 'draft',
+ 'pay_now': 'pay_later',
+ 'name': '',
+ 'date' : time.strftime('%Y-%m-%d'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.voucher',context=c),
'tax_id': _get_tax,
}
@@ -529,7 +547,7 @@ class account_voucher(osv.osv):
return {'value':res}
def action_move_line_create(self, cr, uid, ids, context=None):
-
+
def _get_payment_term_lines(term_id, amount):
term_pool = self.pool.get('account.payment.term')
if term_id and amount:
@@ -546,9 +564,8 @@ class account_voucher(osv.osv):
for inv in self.browse(cr, uid, ids):
if inv.move_id:
continue
-
- if 'force_name' in context and context['force_name']:
- name = context['force_name']
+ if inv.number:
+ name = inv.number
elif inv.journal_id.sequence_id:
name = self.pool.get('ir.sequence').get_id(cr, uid, inv.journal_id.sequence_id.id)
else:
@@ -648,7 +665,7 @@ class account_voucher(osv.osv):
if line.move_line_id.id:
rec_ids = [master_line, line.move_line_id.id]
rec_list_ids.append(rec_ids)
-
+
if not self.pool.get('res.currency').is_zero(cr, uid, inv.currency_id, line_total):
diff = line_total
move_line = {
@@ -671,7 +688,8 @@ class account_voucher(osv.osv):
self.write(cr, uid, [inv.id], {
'move_id': move_id,
- 'state':'posted'
+ 'state': 'posted',
+ 'number': name,
})
move_pool.post(cr, uid, [move_id], context={})
for rec_ids in rec_list_ids:
@@ -819,10 +837,9 @@ class account_bank_statement(osv.osv):
def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, next_number, context=None):
st_line = self.pool.get('account.bank.statement.line').browse(cr, uid, st_line_id, context=context)
if st_line.voucher_id:
- res = self.pool.get('account.voucher').proforma_voucher(cr, uid, [st_line.voucher_id.id], context={'force_name': next_number})
- #force refresh of the cache
- #st_line = self.pool.get('account.bank.statement.line').browse(cr, uid, st_line.id, context=context)
-
+ self.pool.get('account.voucher').write(cr, uid, [st_line.voucher_id.id], {'number': next_number}, context=context)
+ wf_service = netsvc.LocalService("workflow")
+ wf_service.trg_validate(uid, 'account.voucher', st_line.voucher_id.id, 'proforma_voucher', cr)
return self.pool.get('account.move.line').write(cr, uid, [x.id for x in st_line.voucher_id.move_ids], {'statement_id': st_line.statement_id.id}, context=context)
return super(account_bank_statement, self).create_move_from_st_line(cr, uid, st_line, company_currency_id, next_number, context=context)
@@ -856,4 +873,12 @@ class account_bank_statement_line(osv.osv):
}
+ def unlink(self, cr, uid, ids, context=None):
+ statement_line = self.browse(cr, uid, ids, context)
+ unlink_ids = []
+ for st_line in statement_line:
+ unlink_ids.append(st_line.voucher_id.id)
+ self.pool.get('account.voucher').unlink(cr, uid, unlink_ids, context=context)
+ return super(account_bank_statement_line, self).unlink(cr, uid, ids, context=context)
+
account_bank_statement_line()
diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml
index 5fc9b510151..ced86942d5c 100644
--- a/addons/account_voucher/voucher_payment_receipt_view.xml
+++ b/addons/account_voucher/voucher_payment_receipt_view.xml
@@ -23,13 +23,6 @@
-
-
-
-
-
-
-
@@ -37,6 +30,13 @@
+
+
+
+
+
+
+
@@ -63,13 +63,6 @@
-
-
-
-
-
-
-
@@ -77,6 +70,13 @@
+
+
+
+
+
+
+
@@ -151,7 +151,7 @@
@@ -82,5 +79,4 @@
-
-
+
\ No newline at end of file
diff --git a/addons/auction/report/bids_lots.rml b/addons/auction/report/bids_lots.rml
index 9d688868d30..c2cad707a57 100644
--- a/addons/auction/report/bids_lots.rml
+++ b/addons/auction/report/bids_lots.rml
@@ -74,10 +74,10 @@
[[ o.ach_uid and o.ach_uid.name or False]]
- [[o.bid_lines[0] and o.bid_lines[0].bid_id.name or removeParentNode('font')]]
+ [[ o.bid_lines and o.bid_lines[0] and o.bid_lines[0].bid_id.name or removeParentNode('font')]]
- [[o.bid_lines[0] and o.bid_lines[0].bid_id.contact_tel or removeParentNode('font')]]
+ [[o.bid_lines and o.bid_lines[0] and o.bid_lines[0].bid_id.contact_tel or removeParentNode('font')]]
- [[o.bid_lines[0] and o.bid_lines[0].bid_id.contact_tel or removeParentNode('font')]]
+ [[o.bid_lines and o.bid_lines[0] and o.bid_lines[0].bid_id.contact_tel or removeParentNode('font')]]
@@ -84,7 +85,7 @@
-
+
@@ -125,7 +126,7 @@
hr_evaluation.plan.phasetree
-
+
@@ -184,7 +185,7 @@
-
@@ -204,7 +205,7 @@
-
+
@@ -230,40 +231,40 @@
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Evaluation
+ Evaluationshr_evaluation.evaluationformtree,form,graph
- Each employee can be assigned to an evaluation plan. These plans define the frequency and the way you manage your periodic personnal evalautions. You will be able to define steps and attach interview forms to each step. OpenERP manages all kind of evaluations: bottom-up, top-down, self evaluation and final evaluation by the manager.
+ Each employee can be assigned to an evaluation plan. These plans define the frequency and the way you manage your periodic personnal evaluation. You will be able to define steps and attach interview forms to each step. OpenERP manages all kind of evaluations: bottom-up, top-down, self evaluation and final evaluation by the manager.
-
@@ -299,7 +300,7 @@
tree
-
+
@@ -327,26 +328,57 @@
-
+
+
+
+ Interview Request
+ hr.evaluation.interview
+ calendar
+
+
+
+
+
+
+
Interview Requestshr.evaluation.interviewform
- tree,form
+ [('is_evaluation' ,'=', True)]{"search_default_todo":1,"search_default_user_id":uid}Interview Requests are generated automatically by OpenERP according to employees evaluation plan. Each user receives automatic emails and requests to perform evaluation of their collegues periodically.
+
+
+ tree
+
+
+
+
+
+ form
+
+
+
+
+
+ calendar
+
+
+
+
+
+
+
@@ -44,15 +47,13 @@
-
-
-
+
+
+
-
-
@@ -62,24 +63,25 @@
-
-
-
+
+
+
+
-
-
-
-
-
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/hr_evaluation/security/ir.model.access.csv b/addons/hr_evaluation/security/ir.model.access.csv
index 181e412ce69..7c57d67d1cd 100644
--- a/addons/hr_evaluation/security/ir.model.access.csv
+++ b/addons/hr_evaluation/security/ir.model.access.csv
@@ -2,9 +2,9 @@
"access_hr_evaluation_evaluation_user","hr_evaluation.evaluation.user","model_hr_evaluation_evaluation","base.group_hr_user",1,1,1,1
"access_hr_evaluation_evaluation_manager","hr_evaluation.evaluation.manager","model_hr_evaluation_evaluation","base.group_hr_manager",1,1,1,1
"access_hr_evaluation_plan_user","hr_evaluation.plan.user","model_hr_evaluation_evaluation","base.group_hr_user",1,0,0,0
-"access_hr_evaluation_plan_manager","hr_evaluation.plan.manager","model_hr_evaluation_plan","base.group_hr_manager",1,0,0,0
+"access_hr_evaluation_plan_manager","hr_evaluation.plan.manager","model_hr_evaluation_plan","base.group_hr_manager",1,1,1,1
"access_hr_evaluation_plan_phase_user","hr_evaluation.plan.phase.user","model_hr_evaluation_plan_phase","base.group_hr_user",1,0,0,0
-"access_hr_evaluation_plan_phase_manager","hr_evaluation.plan.phase.manager","model_hr_evaluation_plan_phase","base.group_hr_manager",1,0,0,0
+"access_hr_evaluation_plan_phase_manager","hr_evaluation.plan.phase.manager","model_hr_evaluation_plan_phase","base.group_hr_manager",1,1,1,1
"access_hr_evaluation_interview_user","hr.evaluation.interview.user","model_hr_evaluation_interview","base.group_hr_user",1,1,1,1
"access_hr_evaluation_interview_manager","hr.evaluation.interview.manager","model_hr_evaluation_interview","base.group_hr_manager",1,1,1,1
"access_hr_evaluation_report","hr.evaluation.report","model_hr_evaluation_report","base.group_hr_manager",1,1,1,1
@@ -12,6 +12,10 @@
"access_hr_evaluation_plan_phase_system","hr_evaluation.plan.phase.system","model_hr_evaluation_plan_phase","base.group_system",1,1,1,1
"access_hr_evaluation_evaluation_system","hr_evaluation.evaluation.system","model_hr_evaluation_evaluation","base.group_system",1,0,0,0
"access_hr_evaluation_interview_system","hr.evaluation.interview.system","model_hr_evaluation_interview","base.group_system",1,0,0,0
+"access_hr_evaluation_evaluation_employee","hr_evaluation.evaluation.employee","model_hr_evaluation_evaluation","base.group_user",1,0,0,0
+"access_hr_evaluation_interview_employee","hr.evaluation.interview.employee","model_hr_evaluation_interview","base.group_user",1,0,0,0
+"access_hr_evaluation_user","hr_evaluation.user","model_hr_evaluation_plan","base.group_hr_user",1,1,1,1
+"access_hr_evaluation_employee","hr_evaluation.employee","model_hr_evaluation_plan","base.group_user",1,0,0,0
"access_survey_type_hr_manager","survey.type","survey.model_survey_type","base.group_hr_manager",1,1,1,1
"access_survey_hr_manager","survey.hr.manager","survey.model_survey","base.group_hr_manager",1,1,1,1
"access_survey_history_manager","survey.history","survey.model_survey_history","base.group_hr_manager",1,1,1,1
@@ -28,4 +32,11 @@
"access_survey_answer_hr_user","survey.answer.hr.user","survey.model_survey_answer","base.group_hr_user",1,1,1,0
"access_survey_response_answer_hr_user","survey.response.answer.hr.user","survey.model_survey_response_answer","base.group_hr_user",1,1,1,0
"access_survey_type_hr_user","survey.type.hr.user","survey.model_survey_type","base.group_hr_user",1,1,1,0
-"access_survey_question_hr_user","survey.question.hr.user","survey.model_survey_question","base.group_hr_user",1,1,1,0
\ No newline at end of file
+"access_survey_question_hr_user","survey.question.hr.user","survey.model_survey_question","base.group_hr_user",1,1,1,0
+"access_survey_page_hr_user","survey.page.hr.user","survey.model_survey_page","base.group_hr_user",1,1,1,1
+"access_survey_response_hr_user","survey.response.hr.user","survey.model_survey_response","base.group_hr_user",1,1,1,0
+"access_survey_history_hr_user","survey.history.hr.user","survey.model_survey_history","base.group_hr_user",1,1,1,0
+"access_survey_request_hr_user","survey.request.hr.user","survey.model_survey_request","base.group_hr_user",1,1,1,0
+"access_survey_question_column_heading_hr_user","survey.question.column.heading.hr.user","survey.model_survey_question_column_heading","base.group_hr_user",1,0,0,0
+"access_survey_response_line_hr_user","survey.response.line.hr.user","survey.model_survey_response_line","base.group_hr_user",1,1,1,0
+"access_survey_tbl_column_heading_hr_user","survey.tbl.column.heading.hr.user","survey.model_survey_tbl_column_heading","base.group_hr_user",1,1,1,0
diff --git a/addons/hr_evaluation/test/test_hr_evaluation.yml b/addons/hr_evaluation/test/test_hr_evaluation.yml
index 1d2acbcbd49..7797ce417d2 100644
--- a/addons/hr_evaluation/test/test_hr_evaluation.yml
+++ b/addons/hr_evaluation/test/test_hr_evaluation.yml
@@ -125,7 +125,7 @@
self.button_plan_in_progress(cr, uid, [ref('hr_evaluation_evaluation_0')])
-
- I close this servey request by giving answer of survey question.
+ I close this survey request by giving answer of survey question.
-
!python {model: hr.evaluation.interview}: |
self.survey_req_done(cr, uid, [ref('hr_evaluation_interview_0')])
diff --git a/addons/hr_evaluation/wizard/hr_evaluation_mail.py b/addons/hr_evaluation/wizard/hr_evaluation_mail.py
index 75aecf6a9f1..576c782bfd8 100644
--- a/addons/hr_evaluation/wizard/hr_evaluation_mail.py
+++ b/addons/hr_evaluation/wizard/hr_evaluation_mail.py
@@ -25,7 +25,7 @@ class hr_evaluation_reminder(osv.osv_memory):
_name = "hr.evaluation.reminder"
_description = "Sends Reminders to employess to fill the evaluations"
_columns = {
- 'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Evaluations', required=True)
+ 'evaluation_id': fields.many2one('hr.evaluation.interview', 'Interview', required=True)
}
def send_mail(self, cr, uid, ids, context=None):
diff --git a/addons/hr_expense/__openerp__.py b/addons/hr_expense/__openerp__.py
index fe06b0110c2..c9df8587153 100644
--- a/addons/hr_expense/__openerp__.py
+++ b/addons/hr_expense/__openerp__.py
@@ -51,6 +51,7 @@
'process/hr_expense_process.xml',
'report/hr_expense_report_view.xml',
'board_hr_expense_view.xml',
+ 'board_hr_expense_manager_view.xml'
],
'demo_xml': [
'hr_expense_demo.xml',
diff --git a/addons/hr_expense/board_hr_expense_manager_view.xml b/addons/hr_expense/board_hr_expense_manager_view.xml
new file mode 100644
index 00000000000..9063ac32458
--- /dev/null
+++ b/addons/hr_expense/board_hr_expense_manager_view.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+ All Employee Expenses
+ hr.expense.expense
+ form
+ [('state','in',('confirm', 'accepted'))]
+
+
+
+
+ board.hr.manager.expense.form
+ board.board
+
+ form
+
+
+
+
+
+
+
+
+
diff --git a/addons/hr_expense/board_hr_expense_view.xml b/addons/hr_expense/board_hr_expense_view.xml
index 4b06cd758b1..69dbad767d9 100644
--- a/addons/hr_expense/board_hr_expense_view.xml
+++ b/addons/hr_expense/board_hr_expense_view.xml
@@ -13,7 +13,7 @@
My Expenseshr.expense.expenseform
- [('state','in',('draft', 'confirm')),('user_id','=',uid)]
+ [('state','in',('confirm', 'accepted')),('user_id','=',uid)]
diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py
index c5818536f8c..4003cded168 100644
--- a/addons/hr_expense/hr_expense.py
+++ b/addons/hr_expense/hr_expense.py
@@ -61,12 +61,12 @@ class hr_expense_expense(osv.osv):
_name = "hr.expense.expense"
_description = "Expense"
_columns = {
- 'name': fields.char('Expense Sheet', size=128, required=True),
+ 'name': fields.char('Description', size=128, required=True),
'id': fields.integer('Sheet ID', readonly=True),
'ref': fields.char('Reference', size=32),
'date': fields.date('Date'),
'journal_id': fields.many2one('account.journal', 'Force Journal', help = "The journal used when the expense is invoiced"),
- 'employee_id': fields.many2one('hr.employee', "Employee's Name", required=True),
+ 'employee_id': fields.many2one('hr.employee', "Employee", required=True),
'user_id': fields.many2one('res.users', 'User', required=True),
'date_confirm': fields.date('Confirmation Date', help = "Date of the confirmation of the sheet expense. It's filled when the button Confirm is pressed."),
'date_valid': fields.date('Validation Date', help = "Date of the acceptation of the sheet expense. It's filled when the button Accept is pressed."),
@@ -81,11 +81,11 @@ class hr_expense_expense(osv.osv):
'company_id': fields.many2one('res.company', 'Company', required=True),
'state': fields.selection([
('draft', 'Draft'),
- ('confirm', 'Waiting confirmation'),
- ('accepted', 'Accepted'),
+ ('confirm', 'Waiting Approval'),
+ ('accepted', 'Approved'),
('invoiced', 'Invoiced'),
('paid', 'Reimbursed'),
- ('cancelled', 'Cancelled')],
+ ('cancelled', 'Refused')],
'State', readonly=True, help='When the expense request is created the state is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the state is \'Waiting Confirmation\'.\
\nIf the admin accepts it, the state is \'Accepted\'.\n If an invoice is made for the expense request, the state is \'Invoiced\'.\n If the expense is paid to user, the state is \'Reimbursed\'.'),
}
diff --git a/addons/hr_expense/hr_expense_demo.xml b/addons/hr_expense/hr_expense_demo.xml
index da348b02ab4..c3fa9e90c67 100644
--- a/addons/hr_expense/hr_expense_demo.xml
+++ b/addons/hr_expense/hr_expense_demo.xml
@@ -104,6 +104,17 @@
-
+
+ Employee Expense
+
+ [('employee_id.user_id','=',user.id)]
+
+
+
+ Manager Expense
+
+ ['|',('employee_id.user_id','=',user.id),('employee_id.parent_id.user_id','=',user.id )]
+
+
diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml
index 4d25c01e773..79c0d5513f0 100644
--- a/addons/hr_expense/hr_expense_view.xml
+++ b/addons/hr_expense/hr_expense_view.xml
@@ -27,12 +27,12 @@
tree
-
+
+
-
@@ -77,7 +77,7 @@
-
+
@@ -98,10 +98,10 @@
-
+
+
-
-
+
@@ -134,14 +134,16 @@
-
-
+
-
+
@@ -149,8 +151,9 @@
+
+
-
@@ -162,7 +165,7 @@
Expenseshr.expense.expenseform
- {"search_default_user_id":uid}
+ {"search_default_user_id":uid,'search_default_this':1}The OpenERP expenses management module allows you to track the full flow. Every month, the employees record their expenses. At the end of the month, their managers validates the expenses sheets which creates costs on projects/analytic accounts. The accountant validates the proposed entries and the employee can be reimbursed. You can also reinvoice the customer at the end of the flow.
diff --git a/addons/hr_expense/report/expense.rml b/addons/hr_expense/report/expense.rml
index 4ae45ad0aa2..fa9e78c68cd 100644
--- a/addons/hr_expense/report/expense.rml
+++ b/addons/hr_expense/report/expense.rml
@@ -181,7 +181,7 @@
+
+
-
diff --git a/addons/lunch/test/test_lunch.yml b/addons/lunch/test/test_lunch.yml
index 6af4113f153..3183764d927 100644
--- a/addons/lunch/test/test_lunch.yml
+++ b/addons/lunch/test/test_lunch.yml
@@ -1,23 +1,23 @@
- |
- In order to test the Lunch module in OpenERP,
+ In order to test the Lunch module in OpenERP,
I will create one lunch order and then check the effect on cashboxes and cashmoves
-
+
- |
Given that I have a category of lunch products "Burger".
--
+-
!record {model: lunch.category, id: lunch_category_burger0}:
name: Burger
- |
Given that I have a product "Club1" in this category with a price of "2.75".
--
+-
!record {model: lunch.product, id: lunch_product_club1}:
category_id: lunch_category_burger0
name: Club1
- price: 2.75
+ price: 2.75
- |
Given that I have a cashbox "Employee Cashbox"
--
+-
!record {model: lunch.cashbox, id: lunch_cashbox_cashbox0}:
manager: base.user_root
name: Employee Cashbox
@@ -25,87 +25,87 @@
I create a lunch order "LU001" for the "Club1" product
- |
When I select the product "club1", the price of 2.75 is automatically proposed
--
+-
!record {model: lunch.order, id: lunch_order_0}:
date: '2010-04-19'
product: 'lunch_product_club1'
price: 2.75
user_id: base.user_root
-
+
- |
I check that lunch order is on draft state after having created it.
-
!assert {model: lunch.order, id: lunch_order_0}:
- - state == 'draft'
+ - state == 'draft'
- |
I confirm the order "LU001" using the "Confirm Order" wizard.
--
+-
!record {model: lunch.order.confirm, id: lunch_order_confirm_0}:
confirm_cashbox: 'lunch_cashbox_cashbox0'
-
- I click on "Confirm Order" button of this wizard.
+ I click on "Confirm Order" button of this wizard.
-
!python {model: lunch.order.confirm}: |
- self.confirm(cr, uid, [ref('lunch_order_confirm_0')], {'active_ids': [ref('lunch_order_0')]})
-
+ self.confirm(cr, uid, [ref('lunch_order_confirm_0')], {'active_ids': [ref('lunch_order_0')]})
+
- |
I check that the Cash Moves have been generated with the right box
name
-
- !assert {model: lunch.order, id: lunch_order_0}:
+ !assert {model: lunch.order, id: lunch_order_0}:
- cashmove.id != False
-
+
- |
I check that the Total on the "Employee Cashbox" is -2.75
-
+
-
!assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}:
- sum_remain == -2.75
-
+
- |
I create a new lunch order "LU002" for the "Club1" product, at another date.
--
+-
!record {model: lunch.order, id: lunch_order_1}:
date: '2010-04-22'
product: 'lunch_product_club1'
price: 2.75
user_id: base.user_root
-
+
- |
I confirm this order.open wizard and select "Employee Cashbox".
--
+-
!record {model: lunch.order.confirm, id: lunch_order_confirm_1}:
confirm_cashbox: 'lunch_cashbox_cashbox0'
- |
- Now I click on "Confirm Order" button of this wizard.
+ Now I click on "Confirm Order" button of this wizard.
-
!python {model: lunch.order.confirm}: |
self.confirm(cr, uid, [ref('lunch_order_confirm_1')], {'active_ids': [ref('lunch_order_1')]})
-
+
- |
I check that the Total on the "Employee Cashbox" is -5.50
-
!assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}:
- - sum_remain == -5.50
+ - sum_remain == -5.50
- |
I cancel the order "LU002"
--
+-
!record {model: lunch.order.cancel, id: lunch_order_cancel_0}:
{}
- |
- I click on "Yes" button of this wizard for cancel order.
-
+ I click on "Yes" button of this wizard for cancel order.
+
-
!python {model: lunch.order.cancel}: |
self.cancel(cr, uid, [ref('lunch_order_cancel_0')], {'active_ids': [ref('lunch_order_1')]})
-
+
- |
I test that the Cash Moves record have been removed for the order LU002.
-
- !assert {model: lunch.order, id: lunch_order_1}:
+ !assert {model: lunch.order, id: lunch_order_1}:
- cashmove.id == False
-
+
- |
I check that the Total on the "Employee Cashbox" is -2.75
-
@@ -113,7 +113,7 @@
- sum_remain == -2.75
- |
I reset the "Employee Cashbox" to zero using the "Set CashBox to Zero" wizard.
--
+-
!record {model: lunch.cashbox.clean, id: lunch_cashbox_clean_0}:
{}
-
@@ -121,10 +121,10 @@
-
!python {model: lunch.cashbox.clean, id: lunch_cashbox_clean_0}: |
self.set_to_zero(cr, uid, [ref('lunch_cashbox_clean_0')], {'active_ids': [ref('lunch_cashbox_cashbox0')]})
-
+
- |
- I check that the Total on the "Employee Cashbox" is 0.0
+ I check that the Total on the "Employee Cashbox" is -5.50
-
!assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}:
- sum_remain == 0.00
-
+
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index dde47769412..8b9ec8864aa 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -361,11 +361,12 @@ class many2many_domain(fields.many2many):
for i in ids:
res[i] = []
valid_move_ids = move_obj.search(cr, user, self._domain) # move ids relative to domain argument
- cr.execute("SELECT production_id, move_id from mrp_production_move_ids where production_id in %s and move_id in %s",
- [tuple(ids), tuple(valid_move_ids)])
- related_move_map = cr.fetchall()
- related_move_dict = dict((k, list(set([v[1] for v in itr]))) for k, itr in groupby(related_move_map, itemgetter(0)))
- res.update(related_move_dict)
+ if valid_move_ids:
+ cr.execute("SELECT production_id, move_id from mrp_production_move_ids where production_id in %s and move_id in %s",
+ [tuple(ids), tuple(valid_move_ids)])
+ related_move_map = cr.fetchall()
+ related_move_dict = dict((k, list(set([v[1] for v in itr]))) for k, itr in groupby(related_move_map, itemgetter(0)))
+ res.update(related_move_dict)
return res
diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml
index efacd8b675d..ea1f15bc3ea 100644
--- a/addons/mrp/report/mrp_production_order_view.xml
+++ b/addons/mrp/report/mrp_production_order_view.xml
@@ -69,8 +69,21 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -87,20 +100,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py
index 527ef5c1e55..7aafee1a447 100644
--- a/addons/mrp_repair/mrp_repair.py
+++ b/addons/mrp_repair/mrp_repair.py
@@ -19,12 +19,10 @@
#
##############################################################################
-import time
from osv import fields,osv
import netsvc
import mx.DateTime
-from mx.DateTime import RelativeDateTime, today, DateTime, localtime
-from tools import config
+from mx.DateTime import RelativeDateTime, today
from tools.translate import _
import decimal_precision as dp
@@ -95,6 +93,16 @@ class mrp_repair(osv.osv):
cur = repair.pricelist_id.currency_id
res[id] = cur_obj.round(cr, uid, cur, untax.get(id, 0.0) + tax.get(id, 0.0))
return res
+
+ def _get_default_address(self, cr, uid, ids, field_name, arg, context):
+ res = {}
+ partner_obj = self.pool.get('res.partner')
+ for data in self.browse(cr, uid, ids):
+ adr_id = False
+ if data.partner_id:
+ adr_id = partner_obj.address_get(cr, uid, [data.partner_id.id], ['default'])['default']
+ res[data.id] = adr_id
+ return res
def _get_lines(self, cr, uid, ids, context=None):
if context is None:
@@ -109,6 +117,7 @@ class mrp_repair(osv.osv):
'product_id': fields.many2one('product.product', string='Product to Repair', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'partner_id' : fields.many2one('res.partner', 'Partner', select=True, help='This field allow you to choose the parner that will be invoiced and delivered'),
'address_id': fields.many2one('res.partner.address', 'Delivery Address', domain="[('partner_id','=',partner_id)]"),
+ 'default_address_id': fields.function(_get_default_address, method=True, type="many2one", relation="res.partner.address"),
'prodlot_id': fields.many2one('stock.production.lot', 'Lot Number', select=True, domain="[('product_id','=',product_id)]"),
'state': fields.selection([
('draft','Quotation'),
@@ -263,7 +272,6 @@ class mrp_repair(osv.osv):
@param product_id: Product id from current record.
@return: Dictionary of values.
"""
- prodlot_obj = self.pool.get('stock.production.lot')
move_obj = self.pool.get('stock.move')
data = {}
data['value'] = {
@@ -275,7 +283,6 @@ class mrp_repair(osv.osv):
if not lot:
return data
- lot_info = prodlot_obj.browse(cr, uid, lot)
move_ids = move_obj.search(cr, uid, [('prodlot_id', '=', lot)])
if not len(move_ids):
@@ -328,7 +335,6 @@ class mrp_repair(osv.osv):
""" Cancels repair order.
@return: True
"""
- ok=True
mrp_line_obj = self.pool.get('mrp.repair.line')
for repair in self.browse(cr, uid, ids):
mrp_line_obj.write(cr, uid, [l.id for l in repair.operations], {'state': 'cancel'})
@@ -422,7 +428,7 @@ class mrp_repair(osv.osv):
raise osv.except_osv(_('Warning !'), _('No product defined on Fees!'))
if fee.product_id.property_account_income:
- account_id = fee.product_id.property_account_income
+ account_id = fee.product_id.property_account_income.id
elif fee.product_id.categ_id.property_account_income_categ:
account_id = fee.product_id.categ_id.property_account_income_categ.id
else:
@@ -496,7 +502,7 @@ class mrp_repair(osv.osv):
return True
def wkf_repair_done(self, cr, uid, ids, *args):
- res = self.action_repair_done(cr, uid, ids)
+ self.action_repair_done(cr, uid, ids)
return True
def action_repair_done(self, cr, uid, ids, context=None):
@@ -509,7 +515,6 @@ class mrp_repair(osv.osv):
repair_line_obj = self.pool.get('mrp.repair.line')
seq_obj = self.pool.get('ir.sequence')
pick_obj = self.pool.get('stock.picking')
- company = self.pool.get('res.users').browse(cr, uid, uid).company_id
for repair in self.browse(cr, uid, ids, context=context):
for move in repair.operations:
move_id = move_obj.create(cr, uid, {
diff --git a/addons/mrp_repair/report/order.py b/addons/mrp_repair/report/order.py
index 298e1f237ff..3d6f9200dd8 100644
--- a/addons/mrp_repair/report/order.py
+++ b/addons/mrp_repair/report/order.py
@@ -21,8 +21,6 @@
import time
from report import report_sxw
-from osv import osv
-import pooler
class order(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
@@ -30,10 +28,8 @@ class order(report_sxw.rml_parse):
self.localcontext.update({
'time': time,
'total': self.total,
- 'adr_get' : self._adr_get
})
-
def total(self, repair):
total = 0.0
for operation in repair.operations:
@@ -43,13 +39,6 @@ class order(report_sxw.rml_parse):
total = total + repair.amount_tax
return total
- def _adr_get(self, partner, type):
- res_partner = pooler.get_pool(self.cr.dbname).get('res.partner')
- res_partner_address = pooler.get_pool(self.cr.dbname).get('res.partner.address')
- addresses = res_partner.address_get(self.cr, self.uid, [partner.id], [type])
- adr_id = addresses and addresses[type] or False
- return adr_id and res_partner_address.read(self.cr, self.uid, [adr_id])[0] or False
-
report_sxw.report_sxw('report.repair.order','mrp.repair','addons/mrp_repair/report/order.rml',parser=order)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp_repair/report/order.rml b/addons/mrp_repair/report/order.rml
index c71abb614cf..149a2650bfd 100644
--- a/addons/mrp_repair/report/order.rml
+++ b/addons/mrp_repair/report/order.rml
@@ -175,7 +175,7 @@
- Invoice address
+ Invoice address :[[ o.partner_id and o.partner_id.property_payment_term.name ]][[ o.partner_invoice_id.street ]][[ o.partner_invoice_id.street2 or removeParentNode('para') ]]
@@ -189,12 +189,12 @@
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py
index dcbba147b59..28b96f7aebe 100644
--- a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py
+++ b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py
@@ -24,7 +24,7 @@ from report import report_sxw
class all_closed_cashbox_of_the_day(report_sxw.rml_parse):
-
+ #TOFIX: sql injection problem: SQL Request must be pass from sql injection...
def __init__(self, cr, uid, name, context):
super(all_closed_cashbox_of_the_day, self).__init__(cr, uid, name, context)
self.localcontext.update({
@@ -67,7 +67,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse):
def _get_bal(self,data):
res = {}
- sql =""" select sum(pieces*number) as bal from singer_statement where starting_id = %d """%(data['id'])
+ sql =""" select sum(pieces*number) as bal from account_cashbox_line where starting_id = %d """%(data['id'])
self.cr.execute(sql)
res = self.cr.dictfetchall()
if res :
@@ -91,13 +91,13 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse):
return False
def _get_partner(self,statement):
res = {}
- sql =""" select rp.name from account_bank_statement_line as absl,res_partner as rp
- where absl.partner_id = rp.id
- and absl.pos_statement_id = %d"""%(statement['pos_statement_id'])
- self.cr.execute(sql)
- res = self.cr.dictfetchall()
- if res :
- return res[0]['name']
+ if statement['pos_statement_id']:
+ sql =""" select rp.name from account_bank_statement_line as absl,res_partner as rp
+ where absl.partner_id = rp.id
+ and absl.pos_statement_id = %d"""%(statement['pos_statement_id'])
+ self.cr.execute(sql)
+ res = self.cr.dictfetchall() or {}
+ return res and res[0]['name']
else :
return 0.00
@@ -115,7 +115,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse):
res = self.cr.dictfetchall()
for r in res :
total_ending_bal += (r['net_total'] or 0.0)
- sql1 =""" select sum(pieces*number) as bal from singer_statement where starting_id = %d"""%(r['id'])
+ sql1 =""" select sum(pieces*number) as bal from account_cashbox_line where starting_id = %d"""%(r['id'])
self.cr.execute(sql1)
data = self.cr.dictfetchall()
if data[0]['bal']:
@@ -125,10 +125,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse):
return lst
def _get_net_total(self,user):
- lst = []
res={}
- total_ending_bal = 0.0
- total_starting_bal = 0.0
sql = """select sum(absl.amount) as net_total from account_bank_statement as abs
LEFT JOIN account_bank_statement_line as absl ON abs.id = absl.statement_id
where abs.state IN ('confirm','open') and abs.user_id = %d
diff --git a/addons/point_of_sale/report/pos_details.rml b/addons/point_of_sale/report/pos_details.rml
index 1aaac4dbe3a..f3bebade402 100644
--- a/addons/point_of_sale/report/pos_details.rml
+++ b/addons/point_of_sale/report/pos_details.rml
@@ -119,6 +119,7 @@
+
@@ -154,7 +155,13 @@
+
+
+ Details of Sales
+
+
+
+ [[o.state=='cancel' and o.statement_ids and '-' or '']][['%.f' % line.qty ]]
+
+
+ [[o.state=='cancel' and o.statement_ids and '-' or '']][[ '%.2f' % net(line.id) ]] [[company.currency_id.symbol]] [[ line and line.discount == 0.0 and removeParentNode('font') ]] ([[ '%.2f' % line.discount ]]%) [[company.currency_id.symbol]]
+
+
+
+
+
+
+ Taxes :
+
+
+ [[o.state=='cancel' and o.statement_ids and '-' or '']][['%.2f' % o.amount_tax]] [[company.currency_id.symbol]]
+
+
+
+
+
+
+ Total :
+
+
+ [[o.state=='cancel' and o.statement_ids and '-' or '']][['%.2f' % o.amount_total]] [[company.currency_id.symbol]]
+
- [[o.state=='cancel' and o.statement_ids and '-' or '']][['%.f' % line.qty ]]
-
-
-
- [[o.state=='cancel' and o.statement_ids and '-' or '']][[ '%.2f' % net(line.id) ]] [[ line and line.discount == 0.0 and removeParentNode('font') ]] ([[ '%.2f' % line.discount ]]%)
-
-
-
-
-
-
- Taxes :
-
-
- [[o.state=='cancel' and o.statement_ids and '-' or '']][['%.2f' % o.amount_tax ]]
-
-
-
-
-
-
-
-
- Total :
-
-
- [[o.state=='cancel' and o.statement_ids and '-' or '']][['%.2f' % o.amount_total ]]
-