From 65bdf83d0a56ecdd606c7b8b615b0af5eed19df0 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 9 Mar 2009 10:20:57 +0530 Subject: [PATCH 1/3] [FIX] Bug 338678 : Corrected fiscalyear closing wizard bzr revid: jvo@tinyerp.com-20090309045057-8qh60i6iy7dspgrq --- addons/account/account_move_line.py | 2 +- addons/account/wizard/wizard_fiscalyear_close.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 0dacc365fcc..084185a6462 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -531,6 +531,7 @@ class account_move_line(osv.osv): def reconcile(self, cr, uid, ids, type='auto', writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False, context={}): id_set = ','.join(map(str, ids)) + lines = self.browse(cr, uid, ids, context=context) unrec_lines = filter(lambda x: not x['reconcile_id'], lines) credit = debit = 0.0 @@ -707,7 +708,6 @@ class account_move_line(osv.osv): return result def unlink(self, cr, uid, ids, context={}, check=True): - print "CC" self._update_check(cr, uid, ids, context) result = False for line in self.browse(cr, uid, ids, context): diff --git a/addons/account/wizard/wizard_fiscalyear_close.py b/addons/account/wizard/wizard_fiscalyear_close.py index feba99a4ccb..7cd560e7b44 100644 --- a/addons/account/wizard/wizard_fiscalyear_close.py +++ b/addons/account/wizard/wizard_fiscalyear_close.py @@ -63,7 +63,8 @@ def _data_save(self, cr, uid, data, context): period = pool.get('account.period').browse(cr, uid, data['form']['period_id'], context=context) new_fyear = pool.get('account.fiscalyear').browse(cr, uid, data['form']['fy2_id'], context=context) - + old_fyear = pool.get('account.fiscalyear').browse(cr, uid, data['form']['fy_id'], context=context) + new_journal = data['form']['journal_id'] new_journal = pool.get('account.journal').browse(cr, uid, new_journal, context=context) @@ -192,8 +193,12 @@ def _data_save(self, cr, uid, data, context): offset += limit ids = pool.get('account.move.line').search(cr, uid, [('journal_id','=',new_journal.id), - ('period_id.fiscalyear_id','=',new_fyear.id)]) + ('period_id.fiscalyear_id','=',old_fyear.id)]) context['fy_closing'] = True + if not ids: + raise wizard.except_wizard(_('UserError'), + _('The old fiscal year does not have any entry to reconcile!')) + pool.get('account.move.line').reconcile(cr, uid, ids, context=context) new_period = data['form']['period_id'] ids = pool.get('account.journal.period').search(cr, uid, [('journal_id','=',new_journal.id),('period_id','=',new_period)]) From 55d142f3259c4a8d9b801326716ec2d577d6a00a Mon Sep 17 00:00:00 2001 From: husen daudi Date: Mon, 9 Mar 2009 12:35:47 +0530 Subject: [PATCH 2/3] bugfix ref(npa) lp bug: https://launchpad.net/bugs/337747 fixed bzr revid: hda@hda-20090309070547-xwl3vw35f4atg5np --- addons/hr_expense/hr_expense.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index e7129cf00d5..93d268cb827 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -65,7 +65,7 @@ class hr_expense_expense(osv.osv): 'date_valid': fields.date('Date Valided'), 'user_valid': fields.many2one('res.users', 'Validation User'), 'account_move_id': fields.many2one('account.move', 'Account Move'), - 'line_ids': fields.one2many('hr.expense.line', 'expense_id', 'Expense Lines'), + 'line_ids': fields.one2many('hr.expense.line', 'expense_id', 'Expense Lines', readonly=True, states={'draft':[('readonly',False)]} ), 'note': fields.text('Note'), 'amount': fields.function(_amount, method=True, string='Total Amount'), 'invoice_id': fields.many2one('account.invoice', 'Invoice'), @@ -186,10 +186,10 @@ class hr_expense_line(osv.osv): 'date_value': fields.date('Date', required=True), 'expense_id': fields.many2one('hr.expense.expense', 'Expense', ondelete='cascade', select=True), 'total_amount': fields.function(_amount, method=True, string='Total'), - 'unit_amount': fields.float('Unit Price', readonly=True, states={'draft':[('readonly',False)]}), - 'unit_quantity': fields.float('Quantities', readonly=True, states={'draft':[('readonly',False)]}), - 'product_id': fields.many2one('product.product', 'Product', readonly=True, states={'draft':[('readonly',False)]}), - 'uom_id': fields.many2one('product.uom', 'UoM', readonly=True, states={'draft':[('readonly',False)]}), + 'unit_amount': fields.float('Unit Price'), + 'unit_quantity': fields.float('Quantities' ), + 'product_id': fields.many2one('product.product', 'Product' ), + 'uom_id': fields.many2one('product.uom', 'UoM' ), 'description': fields.text('Description'), 'analytic_account': fields.many2one('account.analytic.account','Analytic account'), 'ref': fields.char('Reference', size=32), From 281b70321a5783950c27b8f244b0d503102260f9 Mon Sep 17 00:00:00 2001 From: "Apa (Open ERP)" Date: Mon, 9 Mar 2009 12:43:23 +0530 Subject: [PATCH 3/3] revert bug 338690 bzr revid: apa@tinyerp.com-20090309071323-1rrgbk5xtgkh0ynj --- addons/crm/crm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm.py b/addons/crm/crm.py index c76e733eb00..1801ab65bbc 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -327,7 +327,7 @@ class crm_case(osv.osv): _columns = { 'id': fields.integer('ID', readonly=True), - 'name': fields.char('Description',size=64), + 'name': fields.char('Description',size=64,required=True), 'priority': fields.selection(AVAILABLE_PRIORITIES, 'Priority'), 'active': fields.boolean('Active'), 'description': fields.text('Your action'),