diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index 96412077840..6f3675392e0 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -60,6 +60,7 @@ module named account_voucher.
'wizard/account_period_close_view.xml',
'wizard/account_fiscalyear_close_state.xml',
'wizard/account_chart_view.xml',
+ 'wizard/account_tax_chart_view.xml',
'wizard/account_move_journal_view.xml',
'wizard/account_move_line_reconcile_select_view.xml',
'wizard/account_open_closed_fiscalyear_view.xml',
diff --git a/addons/account/account.py b/addons/account/account.py
index f0884044fcf..f132c933821 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -835,7 +835,7 @@ class account_period(osv.osv):
'company_id': fields.related('fiscalyear_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True)
}
_defaults = {
- 'state': lambda *a: 'draft',
+ 'state': 'draft',
}
_order = "date_start"
@@ -883,13 +883,10 @@ class account_period(osv.osv):
return ids
def action_draft(self, cr, uid, ids, *args):
- users_roles = self.pool.get('res.users').browse(cr, uid, uid).roles_id
- for role in users_roles:
- if role.name=='Period':
- mode = 'draft'
- for id in ids:
- cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id))
- cr.execute('update account_period set state=%s where id=%s', (mode, id))
+ mode = 'draft'
+ for id in ids:
+ cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id))
+ cr.execute('update account_period set state=%s where id=%s', (mode, id))
return True
def name_search(self, cr, user, name, args=None, operator='ilike', context={}, limit=80):
@@ -1051,21 +1048,25 @@ class account_move(osv.osv):
return result
def _search_amount(self, cr, uid, obj, name, args, context):
- ids = []
- cr.execute('select move_id,sum(debit) from account_move_line group by move_id')
- result = dict(cr.fetchall())
-
- for item in args:
- if item[1] == '>=':
- res = [('id', 'in', [k for k,v in result.iteritems() if v >= item[2]])]
+ ids = set()
+ for cond in args:
+ amount = cond[2]
+ if isinstance(cond[2],(list,tuple)):
+ if cond[1] in ['in','not in']:
+ amount = tuple(cond[2])
+ else:
+ continue
else:
- res = [('id', 'in', [k for k,v in result.iteritems() if v <= item[2]])]
- ids += res
-
- if not ids:
- return [('id', '>', '0')]
-
- return ids
+ if cond[1] in ['=like', 'like', 'not like', 'ilike', 'not ilike', 'in', 'not in', 'child_of']:
+ continue
+
+ cr.execute("select move_id from account_move_line group by move_id having sum(debit) %s %%s" % (cond[1]) ,(amount,))
+ 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')]
_columns = {
'name': fields.char('Number', size=64, required=True),
diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py
index 270384a1d9f..32403f658fc 100644
--- a/addons/account/account_bank_statement.py
+++ b/addons/account/account_bank_statement.py
@@ -201,6 +201,7 @@ class account_bank_statement(osv.osv):
res_users_obj = self.pool.get('res.users')
account_move_obj = self.pool.get('account.move')
account_move_line_obj = self.pool.get('account.move.line')
+ account_analytic_line_obj = self.pool.get('account.analytic.line')
account_bank_statement_line_obj = self.pool.get('account.bank.statement.line')
obj_seq = self.pool.get('ir.sequence')
@@ -222,6 +223,11 @@ class account_bank_statement(osv.osv):
raise osv.except_osv(_('Configuration Error !'),
_('Please verify that an account is defined in the journal.'))
+ if not st.name == '/':
+ next_number = st.name
+ else:
+ next_number = obj_seq.get(cr, uid, 'account.bank.statement')
+
for line in st.move_line_ids:
if line.state <> 'valid':
raise osv.except_osv(_('Error !'),
@@ -230,14 +236,18 @@ class account_bank_statement(osv.osv):
# In line we get reconcile_id on bank.ste.rec.
# in bank stat.rec we get line_new_ids on bank.stat.rec.line
for move in st.line_ids:
- context.update({'date':move.date})
+ if move.analytic_account_id:
+ if not st.journal_id.analytic_journal_id:
+ raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (st.journal_id.name,))
+
+ context.update({'date': move.date})
move_id = account_move_obj.create(cr, uid, {
'journal_id': st.journal_id.id,
'period_id': st.period_id.id,
'date': move.date,
}, context=context)
account_bank_statement_line_obj.write(cr, uid, [move.id], {
- 'move_ids': [(4,move_id, False)]
+ 'move_ids': [(4, move_id, False)]
})
if not move.amount:
continue
@@ -268,6 +278,7 @@ class account_bank_statement(osv.osv):
'journal_id': st.journal_id.id,
'period_id': st.period_id.id,
'currency_id': st.currency.id,
+ 'analytic_account_id': move.analytic_account_id and move.analytic_account_id.id or False
}
amount = res_currency_obj.compute(cr, uid, st.currency.id,
@@ -289,7 +300,28 @@ class account_bank_statement(osv.osv):
account=acc_cur)
val['amount_currency'] = amount_cur
- torec.append(account_move_line_obj.create(cr, uid, val , context=context))
+ move_line_id = account_move_line_obj.create(cr, uid, val , context=context)
+ torec.append(move_line_id)
+
+ if move.analytic_account_id:
+ anal_val = {}
+ amt = (val['credit'] or 0.0) - (val['debit'] or 0.0)
+ anal_val = {
+ 'name': val['name'],
+ 'ref': val['ref'],
+ 'date': val['date'],
+ 'amount': amt,
+ 'account_id': val['analytic_account_id'],
+ 'currency_id': val['currency_id'],
+ 'general_account_id': val['account_id'],
+ 'journal_id': st.journal_id.analytic_journal_id.id,
+ 'period_id': val['period_id'],
+ 'user_id': uid,
+ 'move_id': move_line_id
+ }
+ if val.get('amount_currency', False):
+ anal_val['amount_currency'] = val['amount_currency']
+ account_analytic_line_obj.create(cr, uid, anal_val, context=context)
if move.reconcile_id and move.reconcile_id.line_new_ids:
for newline in move.reconcile_id.line_new_ids:
@@ -367,17 +399,11 @@ class account_bank_statement(osv.osv):
account_move_line_obj.reconcile(cr, uid, torec, 'statement', writeoff_acc_id=writeoff_acc_id, writeoff_period_id=st.period_id.id, writeoff_journal_id=st.journal_id.id, context=context)
else:
account_move_line_obj.reconcile_partial(cr, uid, torec, 'statement', context)
-
- if st.journal_id.entry_posted:
- account_move_obj.write(cr, uid, [move_id], {'state': 'posted'})
+ move_name = next_number + ' - ' + str(move.sequence)
+ account_move_obj.write(cr, uid, [move_id], {'name': move_name, 'state': 'posted'}) # Bank statements will not consider boolean on journal entry_posted
self.log(cr, uid, st.id, 'Statement %s is confirmed and entries are created.' % st.name)
done.append(st.id)
-
- next_number = obj_seq.get(cr, uid, 'account.bank.statement')
- if not st.name == '/':
- next_number = st.name + '/' + next_number[-1:]
- account_move_obj.write(cr, uid, [move_id], {'state': 'posted', 'name': next_number})
self.write(cr, uid, [st.id], {'name': next_number}, context=context)
self.write(cr, uid, done, {'state':'confirm'}, context=context)
@@ -397,28 +423,15 @@ class account_bank_statement(osv.osv):
return True
def onchange_journal_id(self, cursor, user, statement_id, journal_id, context=None):
- if not journal_id:
- return {'value': {'currency': False}}
-
account_journal_obj = self.pool.get('account.journal')
res_users_obj = self.pool.get('res.users')
- res_currency_obj = self.pool.get('res.currency')
-
cursor.execute('SELECT balance_end_real \
FROM account_bank_statement \
- WHERE journal_id = %s \
- ORDER BY date DESC,id DESC LIMIT 1', (journal_id,))
+ WHERE journal_id = %s AND NOT state = %s \
+ ORDER BY date DESC,id DESC LIMIT 1', (journal_id, 'draft'))
res = cursor.fetchone()
balance_start = res and res[0] or 0.0
-
- currency_id = account_journal_obj.browse(cursor, user, journal_id,
- context=context).currency.id
- if not currency_id:
- currency_id = res_users_obj.browse(cursor, user, user,
- context=context).company_id.currency_id.id
- currency = res_currency_obj.name_get(cursor, user, [currency_id],
- context=context)[0]
- return {'value': {'balance_start': balance_start, 'currency': currency}}
+ return {'value': {'balance_start': balance_start}}
def unlink(self, cr, uid, ids, context=None):
stat = self.read(cr, uid, ids, ['state'])
@@ -629,6 +642,26 @@ class account_bank_statement_line(osv.osv):
else:
account_id = part.property_account_receivable.id
res['value']['account_id'] = account_id
+
+ if 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:
+ currency_id = company_currency_id
+
+ cursor.execute('SELECT sum(debit-credit) \
+ FROM account_move_line \
+ WHERE (reconcile_id is null) \
+ AND partner_id = %s \
+ AND account_id=%s', (partner_id, account_id))
+ pgres = cursor.fetchone()
+ balance = pgres and pgres[0] or 0.0
+
+ balance = res_currency_obj.compute(cursor, user, company_currency_id,
+ currency_id, balance, context=context)
+ res['value']['amount'] = balance
return res
def _reconcile_amount(self, cursor, user, ids, name, args, context=None):
@@ -669,6 +702,7 @@ class account_bank_statement_line(osv.osv):
select=True, required=True, ondelete='cascade'),
'reconcile_id': fields.many2one('account.bank.statement.reconcile',
'Reconcile'),
+ 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account'),
'move_ids': fields.many2many('account.move',
'account_bank_statement_line_move_rel', 'move_id','statement_id',
'Moves'),
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 41d0344de92..db70d5e0e5a 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -500,7 +500,7 @@
-
+
diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml
index 3cb21315350..24f4bb795a2 100644
--- a/addons/account/account_menuitem.xml
+++ b/addons/account/account_menuitem.xml
@@ -3,8 +3,8 @@
-
-
+
+
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index bab05321f4d..c6e24e07842 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -104,7 +104,7 @@
-
+
@@ -242,8 +242,8 @@
-
+
@@ -520,6 +520,7 @@
+
@@ -668,7 +669,6 @@
-
@@ -711,9 +711,9 @@
-
-
+
+
@@ -858,11 +858,13 @@
Chart of Taxes is a tree view reflecting the structure of the Tax Cases (or tax codes) and shows the current tax situation. The tax chart represents the amount of each area of the tax declaration for your country. It’s presented in a hierarchical structure, which can be modified to fit your needs.
+
+
@@ -461,12 +461,14 @@
Sale Journalaccount.journal
-
+
+ %(year)s/Purchase Journalaccount.journal
-
+
+ %(year)s/
-
+ Journal Itemsaccount.move.journalform
@@ -67,10 +67,10 @@
diff --git a/addons/account/wizard/account_tax_chart.py b/addons/account/wizard/account_tax_chart.py
new file mode 100644
index 00000000000..5b5feaf480c
--- /dev/null
+++ b/addons/account/wizard/account_tax_chart.py
@@ -0,0 +1,78 @@
+# -*- 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 .
+#
+##############################################################################
+
+from osv import fields, osv
+
+class account_tax_chart(osv.osv_memory):
+ """
+ For Chart of taxes
+ """
+ _name = "account.tax.chart"
+ _description = "Account tax chart"
+ _columns = {
+ 'period_id': fields.many2one('account.period', \
+ 'Period', \
+ ),
+ 'target_move': fields.selection([('all', 'All Entries'),
+ ('posted', 'All Posted Entries')], 'Target Moves', required=True),
+ }
+
+ def _get_period(self, cr, uid, context=None):
+ """Return default period value"""
+ return self.pool.get('account.period').find(cr, uid)
+
+ def account_tax_chart_open_window(self, cr, uid, ids, context=None):
+ """
+ Opens chart of Accounts
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param ids: List of account chart’s IDs
+ @return: dictionary of Open account chart window on given fiscalyear and all Entries or posted entries
+ """
+ mod_obj = self.pool.get('ir.model.data')
+ act_obj = self.pool.get('ir.actions.act_window')
+ period_obj = self.pool.get('account.period')
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids, [], context=context)[0]
+ result = mod_obj._get_id(cr, uid, 'account', 'action_tax_code_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]
+ if data['period_id']:
+ fiscalyear_id = period_obj.read(cr, uid, [data['period_id']], context=context)[0]['fiscalyear_id'][0]
+ result['context'] = str({'period_id': data['period_id'], \
+ 'fiscalyear_id': fiscalyear_id, \
+ 'state': data['target_move']})
+ else:
+ result['context'] = str({'state': data['target_move']})
+
+ if data['period_id']:
+ result['name'] += ':' + self.pool.get('account.period').read(cr, uid, [data['period_id']], context=context)[0]['code']
+ return result
+
+ _defaults = {
+ 'period_id': _get_period,
+ 'target_move': 'all'
+ }
+
+account_tax_chart()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account/wizard/account_tax_chart_view.xml b/addons/account/wizard/account_tax_chart_view.xml
new file mode 100644
index 00000000000..f60ad394857
--- /dev/null
+++ b/addons/account/wizard/account_tax_chart_view.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+ account.tax.chart.form
+ account.tax.chart
+ form
+
+
+
+
+
+
+ Chart of Taxes
+ account.tax.chart
+ form
+ tree,form
+ [('parent_id','=',False)]
+
+ Chart of Taxes is a tree view reflecting the structure of the Tax Cases (or tax codes) and shows the current tax situation. The tax chart represents the amount of each area of the tax declaration for your country. It’s presented in a hierarchical structure, which can be modified to fit your needs.
+ new
+
+
+
+
+
+
diff --git a/addons/account_analytic_analysis/i18n/bg.po b/addons/account_analytic_analysis/i18n/bg.po
index 234b0773227..2a62ab5f7cb 100644
--- a/addons/account_analytic_analysis/i18n/bg.po
+++ b/addons/account_analytic_analysis/i18n/bg.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 07:46+0000\n"
+"PO-Revision-Date: 2010-08-29 10:28+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:40+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_analysis
diff --git a/addons/account_analytic_analysis/i18n/fi.po b/addons/account_analytic_analysis/i18n/fi.po
index 8cdc8c93075..ea34b110b06 100644
--- a/addons/account_analytic_analysis/i18n/fi.po
+++ b/addons/account_analytic_analysis/i18n/fi.po
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 09:42+0000\n"
+"PO-Revision-Date: 2010-08-29 10:42+0000\n"
"Last-Translator: OpenERP Administrators \n"
"Language-Team: Finnish \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:40+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_analysis
diff --git a/addons/account_analytic_analysis/i18n/lt.po b/addons/account_analytic_analysis/i18n/lt.po
index 05e5823c72c..fbd6d9852a9 100644
--- a/addons/account_analytic_analysis/i18n/lt.po
+++ b/addons/account_analytic_analysis/i18n/lt.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 08:43+0000\n"
+"PO-Revision-Date: 2010-08-29 10:35+0000\n"
"Last-Translator: OpenERP Administrators \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:40+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_analysis
diff --git a/addons/account_analytic_analysis/i18n/tr.po b/addons/account_analytic_analysis/i18n/tr.po
index 092cf7efb8d..b58a0754f6c 100644
--- a/addons/account_analytic_analysis/i18n/tr.po
+++ b/addons/account_analytic_analysis/i18n/tr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 07:49+0000\n"
+"PO-Revision-Date: 2010-08-29 10:30+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:40+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_analysis
diff --git a/addons/account_analytic_default/i18n/lt.po b/addons/account_analytic_default/i18n/lt.po
index 29ef66b8455..9accfe36326 100644
--- a/addons/account_analytic_default/i18n/lt.po
+++ b/addons/account_analytic_default/i18n/lt.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 07:47+0000\n"
+"PO-Revision-Date: 2010-08-29 10:29+0000\n"
"Last-Translator: OpenERP Administrators \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:41+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_default
diff --git a/addons/account_analytic_default/i18n/tr.po b/addons/account_analytic_default/i18n/tr.po
index 2ad3f17547e..33c30f21aa7 100644
--- a/addons/account_analytic_default/i18n/tr.po
+++ b/addons/account_analytic_default/i18n/tr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 07:56+0000\n"
+"PO-Revision-Date: 2010-08-29 10:31+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:41+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_default
diff --git a/addons/account_analytic_plans/i18n/lt.po b/addons/account_analytic_plans/i18n/lt.po
index 47739a68e0c..50c78e12b74 100644
--- a/addons/account_analytic_plans/i18n/lt.po
+++ b/addons/account_analytic_plans/i18n/lt.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 07:48+0000\n"
+"PO-Revision-Date: 2010-08-29 10:29+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:40+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_plans
diff --git a/addons/account_analytic_plans/i18n/tr.po b/addons/account_analytic_plans/i18n/tr.po
index 332f675174b..5cb9dfe35e7 100644
--- a/addons/account_analytic_plans/i18n/tr.po
+++ b/addons/account_analytic_plans/i18n/tr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 07:43+0000\n"
+"PO-Revision-Date: 2010-08-29 10:27+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:40+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_plans
diff --git a/addons/account_budget/i18n/lt.po b/addons/account_budget/i18n/lt.po
index 68c09587c7a..20f36ab056d 100644
--- a/addons/account_budget/i18n/lt.po
+++ b/addons/account_budget/i18n/lt.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 08:41+0000\n"
+"PO-Revision-Date: 2010-08-29 10:35+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:41+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_budget
diff --git a/addons/account_budget/i18n/tr.po b/addons/account_budget/i18n/tr.po
index a5f849bc0e5..0adbd4eeeae 100644
--- a/addons/account_budget/i18n/tr.po
+++ b/addons/account_budget/i18n/tr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 08:32+0000\n"
+"PO-Revision-Date: 2010-08-29 10:34+0000\n"
"Last-Translator: OpenERP Administrators \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:41+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_budget
diff --git a/addons/account_coda/i18n/ar.po b/addons/account_coda/i18n/ar.po
index d68f80e9b65..ace568652e1 100644
--- a/addons/account_coda/i18n/ar.po
+++ b/addons/account_coda/i18n/ar.po
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2009-11-24 13:11+0000\n"
-"PO-Revision-Date: 2010-08-26 06:50+0000\n"
+"PO-Revision-Date: 2010-08-29 09:50+0000\n"
"Last-Translator: bamuhrez \n"
"Language-Team: Arabic \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:41+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:59+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_coda
diff --git a/addons/account_followup/i18n/lt.po b/addons/account_followup/i18n/lt.po
index 606a55770d7..e353cbf72e5 100644
--- a/addons/account_followup/i18n/lt.po
+++ b/addons/account_followup/i18n/lt.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 07:42+0000\n"
+"PO-Revision-Date: 2010-08-29 10:26+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:39+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:56+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_followup
diff --git a/addons/account_followup/i18n/tr.po b/addons/account_followup/i18n/tr.po
index 02f6e547571..b008256c7dd 100644
--- a/addons/account_followup/i18n/tr.po
+++ b/addons/account_followup/i18n/tr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 08:01+0000\n"
+"PO-Revision-Date: 2010-08-29 10:31+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:39+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:56+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_followup
diff --git a/addons/account_invoice_layout/i18n/lt.po b/addons/account_invoice_layout/i18n/lt.po
index 44e25f4b42a..e18de30be53 100644
--- a/addons/account_invoice_layout/i18n/lt.po
+++ b/addons/account_invoice_layout/i18n/lt.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 07:26+0000\n"
+"PO-Revision-Date: 2010-08-29 08:54+0000\n"
"Last-Translator: OpenERP Administrators \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:41+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_invoice_layout
diff --git a/addons/account_invoice_layout/i18n/tr.po b/addons/account_invoice_layout/i18n/tr.po
index 730d128ead2..f2d0a6251ca 100644
--- a/addons/account_invoice_layout/i18n/tr.po
+++ b/addons/account_invoice_layout/i18n/tr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 08:23+0000\n"
+"PO-Revision-Date: 2010-08-29 10:33+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:41+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_invoice_layout
diff --git a/addons/account_payment/i18n/lt.po b/addons/account_payment/i18n/lt.po
index a68ffcfdfca..b1ef7db28f6 100644
--- a/addons/account_payment/i18n/lt.po
+++ b/addons/account_payment/i18n/lt.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 09:54+0000\n"
+"PO-Revision-Date: 2010-08-29 10:42+0000\n"
"Last-Translator: OpenERP Administrators \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:40+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
diff --git a/addons/account_payment/i18n/tr.po b/addons/account_payment/i18n/tr.po
index 3a1d7268acc..fdbed417cfc 100644
--- a/addons/account_payment/i18n/tr.po
+++ b/addons/account_payment/i18n/tr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 10:06+0000\n"
+"PO-Revision-Date: 2010-08-29 10:43+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:40+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
diff --git a/addons/account_report/i18n/lt.po b/addons/account_report/i18n/lt.po
index 3eee0423ed9..8fce99cbfe5 100644
--- a/addons/account_report/i18n/lt.po
+++ b/addons/account_report/i18n/lt.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 08:18+0000\n"
+"PO-Revision-Date: 2010-08-29 10:32+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:38+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_report
diff --git a/addons/account_report/i18n/tr.po b/addons/account_report/i18n/tr.po
index 92588898561..dfba0d77a64 100644
--- a/addons/account_report/i18n/tr.po
+++ b/addons/account_report/i18n/tr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 08:50+0000\n"
+"PO-Revision-Date: 2010-08-29 10:37+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:38+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:55+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_report
diff --git a/addons/account_reporting/i18n/lt.po b/addons/account_reporting/i18n/lt.po
index 7a0e56c4207..6ddc79030a9 100644
--- a/addons/account_reporting/i18n/lt.po
+++ b/addons/account_reporting/i18n/lt.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 07:25+0000\n"
+"PO-Revision-Date: 2010-08-29 08:53+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:41+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_reporting
diff --git a/addons/account_reporting/i18n/tr.po b/addons/account_reporting/i18n/tr.po
index 715c35dc034..5ecd1d924d1 100644
--- a/addons/account_reporting/i18n/tr.po
+++ b/addons/account_reporting/i18n/tr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 09:02+0000\n"
+"PO-Revision-Date: 2010-08-29 10:38+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:41+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_reporting
diff --git a/addons/account_tax_include/i18n/tr.po b/addons/account_tax_include/i18n/tr.po
index 2b5c25cf133..60dbb2b202d 100644
--- a/addons/account_tax_include/i18n/tr.po
+++ b/addons/account_tax_include/i18n/tr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 08:22+0000\n"
+"PO-Revision-Date: 2010-08-29 10:33+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:39+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:56+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_tax_include
diff --git a/addons/account_voucher/i18n/lt.po b/addons/account_voucher/i18n/lt.po
index 9fb0a76ee4c..daeb17bb6f0 100644
--- a/addons/account_voucher/i18n/lt.po
+++ b/addons/account_voucher/i18n/lt.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 08:27+0000\n"
+"PO-Revision-Date: 2010-08-29 10:34+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:41+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_voucher
diff --git a/addons/account_voucher/i18n/tr.po b/addons/account_voucher/i18n/tr.po
index a45f401e175..8879e5fbfb0 100644
--- a/addons/account_voucher/i18n/tr.po
+++ b/addons/account_voucher/i18n/tr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 08:23+0000\n"
+"PO-Revision-Date: 2010-08-29 10:33+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:41+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_voucher
diff --git a/addons/account_voucher/voucher.py b/addons/account_voucher/voucher.py
index e8a02320533..4cc44433ff8 100644
--- a/addons/account_voucher/voucher.py
+++ b/addons/account_voucher/voucher.py
@@ -44,6 +44,9 @@ class account_move_line(osv.osv):
account_move_line()
class account_voucher(osv.osv):
+ def _get_type(self, cr, uid, ids, context={}):
+ return context.get('type')
+
def _get_period(self, cr, uid, context={}):
if context.get('period_id', False):
return context.get('period_id')
@@ -81,6 +84,12 @@ class account_voucher(osv.osv):
_order = "date desc, id desc"
_rec_name = 'number'
_columns = {
+ 'type':fields.selection([
+ ('sale','Sale'),
+ ('purchase','Purchase'),
+ ('payment','Payment'),
+ ('receipt','Receipt'),
+ ],'Type'),
'name':fields.char('Memo', size=256, readonly=True, states={'draft':[('readonly',False)]}),
'date':fields.date('Date', readonly=True, states={'draft':[('readonly',False)]}, help="Effective date for accounting entries"),
'journal_id':fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}),
@@ -88,9 +97,9 @@ class account_voucher(osv.osv):
'line_ids':fields.one2many('account.voucher.line','voucher_id','Voucher Lines', readonly=True, states={'draft':[('readonly',False)]}),
'line_cr_ids':fields.one2many('account.voucher.line','voucher_id','Credits',
- domain=[('type','=','cr')], context={'default_type':'cr'}),
+ domain=[('type','=','cr')], context={'default_type':'cr'}, readonly=True, states={'draft':[('readonly',False)]}),
'line_dr_ids':fields.one2many('account.voucher.line','voucher_id','Debits',
- domain=[('type','=','dr')], context={'default_type':'dr'}),
+ domain=[('type','=','dr')], context={'default_type':'dr'}, readonly=True, states={'draft':[('readonly',False)]}),
'period_id': fields.many2one('account.period', 'Period', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'narration':fields.text('Narration', readonly=True, states={'draft':[('readonly',False)]}),
'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}),
@@ -110,7 +119,7 @@ class account_voucher(osv.osv):
'reference': fields.char('Ref #', size=64, readonly=True, states={'draft':[('readonly',False)]}, help="Payment or Receipt transaction number, i.e. Bank cheque number or payorder number or Wire transfer number or Acknowledge number."),
'number': fields.related('move_id', 'name', type="char", readonly=True, string='Number'),
'move_id':fields.many2one('account.move', 'Account Entry'),
- 'move_ids': fields.related('move_id','line_id', type='many2many', relation='account.move.line', string='Journal Items', readonly=True, states={'draft':[('readonly',False)]}),
+ 'move_ids': fields.related('move_id','line_id', type='many2many', relation='account.move.line', string='Journal Items', readonly=True),
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True, states={'draft':[('readonly',False)]}),
'audit': fields.related('move_id','to_check', type='boolean', relation='account.move', string='Audit Complete ?'),
'pay_now':fields.selection([
@@ -119,11 +128,14 @@ class account_voucher(osv.osv):
],'Payment', select=True, readonly=True, states={'draft':[('readonly',False)]}),
'tax_id':fields.many2one('account.tax', 'Tax', readonly=True, states={'draft':[('readonly',False)]}),
'pre_line':fields.boolean('Previous Payments ?', required=False),
+ 'date_due': fields.date('Due Date'),
+ 'term_id':fields.many2one('account.payment.term', 'Term', required=False),
}
_defaults = {
'period_id': _get_period,
'journal_id':_get_journal,
'currency_id': _get_currency,
+ 'type':_get_type,
'state': lambda *a: 'draft',
'pay_now':lambda *a: 'pay_later',
'name': lambda *a: '',
@@ -196,9 +208,23 @@ class account_voucher(osv.osv):
return {
'value':res
}
-
- def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id=False, price=0.0, context={}):
- """
+
+ def onchange_term_id(self, cr, uid, ids, term_id, amount):
+ term_pool = self.pool.get('account.payment.term')
+ terms = False
+ due_date = False
+ default = {'date_due':False}
+ if term_id and amount:
+ terms = term_pool.compute(cr, uid, term_id, amount)
+ if terms:
+ due_date = terms[-1][0]
+ default.update({
+ 'date_due':due_date
+ })
+ return {'value':default}
+
+ def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id=False, price=0.0, ttype=False, context={}):
+ """price
Returns a dict that contains new values and context
@param partner_id: latest value from user input for field partner_id
@@ -215,33 +241,46 @@ class account_voucher(osv.osv):
partner_pool = self.pool.get('res.partner')
journal_pool = self.pool.get('account.journal')
default = {
- 'value':{'line_ids':[], 'line_dr_ids':[], 'line_cr_ids':[], 'pre_line': 0},
+ 'value':{'line_ids':[], 'line_dr_ids':[], 'line_cr_ids':[], 'pre_line': False},
}
- # TODO: improve this if possible !
if not partner_id:
- if ids:
- line_ids = line_pool.search(cr, uid, [('voucher_id','=',ids[0])])
- if line_ids:
- line_pool.unlink(cr, uid, line_ids)
+ return default
+
+ if not partner_id and ids:
+ line_ids = line_pool.search(cr, uid, [('voucher_id','=',ids[0])])
+ if line_ids:
+ line_pool.unlink(cr, uid, line_ids)
return default
journal = journal_pool.browse(cr, uid, journal_id)
partner = partner_pool.browse(cr, uid, partner_id)
account_id = False
+ term_id = False
if journal.type in ('sale','sale_refund'):
account_id = partner.property_account_receivable.id
elif journal.type in ('purchase', 'purchase_refund','expense'):
+ term_id = partner.property_payment_term.id
+ if term_id:
+ vals = self.onchange_term_id(cr, uid, ids, term_id, price)
+ default['value'].update(vals.get('value'))
account_id = partner.property_account_payable.id
else:
account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id
default['value'].update({
- 'account_id':account_id
+ 'account_id':account_id,
+ 'term_id':term_id
})
if journal.type not in ('cash', 'bank'):
return default
-
- ids = move_line_pool.search(cr, uid, [('account_id.type','in', ('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',partner_id)], context=context)
+
+ account_type = 'receivable'
+ if ttype == 'payment':
+ account_type = 'payable'
+ else:
+ account_type = 'receivable'
+
+ ids = move_line_pool.search(cr, uid, [('account_id.type','=', account_type), ('reconcile_id','=', False), ('partner_id','=',partner_id)], context=context)
moves = move_line_pool.browse(cr, uid, ids)
total_credit = price or 0.0
total_debit = 0.0
@@ -275,7 +314,11 @@ class account_voucher(osv.osv):
default['value']['line_cr_ids'].append(rs)
else:
default['value']['line_dr_ids'].append(rs)
+
+ if ttype == 'payment' and len(default['value']['line_cr_ids']) > 0:
default['value']['pre_line'] = 1
+ elif ttype == 'receipt' and len(default['value']['line_dr_ids']) > 0:
+ default['value']['pre_line'] = 1
return default
@@ -296,11 +339,10 @@ class account_voucher(osv.osv):
}
}
- # TODO
def onchange_journal(self, cr, uid, ids, journal_id):
return {}
- def proforma_voucher(self, cr, uid, ids, context={}):
+ def proforma_voucher(self, cr, uid, ids):
self.action_move_line_create(cr, uid, ids)
return True
@@ -352,6 +394,14 @@ class account_voucher(osv.osv):
}
def action_move_line_create(self, cr, uid, ids, *args):
+
+ def _get_payment_term_lines(term_id, amount):
+ term_pool = self.pool.get('account.payment.term')
+ if term_id and amount:
+ terms = term_pool.compute(cr, uid, term_id, amount)
+ return terms
+ return False
+
move_pool = self.pool.get('account.move')
move_line_pool = self.pool.get('account.move.line')
analytic_pool = self.pool.get('account.analytic.line')
@@ -380,27 +430,49 @@ class account_voucher(osv.osv):
}
move_id = move_pool.create(cr, uid, move)
company_currency = inv.account_id.company_id.currency_id.id
-
+
#create the first line manually
debit = 0.0
credit = 0.0
- # TODO: to improve to select debit or credit
- if True:
+ # TODO: is there any other alternative then the voucher type ??
+ if inv.type in ('purchase', 'payment'):
+ credit = currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, inv.amount)
+ elif inv.type in ('sale', 'receipt'):
debit = currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, inv.amount)
- move_line = {
- 'name':inv.name or '/',
- 'debit':debit,
- 'credit':credit,
- 'account_id':inv.account_id.id,
- 'move_id':move_id ,
- 'journal_id':inv.journal_id.id,
- 'period_id':inv.period_id.id,
- 'partner_id':inv.partner_id.id,
- 'currency_id':inv.currency_id.id,
- 'date':inv.date
- }
-
- master_line = move_line_pool.create(cr, uid, move_line)
+
+ if inv.type == 'purchase' and inv.term_id and _get_payment_term_lines(inv.term_id.id, credit or debit):
+ terms = _get_payment_term_lines(inv.term_id.id, credit or debit)
+ for term in terms:
+ due_date = term[0]
+ amount = term[1]
+ move_line = {
+ 'name':inv.name or '/',
+ 'debit':0.0,
+ 'credit':amount,
+ 'date_maturity':due_date,
+ 'account_id':inv.account_id.id,
+ 'move_id':move_id ,
+ 'journal_id':inv.journal_id.id,
+ 'period_id':inv.period_id.id,
+ 'partner_id':inv.partner_id.id,
+ 'currency_id':inv.currency_id.id,
+ 'date':inv.date
+ }
+ master_line = move_line_pool.create(cr, uid, move_line)
+ else:
+ move_line = {
+ 'name':inv.name or '/',
+ 'debit':debit,
+ 'credit':credit,
+ 'account_id':inv.account_id.id,
+ 'move_id':move_id ,
+ 'journal_id':inv.journal_id.id,
+ 'period_id':inv.period_id.id,
+ 'partner_id':inv.partner_id.id,
+ 'currency_id':inv.currency_id.id,
+ 'date':inv.date
+ }
+ master_line = move_line_pool.create(cr, uid, move_line)
rec_list_ids = []
line_total = debit - credit
@@ -547,9 +619,9 @@ class account_voucher_line(osv.osv):
return res
_columns = {
- 'voucher_id':fields.many2one('account.voucher', 'Voucher', required=1),
+ 'voucher_id':fields.many2one('account.voucher', 'Voucher', required=1, ondelete='cascade'),
'name':fields.char('Description', size=256),
- 'account_id':fields.many2one('account.account','Account', required=True, domain=[('type','<>','view')]),
+ 'account_id':fields.many2one('account.account','Account', required=True),
'partner_id':fields.related('voucher_id', 'partner_id', type='many2one', relation='res.partner', string='Partner'),
'amount':fields.float('Amount'),
'type':fields.selection([('dr','Debit'),('cr','Credit')], 'Cr/Dr'),
@@ -616,7 +688,11 @@ class account_voucher_line(osv.osv):
elif journal.type in ('purchase', 'expense', 'sale_refund'):
account_id = journal.default_debit_account_id and journal.default_debit_account_id.id or False
elif partner_id:
- account_id = partner_pool.browse(cr, user, partner_id, context=context).property_account_receivable.id
+ partner = partner_pool.browse(cr, user, partner_id, context=context)
+ if context.get('type') == 'payment':
+ account_id = partner.property_account_payable.id
+ elif context.get('type') == 'receipt':
+ account_id = partner.property_account_receivable.id
if (not account_id) and 'account_id' in fields_list:
raise osv.except_osv(_('Invalid Error !'), _('Please change partner and try again !'))
diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml
index 8044093e7fb..4ffba531dc4 100644
--- a/addons/account_voucher/voucher_payment_receipt_view.xml
+++ b/addons/account_voucher/voucher_payment_receipt_view.xml
@@ -8,33 +8,57 @@
-
- Compute Remaining Hours
- config.compute.remaining
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Compute Remaining Hours
- ir.actions.act_window
- config.compute.remaining
- form
- form
- new
-
-
project.task.form
@@ -245,7 +217,7 @@
-
+
@@ -264,10 +236,10 @@
-
+
-
+
@@ -345,7 +317,7 @@
-
+
diff --git a/addons/project/wizard/__init__.py b/addons/project/wizard/__init__.py
index 095a561e8d1..2ea97ae13dc 100644
--- a/addons/project/wizard/__init__.py
+++ b/addons/project/wizard/__init__.py
@@ -19,9 +19,10 @@
#
##############################################################################
-import project_close_task
+import project_task_close
import project_task_delegate
import project_task_review
+import project_task_reevaluate
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project/wizard/project_close_task.py b/addons/project/wizard/project_close_task.py
deleted file mode 100644
index f98d8853271..00000000000
--- a/addons/project/wizard/project_close_task.py
+++ /dev/null
@@ -1,145 +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 fields, osv
-from tools.translate import _
-from tools import email_send as email
-
-class project_close_task(osv.osv_memory):
- """
- Close Task
- """
- _name = "close.task"
- _description = "Project Close Task"
- _columns = {
- 'manager_email': fields.char('Manager E-Mail ID', size=64, help="Email Address of Project's Manager"),
- 'partner_email': fields.char('Partner E-Mail ID', size=64, help="Email Address of Partner"),
- 'description': fields.text('Description'),
- }
-
- def _get_manager_email(self, cr, uid, context=None):
- if context is None:
- context = {}
- email = ''
- if context.get('send_manager', False) and ('task_id' in context):
- project_id = self.pool.get('project.task').read(cr, uid, context['task_id'], ['project_id'])['project_id'][0]
- project = self.pool.get('project.project').browse(cr, uid, project_id)
- manager_id = project.user_id or False
- if manager_id and manager_id.user_email:
- email = manager_id.user_email
- return email
-
- def _get_partner_email(self, cr, uid, context=None):
- if context is None:
- context = {}
- email = ''
- if context.get('send_partner', False) and ('task_id' in context):
- task = self.pool.get('project.task').browse(cr, uid, context['task_id'])
- partner_id = task.partner_id or task.project_id.partner_id
- if partner_id and len(partner_id.address) and partner_id.address[0].email:
- email = partner_id.address[0].email
- return email
-
- def _get_desc(self, cr, uid, context=None):
- if context is None:
- context = {}
- if 'task_id' in context:
- task = self.pool.get('project.task').browse(cr, uid, context['task_id'])
- return task.description or task.name
- return ''
-
- _defaults = {
- 'manager_email': _get_manager_email,
- 'partner_email': _get_partner_email,
- }
-
- def close(self, cr, uid, ids, context=None):
- data = self.read(cr,uid,ids)[0]
- notes=data['description'] or ''
- task_pool = self.pool.get('project.task')
- user_name = self.pool.get('res.users').browse(cr, uid, uid).name
- description = _("Closed By ") + user_name + _(" At ") + time.strftime('%Y-%m-%d %H:%M:%S')
- description += "\n" + "=======================" + "\n" + notes
- if 'task_id' in context:
- task = task_pool.browse(cr, uid, context['task_id'])
- description = task.description and task.description + "\n\n" + description
- task_pool.write(cr, uid, [task.id], {
- 'description': description,
- 'state': 'done',
- 'date_end':time.strftime('%Y-%m-%d %H:%M:%S'),
- 'remaining_hours': 0.0
- })
- return {}
-
- def confirm(self, cr, uid, ids, context=None):
- if context is None:
- context = {}
- if not 'task_id' in context:
- return {}
- close_task = self.read(cr, uid, ids[0], [])
- to_adr = []
- description = close_task['description']
-
- if 'task_id' in context:
- if context.get('send_manager', False) and not close_task.get('manager_email', False):
- raise osv.except_osv(_('Error'), _("Please specify the email address of Project Manager."))
-
- elif context.get('send_partner', False) and not close_task.get('partner_email', False):
- raise osv.except_osv(_('Error'), _("Please specify the email address of partner."))
-
- else:
- task_obj = self.pool.get('project.task')
- task = task_obj.browse(cr, uid, context['task_id'], context=context)
- project = task.project_id
- subject = "Task '%s' closed" % task.name
- if task.user_id and task.user_id.address_id and task.user_id.address_id.email:
- from_adr = task.user_id.address_id.email
- signature = task.user_id.signature
- else:
- raise osv.except_osv(_('Error'), _("Couldn't send mail because your email address is not configured!"))
- val = {
- 'name': task.name,
- 'user_id': task.user_id.name,
- 'task_id': "%d/%d" % (project.id, task.id),
- 'date_start': task.date_start,
- 'date_end': task.date_end,
- 'state': task.state
- }
-
- header = (project.warn_header or '') % val
- footer = (project.warn_footer or '') % val
- body = u'%s\n%s\n%s\n\n-- \n%s' % (header, description, footer, signature)
- to_adr.append(context.get('send_manager', '') and close_task.get('manager_email', '') or '')
- to_adr.append(context.get('send_partner', '') and close_task.get('partner_email', '') or '')
- mail_id = email(from_adr, to_adr, subject, body.encode('utf-8'), email_bcc=[from_adr])
- if not mail_id:
- raise osv.except_osv(_('Error'), _("Couldn't send mail! Check the email ids and smtp configuration settings"))
- task_obj.write(cr, uid, [task.id], {'state': 'done', 'date_end':time.strftime('%Y-%m-%d %H:%M:%S'), 'remaining_hours': 0.0})
- message = _('Task ') + " '" + task.name + "' "+ _("is Done.")
- self.log(cr, uid, task.id, message)
-
- return {}
-
-project_close_task()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project/wizard/project_close_task_view.xml b/addons/project/wizard/project_close_task_view.xml
deleted file mode 100644
index 6a861fcfd10..00000000000
--- a/addons/project/wizard/project_close_task_view.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
- Project Close Task
- close.task
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Project Close Task
- ir.actions.act_window
- close.task
- form
- form
-
- {'record_id' : active_id}
- new
-
-
-
-
diff --git a/addons/project/wizard/project_task_close.py b/addons/project/wizard/project_task_close.py
new file mode 100644
index 00000000000..99b6caef308
--- /dev/null
+++ b/addons/project/wizard/project_task_close.py
@@ -0,0 +1,126 @@
+# -*- 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 fields, osv
+from tools.translate import _
+from tools import email_send as email
+
+class project_task_close(osv.osv_memory):
+ """
+ Close Task
+ """
+ _name = "project.task.close"
+ _description = "Project Close Task"
+ _columns = {
+ 'manager_warn': fields.boolean("Warn Manager", help="Warn Manager by Email"),
+ 'partner_warn': fields.boolean("Warn Customer", help="Warn Customer by Email"),
+ 'manager_email': fields.char('Manager Email', size=128, help="Email Address of Project's Manager"),
+ 'partner_email': fields.char('Customer Email', size=128, help="Email Address of Customer"),
+ 'description': fields.text('Description'),
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+ """
+ This function gets default values
+ """
+ if context is None:
+ context = {}
+ record_id = context and context.get('active_id', False) or False
+ task_pool = self.pool.get('project.task')
+ project_pool = self.pool.get('project.project')
+
+ res = super(project_task_close, self).default_get(cr, uid, fields, context=context)
+ task = task_pool.browse(cr, uid, record_id, context=context)
+ project = task.project_id
+ manager = project.user_id or False
+ partner = task.partner_id or task.project_id.partner_id
+
+ if 'description' in fields:
+ res.update({'description': task.description})
+ if 'manager_warn' in fields:
+ res.update({'manager_warn': project.warn_manager})
+ if 'partner_warn' in fields:
+ res.update({'partner_warn': project.warn_customer})
+ if 'manager_email' in fields:
+ res.update({'manager_email': manager and manager.user_email or False})
+ if partner and len(partner.address) and 'partner_email' in fields:
+ res.update({'partner_email': partner.address[0].email})
+ return res
+
+ def done(self, cr, uid, ids, context=None):
+ task_pool = self.pool.get('project.task')
+ task_id = context.get('active_id', False)
+ res = task_pool.do_close(cr, uid, [task_id], context=context)
+ return res
+
+ def confirm(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
+
+ task_pool = self.pool.get('project.task')
+ task_id = context.get('active_id', False)
+ if not task_id:
+ return {}
+ task = task_pool.browse(cr, uid, task_id, context=context)
+ for data in self.browse(cr, uid, ids, context=context):
+ res = task_pool.do_close(cr, uid, [task.id], context=context)
+ if res:
+ # Send Warn Message by Email to Manager and Customer
+ if data.manager_warn and not data.manager_email:
+ raise osv.except_osv(_('Error'), _("Please specify the email address of Project Manager."))
+
+ elif data.partner_warn and not data.partner_email:
+ raise osv.except_osv(_('Error'), _("Please specify the email address of Customer."))
+
+ elif data.manager_warn or data.partner_warn:
+ project = task.project_id
+ subject = _("Task '%s' Closed") % task.name
+ if task.user_id and task.user_id.address_id and task.user_id.address_id.email:
+ from_adr = task.user_id.address_id.email
+ signature = task.user_id.signature
+ else:
+ raise osv.except_osv(_('Error'), _("Couldn't send mail because your email address is not configured!"))
+ val = {
+ 'name': task.name,
+ 'user_id': task.user_id.name,
+ 'task_id': "%d/%d" % (project.id, task.id),
+ 'date_start': task.date_start,
+ 'date_end': task.date_end,
+ 'state': task.state
+ }
+
+ header = (project.warn_header or '') % val
+ footer = (project.warn_footer or '') % val
+ body = u'%s\n%s\n%s\n\n-- \n%s' % (header, description, footer, signature)
+ if data.manager_warn and data.manager_email:
+ to_adr.append(data.manager_email)
+ if data.partner_warn and data.partner_email:
+ to_adr.append(data.partner_email)
+ mail_id = email(from_adr, to_adr, subject, tools.ustr(body), email_bcc=[from_adr])
+ if not mail_id:
+ raise osv.except_osv(_('Error'), _("Couldn't send mail! Check the email ids and smtp configuration settings"))
+ return {}
+
+project_task_close()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project/wizard/project_task_close_view.xml b/addons/project/wizard/project_task_close_view.xml
new file mode 100644
index 00000000000..9692fe9a733
--- /dev/null
+++ b/addons/project/wizard/project_task_close_view.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+ Done Task
+ project.task.close
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Done Task
+ ir.actions.act_window
+ project.task.close
+ form
+ form
+
+ new
+
+
+
+
diff --git a/addons/project/wizard/project_task_delegate.py b/addons/project/wizard/project_task_delegate.py
index 535d527f45b..2ce74ceefc8 100644
--- a/addons/project/wizard/project_task_delegate.py
+++ b/addons/project/wizard/project_task_delegate.py
@@ -38,67 +38,54 @@ class project_task_delegate(osv.osv_memory):
'state': fields.selection([('pending','Pending'), ('done','Done'), ], 'Validation State', required=True, help="New state of your own task. Pending will be reopened automatically when the delegated task is closed")
}
- def _get_name(self, cr, uid, context=None):
+ def default_get(self, cr, uid, fields, context=None):
+ """
+ This function gets default values
+ """
+ res = super(project_task_delegate, self).default_get(cr, uid, fields, context=context)
if context is None:
context = {}
- if 'active_id' in context:
- task = self.pool.get('project.task').browse(cr, uid, context['active_id'])
+ record_id = context and context.get('active_id', False) or False
+ task_pool = self.pool.get('project.task')
+ task = task_pool.browse(cr, uid, record_id, context=context)
+ project = task.project_id
+ manager = project.user_id or False
+ partner = task.partner_id or task.project_id.partner_id
+
+ if 'name' in fields:
if task.name.startswith(_('CHECK: ')):
newname = str(task.name).replace(_('CHECK: '), '')
else:
newname = task.name or ''
- return newname
- return ''
-
- def _get_plan_hour(self, cr, uid, context=None):
- if context is None:
- context = {}
- if 'active_id' in context:
- task = self.pool.get('project.task').browse(cr, uid, context['active_id'])
- return task.remaining_hours
- return 0.0
-
- def _get_prefix(self, cr, uid, context=None):
- if context is None:
- context = {}
- if 'active_id' in context:
- task = self.pool.get('project.task').browse(cr, uid, context['active_id'])
+ res.update({'name': newname})
+ if 'planned_hours' in fields:
+ res.update({'planned_hours': task.remaining_hours or 0.0})
+ if 'prefix' in fields:
if task.name.startswith(_('CHECK: ')):
newname = str(task.name).replace(_('CHECK: '), '')
else:
newname = task.name or ''
- return _('CHECK: ') + newname
- return ''
+ prefix = _('CHECK: ') + newname
+ res.update({'prefix': prefix})
+ if 'new_task_description' in fields:
+ res.update({'new_task_description': task.description})
+ return res
- def _get_new_desc(self, cr, uid, context=None):
- if context is None:
- context = {}
- if 'active_id' in context:
- task = self.pool.get('project.task').browse(cr, uid, context['active_id'])
- return task.description
- return ''
_defaults = {
- 'name': _get_name,
- 'planned_hours': _get_plan_hour,
'planned_hours_me': 1.0,
- 'prefix': _get_prefix,
- 'new_task_description': _get_new_desc,
'state': 'pending',
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
- users_obj = self.pool.get('res.users')
- obj_tm = users_obj.browse(cr, uid, uid, context).company_id.project_time_mode_id
- tm = obj_tm and obj_tm.name or 'Hours'
-
res = super(project_task_delegate, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu=submenu)
-
+ users_pool = self.pool.get('res.users')
+ obj_tm = users_pool.browse(cr, uid, uid, context).company_id.project_time_mode_id
+ tm = obj_tm and obj_tm.name or 'Hours'
if tm in ['Hours','Hour']:
return res
eview = etree.fromstring(res['arch'])
-
def _check_rec(eview):
if eview.attrib.get('widget','') == 'float_time':
eview.set('widget','float')
@@ -107,47 +94,19 @@ class project_task_delegate(osv.osv_memory):
return True
_check_rec(eview)
-
res['arch'] = etree.tostring(eview)
-
- for f in res['fields']:
- if 'Hours' in res['fields'][f]['string']:
- res['fields'][f]['string'] = res['fields'][f]['string'].replace('Hours',tm)
-
+ for field in res['fields']:
+ if 'Hours' in res['fields'][field]['string']:
+ res['fields'][field]['string'] = res['fields'][field]['string'].replace('Hours',tm)
return res
- def validate(self, cr, uid, ids, context=None):
+ def delegate(self, cr, uid, ids, context=None):
if context is None:
context = {}
- task_obj = self.pool.get('project.task')
- user_obj = self.pool.get('res.users')
+ task_id = context.get('active_id', False)
+ task_pool = self.pool.get('project.task')
delegate_data = self.read(cr, uid, ids, context=context)[0]
- task = task_obj.browse(cr, uid, context['active_id'], context=context)
- newname = delegate_data['prefix'] or ''
- new_task_id = task_obj.copy(cr, uid, task.id, {
- 'name': delegate_data['name'],
- 'user_id': delegate_data['user_id'],
- 'planned_hours': delegate_data['planned_hours'],
- 'remaining_hours': delegate_data['planned_hours'],
- 'parent_ids': [(6, 0, [task.id])],
- 'state': 'draft',
- 'description': delegate_data['new_task_description'] or '',
- 'child_ids': [],
- 'work_ids': []
- }, context)
- task_obj.write(cr, uid, [task.id], {
- 'remaining_hours': delegate_data['planned_hours_me'],
- 'planned_hours': delegate_data['planned_hours_me'] + (task.effective_hours or 0.0),
- 'name': newname,
- }, context)
- if delegate_data['state'] == 'pending':
- task_obj.do_pending(cr, uid, [task.id], context)
- else:
- context.update({'mail_send': False} )
- task_obj.do_close(cr, uid, [task.id], context)
- delegrate_user = user_obj.browse(cr, uid, delegate_data['user_id'], context=context)
- message = _('Task ') + " '" + delegate_data['name'] + "' "+ _("is Delegated to User:") +" '"+ delegrate_user.name +"' "
- self.log(cr, uid, task.id, message)
+ task_pool.do_delegate(cr, uid, task_id, delegate_data, context=context)
return {}
project_task_delegate()
diff --git a/addons/project/wizard/project_task_delegate_view.xml b/addons/project/wizard/project_task_delegate_view.xml
index efaf99e6a8d..7bedecd8f53 100644
--- a/addons/project/wizard/project_task_delegate_view.xml
+++ b/addons/project/wizard/project_task_delegate_view.xml
@@ -21,9 +21,12 @@
-
-
-
+
+
+
+
+
+
diff --git a/addons/project/wizard/project_task_reevaluate.py b/addons/project/wizard/project_task_reevaluate.py
new file mode 100644
index 00000000000..e4e2fab66e3
--- /dev/null
+++ b/addons/project/wizard/project_task_reevaluate.py
@@ -0,0 +1,83 @@
+# -*- 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 .
+#
+##############################################################################
+
+from lxml import etree
+from osv import fields, osv
+from tools.translate import _
+
+class project_task_reevaluate(osv.osv_memory):
+ _name = 'project.task.reevaluate'
+
+ def _get_remaining(self,cr, uid, context=None):
+ if context is None:
+ context = {}
+ active_id = context.get('active_id', False)
+ res = False
+ if active_id:
+ res = self.pool.get('project.task').browse(cr, uid, active_id, context=context).remaining_hours
+ return res
+
+ _columns = {
+ 'remaining_hours' : fields.float('Remaining Hours', digits=(16,2), help="Put here the remaining hours required to close the task."),
+ }
+
+ _defaults = {
+ 'remaining_hours': _get_remaining,
+ }
+
+ def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
+ res = super(project_task_reevaluate, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu=submenu)
+ users_pool = self.pool.get('res.users')
+ time_mode = users_pool.browse(cr, uid, uid, context).company_id.project_time_mode_id
+ time_mode_name = time_mode and time_mode.name or 'Hours'
+ if time_mode_name in ['Hours','Hour']:
+ return res
+
+ eview = etree.fromstring(res['arch'])
+
+ def _check_rec(eview):
+ if eview.attrib.get('widget','') == 'float_time':
+ eview.set('widget','float')
+ for child in eview:
+ _check_rec(child)
+ return True
+
+ _check_rec(eview)
+
+ res['arch'] = etree.tostring(eview)
+
+ for field in res['fields']:
+ if 'Hours' in res['fields'][field]['string']:
+ res['fields'][field]['string'] = res['fields'][field]['string'].replace('Hours',time_mode_name)
+ return res
+
+ def compute_hours(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
+ data = self.browse(cr, uid, ids, context=context)[0]
+ task_pool = self.pool.get('project.task')
+ task_id = context.get('active_id', False)
+ if task_id:
+ task_pool.write(cr, uid, task_id, {'remaining_hours': data.remaining_hours})
+ if context.get('button_reactivate', False):
+ task_pool.do_reopen(cr, uid, [task_id], context=context)
+ return {}
+project_task_reevaluate()
diff --git a/addons/project/wizard/project_task_reevaluate_view.xml b/addons/project/wizard/project_task_reevaluate_view.xml
new file mode 100644
index 00000000000..5e0e7c89069
--- /dev/null
+++ b/addons/project/wizard/project_task_reevaluate_view.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+ Re-evaluate Task
+ project.task.reevaluate
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Re-evaluate Task
+ ir.actions.act_window
+ project.task.reevaluate
+ form
+ form
+ new
+
+
+
diff --git a/addons/project_gtd/i18n/tr.po b/addons/project_gtd/i18n/tr.po
index d448448a457..99167dfec0b 100644
--- a/addons/project_gtd/i18n/tr.po
+++ b/addons/project_gtd/i18n/tr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 07:27+0000\n"
+"PO-Revision-Date: 2010-08-29 09:08+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:41+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: project_gtd
diff --git a/addons/project_long_term/__openerp__.py b/addons/project_long_term/__openerp__.py
index c98c85006fa..0d03b5f7315 100644
--- a/addons/project_long_term/__openerp__.py
+++ b/addons/project_long_term/__openerp__.py
@@ -27,14 +27,14 @@
"category": "Generic Modules/Projects & Services",
"depends": ["resource", "project"],
"description": """
-
- Long Term Project management module that tracks planning, scheduling, resources allocation.
- Mainly used with Big project management.
- - Project Phases will be maintained by Manager of the project
- - Compute Phase Scheduling: Compute start date and end date of the phases which are in draft,open and pending state of the project given.
- If no project given then all the draft,open and pending state phases will be taken
- - Compute Task Scheduling: This works same as the scheduler button on project.phase. It takes the project as argument and computes all the open,draft and pending tasks
- - Schedule Tasks: All the tasks which are in draft,pending and open state are scheduled with taking the phase's start date
+Long Term Project management module that tracks planning, scheduling, resources allocation.
+Features.
+ - Manage Big project.
+ - Define various Phases of Project.
+ - Compute Phase Scheduling: Compute start date and end date of the phases which are in draft,open and pending state of the project given.
+ If no project given then all the draft,open and pending state phases will be taken
+ - Compute Task Scheduling: This works same as the scheduler button on project.phase. It takes the project as argument and computes all the open,draft and pending tasks
+ - Schedule Tasks: All the tasks which are in draft,pending and open state are scheduled with taking the phase's start date
""",
"init_xml": [],
diff --git a/addons/project_long_term/project_long_term_view.xml b/addons/project_long_term/project_long_term_view.xml
index a8d8cc632e8..ee763b759b6 100644
--- a/addons/project_long_term/project_long_term_view.xml
+++ b/addons/project_long_term/project_long_term_view.xml
@@ -116,7 +116,7 @@
-
+
diff --git a/addons/project_long_term/wizard/project_compute_phases_view.xml b/addons/project_long_term/wizard/project_compute_phases_view.xml
index 43c7f55ca9f..8818684e8fa 100644
--- a/addons/project_long_term/wizard/project_compute_phases_view.xml
+++ b/addons/project_long_term/wizard/project_compute_phases_view.xml
@@ -8,21 +8,16 @@
form
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
+
+
+
+
+
diff --git a/addons/project_long_term/wizard/project_compute_tasks_view.xml b/addons/project_long_term/wizard/project_compute_tasks_view.xml
index 7e8b968ce99..e0cd30d5622 100644
--- a/addons/project_long_term/wizard/project_compute_tasks_view.xml
+++ b/addons/project_long_term/wizard/project_compute_tasks_view.xml
@@ -8,12 +8,15 @@
form
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/addons/project_messages/project_messages.py b/addons/project_messages/project_messages.py
index f71e64d2887..88142f78984 100644
--- a/addons/project_messages/project_messages.py
+++ b/addons/project_messages/project_messages.py
@@ -55,9 +55,7 @@ class project_with_message(osv.osv):
_inherit = 'project.project'
_columns = {
- 'message_ids':fields.one2many(
- 'project.messages', 'project_id', 'Messages',
- ),
+ 'message_ids':fields.one2many('project.messages', 'project_id', 'Messages'),
}
project_with_message()
diff --git a/addons/project_mrp/i18n/tr.po b/addons/project_mrp/i18n/tr.po
index 9fd10691cea..1a09d6b9a57 100644
--- a/addons/project_mrp/i18n/tr.po
+++ b/addons/project_mrp/i18n/tr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 07:23+0000\n"
+"PO-Revision-Date: 2010-08-29 09:57+0000\n"
"Last-Translator: OpenERP Administrators \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:41+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: project_mrp
diff --git a/addons/project_retro_planning/i18n/tr.po b/addons/project_retro_planning/i18n/tr.po
index dd11c53d5bd..62925077959 100644
--- a/addons/project_retro_planning/i18n/tr.po
+++ b/addons/project_retro_planning/i18n/tr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 07:19+0000\n"
+"PO-Revision-Date: 2010-08-29 09:46+0000\n"
"Last-Translator: OpenERP Administrators \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:41+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:59+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: project_retro_planning
diff --git a/addons/project_scrum/i18n/et.po b/addons/project_scrum/i18n/et.po
index 6f51b614978..baa1d5ca8ea 100644
--- a/addons/project_scrum/i18n/et.po
+++ b/addons/project_scrum/i18n/et.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-11-09 19:58+0000\n"
-"Last-Translator: Fabien (Open ERP) \n"
+"PO-Revision-Date: 2010-08-28 08:22+0000\n"
+"Last-Translator: OpenERP Administrators \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-12 03:45+0000\n"
+"X-Launchpad-Export-Date: 2010-08-29 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: project_scrum
@@ -34,7 +34,7 @@ msgstr "Loo ülesanne backlogist."
#. module: project_scrum
#: field:project.scrum.product.backlog,user_id:0
msgid "Author"
-msgstr ""
+msgstr "Autor"
#. module: project_scrum
#: model:ir.actions.act_window,name:project_scrum.action_view_task4
@@ -151,12 +151,12 @@ msgstr "Scrum ülesanne"
#: view:project.scrum.product.backlog:0
#: view:project.scrum.sprint:0
msgid "Set to Draft"
-msgstr ""
+msgstr "Sea mustandiks"
#. module: project_scrum
#: field:project.scrum.product.backlog,create_date:0
msgid "Creation Date"
-msgstr ""
+msgstr "Loomise kuupäev"
#. module: project_scrum
#: view:project.scrum.meeting:0
@@ -166,7 +166,7 @@ msgstr ""
#. module: project_scrum
#: view:project.scrum.product.backlog:0
msgid "Editable"
-msgstr ""
+msgstr "Redigeeritav"
#. module: project_scrum
#: model:ir.model,name:project_scrum.model_project_scrum_backlog_assign_sprint
@@ -187,12 +187,12 @@ msgstr ""
#. module: project_scrum
#: field:project.scrum.product.backlog,task_hours:0
msgid "Task Hours"
-msgstr ""
+msgstr "Ülesande tunnid"
#. module: project_scrum
#: view:project.scrum.sprint:0
msgid "Dates"
-msgstr ""
+msgstr "Kuupäevad"
#. module: project_scrum
#: view:project.scrum.meeting:0
@@ -202,7 +202,7 @@ msgstr ""
#. module: project_scrum
#: view:project.scrum.meeting:0
msgid "Daily"
-msgstr ""
+msgstr "Igapäevane"
#. module: project_scrum
#: field:project.scrum.sprint,backlog_ids:0
@@ -212,12 +212,12 @@ msgstr "Sprint Backlog"
#. module: project_scrum
#: view:project.scrum.product.backlog:0
msgid "Delegate"
-msgstr ""
+msgstr "Delegeeri"
#. module: project_scrum
#: view:board.board:0
msgid "My Board"
-msgstr ""
+msgstr "Minu laud"
#. module: project_scrum
#: field:project.scrum.meeting,date:0
@@ -260,7 +260,7 @@ msgstr ""
#. module: project_scrum
#: model:ir.model,name:project_scrum.model_project_task
msgid "Task"
-msgstr ""
+msgstr "Tegevus"
#. module: project_scrum
#: constraint:project.task:0
@@ -509,12 +509,12 @@ msgstr ""
#. module: project_scrum
#: view:project.scrum.sprint:0
msgid "Planning"
-msgstr ""
+msgstr "Planeerimine"
#. module: project_scrum
#: constraint:account.analytic.account:0
msgid "Error! You can not create recursive analytic accounts."
-msgstr ""
+msgstr "Viga! Sa ei saa luua rekursiivseid analüütilisi kontosid."
#. module: project_scrum
#: help:project.scrum.sprint,scrum_master_id:0
@@ -835,7 +835,7 @@ msgstr "Töö tehtud"
#. module: project_scrum
#: view:project.scrum.backlog.merge:0
msgid "Merge"
-msgstr ""
+msgstr "Ühenda"
#. module: project_scrum
#: model:ir.actions.act_window,name:project_scrum.action_sprint_backlog_open
@@ -1222,7 +1222,7 @@ msgstr "Eeldatav lõpp"
#. module: project_scrum
msgid "Hello"
-msgstr ""
+msgstr "Tere"
#. module: project_scrum
msgid "I am sending you Daily Meeting Details of date"
@@ -1242,7 +1242,7 @@ msgstr ""
#. module: project_scrum
msgid "Thank you"
-msgstr ""
+msgstr "Tänan teid"
#. module: project_scrum
msgid "Scrum Meeting of"
diff --git a/addons/project_scrum/i18n/tr.po b/addons/project_scrum/i18n/tr.po
index 5734eac375b..9b23166e8e8 100644
--- a/addons/project_scrum/i18n/tr.po
+++ b/addons/project_scrum/i18n/tr.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-26 07:44+0000\n"
+"PO-Revision-Date: 2010-08-29 10:27+0000\n"
"Last-Translator: Fabien (Open ERP) \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-08-27 03:38+0000\n"
+"X-Launchpad-Export-Date: 2010-08-30 03:56+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: project_scrum
diff --git a/addons/project_scrum/project_scrum.py b/addons/project_scrum/project_scrum.py
index 482e41e179c..a80a31ff257 100644
--- a/addons/project_scrum/project_scrum.py
+++ b/addons/project_scrum/project_scrum.py
@@ -45,49 +45,29 @@ class project_scrum_sprint(osv.osv):
_name = 'project.scrum.sprint'
_description = 'Project Scrum Sprint'
- def _calc_progress(self, cr, uid, ids, name, args, context=None):
- res = {}
+ def _compute(self, cr, uid, ids, fields, arg, context=None):
+ res = {}.fromkeys(ids, 0.0)
+ progress = {}
+ if not ids:
+ return res
if context is None:
context = {}
- for sprint in self.browse(cr, uid, ids):
+ for sprint in self.browse(cr, uid, ids, context=context):
tot = 0.0
prog = 0.0
+ effective = 0.0
+ progress = 0.0
for bl in sprint.backlog_ids:
tot += bl.expected_hours
+ effective += bl.effective_hours
prog += bl.expected_hours * bl.progress / 100.0
- res.setdefault(sprint.id, 0.0)
if tot>0:
- res[sprint.id] = round(prog/tot*100)
- return res
-
- def _calc_effective(self, cr, uid, ids, name, args, context=None):
- res = {}
- if context is None:
- context = {}
- for sprint in self.browse(cr, uid, ids):
- res.setdefault(sprint.id, 0.0)
- for bl in sprint.backlog_ids:
- res[sprint.id] += bl.effective_hours
- return res
-
- def _calc_planned(self, cr, uid, ids, name, args, context=None):
- res = {}
- if context is None:
- context = {}
- for sprint in self.browse(cr, uid, ids):
- res.setdefault(sprint.id, 0.0)
- for bl in sprint.backlog_ids:
- res[sprint.id] += bl.expected_hours
- return res
-
- def _calc_expected(self, cr, uid, ids, name, args, context=None):
- res = {}
- if context is None:
- context = {}
- for sprint in self.browse(cr, uid, ids):
- res.setdefault(sprint.id, 0.0)
- for bl in sprint.backlog_ids:
- res[sprint.id] += bl.expected_hours
+ progress = round(prog/tot*100)
+ res[sprint.id] = {
+ 'progress' : progress,
+ 'expected_hours' : tot,
+ 'effective_hours': effective,
+ }
return res
def button_cancel(self, cr, uid, ids, context=None):
@@ -137,9 +117,9 @@ class project_scrum_sprint(osv.osv):
'review': fields.text('Sprint Review'),
'retrospective': fields.text('Sprint Retrospective'),
'backlog_ids': fields.one2many('project.scrum.product.backlog', 'sprint_id', 'Sprint Backlog'),
- 'progress': fields.function(_calc_progress, method=True, string='Progress (0-100)', help="Computed as: Time Spent / Total Time."),
- 'effective_hours': fields.function(_calc_effective, method=True, string='Effective hours', help="Computed using the sum of the task work done."),
- 'expected_hours': fields.function(_calc_expected, method=True, string='Planned Hours', help='Estimated time to do the task.'),
+ 'progress': fields.function(_compute, group_operator="avg", type='float', multi="progress", method=True, string='Progress (0-100)', help="Computed as: Time Spent / Total Time."),
+ 'effective_hours': fields.function(_compute, multi="effective_hours", method=True, string='Effective hours', help="Computed using the sum of the task work done."),
+ 'expected_hours': fields.function(_compute, multi="expected_hours", method=True, string='Planned Hours', help='Estimated time to do the task.'),
'state': fields.selection([('draft','Draft'),('open','Open'),('pending','Pending'),('cancel','Cancelled'),('done','Done')], 'State', required=True),
}
_defaults = {
@@ -188,39 +168,31 @@ class project_scrum_product_backlog(osv.osv):
return self.name_get(cr, uid, ids, context=context)
return super(project_scrum_product_backlog, self).name_search(cr, uid, name, args, operator,context, limit=limit)
- def _calc_progress(self, cr, uid, ids, name, args, context=None):
- res = {}
+ def _compute(self, cr, uid, ids, fields, arg, context=None):
+ res = {}.fromkeys(ids, 0.0)
+ progress = {}
+ if not ids:
+ return res
if context is None:
context = {}
- for bl in self.browse(cr, uid, ids):
+ for backlog in self.browse(cr, uid, ids, context=context):
tot = 0.0
prog = 0.0
- for task in bl.tasks_id:
+ effective = 0.0
+ task_hours = 0.0
+ progress = 0.0
+ for task in backlog.tasks_id:
+ task_hours += task.total_hours
+ effective += task.effective_hours
tot += task.planned_hours
prog += task.planned_hours * task.progress / 100.0
- res.setdefault(bl.id, 0.0)
if tot>0:
- res[bl.id] = round(prog/tot*100)
- return res
-
- def _calc_effective(self, cr, uid, ids, name, args, context=None):
- res = {}
- if context is None:
- context = {}
- for bl in self.browse(cr, uid, ids):
- res.setdefault(bl.id, 0.0)
- for task in bl.tasks_id:
- res[bl.id] += task.effective_hours
- return res
-
- def _calc_task(self, cr, uid, ids, name, args, context=None):
- res = {}
- if context is None:
- context = {}
- for bl in self.browse(cr, uid, ids):
- res.setdefault(bl.id, 0.0)
- for task in bl.tasks_id:
- res[bl.id] += task.total_hours
+ progress = round(prog/tot*100)
+ res[backlog.id] = {
+ 'progress' : progress,
+ 'effective_hours': effective,
+ 'task_hours' : task_hours
+ }
return res
def button_cancel(self, cr, uid, ids, context=None):
@@ -291,11 +263,11 @@ class project_scrum_product_backlog(osv.osv):
'sequence' : fields.integer('Sequence', help="Gives the sequence order when displaying a list of product backlog."),
'tasks_id': fields.one2many('project.task', 'product_backlog_id', 'Tasks Details'),
'state': fields.selection([('draft','Draft'),('open','Open'),('pending','Pending'),('done','Done'),('cancel','Cancelled')], 'State', required=True),
- 'progress': fields.function(_calc_progress, method=True, string='Progress', help="Computed as: Time Spent / Total Time."),
- 'effective_hours': fields.function(_calc_effective, method=True, string='Spent Hours', help="Computed using the sum of the time spent on every related tasks"),
+ 'progress': fields.function(_compute, multi="progress", group_operator="avg", type='float', method=True, string='Progress', help="Computed as: Time Spent / Total Time."),
+ 'effective_hours': fields.function(_compute, multi="effective_hours", method=True, string='Spent Hours', help="Computed using the sum of the time spent on every related tasks"),
'expected_hours': fields.float('Planned Hours', help='Estimated total time to do the Backlog'),
'create_date': fields.datetime("Creation Date", readonly=True),
- 'task_hours': fields.function(_calc_task, method=True, string='Task Hours', help='Estimated time of the total hours of the tasks')
+ 'task_hours': fields.function(_compute, multi="task_hours", method=True, string='Task Hours', help='Estimated time of the total hours of the tasks')
}
_defaults = {
'state': 'draft',
diff --git a/addons/project_scrum/wizard/project_scrum_backlog_create_task.py b/addons/project_scrum/wizard/project_scrum_backlog_create_task.py
index 92681d804a9..2b8a641622d 100644
--- a/addons/project_scrum/wizard/project_scrum_backlog_create_task.py
+++ b/addons/project_scrum/wizard/project_scrum_backlog_create_task.py
@@ -24,7 +24,7 @@ class backlog_create_task(osv.osv_memory):
_name = 'project.scrum.backlog.create.task'
_description = 'Create Tasks from Product Backlogs'
_columns = {
- 'user_id': fields.many2one('res.users', 'Assign To')
+ 'user_id': fields.many2one('res.users', 'Assign To', help="Resposible user who can work on task")
}
def do_create(self, cr, uid, ids, context=None):
diff --git a/addons/project_scrum/wizard/project_scrum_backlog_create_task_view.xml b/addons/project_scrum/wizard/project_scrum_backlog_create_task_view.xml
index cb77a7d315d..6707a7326d0 100644
--- a/addons/project_scrum/wizard/project_scrum_backlog_create_task_view.xml
+++ b/addons/project_scrum/wizard/project_scrum_backlog_create_task_view.xml
@@ -7,21 +7,22 @@
project.scrum.backlog.create.taskform
-
-
-
-
+
+
+
-
-
-
+
+
+
+
+
- Create Tasks
+ Convert into Tasksir.actions.act_windowproject.scrum.backlog.create.taskform
@@ -32,7 +33,7 @@
- Create Tasks
+ Convert into Tasksclient_action_multiaction
diff --git a/addons/project_scrum/wizard/project_scrum_backlog_sprint.py b/addons/project_scrum/wizard/project_scrum_backlog_sprint.py
index 640bdfd4a65..52704fe1097 100644
--- a/addons/project_scrum/wizard/project_scrum_backlog_sprint.py
+++ b/addons/project_scrum/wizard/project_scrum_backlog_sprint.py
@@ -25,8 +25,8 @@ class backlog_sprint_assign(osv.osv_memory):
_name = 'project.scrum.backlog.assign.sprint'
_description = 'Assign sprint to backlogs'
_columns = {
- 'sprint_id': fields.many2one('project.scrum.sprint', 'Sprint Name', required=True),
- 'state_open': fields.boolean('Set Open', help="Change the state of product backlogs to open if its in draft state"),
+ 'sprint_id': fields.many2one('project.scrum.sprint', 'Sprint', required=True, help="Select Sprint to assign backlog."),
+ 'state_open': fields.boolean('Open Backlog', help="Change the state of product backlogs to open if its in draft state"),
'convert_to_task': fields.boolean('Convert To Task', help="Create Task for Product Backlog")
}
_defaults = {
diff --git a/addons/project_scrum/wizard/project_scrum_backlog_sprint_view.xml b/addons/project_scrum/wizard/project_scrum_backlog_sprint_view.xml
index d44886eb986..b6c5ea30b42 100644
--- a/addons/project_scrum/wizard/project_scrum_backlog_sprint_view.xml
+++ b/addons/project_scrum/wizard/project_scrum_backlog_sprint_view.xml
@@ -8,20 +8,16 @@
form