- [[ repeatIn(lines(o.id),'line')]] [[ line['code'] ]]
+ [[ line['code'] ]]
[[ line['name'] ]]
@@ -365,10 +365,10 @@
+ [[ repeatIn(lines(o.id),'line')]]
[[ display_currency(data) or removeParentNode('blockTable') ]]
- [[lines(o.id) and removeParentNode('para') or removeParentNode('section') ]]
- [[ repeatIn(lines(o.id),'line')]] [[ line['code'] ]]
+ [[ line['code'] ]]
[[ line['name'] ]]
[[ formatLang(line['debit'] )]]
[[ formatLang(line['credit']) ]]
diff --git a/addons/account/report/account_general_ledger.rml b/addons/account/report/account_general_ledger.rml
index 5a3812206aa..7ded26849bd 100644
--- a/addons/account/report/account_general_ledger.rml
+++ b/addons/account/report/account_general_ledger.rml
@@ -245,7 +245,7 @@
Move
Entry Label
Debit
- Crebit
+ Credit
Balance
@@ -254,7 +254,7 @@
[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
-
+
[[ '..'*(o.level-1) ]] [[ o.code or '']] [[ o.name or '']]
@@ -305,7 +305,7 @@
[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
-
+
[[ '..'*(o.level-1) ]] [[ o.code or '' ]] [[ o.name or '' ]]
diff --git a/addons/account/report/account_general_ledger_landscape.rml b/addons/account/report/account_general_ledger_landscape.rml
index 80a55c76905..163d5cb5f2c 100644
--- a/addons/account/report/account_general_ledger_landscape.rml
+++ b/addons/account/report/account_general_ledger_landscape.rml
@@ -262,7 +262,7 @@
[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
-
+
[[ '..'*(o.level-1) ]] [[ o.code ]] [[ o.name ]]
@@ -323,7 +323,7 @@
[[data['form']['amount_currency'] == False or removeParentNode('blockTable')]]
-
+
[[ '..'*(o.level-1) ]] [[ o.code ]] [[ o.name ]]
diff --git a/addons/account/report/account_journal.rml b/addons/account/report/account_journal.rml
index e153ae20adb..5b7ebf78766 100644
--- a/addons/account/report/account_journal.rml
+++ b/addons/account/report/account_journal.rml
@@ -252,7 +252,7 @@
Entry No
A/c No.
Partner
- Move - Entry label
+ Move/Entry label
Debit
Credit
Balance
@@ -264,8 +264,8 @@
[[ formatLang(sum_debit(o.period_id.id, o.journal_id.id)) ]]
- [[ formatLang(sum_credit(o.period_id.id, o.journal_id.id)) ]]
- [[ formatLang((sum_credit(o.period_id.id, o.journal_id.id) - sum_debit(o.period_id.id, o.journal_id.id))) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang(sum_credit(o.period_id.id, o.journal_id.id)) ]]
+ [[ formatLang((sum_credit(o.period_id.id, o.journal_id.id)-sum_debit(o.period_id.id, o.journal_id.id))) ]] [[ company.currency_id.symbol ]]
[[lines(o.period_id.id, o.journal_id.id) or removeParentNode('story') ]]
@@ -287,7 +287,7 @@
Entry No
A/c No.
Partner
- Move - Entry label
+ Move/Entry label
Debit
Credit
Balance
diff --git a/addons/account/report/account_partner_balance.py b/addons/account/report/account_partner_balance.py
index 4ce8eeb986c..dcf35665a02 100644
--- a/addons/account/report/account_partner_balance.py
+++ b/addons/account/report/account_partner_balance.py
@@ -22,7 +22,7 @@
import time
import re
import copy
-
+from tools.translate import _
from report import report_sxw
from common_report_header import common_report_header
@@ -39,14 +39,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
'sum_debit': self._sum_debit,
'sum_credit': self._sum_credit,
'sum_litige': self._sum_litige,
- 'sum_sdebit': self._sum_sdebit,
- 'sum_scredit': self._sum_scredit,
- 'solde_debit': self._solde_balance_debit,
- 'solde_credit': self._solde_balance_credit,
- 'get_currency': self._get_currency,
- 'comma_me' : self.comma_me,
'get_fiscalyear': self._get_fiscalyear,
- 'get_periods':self.get_periods,
'get_journal': self._get_journal,
'get_filter': self._get_filter,
'get_account': self._get_account,
@@ -56,50 +49,8 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
'get_end_period': self.get_end_period,
'get_partners':self._get_partners,
})
- ## Compute account list one time
- #
- # Date Management
- #
-
- def get_periods(self, form):
- result = ''
- if form.has_key('periods') and form['periods']:
- period_ids = form['periods']
- per_ids = self.pool.get('account.period').browse(self.cr, self.uid, form['periods'])
- for r in per_ids:
- if r == per_ids[len(per_ids)-1]:
- result += r.name + ". "
- else:
- result += r.name + ", "
- else:
- fy_obj = self.pool.get('account.fiscalyear').browse(self.cr, self.uid, form['fiscalyear'])
- res = fy_obj.period_ids
- len_res = len(res)
- for r in res:
- if r == res[len_res-1]:
- result += r.name + ". "
- else:
- result += r.name + ", "
- return str(result and result[:-1]) or 'ALL'
-
- def comma_me(self, amount):
- if type(amount) is float :
- amount = str('%.2f'%amount)
- else :
- amount = str(amount)
- if (amount == '0'):
- return ' '
- orig = amount
- new = re.sub("^(-?\d+)(\d{3})", "\g<1>'\g<2>", amount)
- if orig == new:
- return new
- else:
- return self.comma_me(new)
def set_context(self, objects, data, ids, report_type=None):
- ## Compute Code
- #
-# self.initial_balance = data['form'].get('initial_balance', True)
self.display_partner = data['form'].get('display_partner', 'non-zero_balance')
self.query = data['form'].get('query_line', '')
self.init_query = data['form'].get('initial_bal_query', '')
@@ -156,63 +107,6 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
(self.ACCOUNT_TYPE, tuple(move_state)))
res = self.cr.dictfetchall()
- #For include intial balance..
-# if self.initial_balance:
-# self.cr.execute(
-# "SELECT '1' AS type, '' AS ref, l.account_id AS account_id, '' AS account_name, '' AS code, '' AS name, sum(debit) AS debit, sum(credit) AS credit, " \
-# "CASE WHEN sum(debit) > sum(credit) " \
-# "THEN sum(debit) - sum(credit) " \
-# "ELSE 0 " \
-# "END AS sdebit, " \
-# "CASE WHEN sum(debit) < sum(credit) " \
-# "THEN sum(credit) - sum(debit) " \
-# "ELSE 0 " \
-# "END AS scredit, " \
-# "(SELECT sum(debit-credit) " \
-# "FROM account_move_line l " \
-# "WHERE partner_id = p.id " \
-# " AND " + self.init_query + " " \
-# "AND blocked = TRUE " \
-# ") AS enlitige " \
-# "FROM account_move_line l LEFT JOIN res_partner p ON (l.partner_id=p.id) " \
-# "JOIN account_account ac ON (l.account_id = ac.id) " \
-# "WHERE ac.type IN %s " \
-# "AND " + self.init_query + "" \
-# "GROUP BY p.id, p.ref, p.name,l.account_id,ac.name,ac.code " \
-# "ORDER BY l.account_id, p.name",
-# (self.ACCOUNT_TYPE, ))
-# res1 = self.cr.dictfetchall()
-# final_init = {}
-# res_init = {}
-# debit = credit = 0
-# for r in res1:
-# if final_init.get(r['account_id'], False):
-# res_init = final_init[r['account_id']]
-# debit += final_init[r['account_id']]['debit']
-# credit += final_init[r['account_id']]['credit']
-# res_init['credit'] = credit
-# res_init['debit'] = debit
-# res_init['type'] = 3
-# res_init['ref'] = ''
-# res_init['code'] = ''
-# res_init['name'] = 'Initial Balance'
-# res_init['balance'] = debit - credit
-# res_init['enlitige'] = 0.0 # fix me
-# res_init['account_id'] = final_init[r['account_id']]['account_id']
-# else:
-# res_init = {}
-# debit = r['debit']
-# credit = r['credit']
-# res_init['credit'] = credit
-# res_init['debit'] = debit
-# res_init['type'] = 3
-# res_init['ref'] = ''
-# res_init['code'] = ''
-# res_init['name'] = 'Initial Balance'
-# res_init['balance'] = debit - credit
-# res_init['enlitige'] = 0.0 # fix me
-# res_init['account_id'] = r['account_id']
-# final_init[r['account_id']] = res_init
if self.display_partner == 'non-zero_balance':
full_account = [r for r in res if r['sdebit'] > 0 or r['scredit'] > 0]
@@ -221,20 +115,10 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
for rec in full_account:
if not rec.get('name', False):
- rec.update({'name': 'Unknown Partner'})
+ rec.update({'name': _('Unknown Partner')})
## We will now compute Total
subtotal_row = self._add_subtotal(full_account)
-# if not self.initial_balance:
-# return subtotal_row
-#
-# #If include initial balance is selected..
-# subtotal = copy.deepcopy(subtotal_row)
-# init_acnt = []
-# for row in subtotal_row:
-# if final_init and row.get('account_id', False) and not row['account_id'] in init_acnt and final_init.get(row['account_id'], False):
-# subtotal.insert(subtotal.index(row), final_init[row['account_id']])
-# init_acnt.append(row['account_id'])
return subtotal_row
def _add_subtotal(self, cleanarray):
@@ -257,12 +141,12 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
new_header['ref'] = ''
new_header['name'] = r['account_name']
new_header['code'] = r['code']
- new_header['debit'] = r['credit'] #tot_credit
- new_header['credit'] = r['debit'] #tot_debit
+ new_header['debit'] = r['debit']
+ new_header['credit'] = r['credit']
new_header['scredit'] = tot_scredit
new_header['sdebit'] = tot_sdebit
new_header['enlitige'] = tot_enlitige
- new_header['balance'] = float(tot_sdebit) - float(tot_scredit)
+ new_header['balance'] = r['debit'] - r['credit']
new_header['type'] = 3
##
completearray.append(new_header)
@@ -371,14 +255,6 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
"AND " + self.query + "" ,
(tuple(self.account_ids), tuple(move_state)))
temp_res = float(self.cr.fetchone()[0] or 0.0)
-# if self.initial_balance:
-# self.cr.execute(
-# "SELECT sum(debit) " \
-# "FROM account_move_line AS l " \
-# "WHERE l.account_id IN %s " \
-# "AND " + self.init_query + "" ,
-# (tuple(self.account_ids), ))
-# temp_res += float(self.cr.fetchone()[0] or 0.0)
return temp_res
def _sum_credit(self):
@@ -398,14 +274,6 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
"AND " + self.query + "" ,
(tuple(self.account_ids), tuple(move_state)))
temp_res = float(self.cr.fetchone()[0] or 0.0)
-# if self.initial_balance:
-# self.cr.execute(
-# "SELECT sum(credit) " \
-# "FROM account_move_line AS l " \
-# "WHERE l.account_id IN %s " \
-# "AND " + self.init_query + "" ,
-# (tuple(self.account_ids),))
-# temp_res += float(self.cr.fetchone()[0] or 0.0)
return temp_res
def _sum_litige(self):
@@ -426,82 +294,8 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
"AND l.blocked=TRUE ",
(tuple(self.account_ids), tuple(move_state), ))
temp_res = float(self.cr.fetchone()[0] or 0.0)
-# if self.initial_balance:
-# self.cr.execute(
-# "SELECT sum(debit-credit) " \
-# "FROM account_move_line AS l " \
-# "WHERE l.account_id IN %s " \
-# "AND l.blocked=TRUE "\
-# "AND " + self.init_query + "" ,
-# (tuple(self.account_ids), ))
-# temp_res += float(self.cr.fetchone()[0] or 0.0)
return temp_res
- def _sum_sdebit(self):
- move_state = ['draft','posted']
- if self.target_move == 'posted':
- move_state = ['posted']
-
- if not self.ids:
- return 0.0
- result_tmp = 0.0
- a = 0.0
- self.cr.execute(
- "SELECT CASE WHEN sum(debit) > sum(credit) " \
- "THEN sum(debit) - sum(credit) " \
- "ELSE 0 " \
- "END " \
- "FROM account_move_line AS l " \
- "JOIN account_move am ON (am.id = l.move_id)" \
- "WHERE l.account_id IN %s" \
- "AND am.state IN %s" \
- "AND " + self.query + " " \
- "GROUP BY l.partner_id",
- (tuple(self.account_ids), tuple(move_state),))
- a = self.cr.fetchone()[0]
-
- if self.cr.fetchone() != None:
- result_tmp = result_tmp + (a or 0.0)
- else:
- result_tmp = 0.0
- return result_tmp
-
- def _sum_scredit(self):
- move_state = ['draft','posted']
- if self.target_move == 'posted':
- move_state = ['posted']
-
- if not self.ids:
- return 0.0
- result_tmp = 0.0
- a = 0.0
- self.cr.execute(
- "SELECT CASE WHEN sum(debit) < sum(credit) " \
- "THEN sum(credit) - sum(debit) " \
- "ELSE 0 " \
- "END " \
- "FROM account_move_line AS l " \
- "WHERE l.account_id IN %s" \
- "JOIN account_move am ON (am.id = l.move_id)" \
- "AND am.state IN %s" \
- "AND " + self.query + " " \
- "GROUP BY l.partner_id",
- (tuple(self.account_ids), tuple(move_state), ))
- a = self.cr.fetchone()[0] or 0.0
- if self.cr.fetchone() != None:
- result_tmp = result_tmp + (a or 0.0)
- else:
- result_tmp = 0.0
- return result_tmp
-
- def _solde_balance_debit(self):
- debit, credit = self._sum_debit(), self._sum_credit()
- return debit > credit and debit - credit
-
- def _solde_balance_credit(self):
- debit, credit = self._sum_debit(), self._sum_credit()
- return credit > debit and credit - debit
-
def _get_partners(self):
if self.result_selection == 'customer':
return 'Receivable Accounts'
@@ -513,4 +307,4 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
report_sxw.report_sxw('report.account.partner.balance', 'res.partner', 'account/report/account_partner_balance.rml',parser=partner_balance, header="internal")
-# 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/report/account_partner_balance.rml b/addons/account/report/account_partner_balance.rml
index a11df4e7576..eee31e87d6c 100644
--- a/addons/account/report/account_partner_balance.rml
+++ b/addons/account/report/account_partner_balance.rml
@@ -1,5 +1,5 @@
-
+
@@ -234,14 +234,14 @@
Debit
Credit
Balance
- In dispute
+ In dispute
Total:
- [[ formatLang(sum_debit()) ]]
+ [[ formatLang(sum_debit()) ]]
[[ formatLang(sum_credit()) ]]
- [[ formatLang((solde_debit()-solde_credit())) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang((sum_debit()-sum_credit())) ]] [[ company.currency_id.symbol ]]
[[ formatLang(sum_litige()) ]] [[ company.currency_id.symbol ]]
diff --git a/addons/account/wizard/account_chart.py b/addons/account/wizard/account_chart.py
index bf10838b9c8..b8e18659327 100644
--- a/addons/account/wizard/account_chart.py
+++ b/addons/account/wizard/account_chart.py
@@ -44,14 +44,6 @@ class account_chart(osv.osv_memory):
fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, [('date_start', '<', now), ('date_stop', '>', now)], limit=1 )
return fiscalyears and fiscalyears[0] or False
- def _build_periods(self, cr, uid, period_from, period_to):
- period_obj = self.pool.get('account.period')
- period_date_start = period_obj.read(cr, uid, period_from, ['date_start'])['date_start']
- period_date_stop = period_obj.read(cr, uid, period_to, ['date_stop'])['date_stop']
- if period_date_start > period_date_stop:
- raise osv.except_osv(_('Error'),_('Start period should be smaller then End period'))
- return period_obj.search(cr, uid, [('date_start', '>=', period_date_start), ('date_stop', '<=', period_date_stop)])
-
def onchange_fiscalyear(self, cr, uid, ids, fiscalyear_id=False, context=None):
res = {}
res['value'] = {}
@@ -95,9 +87,9 @@ class account_chart(osv.osv_memory):
result = mod_obj._get_id(cr, uid, 'account', 'action_account_tree')
id = mod_obj.read(cr, uid, [result], ['res_id'], context=context)[0]['res_id']
result = act_obj.read(cr, uid, [id], context=context)[0]
- result['periods'] = []
+ result['periods'] = []
if data['period_from'] and data['period_to']:
- result['periods'] = self._build_periods(cr, uid, data['period_from'], data['period_to'])
+ result['periods'] = self.pool.get('account.period').build_ctx_periods(cr, uid, data['period_from'], data['period_to'])
result['context'] = str({'fiscalyear': data['fiscalyear'], 'periods': result['periods'], \
'state': data['target_move']})
if data['fiscalyear']:
@@ -111,4 +103,4 @@ class account_chart(osv.osv_memory):
account_chart()
-# 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_report_common.py b/addons/account/wizard/account_report_common.py
index e5ed39427b4..a9a343a0d6a 100644
--- a/addons/account/wizard/account_report_common.py
+++ b/addons/account/wizard/account_report_common.py
@@ -103,14 +103,6 @@ class account_common_report(osv.osv_memory):
'chart_account_id': _get_account,
}
- def _build_periods(self, cr, uid, period_from, period_to):
- period_obj = self.pool.get('account.period')
- period_date_start = period_obj.read(cr, uid, period_from, ['date_start'])['date_start']
- period_date_stop = period_obj.read(cr, uid, period_to, ['date_stop'])['date_stop']
- if period_date_start > period_date_stop:
- raise osv.except_osv(_('Error'),_('Start period should be smaller then End period'))
- return period_obj.search(cr, uid, [('date_start', '>=', period_date_start), ('date_stop', '<=', period_date_stop)])
-
def _build_contexts(self, cr, uid, ids, data, context=None):
if context is None:
context = {}
@@ -129,9 +121,10 @@ class account_common_report(osv.osv_memory):
elif data['form']['filter'] == 'filter_period':
if not data['form']['period_from'] or not data['form']['period_to']:
raise osv.except_osv(_('Error'),_('Select a starting and an ending period'))
- result['periods'] = self._build_periods(cr, uid, data['form']['period_from'], data['form']['period_to'])
- first_period = self.pool.get('account.period').search(cr, uid, [], order='date_start', limit=1)[0]
- result_initial_bal['periods'] = self._build_periods(cr, uid, first_period, data['form']['period_from'])
+ company_id = period_obj.browse(cr, uid, data['form']['period_from'], context=context).company_id.id
+ result['periods'] = period_obj.build_ctx_periods(cr, uid, data['form']['period_from'], data['form']['period_to'])
+ first_period = self.pool.get('account.period').search(cr, uid, [('company_id', '=', company_id)], order='date_start', limit=1)[0]
+ result_initial_bal['periods'] = period_obj.build_ctx_periods(cr, uid, first_period, data['form']['period_from'])
else:
if data['form']['fiscalyear_id']:
fiscal_date_start = fiscal_obj.browse(cr, uid, [data['form']['fiscalyear_id']], context=context)[0].date_start
diff --git a/addons/account_budget/crossovered_budget.py b/addons/account_budget/crossovered_budget.py
index e0e1be5e2a2..6c7eb6639ec 100644
--- a/addons/account_budget/crossovered_budget.py
+++ b/addons/account_budget/crossovered_budget.py
@@ -18,6 +18,7 @@
# along with this program. If not, see .
#
##############################################################################
+
import datetime
from osv import osv, fields
@@ -42,7 +43,7 @@ class account_budget_post(osv.osv):
'company_id': fields.many2one('res.company', 'Company', required=True),
}
_defaults = {
- 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.budget.post', context=c)
+ 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.budget.post', context=c)
}
_order = "name"
@@ -62,8 +63,8 @@ class account_budget_post(osv.osv):
account_budget_post()
class account_budget_post_dotation(osv.osv):
- def _tot_planned(self, cr, uid, ids,name,args,context):
- res={}
+ def _tot_planned(self, cr, uid, ids, name, args, context):
+ res = {}
for line in self.browse(cr, uid, ids):
if line.period_id:
obj_period=self.pool.get('account.period').browse(cr, uid, line.period_id.id)
@@ -75,7 +76,6 @@ class account_budget_post_dotation(osv.osv):
OR (date_to >=%s and date_to <= %s) OR (date_from < %s and date_to > %s)"
cr.execute(query,(budget_id,obj_period.date_start,obj_period.date_stop,obj_period.date_start,obj_period.date_stop,obj_period.date_start,obj_period.date_stop,))
res1=cr.fetchall()
-
tot_planned=0.00
for record in res1:
obj_lines = self.pool.get('crossovered.budget.lines').browse(cr, uid, record[0])
@@ -84,9 +84,9 @@ class account_budget_post_dotation(osv.osv):
count_days = strToDate(obj_lines.date_to) - strToDate(obj_lines.date_from)
total_days_of_rec = count_days.days +1
tot_planned += obj_lines.planned_amount/total_days_of_rec* days_in_period
- res[line.id]=tot_planned
+ res[line.id] = tot_planned
else:
- res[line.id]=0.00
+ res[line.id] = 0.00
return res
_name = 'account.budget.post.dotation'
@@ -143,7 +143,6 @@ class crossovered_budget(osv.osv):
return True
def budget_cancel(self, cr, uid, ids, *args):
-
self.write(cr, uid, ids, {
'state':'cancel'
})
@@ -165,7 +164,6 @@ class crossovered_budget_lines(osv.osv):
acc_ids = [x.id for x in line.general_budget_id.account_ids]
if not acc_ids:
raise osv.except_osv(_('Error!'),_("The General Budget '%s' has no Accounts!") % str(line.general_budget_id.name))
-
date_to = line.date_to
date_from = line.date_from
if context.has_key('wizard_date_from'):
@@ -185,7 +183,6 @@ class crossovered_budget_lines(osv.osv):
res={}
for line in self.browse(cr, uid, ids):
res[line.id]=self._prac_amt(cr, uid, [line.id], context=context)[line.id]
-
return res
def _theo_amt(self, cr, uid, ids,context={}):
@@ -233,7 +230,8 @@ class crossovered_budget_lines(osv.osv):
else:
res[line.id]=0.00
return res
- _name="crossovered.budget.lines"
+
+ _name = "crossovered.budget.lines"
_description = "Budget Line"
_columns = {
'crossovered_budget_id': fields.many2one('crossovered.budget', 'Budget', ondelete='cascade', select=True, required=True),
@@ -252,7 +250,6 @@ class crossovered_budget_lines(osv.osv):
crossovered_budget_lines()
class account_analytic_account(osv.osv):
- _name = 'account.analytic.account'
_inherit = 'account.analytic.account'
_columns = {
diff --git a/addons/account_budget/crossovered_budget_view.xml b/addons/account_budget/crossovered_budget_view.xml
index 263dee3f686..7a4883ec61d 100644
--- a/addons/account_budget/crossovered_budget_view.xml
+++ b/addons/account_budget/crossovered_budget_view.xml
@@ -266,8 +266,8 @@
id="act_account_analytic_account_cb_lines"/>
-
- account.analytic.account.form.inherot.cci
+
+ account.analytic.account.form.inherot.budget
form
account.analytic.account
diff --git a/addons/account_budget/report/__init__.py b/addons/account_budget/report/__init__.py
index 085b4262b6c..d1104982f8c 100644
--- a/addons/account_budget/report/__init__.py
+++ b/addons/account_budget/report/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,12 +15,13 @@
# 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 crossovered_budget_report
import analytic_account_budget_report
import budget_report
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_budget/report/analytic_account_budget_report.py b/addons/account_budget/report/analytic_account_budget_report.py
index 37fc4680d1f..c724968a06d 100644
--- a/addons/account_budget/report/analytic_account_budget_report.py
+++ b/addons/account_budget/report/analytic_account_budget_report.py
@@ -20,9 +20,10 @@
##############################################################################
import time
+import datetime
+
import pooler
from report import report_sxw
-import datetime
class analytic_account_budget_report(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
@@ -34,7 +35,6 @@ class analytic_account_budget_report(report_sxw.rml_parse):
})
self.context=context
-
def funct(self,object,form,ids={}, done=None, level=1):
if not ids:
@@ -181,5 +181,5 @@ class analytic_account_budget_report(report_sxw.rml_parse):
return result
report_sxw.report_sxw('report.account.analytic.account.budget', 'account.analytic.account', 'addons/account_budget/report/analytic_account_budget_report.rml',parser=analytic_account_budget_report,header='internal')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_budget/report/analytic_account_budget_report.rml b/addons/account_budget/report/analytic_account_budget_report.rml
index e349b3d4920..ea800685470 100644
--- a/addons/account_budget/report/analytic_account_budget_report.rml
+++ b/addons/account_budget/report/analytic_account_budget_report.rml
@@ -104,7 +104,7 @@
Currency: [[ company.currency_id.name ]]
- Printed at: [[ formatLang(time.strftime('%Y-%m-%d'),date=True) ]] at [[ time.strftime('%H:%M:%S')]]
+ Printed at: [[ formatLang(time.strftime('%Y-%m-%d'),date=True) ]] at [[ time.strftime('%H:%M:%S')]]
@@ -186,4 +186,4 @@
-
\ No newline at end of file
+
diff --git a/addons/account_budget/report/budget_report.py b/addons/account_budget/report/budget_report.py
index 648015b3d2b..171984e9851 100644
--- a/addons/account_budget/report/budget_report.py
+++ b/addons/account_budget/report/budget_report.py
@@ -20,8 +20,9 @@
##############################################################################
import time
-from report import report_sxw
import datetime
+
+from report import report_sxw
import operator
class budget_report(report_sxw.rml_parse):
@@ -64,8 +65,8 @@ class budget_report(report_sxw.rml_parse):
achievements = float(self.cr.fetchone()[0])
res.append({'name': a.name, 'code': a.code, 'achievements': achievements})
return res
+
report_sxw.report_sxw('report.account.budget', 'account.budget.post', 'addons/account_budget/report/budget_report.rml',parser=budget_report, header="internal")
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_budget/wizard/account_budget_analytic.py b/addons/account_budget/wizard/account_budget_analytic.py
index 62553520cbd..70ce1a5156b 100644
--- a/addons/account_budget/wizard/account_budget_analytic.py
+++ b/addons/account_budget/wizard/account_budget_analytic.py
@@ -53,5 +53,4 @@ class account_budget_analytic(osv.osv_memory):
account_budget_analytic()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_budget/wizard/account_budget_crossovered_report.py b/addons/account_budget/wizard/account_budget_crossovered_report.py
index 2862cd1db48..2427044e681 100644
--- a/addons/account_budget/wizard/account_budget_crossovered_report.py
+++ b/addons/account_budget/wizard/account_budget_crossovered_report.py
@@ -18,6 +18,7 @@
# along with this program. If not, see .
#
##############################################################################
+
import time
from osv import fields, osv
@@ -54,5 +55,4 @@ class account_budget_crossvered_report(osv.osv_memory):
account_budget_crossvered_report()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_budget/wizard/account_budget_spread.py b/addons/account_budget/wizard/account_budget_spread.py
index b5ab413a862..31e059f754b 100644
--- a/addons/account_budget/wizard/account_budget_spread.py
+++ b/addons/account_budget/wizard/account_budget_spread.py
@@ -18,7 +18,7 @@
# along with this program. If not, see .
#
##############################################################################
-import netsvc
+
from osv import fields, osv
import decimal_precision as dp
diff --git a/addons/account_coda/__openerp__.py b/addons/account_coda/__openerp__.py
index 4aa61c20827..660103e878a 100644
--- a/addons/account_coda/__openerp__.py
+++ b/addons/account_coda/__openerp__.py
@@ -28,7 +28,7 @@
Module provides functionality to import
bank statements from coda files.
""",
- "depends" : ["account"],
+ "depends" : ["account_voucher"],
"demo_xml" : [],
"init_xml" : [],
"update_xml": ["security/ir.model.access.csv",
diff --git a/addons/account_coda/wizard/account_coda_import.py b/addons/account_coda/wizard/account_coda_import.py
index 913db0bc4c2..8a88f4a255d 100644
--- a/addons/account_coda/wizard/account_coda_import.py
+++ b/addons/account_coda/wizard/account_coda_import.py
@@ -48,7 +48,7 @@ class account_coda_import(osv.osv_memory):
'journal_id': fields.many2one('account.journal', 'Bank Journal', required=True),
'def_payable': fields.many2one('account.account', 'Default Payable Account', domain=[('type', '=', 'payable')], required=True, help= 'Set here the payable account that will be used, by default, if the partner is not found'),
'def_receivable': fields.many2one('account.account', 'Default Receivable Account', domain=[('type', '=', 'receivable')], required=True, help= 'Set here the receivable account that will be used, by default, if the partner is not found',),
- 'awaiting_account': fields.many2one('account.account', 'Default Account for Unrecognized Movement', required=True, help= 'Set here the default account that will be used, if the partner is found but does not have the bank account , or if he is domiciled',),
+ 'awaiting_account': fields.many2one('account.account', 'Default Account for Unrecognized Movement', domain=[('type', '=', 'liquidity')], required=True, help= 'Set here the default account that will be used, if the partner is found but does not have the bank account , or if he is domiciled'),
'coda': fields.binary('Coda File', required=True),
'note':fields.text('Log'),
}
@@ -61,7 +61,8 @@ class account_coda_import(osv.osv_memory):
bank_statement_obj = self.pool.get('account.bank.statement')
move_line_obj = self.pool.get('account.move.line')
bank_statement_line_obj = self.pool.get('account.bank.statement.line')
- statement_reconcile_obj = self.pool.get('account.bank.statement.reconcile')
+ voucher_obj = self.pool.get('account.voucher')
+ voucher_line_obj = self.pool.get('account.voucher.line')
account_coda_obj = self.pool.get('account.coda')
mod_obj = self.pool.get('ir.model.data')
@@ -194,48 +195,76 @@ class account_coda_import(osv.osv_memory):
for statement in bank_statements:
try:
bk_st_id =bank_statement_obj.create(cr, uid, {
- 'journal_id': statement['journal_id'],
- 'date': time.strftime('%Y-%m-%d', time.strptime(statement['date'], "%y/%m/%d")),
- 'period_id': statement['period_id'] or period,
- 'balance_start': statement["balance_start"],
- 'balance_end_real': statement["balance_end_real"],
+ 'journal_id': statement.get('journal_id',False),
+ 'date': time.strftime('%Y-%m-%d', time.strptime(statement.get('date',time.strftime('%Y-%m-%d')), "%y/%m/%d")),
+ 'period_id': statement.get('period_id',False) or period,
+ 'balance_start': statement.get('balance_start',False),
+ 'balance_end_real': statement.get('balance_end_real',False),
'state': 'draft',
- 'name': statement['name'],
+ 'name': statement.get('name',False),
})
- lines=statement["bank_statement_line"]
- for value in lines:
- line=lines[value]
- reconcile_id = False
- if line['toreconcile']:
- name = line['name'][:3] + '/' + line['name'][3:7] + '/' + line['name'][7:]
- rec_id = pool.get('account.move.line').search(cr, uid, [('name', '=', name), ('reconcile_id', '=', False), ('account_id.reconcile', '=', True)])
- if rec_id:
- reconcile_id = statement_reconcile_obj.create(cr, uid, {
- 'line_ids': [(6, 0, rec_id)]
- }, context=context)
- mv = pool.get('account.move.line').browse(cr, uid, rec_id[0], context=context)
- if mv.partner_id:
- line['partner_id'] = mv.partner_id.id
- if line['amount'] < 0 :
- line['account_id'] = mv.partner_id.property_account_payable.id
- else :
- line['account_id'] = mv.partner_id.property_account_receivable.id
+ lines = statement.get('bank_statement_line',False)
+ if lines:
+ for value in lines:
+ line = lines[value]
+ voucher_id = False
+ if line.get('toreconcile',False): # Fix me
+ name = line['name'][:3] + '/' + line['name'][3:7] + '/' + line['name'][7:]
+ rec_id = self.pool.get('account.move.line').search(cr, uid, [('name', '=', name), ('reconcile_id', '=', False), ('account_id.reconcile', '=', True)])
+ if rec_id:
+ voucher_res = { 'type':(line['amount'] < 0 and 'payment' or 'receipt') ,
+ 'name': line['name'],#line.name,
+ 'partner_id': line['partner_id'] ,#line.partner_id.id,
+ 'journal_id': statement['journal_id'], #statement.journal_id.id,
+ 'account_id': line['account_id'],#line.account_id.id,
+ 'company_id': statement['company_id'],#statement.company_id.id,
+ 'currency_id': statement['currency'],#statement.currency.id,
+ 'date': line['date'], #line.date,
+ 'amount':abs(line['amount']),
+ 'period_id':statement.get('period_id',False) or period,# statement.period_id.id
+ }
+ voucher_id = voucher_obj.create(cr, uid, voucher_res, context=context)
+
+ result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype=(amount < 0 and 'payment' or 'receipt'))
+ voucher_line_dict = False
+ if result['value']['line_ids']:
+ for line_dict in result['value']['line_ids']:
+ move_line = line_obj.browse(cr, uid, line_dict['move_line_id'], context)
+ if line.move_id.id == move_line.move_id.id:
+ voucher_line_dict = line_dict
+
+ if voucher_line_dict:
+ voucher_line_dict.update({'voucher_id':voucher_id})
+ voucher_line_obj.create(cr, uid, voucher_line_dict, context=context)
+
+ # reconcile_id = statement_reconcile_obj.create(cr, uid, {
+ # 'line_ids': [(6, 0, rec_id)]
+ # }, context=context)
+ #
+
+ mv = self.pool.get('account.move.line').browse(cr, uid, rec_id[0], context=context)
+ if mv.partner_id:
+ line['partner_id'] = mv.partner_id.id
+ if line['amount'] < 0 :
+ line['account_id'] = mv.partner_id.property_account_payable.id
+ else :
+ line['account_id'] = mv.partner_id.property_account_receivable.id
str_not1 = ''
if line.has_key('contry_name') and line.has_key('cntry_number'):
str_not1="Partner name:%s \n Partner Account Number:%s \n Communication:%s \n Value Date:%s \n Entry Date:%s \n"%(line["contry_name"], line["cntry_number"], line["free_comm"]+line['extra_note'], line["val_date"][0], line["entry_date"][0])
- id=bank_statement_line_obj.create(cr, uid, {
+ id = bank_statement_line_obj.create(cr, uid, {
'name':line['name'],
'date': line['date'],
'amount': line['amount'],
'partner_id':line['partner_id'] or 0,
'account_id':line['account_id'],
'statement_id': bk_st_id,
- 'reconcile_id': reconcile_id,
+ 'voucher_id': voucher_id,
'note':str_not1,
'ref':line['ref'],
})
- str_not= "\n \n Account Number: %s \n Account Holder Name: %s " %(statement["acc_number"], statement["acc_holder"])
+ str_not = "\n \n Account Number: %s \n Account Holder Name: %s " %(statement["acc_number"], statement["acc_holder"])
std_log += "\nStatement : %s , Date : %s, Starting Balance : %.2f , Ending Balance : %.2f \n"\
%(statement['name'], statement['date'], float(statement["balance_start"]), float(statement["balance_end_real"]))
bkst_list.append(bk_st_id)
@@ -267,7 +296,7 @@ class account_coda_import(osv.osv_memory):
'date': time.strftime("%Y-%m-%d"),
'user_id': uid,
})
- test=''
+ test = ''
test = str_log1 + std_log + err_log
self.write(cr, uid, ids, {'note': test}, context=context)
extraction = { 'statment_ids': bkst_list}
@@ -291,6 +320,7 @@ class account_coda_import(osv.osv_memory):
def action_open_window(self, cr, uid, data, context=None):
if not context:
cotext = {}
+
return {
'domain':"[('id','in',%s)]"%(context.get('statment_ids', False)),
'name': 'Statement',
@@ -299,7 +329,7 @@ class account_coda_import(osv.osv_memory):
'res_model': 'account.bank.statement',
'view_id': False,
'type': 'ir.actions.act_window',
- }
+ }
account_coda_import()
diff --git a/addons/account_coda/wizard/account_coda_import.xml b/addons/account_coda/wizard/account_coda_import.xml
index f344221c411..480e86d1b97 100644
--- a/addons/account_coda/wizard/account_coda_import.xml
+++ b/addons/account_coda/wizard/account_coda_import.xml
@@ -7,19 +7,20 @@
form
@@ -31,12 +35,46 @@
-
+
+ account_followup.stat.search
+ account_followup.stat
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Follow-ups Sent
account_followup.stat
form
tree,graph
+ {'search_default_followup_level':1,'search_default_fiscalyear':1}
+
diff --git a/addons/account_payment/__openerp__.py b/addons/account_payment/__openerp__.py
index c37fe6a3d04..be0ca2a127b 100644
--- a/addons/account_payment/__openerp__.py
+++ b/addons/account_payment/__openerp__.py
@@ -33,7 +33,7 @@
* a basic mechanism to easily plug various automated payment.
""",
'author': 'OpenERP SA',
- 'depends': ['account'],
+ 'depends': ['account_voucher'],
'init_xml': [],
'update_xml': [
'security/account_payment_security.xml',
diff --git a/addons/account_payment/wizard/account_payment_populate_statement.py b/addons/account_payment/wizard/account_payment_populate_statement.py
index 38d742119ad..0e7ea32e8d3 100644
--- a/addons/account_payment/wizard/account_payment_populate_statement.py
+++ b/addons/account_payment/wizard/account_payment_populate_statement.py
@@ -19,6 +19,7 @@
#
##############################################################################
+import time
from lxml import etree
from osv import osv, fields
@@ -53,7 +54,9 @@ class account_payment_populate_statement(osv.osv_memory):
statement_obj = self.pool.get('account.bank.statement')
statement_line_obj = self.pool.get('account.bank.statement.line')
currency_obj = self.pool.get('res.currency')
- statement_reconcile_obj = self.pool.get('account.bank.statement.reconcile')
+ voucher_obj = self.pool.get('account.voucher')
+ voucher_line_obj = self.pool.get('account.voucher.line')
+
if context is None:
context = {}
data = self.read(cr, uid, ids, [])[0]
@@ -68,11 +71,37 @@ class account_payment_populate_statement(osv.osv_memory):
ctx['date'] = line.ml_maturity_date # was value_date earlier,but this field exists no more now
amount = currency_obj.compute(cr, uid, line.currency.id,
statement.currency.id, line.amount_currency, context=ctx)
+ if line.partner_id:
+# line['partner_id'] = mv.partner_id.id
+ if amount < 0 :
+ account = line.partner_id.property_account_payable.id
+ else :
+ account = line.partner_id.property_account_receivable.id
if line.move_line_id:
- reconcile_id = statement_reconcile_obj.create(cr, uid, {
- 'line_ids': [(6, 0, [line.move_line_id.id])]
- }, context=context)
+ voucher_res = { 'type': 'payment' ,
+ 'name': line.name,
+ 'partner_id': line.partner_id.id,
+ 'journal_id': statement.journal_id.id,
+ 'account_id': account,
+ 'company_id': statement.company_id.id,
+ 'currency_id': statement.currency.id,
+ 'date': line.date or time.strftime('%Y-%m-%d'),
+ 'amount': abs(amount),
+ 'period_id': statement.period_id.id
+ }
+ voucher_id = voucher_obj.create(cr, uid, voucher_res, context=context)
+ result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype='payment')
+ voucher_line_dict = False
+ if result['value']['line_ids']:
+ for line_dict in result['value']['line_ids']:
+ move_line = self.pool.get('account.move.line').browse(cr, uid, line_dict['move_line_id'], context)
+ if line.move_line_id.move_id.id == move_line.move_id.id:
+ voucher_line_dict = line_dict
+ if voucher_line_dict:
+ voucher_line_dict.update({'voucher_id':voucher_id})
+ voucher_line_obj.create(cr, uid, voucher_line_dict, context=context)
+
st_line_id = statement_line_obj.create(cr, uid, {
'name': line.order_id.reference or '?',
'amount': - amount,
@@ -81,8 +110,9 @@ class account_payment_populate_statement(osv.osv_memory):
'account_id': line.move_line_id.account_id.id,
'statement_id': statement.id,
'ref': line.communication,
- 'reconcile_id': reconcile_id,
+ 'voucher_id': voucher_id,
}, context=context)
+
line_obj.write(cr, uid, [line.id], {'bank_statement_line_id': st_line_id})
return {'type': 'ir.actions.act_window_close'}
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index c6f7759859c..edfe79540e6 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -179,7 +179,7 @@ class crm_case(object):
if not stage_record.section_id:
section_id = False # only select stages without section
- domain = [('object_id.model', '=', self._name), ('section_id', '=', section_id)]
+ domain = [('object_id.model', '=', self._name), '|', ('section_id', '=', section_id),('section_id','=',False)]
if 'force_domain' in context and context['force_domain']:
domain += context['force_domain']
sid = stage_obj.search(cr, uid, domain, context=context)
@@ -580,10 +580,8 @@ crm_case_section()
class crm_case_categ(osv.osv):
""" Category of Case """
-
_name = "crm.case.categ"
- _description = "Category of case"
-
+ _description = "Category of Case"
_columns = {
'name': fields.char('Name', size=64, required=True, translate=True),
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index 0a552a4165a..ee778401e4a 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -120,7 +120,7 @@ class crm_lead(crm_case, osv.osv):
# Lead fields
'categ_id': fields.many2one('crm.case.categ', 'Category', \
- domain="['|',('section_id','=',section_id),('section_id','=',False)]"),
+ domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.project.bug')]"),
'type_id': fields.many2one('crm.case.resource.type', 'Campaign', \
domain="['|',('section_id','=',section_id),('section_id','=',False)]"),
'channel_id': fields.many2one('res.partner.canal', 'Channel'),
diff --git a/addons/crm/crm_lead_menu.xml b/addons/crm/crm_lead_menu.xml
index 0bb854fea17..65daf5d79d5 100644
--- a/addons/crm/crm_lead_menu.xml
+++ b/addons/crm/crm_lead_menu.xml
@@ -10,7 +10,7 @@
{"search_default_user_id":uid,'search_default_current':1}
- {'search_default_current':1, 'default_type': 'lead'}
+ {'search_default_current':1, 'default_type': 'lead', 'search_default_section_id':section_id}
A lead is a first, unqualified, contact with a new prospect. Use leads when you import a database of prospects or integrate your website's contact form with OpenERP. After having been qualified, the lead can be converted to a partner and a business opportunity for a further detailed tracking of the related activities.
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index 2df1369bbb1..40317a4b188 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -32,20 +32,6 @@
id="menu_crm_lead_categ" name="Categories"
parent="base.menu_crm_config_lead" sequence="1"/>
-
-
- Lead Sources
- crm.case.resource.type
- form
-
- [('object_id.model', '=', 'crm.lead')]
- {'object_id':'crm.lead'}
-
-
-
@@ -70,7 +56,7 @@
+ domain="[('section_id','=',section_id), ('section_id','=',False), ('object_id.model', '=', 'crm.lead')]" />
- Existing Customer
+ Interrest in Computer
-
+
- Self Generated
+ Interrest in Accessories
- Employee
+ Need Services
- Partner
+ Need Information
- Campaign
+ Need a Website Design
- Website
+ Potential Reseller
- Word of mouth
+ Need Consulting
diff --git a/addons/crm/crm_opportunity_menu.xml b/addons/crm/crm_opportunity_menu.xml
index 0bfb5f35efc..d2d2a299edb 100644
--- a/addons/crm/crm_opportunity_menu.xml
+++ b/addons/crm/crm_opportunity_menu.xml
@@ -28,7 +28,7 @@
crm.lead
tree,form,graph,calendar
[('type','=','opportunity')]
- {'search_default_user_id':uid,'search_default_current':1, 'default_type': 'opportunity'}
+ {'search_default_user_id':uid,'search_default_current':1, 'search_default_section_id':section_id,'default_type': 'opportunity'}
Opportunities allows you to track your best deals pipeline: history of
diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml
index c2713b91f89..34f5e542ab0 100644
--- a/addons/crm/crm_opportunity_view.xml
+++ b/addons/crm/crm_opportunity_view.xml
@@ -15,7 +15,7 @@
+ domain="['|',('section_id','=',section_id),('section_id','=',False),('object_id.model', '=', 'crm.lead')]" />
@@ -62,7 +62,7 @@
-
@@ -118,7 +118,7 @@
-
+
@@ -337,7 +337,7 @@
+ domain="[]" context="{'group_by':'type_id'}" groups="base.group_extended"/>
diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py
index afa153fb662..0c7385532fb 100644
--- a/addons/crm/crm_phonecall.py
+++ b/addons/crm/crm_phonecall.py
@@ -62,13 +62,13 @@ class crm_phonecall(crm_case, osv.osv):
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
'email_from': fields.char('Email', size=128, help="These people will receive email."),
'stage_id': fields.many2one('crm.case.stage', 'Stage', \
- domain="[('section_id','=',section_id),\
+ domain="['|',('section_id','=',section_id),('section_id','=',False),\
('object_id.model', '=', 'crm.phonecall')]"),
'date_open': fields.datetime('Opened', readonly=True),
# phonecall fields
'duration': fields.float('Duration', help="Duration in Minutes"),
'categ_id': fields.many2one('crm.case.categ', 'Category', \
- domain="[('section_id','=',section_id),\
+ domain="['|',('section_id','=',section_id),('section_id','=',False),\
('object_id.model', '=', 'crm.phonecall')]"),
'partner_phone': fields.char('Phone', size=32),
'partner_contact': fields.related('partner_address_id', 'name', \
diff --git a/addons/crm/crm_phonecall_menu.xml b/addons/crm/crm_phonecall_menu.xml
index 8585ddc7fe4..44f1bcb219f 100644
--- a/addons/crm/crm_phonecall_menu.xml
+++ b/addons/crm/crm_phonecall_menu.xml
@@ -32,7 +32,7 @@
form
tree,calendar
- {"search_default_user_id":uid}
+ {"search_default_user_id":uid, 'search_default_section_id':section_id}
@@ -106,7 +106,7 @@
tree,calendar
-
+
The Outbound menu open a search view in editable mode, so you can easily modify or plan a new call. Actions buttons allows you to to make you call status evolved for a better follow up of your planned calls. During calls, convert your lead into an opportunity, plan a meeting or canceled it.
diff --git a/addons/crm/report/crm_lead_report.py b/addons/crm/report/crm_lead_report.py
index 71d19b3d6f1..69f08faac79 100644
--- a/addons/crm/report/crm_lead_report.py
+++ b/addons/crm/report/crm_lead_report.py
@@ -100,9 +100,9 @@ class crm_lead_report(osv.osv):
'planned_revenue': fields.float('Planned Revenue',digits=(16,2),readonly=True),
'probable_revenue': fields.float('Probable Revenue', digits=(16,2),readonly=True),
'categ_id': fields.many2one('crm.case.categ', 'Category',\
- domain="[('section_id','=',section_id)]" , readonly=True),
+ domain="['|',('section_id','=',False),('section_id','=',section_id)]" , readonly=True),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', \
- domain="[('section_id','=',section_id),\
+ domain="['|',('section_id','=',False),('section_id','=',section_id),\
('object_id.model', '=', 'crm.lead')]", readonly=True),
'partner_id': fields.many2one('res.partner', 'Partner' , readonly=True),
'opening_date': fields.date('Opening Date', readonly=True),
diff --git a/addons/crm/wizard/crm_opportunity_to_phonecall.py b/addons/crm/wizard/crm_opportunity_to_phonecall.py
index fdf5cfc1f37..bd2aaca0607 100644
--- a/addons/crm/wizard/crm_opportunity_to_phonecall.py
+++ b/addons/crm/wizard/crm_opportunity_to_phonecall.py
@@ -34,7 +34,7 @@ class crm_opportunity2phonecall(osv.osv_memory):
'date': fields.datetime('Date' , required=True),
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
'categ_id': fields.many2one('crm.case.categ', 'Category', required=True, \
- domain="[('section_id','=',section_id),\
+ domain="['|',('section_id','=',False),('section_id','=',section_id),\
('object_id.model', '=', 'crm.phonecall')]"),
}
diff --git a/addons/crm/wizard/crm_phonecall_to_phonecall.py b/addons/crm/wizard/crm_phonecall_to_phonecall.py
index f288fd2d5b7..aaba8e082c5 100644
--- a/addons/crm/wizard/crm_phonecall_to_phonecall.py
+++ b/addons/crm/wizard/crm_phonecall_to_phonecall.py
@@ -103,7 +103,7 @@ class crm_phonecall2phonecall(osv.osv_memory):
'name' : fields.char('Call summary', size=64, required=True, select=1),
'user_id' : fields.many2one('res.users',"Assign To"),
'categ_id': fields.many2one('crm.case.categ', 'Category', required=True, \
- domain="[('section_id','=',section_id),\
+ domain="['|',('section_id','=',False),('section_id','=',section_id),\
('object_id.model', '=', 'crm.phonecall')]"),
'date': fields.datetime('Date', required=True),
'section_id':fields.many2one('crm.case.section','Sales Team'),
diff --git a/addons/crm_claim/crm_claim.py b/addons/crm_claim/crm_claim.py
index de77c842aa6..d6c6603b829 100644
--- a/addons/crm_claim/crm_claim.py
+++ b/addons/crm_claim/crm_claim.py
@@ -54,9 +54,7 @@ class crm_claim(crm.crm_case, osv.osv):
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.claim')]"),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
- 'type_id': fields.many2one('crm.case.resource.type', 'Claim Type', \
- domain="[('section_id','=',section_id),\
- ('object_id.model', '=', 'crm.claim')]"),
+ 'type_action': fields.selection([('correction','Corrective Action'),('prevention','Preventive Action')], 'Action Type'),
'user_id': fields.many2one('res.users', 'Responsible'),
'section_id': fields.many2one('crm.case.section', 'Sales Team', \
select=True, help="Sales team to which Case belongs to."\
diff --git a/addons/crm_claim/crm_claim_data.xml b/addons/crm_claim/crm_claim_data.xml
index a176b3aa8e0..cd8db8499a5 100644
--- a/addons/crm_claim/crm_claim_data.xml
+++ b/addons/crm_claim/crm_claim_data.xml
@@ -1,78 +1,76 @@
-
+
-
-
-
- Factual Claims
-
-
-
-
-
- Value Claims
-
-
-
-
-
- Policy Claims
-
-
-
-
-
-
-
- Corrective
-
-
-
-
-
- Preventive
-
-
-
-
-
-
-
- Accepted as Claim
-
-
-
-
-
- Fixed
-
-
-
-
-
- Won't fix
-
-
-
-
-
- Invalid
-
-
-
-
-
- Awaiting Response
-
-
-
-
-
+
+
+
+ Factual Claims
+
+
+
+
+
+ Value Claims
+
+
+
+
+
+ Policy Claims
+
+
+
+
+
+
+
+ Corrective
+
+
+
+
+ Preventive
+
+
+
+
+
+
+ Accepted as Claim
+
+
+
+
+
+ Fixed
+
+
+
+
+
+ Won't fix
+
+
+
+
+
+ Invalid
+
+
+
+
+
+ Awaiting Response
+
+
+
+
+
diff --git a/addons/crm_claim/crm_claim_demo.xml b/addons/crm_claim/crm_claim_demo.xml
index db21223656e..0a603cb8f5a 100644
--- a/addons/crm_claim/crm_claim_demo.xml
+++ b/addons/crm_claim/crm_claim_demo.xml
@@ -1,129 +1,122 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/crm_claim/crm_claim_view.xml b/addons/crm_claim/crm_claim_view.xml
index a341915bc39..64c917ffe4b 100644
--- a/addons/crm_claim/crm_claim_view.xml
+++ b/addons/crm_claim/crm_claim_view.xml
@@ -117,8 +117,7 @@
-
+
diff --git a/addons/crm_claim/report/crm_claim_report.py b/addons/crm_claim/report/crm_claim_report.py
index e0dc7244f14..01b79db4823 100644
--- a/addons/crm_claim/report/crm_claim_report.py
+++ b/addons/crm_claim/report/crm_claim_report.py
@@ -71,9 +71,7 @@ class crm_claim_report(osv.osv):
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'priority': fields.selection(AVAILABLE_PRIORITIES, 'Priority'),
- 'type_id': fields.many2one('crm.case.resource.type', 'Claim Type',\
- domain="[('section_id','=',section_id),\
- ('object_id.model', '=', 'crm.claim')]"),
+ 'type_action': fields.selection([('correction','Corrective Action'),('prevention','Preventive Action')], 'Action Type'),
'date_closed': fields.date('Closed', readonly=True),
'delay_expected': fields.float('Overpassed Deadline',digits=(16,2),readonly=True, group_operator="avg"),
}
@@ -102,7 +100,7 @@ class crm_claim_report(osv.osv):
c.categ_id,
count(*) as nbr,
c.priority as priority,
- c.type_id as type_id,
+ c.type_action as type_action,
date_trunc('day',c.create_date) as create_date,
avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close,
extract('epoch' from (c.date_deadline - c.date_closed))/(3600*24) as delay_expected
@@ -111,7 +109,7 @@ class crm_claim_report(osv.osv):
group by to_char(c.date, 'YYYY'), to_char(c.date, 'MM'),to_char(c.date, 'YYYY-MM-DD'),\
c.state, c.user_id,c.section_id, c.stage_id,\
c.categ_id,c.partner_id,c.company_id,c.create_date,
- c.priority,c.type_id,c.date_deadline,c.date_closed
+ c.priority,c.type_action,c.date_deadline,c.date_closed
)""")
crm_claim_report()
diff --git a/addons/crm_claim/report/crm_claim_report_view.xml b/addons/crm_claim/report/crm_claim_report_view.xml
index db5973c1867..5b184c8ef66 100644
--- a/addons/crm_claim/report/crm_claim_report_view.xml
+++ b/addons/crm_claim/report/crm_claim_report_view.xml
@@ -10,21 +10,21 @@
tree
-
-
-
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -36,11 +36,11 @@
crm.claim.report
form
-