}
history = []
for i in range(5):
+ args_list = (tuple(self.ACCOUNT_TYPE), tuple(partner_ids) ,self.date_from,)
+ dates_query = '(COALESCE(date_maturity,date)'
+ if form[str(i)]['start'] and form[str(i)]['stop']:
+ dates_query += ' BETWEEN %s AND %s)'
+ args_list += (form[str(i)]['start'], form[str(i)]['stop'])
+ elif form[str(i)]['start']:
+ dates_query += ' > %s)'
+ args_list += (form[str(i)]['start'],)
+ else:
+ dates_query += ' < %s)'
+ args_list += (form[str(i)]['stop'],)
self.cr.execute('SELECT partner_id, SUM(debit-credit)\
FROM account_move_line AS l, account_account\
WHERE (l.account_id = account_account.id)\
AND (account_account.type IN %s)\
- AND (COALESCE(date_maturity,date) BETWEEN %s AND %s)\
AND (partner_id IN %s)\
AND ((reconcile_id IS NULL)\
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
AND '+ self.query + '\
AND account_account.active\
- GROUP BY partner_id' , (tuple(self.ACCOUNT_TYPE), form[str(i)]['start'], form[str(i)]['stop'], tuple(partner_ids) ,self.date_from,))
+ AND ' + dates_query + '\
+ GROUP BY partner_id' , args_list)
t = self.cr.fetchall()
d = {}
for i in t:
diff --git a/addons/account/report/account_aged_partner_balance.rml b/addons/account/report/account_aged_partner_balance.rml
index bd52f9be4f5..3bc159d8288 100644
--- a/addons/account/report/account_aged_partner_balance.rml
+++ b/addons/account/report/account_aged_partner_balance.rml
@@ -168,7 +168,7 @@
Partners
- [[ data['form']['direction_selection'] == 'future' and 'Due' or 'Not due' ]] [[ formatLang(data['form']['date1'],date=True) ]]
+ [[ data['form']['direction_selection'] == 'future' and 'Due' or 'Not due' ]]
[[ data['form']['4']['name'] ]]
diff --git a/addons/account/wizard/account_report_aged_partner_balance.py b/addons/account/wizard/account_report_aged_partner_balance.py
index 29867f04d5b..fb0e404401a 100644
--- a/addons/account/wizard/account_report_aged_partner_balance.py
+++ b/addons/account/wizard/account_report_aged_partner_balance.py
@@ -75,18 +75,18 @@ class account_aged_trial_balance(osv.osv_memory):
for i in range(5)[::-1]:
stop = start - RelativeDateTime(days=period_length)
res[str(i)] = {
- 'name' : str((5-(i+1)) * period_length) + '-' + str((5-i) * period_length),
+ 'name': (i!=0 and (str((5-(i+1)) * period_length) + '-' + str((5-i) * period_length)) or ('+'+str(4 * period_length))),
'stop': start.strftime('%Y-%m-%d'),
- 'start' : stop.strftime('%Y-%m-%d'),
+ 'start': (i!=0 and stop.strftime('%Y-%m-%d') or None),
}
start = stop - RelativeDateTime(days=1)
else:
for i in range(5):
stop = start + RelativeDateTime(days=period_length)
res[str(5-(i+1))] = {
- 'name' : str((i) * period_length)+'-' + str((i+1) * period_length),
+ 'name' : (i!=4 and str((i) * period_length)+'-' + str((i+1) * period_length) or ('+'+str(4 * period_length))),
'start': start.strftime('%Y-%m-%d'),
- 'stop': stop.strftime('%Y-%m-%d'),
+ 'stop': (i!=4 and stop.strftime('%Y-%m-%d') or None),
}
start = stop + RelativeDateTime(days=1)
data['form'].update(res)
@@ -99,4 +99,4 @@ class account_aged_trial_balance(osv.osv_memory):
account_aged_trial_balance()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
From 7d3816bf9bea653184463f5af7ec57996ccbaf26 Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Thu, 2 Sep 2010 16:10:45 +0200
Subject: [PATCH 009/128] [IMP] account: usability small changes
bzr revid: qdp-launchpad@tinyerp.com-20100902141045-evuc4leiw7gy6mty
---
addons/account/project/project_view.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml
index 7e26ea2b84f..932fa0495a3 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/account/project/project_view.xml
@@ -296,8 +296,8 @@
-
+
@@ -329,7 +329,7 @@
tree,form,search
-
+
#
# Open journal entries
From 0b27dc8113b976ac23720a812cbeb70071645487 Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Thu, 2 Sep 2010 16:27:59 +0200
Subject: [PATCH 010/128] [IMP] account: usability small changes
bzr revid: qdp-launchpad@tinyerp.com-20100902142759-wrcdq6b9zrwf2q76
---
addons/account/account_view.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index aaba98688c1..a929cd21e6d 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -58,8 +58,8 @@
-
-
+
+
From 3d975173ed95307286ded8a89d10de4e25ab9e81 Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Thu, 2 Sep 2010 17:09:21 +0200
Subject: [PATCH 011/128] [IMP] account: usability small changes
bzr revid: qdp-launchpad@tinyerp.com-20100902150921-ofg453rp63upn723
---
addons/account/account_menuitem.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml
index 07f094d5867..92fdd43ca81 100644
--- a/addons/account/account_menuitem.xml
+++ b/addons/account/account_menuitem.xml
@@ -22,7 +22,7 @@
-
+
From ac71f09d554040dd5cde6b4877e54e9d743b1247 Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Fri, 3 Sep 2010 11:10:06 +0200
Subject: [PATCH 016/128] [IMP] account: usability changes
bzr revid: qdp-launchpad@tinyerp.com-20100903091006-sgsq8928ia8afpjs
---
addons/account/wizard/account_state_open_view.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/account/wizard/account_state_open_view.xml b/addons/account/wizard/account_state_open_view.xml
index a14d4b66007..563a15bff73 100644
--- a/addons/account/wizard/account_state_open_view.xml
+++ b/addons/account/wizard/account_state_open_view.xml
@@ -13,8 +13,8 @@
-
-
+
+
From d93b7ba3bc330aa8574b8a45704f8fbe388f84c5 Mon Sep 17 00:00:00 2001
From: Mustufa Rangwala
Date: Fri, 3 Sep 2010 14:42:56 +0530
Subject: [PATCH 017/128] [IMP] Account: Move line create method if you set the
value of journal/period on creation of move line it will not change the value
as per context's journal/period ..so you can create different journal/periond
with move line
bzr revid: mra@mra-laptop-20100903091256-l3ut29d7d1bw1xle
---
addons/account/account_move_line.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index cf17c76deff..a2ba1029981 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -1086,9 +1086,9 @@ class account_move_line(osv.osv):
self._check_date(cr, uid, vals, context, check)
if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']:
raise osv.except_osv(_('Bad account!'), _('You can not use an inactive account!'))
- if 'journal_id' in vals and 'journal_id' not in context:
+ if 'journal_id' in vals:
context['journal_id'] = vals['journal_id']
- if 'period_id' in vals and 'period_id' not in context:
+ if 'period_id' in vals:
context['period_id'] = vals['period_id']
if ('journal_id' not in context) and ('move_id' in vals) and vals['move_id']:
m = self.pool.get('account.move').browse(cr, uid, vals['move_id'])
@@ -1097,7 +1097,6 @@ class account_move_line(osv.osv):
self._update_journal_check(cr, uid, context['journal_id'], context['period_id'], context)
company_currency = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id.id
-
move_id = vals.get('move_id', False)
journal = self.pool.get('account.journal').browse(cr, uid, context['journal_id'])
is_new_move = False
From 2f82d47c346ecef14f5a6c749a40c33cace17c5f Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Fri, 3 Sep 2010 11:43:38 +0200
Subject: [PATCH 018/128] [IMP] account: cash statement usability changes
bzr revid: qdp-launchpad@tinyerp.com-20100903094338-4ve4d3zmwndq7dcb
---
addons/account/account_view.xml | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index a929cd21e6d..ed16b5a49ad 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -483,9 +483,10 @@
-
-
+
+
+
@@ -2476,11 +2477,11 @@
-
+
-
+
From cd43bf49df07ba685838b968713a93a94ec2a2a6 Mon Sep 17 00:00:00 2001
From: Mustufa Rangwala
Date: Fri, 3 Sep 2010 16:14:37 +0530
Subject: [PATCH 019/128] [IMP] Account: Bank statement line visible seq field
on tree view also
bzr revid: mra@mra-laptop-20100903104437-jvrnqrq7jg0jyj2j
---
addons/account/account_view.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index a929cd21e6d..1a54d345786 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -121,7 +121,7 @@
-
+
account.period.search
account.period
@@ -137,7 +137,7 @@
-
+
Periods
account.period
@@ -520,7 +520,7 @@
-
+
@@ -2411,7 +2411,7 @@
-
+
From 4fd67b69c6b0fc3ce35920df8e8fdc664e1fbc7b Mon Sep 17 00:00:00 2001
From: vra
Date: Fri, 3 Sep 2010 16:55:45 +0530
Subject: [PATCH 020/128] [FIX] account: Fixed the opening balance problem in
account_cash_statement.
bzr revid: vra@tinyerp.com-20100903112545-78hgv1gy6gayvvvt
---
addons/account/account_cash_statement.py | 70 +++++++++++++++---------
1 file changed, 45 insertions(+), 25 deletions(-)
diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py
index 5ed057536a8..5010664e8f2 100644
--- a/addons/account/account_cash_statement.py
+++ b/addons/account/account_cash_statement.py
@@ -151,17 +151,37 @@ class account_cash_statement(osv.osv):
res[r] = round(res[r], 2)
return res
- def _get_company(self, cr, uid, ids, context={}):
+ def _get_company(self, cr, uid, context={}):
user_pool = self.pool.get('res.users')
company_pool = self.pool.get('res.company')
- user = user_pool.browse(cr, uid, uid, uid)
+ user = user_pool.browse(cr, uid, uid, context)
company_id = user.company_id and user.company_id.id
if not company_id:
company_id = company_pool.search(cr, uid, [])[0]
return company_id
- def _get_cash_open_box_lines(self, cr, uid, ids, context={}):
+ def _get_cash_open_box_lines(self, cr, uid, context={}):
+ res = []
+ curr = [1, 2, 5, 10, 20, 50, 100, 500]
+ for rs in curr:
+ dct = {
+ 'pieces':rs,
+ 'number':0
+ }
+ res.append(dct)
+ journal_ids = self.pool.get('account.journal').search(cr, uid, [('type','=','cash')], context=context)
+ if journal_ids:
+ results = self.search(cr, uid, [('journal_id','in',journal_ids),('state','=','confirm')],context=context)
+ if results:
+ cash_st = self.browse(cr, uid, results, context)[0]
+ for cash_line in cash_st.ending_details_ids:
+ for r in res:
+ if cash_line.pieces == r['pieces']:
+ r['number'] = cash_line.number
+ return res
+
+ def _get_default_cash_close_box_lines(self, cr, uid, context={}):
res = []
curr = [1, 2, 5, 10, 20, 50, 100, 500]
for rs in curr:
@@ -172,7 +192,7 @@ class account_cash_statement(osv.osv):
res.append(dct)
return res
- def _get_cash_close_box_lines(self, cr, uid, ids, context={}):
+ def _get_cash_close_box_lines(self, cr, ids, uid, context={}):
res = []
curr = [1, 2, 5, 10, 20, 50, 100, 500]
for rs in curr:
@@ -180,7 +200,7 @@ class account_cash_statement(osv.osv):
'pieces':rs,
'number':0
}
- res.append((0, 0, dct))
+ res.append((0,0,dct))
return res
_columns = {
@@ -206,7 +226,7 @@ class account_cash_statement(osv.osv):
'user_id': lambda self, cr, uid, context=None: uid,
'company_id': _get_company,
'starting_details_ids':_get_cash_open_box_lines,
- 'ending_details_ids':_get_cash_open_box_lines
+ 'ending_details_ids':_get_default_cash_close_box_lines
}
def create(self, cr, uid, vals, context=None):
@@ -305,25 +325,25 @@ class account_cash_statement(osv.osv):
'name': number
})
- cr.execute("select id from account_bank_statement where journal_id=%s and user_id=%s and state=%s order by id desc limit 1", (statement.journal_id.id, uid, 'confirm'))
- rs = cr.fetchone()
- rs = rs and rs[0] or None
- if rs:
- if len(statement.starting_details_ids) > 0:
- sid = []
- for line in statement.starting_details_ids:
- sid.append(line.id)
- cash_pool.unlink(cr, uid, sid)
-
- statement = statement_pool.browse(cr, uid, rs)
- balance_start = statement.balance_end_real or 0.0
- open_ids = cash_pool.search(cr, uid, [('ending_id','=',statement.id)])
- for sid in open_ids:
- default = {
- 'ending_id': False,
- 'starting_id':ids[0]
- }
- cash_pool.copy(cr, uid, sid, default)
+# cr.execute("select id from account_bank_statement where journal_id=%s and user_id=%s and state=%s order by id desc limit 1", (statement.journal_id.id, uid, 'confirm'))
+# rs = cr.fetchone()
+# rs = rs and rs[0] or None
+# if rs:
+# if len(statement.starting_details_ids) > 0:
+# sid = []
+# for line in statement.starting_details_ids:
+# sid.append(line.id)
+# cash_pool.unlink(cr, uid, sid)
+#
+# statement = statement_pool.browse(cr, uid, rs)
+# balance_start = statement.balance_end_real or 0.0
+# open_ids = cash_pool.search(cr, uid, [('ending_id','=',statement.id)])
+# for sid in open_ids:
+# default = {
+# 'ending_id': False,
+# 'starting_id':ids[0]
+# }
+# cash_pool.copy(cr, uid, sid, default)
vals.update({
'date':time.strftime("%Y-%m-%d %H:%M:%S"),
From 20bbdd3cf1a6604cc6b1bc4110a15268b2fef853 Mon Sep 17 00:00:00 2001
From: "pap (openerp)"
Date: Fri, 3 Sep 2010 16:59:50 +0530
Subject: [PATCH 021/128] [IMP] Account: - added analytic_account field on
account_model_line - removed wizard asking whether to open entries after
creating entries from account model - validating moves through
Accounting/Periodical Processing/Draft Entries/Validate Journal Entries
wizard validated moves with unbalanced entries too, fixed the bug - added
search view on account model
bzr revid: pap@tinyerp.co.in-20100903112950-eoferlxasre8pjkw
---
addons/account/account.py | 51 ++++++++++---------
addons/account/account_move_line.py | 2 +-
addons/account/account_view.xml | 44 ++++++++++++----
addons/account/wizard/account_use_model.py | 26 +++-------
.../account/wizard/account_use_model_view.xml | 16 ------
5 files changed, 72 insertions(+), 67 deletions(-)
diff --git a/addons/account/account.py b/addons/account/account.py
index 3a4eea085dd..5766a5a1adc 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -1129,8 +1129,9 @@ class account_move(osv.osv):
def post(self, cr, uid, ids, context=None):
invoice = context.get('invoice', False)
- if self.validate(cr, uid, ids, context) and len(ids):
- for move in self.browse(cr, uid, ids):
+ valid_moves = self.validate(cr, uid, ids, context)
+ if valid_moves:
+ for move in self.browse(cr, uid, valid_moves):
if move.name =='/':
new_name = False
journal = move.journal_id
@@ -1150,7 +1151,7 @@ class account_move(osv.osv):
cr.execute('UPDATE account_move '\
'SET state=%s '\
'WHERE id IN %s',
- ('posted', tuple(ids),))
+ ('posted', tuple(valid_moves),))
else:
raise osv.except_osv(_('Integrity Error !'), _('You can not validate a non-balanced entry !\nMake sure you have configured Payment Term properly !\nIt should contain atleast one Payment Term Line with type "Balance" !'))
return True
@@ -1421,7 +1422,8 @@ class account_move(osv.osv):
for record in valid_moves:
self.pool.get('account.move.line').create_analytic_lines(cr, uid, [line.id for line in record.line_id], context)
- return len(valid_moves) > 0
+ valid_moves = [move.id for move in valid_moves]
+ return len(valid_moves) > 0 and valid_moves or False
account_move()
@@ -1986,21 +1988,26 @@ class account_model(osv.osv):
'company_id': fields.many2one('res.company', 'Company', required=True),
'lines_id': fields.one2many('account.model.line', 'model_id', 'Model Entries'),
'legend' :fields.text('Legend', readonly=True, size=100),
+ 'date': fields.selection([('today','Date of the day'), ('partner','Partner Payment Term')], 'Current Date', required=True, help="The date of the generated entries"),
}
_defaults = {
'legend': lambda self, cr, uid, context:_('You can specify year, month and date in the name of the model using the following labels:\n\n%(year)s : To Specify Year \n%(month)s : To Specify Month \n%(date)s : Current Date\n\ne.g. My model on %(date)s'),
- 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id
+ 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
+ 'date': 'today'
}
def generate(self, cr, uid, ids, datas={}, context={}):
move_ids = []
+ account_move_obj = self.pool.get('account.move')
+ account_move_line_obj = self.pool.get('account.move.line')
+ period_id = self.pool.get('account.period').find(cr, uid, dt=context.get('date', False))
+ if not period_id:
+ raise osv.except_osv(_('No period found !'), _('Unable to find a valid period !'))
+ period_id = period_id[0]
+
for model in self.browse(cr, uid, ids, context):
context.update({'date':datas['date']})
- period_id = self.pool.get('account.period').find(cr, uid, dt=context.get('date', False))
- if not period_id:
- raise osv.except_osv(_('No period found !'), _('Unable to find a valid period !'))
- period_id = period_id[0]
- move_id = self.pool.get('account.move').create(cr, uid, {
+ move_id = account_move_obj.create(cr, uid, {
'ref': model.ref,
'period_id': period_id,
'journal_id': model.journal_id.id,
@@ -2008,10 +2015,16 @@ class account_model(osv.osv):
})
move_ids.append(move_id)
for line in model.lines_id:
+ analytic_account_id = False
+ if line.analytic_account_id:
+ if not model.journal_id.analytic_journal_id:
+ raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (model.journal_id.name,))
+ analytic_account_id = line.analytic_account_id.id
val = {
'move_id': move_id,
'journal_id': model.journal_id.id,
- 'period_id': period_id
+ 'period_id': period_id,
+ 'analytic_account_id': analytic_account_id
}
val.update({
'name': line.name,
@@ -2027,7 +2040,7 @@ class account_model(osv.osv):
})
c = context.copy()
c.update({'journal_id': model.journal_id.id,'period_id': period_id})
- self.pool.get('account.move.line').create(cr, uid, val, context=c)
+ account_move_line_obj.create(cr, uid, val, context=c)
return move_ids
account_model()
@@ -2040,22 +2053,14 @@ class account_model_line(osv.osv):
'quantity': fields.float('Quantity', digits_compute=dp.get_precision('Account'), help="The optional quantity on entries"),
'debit': fields.float('Debit', digits_compute=dp.get_precision('Account')),
'credit': fields.float('Credit', digits_compute=dp.get_precision('Account')),
-
- 'account_id': fields.many2one('account.account', 'Account', required=True, ondelete="cascade"),
-
- 'model_id': fields.many2one('account.model', 'Model', required=True, ondelete="cascade", select=True),
-
'ref': fields.char('Reference', size=16),
-
+ 'account_id': fields.many2one('account.account', 'Account', required=True, ondelete="cascade"),
+ 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', ondelete="cascade"),
+ 'model_id': fields.many2one('account.model', 'Model', required=True, ondelete="cascade", select=True),
'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency."),
'currency_id': fields.many2one('res.currency', 'Currency'),
-
'partner_id': fields.many2one('res.partner', 'Partner'),
'date_maturity': fields.selection([('today','Date of the day'), ('partner','Partner Payment Term')], 'Maturity date', help="The maturity date of the generated entries for this model. You can choose between the creation date or the creation date of the entries plus the partner payment terms."),
- 'date': fields.selection([('today','Date of the day'), ('partner','Partner Payment Term')], 'Current Date', required=True, help="The date of the generated entries"),
- }
- _defaults = {
- 'date': lambda *a: 'today'
}
_order = 'sequence'
_sql_constraints = [
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index a2ba1029981..79a846c8ad7 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -986,7 +986,7 @@ class account_move_line(osv.osv):
if 'period_id' in vals and 'period_id' not in context:
period_id = vals['period_id']
elif 'journal_id' not in context and 'move_id' in vals:
- if vals['move_id']:
+ if vals.get('move_id', False):
m = self.pool.get('account.move').browse(cr, uid, vals['move_id'])
journal_id = m.journal_id.id
period_id = m.period_id.id
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 1a54d345786..f720e3c72a8 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1548,13 +1548,13 @@
-
+
+
-
@@ -1571,12 +1571,11 @@
+
+
-
-
-
@@ -1589,9 +1588,10 @@
+
account.model.tree
account.model
@@ -1609,15 +1610,39 @@
-
+
+
+
+ account.model.search
+ account.model
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Recurring Models
account.model
form
- tree,form
+ tree,form,search
+ view_model_search
@@ -2418,6 +2443,7 @@
+
diff --git a/addons/account/wizard/account_use_model.py b/addons/account/wizard/account_use_model.py
index facb675a090..84554dd6d79 100644
--- a/addons/account/wizard/account_use_model.py
+++ b/addons/account/wizard/account_use_model.py
@@ -60,10 +60,16 @@ class account_use_model(osv.osv_memory):
})
move_ids.append(move_id)
for line in model.lines_id:
+ analytic_account_id = False
+ if line.analytic_account_id:
+ if not model.journal_id.analytic_journal_id:
+ raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (model.journal_id.name,))
+ analytic_account_id = line.analytic_account_id.id
val = {
'move_id': move_id,
'journal_id': model.journal_id.id,
- 'period_id': period_id
+ 'period_id': period_id,
+ 'analytic_account_id': analytic_account_id
}
val.update({
'name': line.name,
@@ -80,24 +86,8 @@ class account_use_model(osv.osv_memory):
c = context.copy()
c.update({'journal_id': model.journal_id.id,'period_id': period_id})
id_line = account_move_line_obj.create(cr, uid, val, context=c)
- context.update({'move_ids':move_ids})
- model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_account_use_model_open_entry')], context=context)
- resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
- return {
- 'name': _('Use Model'),
- 'context': context,
- 'view_type': 'form',
- 'view_mode': 'form',
- 'res_model': 'account.use.model',
- 'views': [(resource_id,'form')],
- 'type': 'ir.actions.act_window',
- 'target': 'new',
- }
- def open_moves(self, cr, uid, ids, context=None):
- mod_obj = self.pool.get('ir.model.data')
- if context is None:
- context = {}
+ context.update({'move_ids':move_ids})
model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_move_form')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
return {
diff --git a/addons/account/wizard/account_use_model_view.xml b/addons/account/wizard/account_use_model_view.xml
index fd3b13f3888..232c1b8df88 100644
--- a/addons/account/wizard/account_use_model_view.xml
+++ b/addons/account/wizard/account_use_model_view.xml
@@ -42,22 +42,6 @@
account.move.line
-
- account.use.model.open.entry.form
- account.use.model
- form
-
-
-
-
-
account.use.model.create.entry.form
account.use.model
From d45d0a840b96224363163db4692e128e78797359 Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Fri, 3 Sep 2010 14:28:50 +0200
Subject: [PATCH 022/128] [IMP] account: removed the sequence field from
account.account.type object
bzr revid: qdp-launchpad@tinyerp.com-20100903122850-x52dsdj5pvctloky
---
addons/account/account.py | 4 +---
addons/account/account_view.xml | 1 -
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/addons/account/account.py b/addons/account/account.py
index 652eddb4218..acbf65acf20 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -143,7 +143,6 @@ class account_account_type(osv.osv):
_columns = {
'name': fields.char('Acc. Type Name', size=64, required=True, translate=True),
'code': fields.char('Code', size=32, required=True),
- 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of account types."),
'close_method': fields.selection([('none', 'None'), ('balance', 'Balance'), ('detail', 'Detail'), ('unreconciled', 'Unreconciled')], 'Deferral Method', required=True),
'sign': fields.selection([(-1, 'Negative'), (1, 'Positive')], 'Sign on Reports', required=True, help='Allows you to change the sign of the balance amount displayed in the reports, so that you can see positive figures instead of negative ones in expenses accounts.'),
'report_type':fields.selection([
@@ -159,10 +158,9 @@ class account_account_type(osv.osv):
}
_defaults = {
'close_method': lambda *a: 'none',
- 'sequence': lambda *a: 5,
'sign': lambda *a: 1,
}
- _order = "sequence"
+ _order = "code"
def _check_recursion(self, cr, uid, ids):
#TODO: Need to check for recusrion
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index ed16b5a49ad..8feb7e3ffdf 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -650,7 +650,6 @@
-
From aa88cbf32a4d99b6a13814bc0a7c0fbb55f2e2df Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Fri, 3 Sep 2010 14:29:47 +0200
Subject: [PATCH 023/128] [IMP] account: cash statement, usability changes
(required fields)
bzr revid: qdp-launchpad@tinyerp.com-20100903122947-tym18iohoardu9f8
---
addons/account/account_cash_statement.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py
index 5ed057536a8..b9cdf7df09b 100644
--- a/addons/account/account_cash_statement.py
+++ b/addons/account/account_cash_statement.py
@@ -184,8 +184,8 @@ class account_cash_statement(osv.osv):
return res
_columns = {
- 'company_id':fields.many2one('res.company', 'Company', required=False),
- 'journal_id': fields.many2one('account.journal', 'Journal', required=True, states={'confirm': [('readonly', True)]}, domain=[('type', '=', 'cash')]),
+ 'company_id':fields.many2one('res.company', 'Company', required=True, states={'draft': [('readonly', False)]}, readonly=True,),
+ 'journal_id': fields.many2one('account.journal', 'Journal', required=True, states={'draft': [('readonly', False)]}, readonly=True, domain=[('type', '=', 'cash')]),
'balance_end_real': fields.float('Closing Balance', digits_compute=dp.get_precision('Account'), states={'confirm':[('readonly', True)]}, help="closing balance entered by the cashbox verifier"),
'state': fields.selection(
[('draft', 'Draft'),
@@ -197,7 +197,7 @@ class account_cash_statement(osv.osv):
'balance_end_cash': fields.function(_balance_end_cash, method=True, store=True, string='Balance', help="Closing balance based on cashBox"),
'starting_details_ids': fields.one2many('account.cashbox.line', 'starting_id', string='Opening Cashbox'),
'ending_details_ids': fields.one2many('account.cashbox.line', 'ending_id', string='Closing Cashbox'),
- 'name': fields.char('Name', size=64, required=True, readonly=False, help='if you give the Name other then / , its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself'),
+ 'name': fields.char('Name', size=64, required=True, states={'draft': [('readonly', False)]}, readonly=True, help='if you give the Name other then / , its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself'),
'user_id':fields.many2one('res.users', 'Responsible', required=False),
}
_defaults = {
From 396d5c4a21c8a58861849bb4dc4ee51916ea3bab Mon Sep 17 00:00:00 2001
From: "pap (openerp)"
Date: Fri, 3 Sep 2010 18:14:03 +0530
Subject: [PATCH 024/128] [ADD] Analytic: added Analytic group on analytic
account and put that group on menus related to analytic accounting, removed
access rules for anaytic accounting
bzr revid: pap@tinyerp.co.in-20100903124403-o1gbrd38nc047vhx
---
addons/account/__openerp__.py | 1 +
addons/account/account_view.xml | 2 +-
addons/account/security/analytic_security.xml | 28 +++++++++++++++++++
.../analytic/security/analytic_security.xml | 8 ++----
addons/analytic/security/ir.model.access.csv | 4 ---
5 files changed, 32 insertions(+), 11 deletions(-)
create mode 100644 addons/account/security/analytic_security.xml
diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index da1f95de301..cdbafb8fdf3 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -46,6 +46,7 @@ module named account_voucher.
"depends" : ["product", "analytic", "process","board"],
'update_xml': [
'security/account_security.xml',
+ 'security/analytic_security.xml',
'security/ir.model.access.csv',
'account_menuitem.xml',
'account_wizard.xml',
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index f720e3c72a8..4300a3c8d4e 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1642,7 +1642,7 @@
account.model
form
tree,form,search
- view_model_search
+
diff --git a/addons/account/security/analytic_security.xml b/addons/account/security/analytic_security.xml
new file mode 100644
index 00000000000..b2543f5fa05
--- /dev/null
+++ b/addons/account/security/analytic_security.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/analytic/security/analytic_security.xml b/addons/analytic/security/analytic_security.xml
index 8a9ebf573d5..ff521f7cd1b 100644
--- a/addons/analytic/security/analytic_security.xml
+++ b/addons/analytic/security/analytic_security.xml
@@ -8,12 +8,8 @@
[('company_id','=',user.company_id.id)]
-
- Analytic Accounting / User
-
-
-
- Analytic Accounting / Manager
+
+ Analytic Accounting
diff --git a/addons/analytic/security/ir.model.access.csv b/addons/analytic/security/ir.model.access.csv
index 6c945ca9ea2..0343f29f43a 100644
--- a/addons/analytic/security/ir.model.access.csv
+++ b/addons/analytic/security/ir.model.access.csv
@@ -1,5 +1 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_account_analytic_account_manager","account.analytic.account manager","model_account_analytic_account","analytic.group_analytic_manager",1,1,1,1
-"access_account_analytic_line_manager","account.analytic.line manager","model_account_analytic_line","analytic.group_analytic_manager",1,1,1,1
-"access_account_analytic_account_user","account.analytic.account user","model_account_analytic_account","analytic.group_analytic_user",1,0,0,0
-"access_account_analytic_line_user","account.analytic.line user","model_account_analytic_line","analytic.group_analytic_user",1,0,0,0
\ No newline at end of file
From 218d48eec2f65025206aa4c658cd0f76cf80d653 Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Fri, 3 Sep 2010 15:06:03 +0200
Subject: [PATCH 025/128] [IMP] account: tax code usability changes
bzr revid: qdp-launchpad@tinyerp.com-20100903130603-e4rcdyl32dfbe5h8
---
addons/account/account.py | 2 +-
addons/account/account_view.xml | 26 ++++++++++++++++----------
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/addons/account/account.py b/addons/account/account.py
index acbf65acf20..829b440efba 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -1551,7 +1551,7 @@ class account_tax_code(osv.osv):
'child_ids': fields.one2many('account.tax.code', 'parent_id', 'Child Codes'),
'line_ids': fields.one2many('account.move.line', 'tax_code_id', 'Lines'),
'company_id': fields.many2one('res.company', 'Company', required=True),
- 'sign': fields.float('Sign for parent', required=True),
+ 'sign': fields.float('Coefficent for parent', required=True, help='You can specify here the coefficient that will be used when consolidating the amount of this case into its parent. For example, set 1/-1 if you want to add/substract it.'),
'notprintable':fields.boolean("Not Printable in Invoice", help="Check this box if you don't want any VAT related to this Tax Code to appear on invoices"),
}
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 8feb7e3ffdf..f6294b762c0 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -742,16 +742,22 @@
form
From e3ba2e220671294402d462b57a4b72ece4cfb466 Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Fri, 3 Sep 2010 15:31:12 +0200
Subject: [PATCH 026/128] [IMP] account: account.account.type usability changes
bzr revid: qdp-launchpad@tinyerp.com-20100903133112-rmheg4gxh148nonj
---
addons/account/account.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/addons/account/account.py b/addons/account/account.py
index 829b440efba..e0377512efc 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -143,7 +143,12 @@ class account_account_type(osv.osv):
_columns = {
'name': fields.char('Acc. Type Name', size=64, required=True, translate=True),
'code': fields.char('Code', size=32, required=True),
- 'close_method': fields.selection([('none', 'None'), ('balance', 'Balance'), ('detail', 'Detail'), ('unreconciled', 'Unreconciled')], 'Deferral Method', required=True),
+ 'close_method': fields.selection([('none', 'None'), ('balance', 'Balance'), ('detail', 'Detail'), ('unreconciled', 'Unreconciled')], 'Deferral Method', required=True, help="""Set here the method that will be used to generate the end of year journal entries for all the accounts of this type.
+
+ 'None' means that nothing will be done.
+ 'Balance' will generally be used for cash accounts.
+ 'Detail' will copy each existing journal item of the previous year, even the reconciled ones.
+ 'Unreconciled' will copy only the journal items that were unreconciled on the first day of the new fiscal year."""),
'sign': fields.selection([(-1, 'Negative'), (1, 'Positive')], 'Sign on Reports', required=True, help='Allows you to change the sign of the balance amount displayed in the reports, so that you can see positive figures instead of negative ones in expenses accounts.'),
'report_type':fields.selection([
('none','/'),
From 480182a68d4bac88eea048f7327d3de55dad9c25 Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Fri, 3 Sep 2010 17:00:43 +0200
Subject: [PATCH 027/128] [FIX] account: secondary currency on account.account
may also accept invoices in company currency
bzr revid: qdp-launchpad@tinyerp.com-20100903150043-vfptw2f9dgsoqcf4
---
addons/account/account.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/account/account.py b/addons/account/account.py
index e0377512efc..02538dc2ac2 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -1350,8 +1350,8 @@ class account_move(osv.osv):
if not company_id == line.account_id.company_id.id:
raise osv.except_osv(_('Error'), _("Couldn't create move between different companies"))
- if line.account_id.currency_id:
- if line.account_id.currency_id.id != line.currency_id.id and (line.account_id.currency_id.id != line.account_id.company_id.currency_id.id or line.currency_id):
+ if line.account_id.currency_id and line.currency_id:
+ if line.account_id.currency_id.id != line.currency_id.id and (line.account_id.currency_id.id != line.account_id.company_id.currency_id.id):
raise osv.except_osv(_('Error'), _("""Couldn't create move with currency different from the secondary currency of the account "%s - %s". Clear the secondary currency field of the account definition if you want to accept all currencies.""" % (line.account_id.code, line.account_id.name)))
if abs(amount) < 10 ** -4:
From dca67f7fd51121c6139d526912b3c39f67e4c8f2 Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Fri, 3 Sep 2010 17:29:11 +0200
Subject: [PATCH 028/128] [IMP] account: removed account.analytic.check report,
as this feature should now be replaced by the Analytic Entries Analysis
bzr revid: qdp-launchpad@tinyerp.com-20100903152911-r2z5pzn96repc91q
---
addons/account/__openerp__.py | 1 -
addons/account/project/project_report.xml | 2 -
.../account/project/report/analytic_check.rml | 190 ------------------
addons/account/project/wizard/__init__.py | 3 +-
.../project/wizard/account_analytic_check.py | 57 ------
.../wizard/account_analytic_check_view.xml | 46 -----
6 files changed, 1 insertion(+), 298 deletions(-)
delete mode 100644 addons/account/project/report/analytic_check.rml
delete mode 100644 addons/account/project/wizard/account_analytic_check.py
delete mode 100644 addons/account/project/wizard/account_analytic_check_view.xml
diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index da1f95de301..c432689de44 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -95,7 +95,6 @@ module named account_voucher.
'account_invoice_workflow.xml',
'project/project_view.xml',
'project/project_report.xml',
- 'project/wizard/account_analytic_check_view.xml',
'project/wizard/account_analytic_balance_report_view.xml',
'project/wizard/account_analytic_cost_ledger_view.xml',
'project/wizard/account_analytic_inverted_balance_report.xml',
diff --git a/addons/account/project/project_report.xml b/addons/account/project/project_report.xml
index 0bc8077761e..dcfdd52a771 100644
--- a/addons/account/project/project_report.xml
+++ b/addons/account/project/project_report.xml
@@ -11,7 +11,5 @@
-
-
diff --git a/addons/account/project/report/analytic_check.rml b/addons/account/project/report/analytic_check.rml
deleted file mode 100644
index d38ac43adc8..00000000000
--- a/addons/account/project/report/analytic_check.rml
+++ /dev/null
@@ -1,190 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [[ company.name ]]
- Analytic Check - [[ company.currency_id.name ]]
-
-
-
-
-
- [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]
- Page
-
-
-
-
- 1cm 27.7cm 20cm 27.7cm
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Code
-
-
- Account Name
-
-
- General Debit
-
-
- General Credit
-
-
- Analytic Debit
-
-
- Analytic Credit
-
-
- Delta Debit
-
-
- Delta Credit
-
-
-
-
- [[ (lines_p(data['form']['date1'],data['form']['date2']),'acc') == False or removeParentNode('para') ]]
- Total
-
-
-
- [[ formatLang( general_debit(data['form']['date1'],data['form']['date2'])) ]]
-
-
- [[ formatLang( general_credit(data['form']['date1'],data['form']['date2'])) ]]
-
-
- [[ formatLang( analytic_debit(data['form']['date1'],data['form']['date2'])) ]]
-
-
- [[ formatLang( analytic_credit(data['form']['date1'],data['form']['date2'])) ]]
-
-
- [[ formatLang( delta_debit(data['form']['date1'],data['form']['date2'])) ]]
-
-
- [[ formatLang( delta_credit(data['form']['date1'],data['form']['date2'])) ]]
-
-
-
-
- [[ repeatIn(lines_p(data['form']['date1'],data['form']['date2']),'acc') ]] [[ acc['code'] ]]
-
-
- [[ acc['name'] ]]
-
-
- [[ formatLang( acc['gen_debit']) ]]
-
-
- [[ formatLang( acc['gen_credit']) ]]
-
-
- [[ formatLang( acc['ana_debit']) ]]
-
-
- [[ formatLang( acc['ana_credit']) ]]
-
-
- [[ formatLang( acc['delta_debit']) ]]
-
-
- [[ formatLang( acc['delta_credit']) ]]
-
-
-
-
-
\ No newline at end of file
diff --git a/addons/account/project/wizard/__init__.py b/addons/account/project/wizard/__init__.py
index 60f591fcb55..972373f87af 100644
--- a/addons/account/project/wizard/__init__.py
+++ b/addons/account/project/wizard/__init__.py
@@ -24,8 +24,7 @@ import account_analytic_balance_report
import account_analytic_inverted_balance_report
import account_analytic_cost_ledger_report
import account_analytic_cost_ledger_for_journal_report
-import account_analytic_check
import project_account_analytic_line
import account_analytic_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/project/wizard/account_analytic_check.py b/addons/account/project/wizard/account_analytic_check.py
deleted file mode 100644
index 53327963151..00000000000
--- a/addons/account/project/wizard/account_analytic_check.py
+++ /dev/null
@@ -1,57 +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
-
-class account_analytic_check(osv.osv_memory):
- _name = 'account.analytic.check'
- _description = 'Account Analytic Check'
-
- _columns = {
- 'date1': fields.date('Start of period', required=True),
- 'date2': fields.date('End of period', required=True),
- }
-
- _defaults = {
- 'date1':time.strftime('%Y-01-01'),
- 'date2':time.strftime('%Y-%m-%d')
- }
-
- def check_report(self, cr, uid, ids, context=None):
- datas = {}
- if context is None:
- context = {}
- data = self.read(cr, uid, ids)[0]
- datas = {
- 'ids': context.get('active_ids',[]),
- 'model': 'account.account',
- 'form': data
- }
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'account.analytic.account.analytic.check',
- 'datas': datas,
- }
-
-account_analytic_check()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/account_analytic_check_view.xml b/addons/account/project/wizard/account_analytic_check_view.xml
deleted file mode 100644
index d12acd214a4..00000000000
--- a/addons/account/project/wizard/account_analytic_check_view.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
- Account Analytic Check
- account.analytic.check
- form
-
-
-
-
-
-
- Analytic Check
- ir.actions.act_window
- account.analytic.check
- form
- form
-
- new
-
-
-
-
-
- Account Analytic Check
- client_print_multi
-
- action
- account.account
-
-
-
-
-
From de2a55eb293902c7aac60cd59be973e8bee859b2 Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Fri, 3 Sep 2010 18:19:42 +0200
Subject: [PATCH 029/128] [IMP] account: allow user to search on
account.account name with copy/pasted value from name_get (like '110200
Debtors')
bzr revid: qdp-launchpad@tinyerp.com-20100903161942-reu3kq1sgiyzzfbp
---
addons/account/account.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/addons/account/account.py b/addons/account/account.py
index 02538dc2ac2..9caefac168e 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -466,6 +466,8 @@ class account_account(osv.osv):
ids = self.search(cr, user, [('shortcut', '=', name)]+ args, limit=limit)
if not ids:
ids = self.search(cr, user, [('name', operator, name)]+ args, limit=limit)
+ if not ids and len(name.split()) >= 2:
+ ids = self.search(cr, user, [('code', operator, name.split()[0]), ('name', operator, name.split()[1])]+ args, limit=limit)
else:
ids = self.search(cr, user, args, context=context, limit=limit)
return self.name_get(cr, user, ids, context=context)
From d5205a6fa7895bd6b522cd52370ef5144ff46fce Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Fri, 3 Sep 2010 18:20:24 +0200
Subject: [PATCH 030/128] [IMP] account: usability changes (act windows on
account.account)
bzr revid: qdp-launchpad@tinyerp.com-20100903162024-qxa61dw43bbkbmh4
---
addons/account/account_view.xml | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index f6294b762c0..004172d1dae 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1498,19 +1498,17 @@
From 8997f607bd92b3776fb2eeda8f93b8913b888c1e Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Fri, 3 Sep 2010 19:06:04 +0200
Subject: [PATCH 031/128] [IMP] account: made required the field sequence_id on
account.journal (in the object)! + also some small usability changes
bzr revid: qdp-launchpad@tinyerp.com-20100903170604-74e6p93c102zuqpa
---
addons/account/account.py | 46 +++++++++++++--------------------
addons/account/account_view.xml | 2 +-
2 files changed, 19 insertions(+), 29 deletions(-)
diff --git a/addons/account/account.py b/addons/account/account.py
index 9caefac168e..6f55aed1f36 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -599,8 +599,8 @@ class account_journal(osv.osv):
_name = "account.journal"
_description = "Journal"
_columns = {
- 'name': fields.char('Journal Name', size=64, required=True, translate=True,help="Name of the journal"),
- 'code': fields.char('Code', size=16,required=True,help="Code of the journal"),
+ 'name': fields.char('Journal Name', size=64, required=True, translate=True),
+ 'code': fields.char('Code', size=16, required=True, help="The code will be used to generate the numbers of the journal entries of this journal."),
'type': fields.selection([('sale', 'Sale'),('sale_refund','Sale Refund'), ('purchase', 'Purchase'), ('purchase_refund','Purchase Refund'),('expense', 'Expense'), ('cash', 'Cash'), ('bank', 'Bank and Cheques'), ('general', 'General'), ('situation', 'Situation')], 'Type', size=32, required=True,
help="Select 'Sale' for Sale journal to be used at the time of making invoice."\
" Select 'Purchase' for Purchase Journal to be used at the time of approving purchase order."\
@@ -616,7 +616,7 @@ class account_journal(osv.osv):
'centralisation': fields.boolean('Centralised counterpart', help="Check this box to determine that each entry of this journal won't create a new counterpart but will share the same counterpart. This is used in fiscal year closing."),
'update_posted': fields.boolean('Allow Cancelling Entries', help="Check this box if you want to allow the cancellation the entries related to this journal or of the invoice related to this journal"),
'group_invoice_lines': fields.boolean('Group Invoice Lines', help="If this box is checked, the system will try to group the accounting lines when generating them from invoices."),
- 'sequence_id': fields.many2one('ir.sequence', 'Entry Sequence', help="The sequence gives the display order for a list of journals", required=False),
+ 'sequence_id': fields.many2one('ir.sequence', 'Entry Sequence', help="This field contains the informatin related to the numbering of the journal entries of this journal.", required=True),
'user_id': fields.many2one('res.users', 'User', help="The user responsible for this journal"),
'groups_id': fields.many2many('res.groups', 'account_journal_group_rel', 'journal_id', 'group_id', 'Groups'),
'currency': fields.many2one('res.currency', 'Currency', help='The currency used to enter statement'),
@@ -640,7 +640,7 @@ class account_journal(osv.osv):
raise osv.except_osv(_('Warning !'), _('You cannot modify company of this journal as its related record exist in Entry Lines'))
return super(account_journal, self).write(cr, uid, ids, vals, context=context)
- def create_sequence(self, cr, uid, ids, context={}):
+ def create_sequence(self, cr, uid, vals, context={}):
"""
Create new entry sequence for every new Joural
@param cr: cursor to database
@@ -663,39 +663,29 @@ class account_journal(osv.osv):
date_pool = self.pool.get('ir.model.data')
result = True
+ name = vals['name']
+ code = vals['code'].lower()
- journal = self.browse(cr, uid, ids[0], context)
- code = journal.code.lower()
types = {
- 'name':journal.name,
- 'code':code
+ 'name': name,
+ 'code': code
}
type_id = seq_typ_pool.create(cr, uid, types)
seq = {
- 'name':journal.name,
- 'code':code,
- 'active':True,
- 'prefix':journal.code + "/%(year)s/",
- 'padding':4,
- 'number_increment':1
+ 'name': name,
+ 'code': code,
+ 'active': True,
+ 'prefix': code + "/%(year)s/",
+ 'padding': 4,
+ 'number_increment': 1
}
- seq_id = seq_pool.create(cr, uid, seq)
-
- res = {}
- if not journal.sequence_id:
- res.update({
- 'sequence_id':seq_id
- })
-
- result = self.write(cr, uid, [journal.id], res)
-
- return result
+ return seq_pool.create(cr, uid, seq)
def create(self, cr, uid, vals, context={}):
- journal_id = super(account_journal, self).create(cr, uid, vals, context)
- self.create_sequence(cr, uid, [journal_id], context)
- return journal_id
+ if not 'sequence_id' in vals or not vals['sequence_id']:
+ vals.update({'sequence_id' : self.create_sequence(cr, uid, vals, context)})
+ return super(account_journal, self).create(cr, uid, vals, context)
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
if not args:
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 004172d1dae..bf1aadd48be 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -408,7 +408,7 @@
-
+
From 6c248417fc982516a2e15f37d887959e0481cabe Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Fri, 3 Sep 2010 19:39:11 +0200
Subject: [PATCH 032/128] [IMP] account usability: act_window on
account.journal
bzr revid: qdp-launchpad@tinyerp.com-20100903173911-g862xx0kilc6uckl
---
addons/account/account_invoice_view.xml | 9 +++++++--
addons/account/account_view.xml | 16 +++++++++++++---
2 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 241d0eb05d1..30afcf70bd4 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -354,7 +354,7 @@
-
+
@@ -499,7 +499,12 @@
-
+
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index bf1aadd48be..77922b3ca39 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -441,7 +441,7 @@
-
+
@@ -1882,9 +1882,19 @@
# Admin config
-->
-
+
-
+
From 006d9a2abb298674836de6ac2c36942ee629906c Mon Sep 17 00:00:00 2001
From: "PAP(OpenERP)" <>
Date: Mon, 6 Sep 2010 08:35:58 +0530
Subject: [PATCH 033/128] [FIX] Account budget: Print report error Print
budgets
bzr revid: mra@mra-laptop-20100906030558-93s2gvsxvlabouna
---
.../report/crossovered_budget_report.rml | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/addons/account_budget/report/crossovered_budget_report.rml b/addons/account_budget/report/crossovered_budget_report.rml
index 61c13f1ef78..6dfa2e21584 100644
--- a/addons/account_budget/report/crossovered_budget_report.rml
+++ b/addons/account_budget/report/crossovered_budget_report.rml
@@ -163,19 +163,19 @@
- [[ a['status']==1 and (setTag('font','font',{'name':'Helvetica-bold'})) ]][[ a['name'] ]]
+ [[ (setTag('font','font',{'name':'Helvetica-bold'})) ]][[ a['name'] ]]
- [[ a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ '%.2f' % a['theo'] ]]
+ [[ ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ '%.2f' % a['theo'] ]]
- [[ a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ '%.2f' % a['pln'] ]]
+ [[ ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ '%.2f' % a['pln'] ]]
- [[ a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ '%.2f' % a['prac'] ]]
+ [[ ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ '%.2f' % a['prac'] ]]
- [[ a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ '%.2f' % a['perc'] ]]%
+ [[ ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ '%.2f' % a['perc'] ]]%
From e4831cf51bcfaf9382229628d068b0097fd75e08 Mon Sep 17 00:00:00 2001
From: "PSI(OpenERP)" <>
Date: Mon, 6 Sep 2010 08:43:40 +0530
Subject: [PATCH 034/128] [IMP] followup: Menu item move to misc. and remove
action to send followup from object
bzr revid: mra@mra-laptop-20100906031340-bslf2i85jb55z1r5
---
addons/account_followup/account_followup_view.xml | 2 +-
.../wizard/account_followup_print_view.xml | 10 ----------
2 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/addons/account_followup/account_followup_view.xml b/addons/account_followup/account_followup_view.xml
index 8d494b685a7..7dc4692f14f 100644
--- a/addons/account_followup/account_followup_view.xml
+++ b/addons/account_followup/account_followup_view.xml
@@ -85,7 +85,7 @@
form
-
+
diff --git a/addons/account_followup/wizard/account_followup_print_view.xml b/addons/account_followup/wizard/account_followup_print_view.xml
index eb322b2101b..43cf26da251 100644
--- a/addons/account_followup/wizard/account_followup_print_view.xml
+++ b/addons/account_followup/wizard/account_followup_print_view.xml
@@ -31,16 +31,6 @@
new
-
-
-
- Send followups
- client_action_multi
-
- action
- account_followup.followup
-
-
+
+
+ [[ repeatIn(get_lines_with_out_partner(data['form']), 'not_partner') ]]
+ [[ not_partner['name'] ]]
+
+
+ [[ formatLang(not_partner['direction'] or 0.00) ]]
+
+
+ [[ formatLang(not_partner['4'] or 0.00)]]
+
+
+ [[ formatLang(not_partner['3'] or 0.00)]]
+
+
+ [[ formatLang(not_partner['2'] or 0.00) ]]
+
+
+ [[ formatLang(not_partner['1'] or 0.00) ]]
+
+
+ [[ formatLang(not_partner['0'] or 0.00) ]]
+
+
+ [[ formatLang(not_partner['total'] or 0.00 ) ]]
+
+
From 0ff1aecac1373f7324c3f2f5212cfb5654cdce8d Mon Sep 17 00:00:00 2001
From: Mustufa Rangwala
Date: Tue, 7 Sep 2010 11:36:58 +0530
Subject: [PATCH 062/128] [FIX] Account bank statement: Small fix
bzr revid: mra@mra-laptop-20100907060658-ri74f61lbuyt43l9
---
addons/account/account_bank_statement.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py
index 51f4026756d..45da0e6015f 100644
--- a/addons/account/account_bank_statement.py
+++ b/addons/account/account_bank_statement.py
@@ -632,7 +632,7 @@ class account_bank_statement_line(osv.osv):
context = {}
if not partner_id:
return res
-
+ account_id = False
line = self.browse(cursor, user, line_id)
if not line or (line and not line[0].account_id):
part = obj_partner.browse(cursor, user, partner_id, context=context)
From a339c9361608674fb9f781d94596caf2f72db933 Mon Sep 17 00:00:00 2001
From: Mustufa Rangwala
Date: Tue, 7 Sep 2010 11:44:12 +0530
Subject: [PATCH 063/128] [IMP] Account: add parent_id field on tree of account
for group by on search view (invisible=1)
bzr revid: mra@mra-laptop-20100907061412-yanbfcw2apf28bd4
---
addons/account/account_view.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 6185337b999..7f0ac4cdb6f 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -225,6 +225,7 @@
+
From cde1c9551f5a98ebad6bf3ea661d603b57f79216 Mon Sep 17 00:00:00 2001
From: Mustufa Rangwala
Date: Tue, 7 Sep 2010 12:12:15 +0530
Subject: [PATCH 064/128] [REF]
bzr revid: mra@mra-laptop-20100907064215-3x33rxl10thbv22n
---
addons/account/account_bank_statement.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py
index 45da0e6015f..91d8efc72ce 100644
--- a/addons/account/account_bank_statement.py
+++ b/addons/account/account_bank_statement.py
@@ -626,6 +626,8 @@ account_bank_statement_reconcile_line()
class account_bank_statement_line(osv.osv):
def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context=None):
+ res_users_obj = self.pool.get('res.users')
+ res_currency_obj = self.pool.get('res.currency')
res = {'value': {}}
obj_partner = self.pool.get('res.partner')
if context is None:
@@ -643,8 +645,6 @@ class account_bank_statement_line(osv.osv):
res['value']['account_id'] = account_id
if account_id and (not line or (line and not line[0].amount)):
- res_users_obj = self.pool.get('res.users')
- res_currency_obj = self.pool.get('res.currency')
company_currency_id = res_users_obj.browse(cursor, user, user,
context=context).company_id.currency_id.id
if not currency_id:
From 3d046db1fdb5c19ce035fc2da691523212943f66 Mon Sep 17 00:00:00 2001
From: Mustufa Rangwala
Date: Tue, 7 Sep 2010 12:24:14 +0530
Subject: [PATCH 065/128] [IMP] Account: Bank st => Add analytic field on st
lines tree view
bzr revid: mra@mra-laptop-20100907065414-z3ru05s593dzgqpt
---
addons/account/account_view.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 7f0ac4cdb6f..47b675386f6 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -530,6 +530,7 @@
+
From 56acf2e99122ec13ad16d7008bf9d10d8f5350d3 Mon Sep 17 00:00:00 2001
From: vra
Date: Tue, 7 Sep 2010 14:19:25 +0530
Subject: [PATCH 066/128] [IMP] account : replace the string 'With out Partner'
with 'No Partner Defined' in aged partner balance report.
bzr revid: vra@tinyerp.com-20100907084925-s20r7m6bb14cmyfg
---
.../report/account_aged_partner_balance.py | 26 +++++++++----------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py
index 7f4141d334d..119c1edef1a 100644
--- a/addons/account/report/account_aged_partner_balance.py
+++ b/addons/account/report/account_aged_partner_balance.py
@@ -224,7 +224,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
AND account_account.active ' ,(tuple(self.ACCOUNT_TYPE), self.date_from, ))
t = self.cr.fetchall()
for i in t:
- totals['With out Partner'] = i[0]
+ totals['No Partner Defined'] = i[0]
future_past = {}
if self.direction_selection == 'future':
self.cr.execute('SELECT SUM(debit-credit) \
@@ -239,7 +239,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
AND account_account.active ', (tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from, ))
t = self.cr.fetchall()
for i in t:
- future_past['With out Partner'] = i[0]
+ future_past['No Partner Defined'] = i[0]
elif self.direction_selection == 'past': # Using elif so people could extend without this breaking
self.cr.execute('SELECT SUM(debit-credit) \
FROM account_move_line AS l, account_account\
@@ -253,7 +253,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
AND account_account.active ' , (tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from,))
t = self.cr.fetchall()
for i in t:
- future_past['With out Partner'] = i[0]
+ future_past['No Partner Defined'] = i[0]
history = []
for i in range(5):
self.cr.execute('SELECT SUM(debit-credit)\
@@ -269,37 +269,37 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
t = self.cr.fetchall()
d = {}
for i in t:
- d['With out Partner'] = i[0]
+ d['No Partner Defined'] = i[0]
history.append(d)
values = {}
if self.direction_selection == 'future':
before = False
- if future_past.has_key('With out Partner'):
- before = [ future_past['With out Partner'] ]
+ if future_past.has_key('No Partner Defined'):
+ before = [ future_past['No Partner Defined'] ]
self.total_account[6] = self.total_account[6] + (before and before[0] or 0.0)
values['direction'] = before and before[0] or 0.0
elif self.direction_selection == 'past':
after = False
- if future_past.has_key('With out Partner'):
- after = [ future_past['With out Partner'] ]
+ if future_past.has_key('No Partner Defined'):
+ after = [ future_past['No Partner Defined'] ]
self.total_account[6] = self.total_account[6] + (after and after[0] or 0.0)
values['direction'] = after and after[0] or ""
for i in range(5):
during = False
- if history[i].has_key('With out Partner'):
- during = [ history[i]['With out Partner'] ]
+ if history[i].has_key('No Partner Defined'):
+ during = [ history[i]['No Partner Defined'] ]
self.total_account[(i)] = self.total_account[(i)] + (during and during[0] or 0)
values[str(i)] = during and during[0] or ""
total = False
- if totals.has_key( 'With out Partner' ):
- total = [ totals['With out Partner'] ]
+ if totals.has_key( 'No Partner Defined' ):
+ total = [ totals['No Partner Defined'] ]
values['total'] = total and total[0] or 0.0
## Add for total
self.total_account[(i+1)] = self.total_account[(i+1)] + (total and total[0] or 0.0)
- values['name'] = 'With out Partner'
+ values['name'] = 'No Partner Defined'
if values['total']:
res.append(values)
From 62354263a2cabc0df4925ecacc20723ee7032624 Mon Sep 17 00:00:00 2001
From: "Reporting Team(JNI OpenERP)" <>
Date: Tue, 7 Sep 2010 14:34:08 +0530
Subject: [PATCH 067/128] [IMP] hr_*:Improve dashboards as per piratepad
bzr revid: psi@tinyerp.co.in-20100907090408-oxk6zfi4u3370yhf
---
addons/hr_holidays/board_hr_holidays_view.xml | 114 +++++++++++-------
.../board_hr_recruitment_statistical_view.xml | 35 ++++++
.../board_hr_timesheet_invoice.xml | 43 ++++++-
.../security/ir.model.access.csv | 1 +
.../board_hr_timesheet_view.xml | 37 ++++--
5 files changed, 177 insertions(+), 53 deletions(-)
diff --git a/addons/hr_holidays/board_hr_holidays_view.xml b/addons/hr_holidays/board_hr_holidays_view.xml
index 4f3f2142447..54fe8153bf2 100644
--- a/addons/hr_holidays/board_hr_holidays_view.xml
+++ b/addons/hr_holidays/board_hr_holidays_view.xml
@@ -2,50 +2,78 @@
-
- My Leaves
- ir.actions.act_window
- hr.holidays
- form
- tree,form
- [('user_id','=',uid)]
-
-
-
-
- Remaining Leaves by User
- ir.actions.act_window
- hr.holidays.remaining.leaves.user
- form
- graph,tree
- [('user_id','=',uid)]
-
-
+
+ My Leaves
+ ir.actions.act_window
+ hr.holidays
+ form
+ tree,form
+ [('user_id','=',uid)]
+
+
-
- board.hr.holidays.form
- board.board
-
- form
-
-
-
-
-
+
+ Remaining Leaves by User
+ ir.actions.act_window
+ hr.holidays.remaining.leaves.user
+ form
+ graph,tree
+ [('user_id','=',uid)]
+
+
+
+
+ hr.holidays.awaited.response.tree
+ hr.holidays
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+ Holidays Awaited For Response
+ ir.actions.act_window
+ hr.holidays
+ form
+ tree,form
+ [('state','in',('confirm','validate1'))]
+
+
+
+
+ board.hr.holidays.form
+ board.board
+
+ form
+
+
+
+
+
+
+
+
+
-
- board.hr.holidays.remaining.form
- board.board
- form
-
-
-
-
-
-
-
-
+ -->
+
diff --git a/addons/hr_recruitment/board_hr_recruitment_statistical_view.xml b/addons/hr_recruitment/board_hr_recruitment_statistical_view.xml
index 14710cf8f37..59b9aaca546 100644
--- a/addons/hr_recruitment/board_hr_recruitment_statistical_view.xml
+++ b/addons/hr_recruitment/board_hr_recruitment_statistical_view.xml
@@ -2,5 +2,40 @@
+
+ applicants.status.tree
+ hr.applicant
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+ Applicants Status
+ ir.actions.act_window
+ hr.applicant
+ form
+ tree,form
+ [('state','in',('draft','open'))]
+
+
+
+
+ board.hr.applicants.status.form
+ board.board
+
+
+
+
+
+
+
diff --git a/addons/hr_timesheet_invoice/board_hr_timesheet_invoice.xml b/addons/hr_timesheet_invoice/board_hr_timesheet_invoice.xml
index 78945f73f4e..2d38011f279 100644
--- a/addons/hr_timesheet_invoice/board_hr_timesheet_invoice.xml
+++ b/addons/hr_timesheet_invoice/board_hr_timesheet_invoice.xml
@@ -28,13 +28,50 @@
board.hr.timesheet.invoice
board.board
- form
+ form
-
-
+
+
+
+
+ timesheet.uninvoiced.line.tree
+ report.timesheet.line
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+ Uninvoice lines with billing rate
+ report.timesheet.line
+ form
+ form,tree
+ [('invoice_id','=',False)]
+
+
+
+
+ board.hr.timesheet.uninvoiced.form
+ board.board
+ form
+
+
+
+
+
+
+
+
diff --git a/addons/hr_timesheet_invoice/security/ir.model.access.csv b/addons/hr_timesheet_invoice/security/ir.model.access.csv
index 0d65ae44f1b..619fc6344cf 100644
--- a/addons/hr_timesheet_invoice/security/ir.model.access.csv
+++ b/addons/hr_timesheet_invoice/security/ir.model.access.csv
@@ -11,3 +11,4 @@
"access_report_random_timesheet_lines","random_timesheet_lines","model_random_timesheet_lines","base.group_hr_manager",1,0,0,0
"access_report_analytic_account_close_system","report.analytic.account.close system","model_report_analytic_account_close","base.group_system",1,1,1,1
"access_report_account_analytic_line_to_invoice_system","report.account.analytic.line.to.invoice system","model_report_account_analytic_line_to_invoice","base.group_system",1,1,1,1
+"access_report_timesheet_line","report.timesheet.line","model_report_timesheet_line","base.group_hr_manager",1,0,0,0
diff --git a/addons/hr_timesheet_sheet/board_hr_timesheet_view.xml b/addons/hr_timesheet_sheet/board_hr_timesheet_view.xml
index 70d36184980..aefed275256 100644
--- a/addons/hr_timesheet_sheet/board_hr_timesheet_view.xml
+++ b/addons/hr_timesheet_sheet/board_hr_timesheet_view.xml
@@ -1,7 +1,8 @@
-
+
+
Timesheets by Month
ir.actions.act_window
timesheet.report
@@ -9,9 +10,9 @@
graph,tree
[('user_id','=',uid), ('month', '=' , time.strftime('%m')), ('year', '=', time.strftime('%Y'))]
-
+
-
+
Timesheets
ir.actions.act_window
hr_timesheet_sheet.sheet
@@ -20,17 +21,39 @@
+
+ Employee Attendance Graph
+ timesheet.report
+ graph
+
+
+
+
+
+
+
+
+
+
+ Employee Attendance Graph
+ timesheet.report
+ form
+ graph
+
+
+
board.hr.timesheet.form
board.board
-
+
form
-
-
-
+
+
+
+
hr.timesheet.sheet.tree.simplified.board
hr_timesheet_sheet.sheet
From b46bbb5e6565624c1bd3ca797ac4b3b225272e2d Mon Sep 17 00:00:00 2001
From: Mustufa Rangwala
Date: Tue, 7 Sep 2010 14:47:38 +0530
Subject: [PATCH 068/128] [FIX] Account: Bank statement => onchange on partner
with st. line -> if line does not save then amount taken from context
bzr revid: mra@mra-laptop-20100907091738-b9abe0896v252zrb
---
addons/account/account_bank_statement.py | 2 +-
addons/account/account_view.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py
index 91d8efc72ce..8ab1c6d7ac9 100644
--- a/addons/account/account_bank_statement.py
+++ b/addons/account/account_bank_statement.py
@@ -644,7 +644,7 @@ class account_bank_statement_line(osv.osv):
account_id = part.property_account_receivable.id
res['value']['account_id'] = account_id
- if account_id and (not line or (line and not line[0].amount)):
+ if account_id and (not line or (line and not line[0].amount)) and not context.get('amount', False):
company_currency_id = res_users_obj.browse(cursor, user, user,
context=context).company_id.currency_id.id
if not currency_id:
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 47b675386f6..6643370f0c4 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -538,7 +538,7 @@
-
+
From f2aa58f49666c2cd095713c4704409e21b22a6d9 Mon Sep 17 00:00:00 2001
From: "psi (Open ERP)"
Date: Tue, 7 Sep 2010 16:39:30 +0530
Subject: [PATCH 069/128] [FIX] hr_recruitment: Fix the dashboard view
bzr revid: psi@tinyerp.co.in-20100907110930-b48cbzexhggpsrlb
---
addons/hr_recruitment/board_hr_recruitment_statistical_view.xml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/addons/hr_recruitment/board_hr_recruitment_statistical_view.xml b/addons/hr_recruitment/board_hr_recruitment_statistical_view.xml
index 59b9aaca546..5304f95ea52 100644
--- a/addons/hr_recruitment/board_hr_recruitment_statistical_view.xml
+++ b/addons/hr_recruitment/board_hr_recruitment_statistical_view.xml
@@ -31,6 +31,8 @@
board.hr.applicants.status.form
board.board
+ form
+
From b3bc4145f69e1dbbe8d7e304df19086131027d31 Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Tue, 7 Sep 2010 13:49:05 +0200
Subject: [PATCH 070/128] [IMP] account_coda: replaced tabs with 4 spaces
bzr revid: qdp-launchpad@tinyerp.com-20100907114905-60aupbp1palycrc9
---
addons/account_coda/account_coda_view.xml | 108 +++++++++++-----------
1 file changed, 54 insertions(+), 54 deletions(-)
diff --git a/addons/account_coda/account_coda_view.xml b/addons/account_coda/account_coda_view.xml
index 6bae5c04b83..601a1e8641e 100644
--- a/addons/account_coda/account_coda_view.xml
+++ b/addons/account_coda/account_coda_view.xml
@@ -2,42 +2,42 @@
-
- account.coda.form
- account.coda
- form
-
-
-
-
+
+ account.coda.form
+ account.coda
+ form
+
+
+
+
-
- account.coda.tree
- account.coda
- tree
-
-
-
-
-
-
-
-
-
+
+ account.coda.tree
+ account.coda
+ tree
+
+
+
+
+
+
+
+
+
account.coda.select
@@ -63,28 +63,28 @@
-
- Statements
- ir.actions.act_window
- account.coda
- form
- tree,form
+
+ Statements
+ ir.actions.act_window
+ account.coda
+ form
+ tree,form
{"search_default_user_id":uid}
-
-
+
+
-
+
-
+
-
+
-
+
From a5051c6a1334cd8f28c862dc4e814396a22c2948 Mon Sep 17 00:00:00 2001
From: "qdp-launchpad@tinyerp.com" <>
Date: Tue, 7 Sep 2010 13:52:23 +0200
Subject: [PATCH 071/128] [IMP] account_coda: remove default filter on uid
bzr revid: qdp-launchpad@tinyerp.com-20100907115223-b4953buqxvgvy0gw
---
addons/account_coda/account_coda_view.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/account_coda/account_coda_view.xml b/addons/account_coda/account_coda_view.xml
index 601a1e8641e..b53a7b4a132 100644
--- a/addons/account_coda/account_coda_view.xml
+++ b/addons/account_coda/account_coda_view.xml
@@ -69,7 +69,7 @@
account.coda
form
tree,form
- {"search_default_user_id":uid}
+ {}
From 59f2e4dcbd39996b551f9f9cfa759a367b7ca48c Mon Sep 17 00:00:00 2001
From: Mantavya Gajjar
Date: Tue, 7 Sep 2010 17:24:14 +0530
Subject: [PATCH 072/128] [FIX]: fix a problem for selecting a correct account
on change payment method
bzr revid: mga@tinyerp.com-20100907115414-heu14yxy06ewp89j
---
addons/account_voucher/voucher.py | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/addons/account_voucher/voucher.py b/addons/account_voucher/voucher.py
index 012a386fa13..6d4e6dc871e 100644
--- a/addons/account_voucher/voucher.py
+++ b/addons/account_voucher/voucher.py
@@ -427,23 +427,23 @@ class account_voucher(osv.osv):
# TODO
def onchange_payment(self, cr, uid, ids, pay_now, journal_id, partner_id, ttype='sale'):
+ res = {}
if not partner_id:
- return {}
- partner_pool = self.pool.get('res.partner')
+ return res
res = {'account_id':False}
+ partner_pool = self.pool.get('res.partner')
+ journal_pool = self.pool.get('account.journal')
if pay_now == 'pay_later':
partner = partner_pool.browse(cr, uid, partner_id)
- if ttype == 'sale':
- res.update({
- 'account_id':partner.property_account_receivable.id,
- })
- elif ttype == 'purchase':
- res.update({
- 'account_id':partner.property_account_payable.id,
- })
- return {
- 'value':res
- }
+ journal = journal_pool.browse(cr, uid, journal_id)
+ if journal.type in ('sale','sale_refund'):
+ account_id = partner.property_account_receivable.id
+ elif journal.type in ('purchase', 'purchase_refund','expense'):
+ account_id = partner.property_account_payable.id
+ else:
+ account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id
+ res['account_id'] = account_id
+ return {'value':res}
def action_move_line_create(self, cr, uid, ids, *args):
From 039ef25d0da26ebdd88259486ce84ae1c14fb481 Mon Sep 17 00:00:00 2001
From: vra
Date: Tue, 7 Sep 2010 17:27:28 +0530
Subject: [PATCH 073/128] [ADD] added access rights for Analytic Accounting
group including menus. [REM] Extended group for analytic related menus. [FIX]
Analytic Entries date Order. [FIX] Assigning sale price with proper sign in
product_id onchange in analytic line.
bzr revid: vra@tinyerp.com-20100907115728-n09gkjycdr32ej77
---
addons/account/account_analytic_line.py | 24 +++++++++---
addons/account/account_menuitem.xml | 6 +--
addons/account/project/project_view.xml | 5 ++-
.../wizard/account_analytic_chart_view.xml | 3 +-
.../account_analytic_entries_report_view.xml | 2 +-
addons/account/security/account_security.xml | 2 +-
addons/account/security/analytic_security.xml | 38 +++++++++++++++----
.../account_analytic_plans_view.xml | 2 +-
.../analytic/security/analytic_security.xml | 2 +-
addons/analytic/security/ir.model.access.csv | 7 ++++
10 files changed, 68 insertions(+), 23 deletions(-)
diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py
index 9126a610aea..5a8ee0d4e8c 100644
--- a/addons/account/account_analytic_line.py
+++ b/addons/account/account_analytic_line.py
@@ -46,7 +46,7 @@ class account_analytic_line(osv.osv):
'date': lambda *a: time.strftime('%Y-%m-%d'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=c),
}
- _order = 'date'
+ _order = 'date desc'
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
if context is None:
@@ -73,13 +73,16 @@ class account_analytic_line(osv.osv):
# Compute the cost based on the price type define into company
# property_valuation_price_type property
def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount,company_id,
- unit=False, context=None):
+ unit=False, journal_id=False, context=None):
if context==None:
context={}
uom_obj = self.pool.get('product.uom')
product_obj = self.pool.get('product.product')
company_obj=self.pool.get('res.company')
+ analytic_journal_obj=self.pool.get('account.analytic.journal')
+ product_price_type_obj = self.pool.get('product.price.type')
if prod_id:
+ result = 0.0
prod = product_obj.browse(cr, uid, prod_id)
a = prod.product_tmpl_id.property_account_expense.id
if not a:
@@ -91,16 +94,27 @@ class account_analytic_line(osv.osv):
(prod.name, prod.id,))
if not company_id:
company_id=company_obj._company_default_get(cr, uid, 'account.analytic.line', context)
-
+ flag = False
# Compute based on pricetype
- pricetype=self.pool.get('product.price.type').browse(cr, uid, company_obj.browse(cr,uid,company_id).property_valuation_price_type.id)
+ pricetype=product_price_type_obj.browse(cr, uid, company_obj.browse(cr,uid,company_id).property_valuation_price_type.id)
+ if journal_id:
+ journal = analytic_journal_obj.browse(cr, uid, journal_id)
+ if journal.type == 'sale':
+ product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','list_price')], context)
+ if product_price_type_ids:
+ pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context)[0]
# Take the company currency as the reference one
+ if pricetype.field == 'list_price':
+ flag = True
amount_unit = prod.price_get(pricetype.field, context)[prod.id]
amount = amount_unit*unit_amount or 1.0
prec = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
amount = amount_unit*unit_amount or 1.0
+ result = round(amount, prec)
+ if not flag:
+ result *= -1
return {'value': {
- 'amount': - round(amount, prec),
+ 'amount': result,
'general_account_id': a,
}}
return {}
diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml
index 4860f937966..050a12580fc 100644
--- a/addons/account/account_menuitem.xml
+++ b/addons/account/account_menuitem.xml
@@ -19,11 +19,11 @@
-
-
+
+
-
+