diff --git a/addons/account/account.py b/addons/account/account.py
index 968af43396e..b9cc9473579 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -395,7 +395,7 @@ class account_account(osv.osv):
'reconcile': False,
'active': True,
'currency_mode': 'current',
- 'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.account', context=c),
+ 'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.account', context=c),
}
def _check_recursion(self, cr, uid, ids, context=None):
@@ -1121,9 +1121,8 @@ class account_move(osv.osv):
res_ids = set(id[0] for id in cr.fetchall())
ids = ids and (ids & res_ids) or res_ids
if ids:
- return [('id','in',tuple(ids))]
- else:
- return [('id', '=', '0')]
+ return [('id', 'in', tuple(ids))]
+ return [('id', '=', '0')]
_columns = {
'name': fields.char('Number', size=64, required=True),
@@ -1207,7 +1206,6 @@ class account_move(osv.osv):
'SET state=%s '\
'WHERE id IN %s',
('posted', tuple(valid_moves),))
-
return True
def button_validate(self, cursor, user, ids, context=None):
@@ -1522,7 +1520,6 @@ class account_move_reconcile(osv.osv):
result.append((r.id,r.name))
return result
-
account_move_reconcile()
#----------------------------------------------------------
@@ -1834,7 +1831,6 @@ class account_tax(osv.osv):
obj_partener_address = self.pool.get('res.partner.address')
for tax in taxes:
# we compute the amount for the current tax object and append it to the result
-
data = {'id':tax.id,
'name':tax.description and tax.description + " - " + tax.name or tax.name,
'account_collected_id':tax.account_collected_id.id,
@@ -2049,6 +2045,7 @@ class account_tax(osv.osv):
r['amount'] = round(r['amount'] * quantity, prec)
total += r['amount']
return res
+
account_tax()
# ---------------------------------------------------------
@@ -2177,13 +2174,11 @@ class account_subscription(osv.osv):
'name': fields.char('Name', size=64, required=True),
'ref': fields.char('Reference', size=16),
'model_id': fields.many2one('account.model', 'Model', required=True),
-
'date_start': fields.date('Start Date', required=True),
'period_total': fields.integer('Number of Periods', required=True),
'period_nbr': fields.integer('Period', required=True),
'period_type': fields.selection([('day','days'),('month','month'),('year','year')], 'Period Type', required=True),
'state': fields.selection([('draft','Draft'),('running','Running'),('done','Done')], 'State', required=True, readonly=True),
-
'lines_id': fields.one2many('account.subscription.line', 'subscription_id', 'Subscription Lines')
}
_defaults = {
@@ -2354,9 +2349,9 @@ class account_add_tmpl_wizard(osv.osv_memory):
_name = 'account.addtmpl.wizard'
def _get_def_cparent(self, cr, uid, context=None):
- acc_obj=self.pool.get('account.account')
- tmpl_obj=self.pool.get('account.account.template')
- tids=tmpl_obj.read(cr, uid, [context['tmpl_ids']], ['parent_id'])
+ acc_obj = self.pool.get('account.account')
+ tmpl_obj = self.pool.get('account.account.template')
+ tids = tmpl_obj.read(cr, uid, [context['tmpl_ids']], ['parent_id'])
if not tids or not tids[0]['parent_id']:
return False
ptids = tmpl_obj.read(cr, uid, [tids[0]['parent_id'][0]], ['code'])
@@ -2364,7 +2359,6 @@ class account_add_tmpl_wizard(osv.osv_memory):
if not ptids or not ptids[0]['code']:
raise osv.except_osv(_('Error !'), _('Cannot locate parent code for template account!'))
res = acc_obj.search(cr, uid, [('code','=',ptids[0]['code'])])
-
return res and res[0] or False
_columns = {
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index a50bb37a981..cd855bfef4b 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -657,7 +657,9 @@ class account_invoice(osv.osv):
def _convert_ref(self, cr, uid, ref):
return (ref or '').replace('/','')
- def _get_analytic_lines(self, cr, uid, id):
+ def _get_analytic_lines(self, cr, uid, id, context=None):
+ if context is None:
+ context = {}
inv = self.browse(cr, uid, id)
cur_obj = self.pool.get('res.currency')
@@ -667,7 +669,7 @@ class account_invoice(osv.osv):
else:
sign = -1
- iml = self.pool.get('account.invoice.line').move_line_get(cr, uid, inv.id)
+ iml = self.pool.get('account.invoice.line').move_line_get(cr, uid, inv.id, context=context)
for il in iml:
if il['account_analytic_id']:
if inv.type in ('in_invoice', 'in_refund'):
diff --git a/addons/account/project/analytic_account_demo.xml b/addons/account/project/analytic_account_demo.xml
index 8f33f70f856..6df74d0a0ba 100644
--- a/addons/account/project/analytic_account_demo.xml
+++ b/addons/account/project/analytic_account_demo.xml
@@ -8,89 +8,106 @@
Leaves
1
+ view
Internal
2
+ view
Our Super Product
100
open
+ view
Project 1
101
+ view
Project 2
102
+ view
Training
4
+ view
In House
1
+ normal
Online
2
+ normal
Support
support
+ view
Partners
partners
+ view
Customers
customers
+ view
Internal
3
+ normal
Integration
integration
+ view
Consultancy
4
+ normal
Training
5
+ normal
Seagate P1
1
+ normal
open
Seagate P2
2
+ normal
open
@@ -99,11 +116,13 @@
Magasin BML 1
3
+ normal
CampToCamp
7
+ normal
@@ -114,18 +133,21 @@
Agrolait
3
+ normal
Asustek
4
-
+ normal
+
DistriPC
7
+ normal
@@ -134,6 +156,7 @@
+ normal
open
@@ -142,6 +165,7 @@
3
+ normal
open
@@ -151,6 +175,7 @@
10
+ normal
@@ -159,12 +184,14 @@
12
+ normal
OpenERP SA AT Work
15
+ normal
@@ -173,6 +200,7 @@
21
+ normal
open
@@ -180,56 +208,67 @@
Support
1
+ normal
Development
2
+ normal
Training
1
+ normal
Development
2
+ normal
Administrative
1
+ normal
Commercial & Marketing
2
+ normal
Our Super Product Development
3
+ view
Stable
1
+ normal
Trunk
2
+ normal
Paid
1
+ normal
Unpaid
2
+ normal
diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml
index ce3496e3e30..380db5b0291 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/account/project/project_view.xml
@@ -55,19 +55,20 @@
tree
child_complete_ids
-
-
+
+
-
+
+