From ae95cab5332fe3730381329bf31d0baf668cd721 Mon Sep 17 00:00:00 2001 From: Vijaykumar Baladaniya Date: Tue, 23 Oct 2012 10:57:15 +0530 Subject: [PATCH 01/26] [FIX] point_of_sale: Add a context on launch_payment() method. bzr revid: vba@tinyerp.com-20121023052715-78d4sykmrrpzult0 --- addons/point_of_sale/wizard/pos_payment.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py index ca9331012b7..6dd02179f30 100644 --- a/addons/point_of_sale/wizard/pos_payment.py +++ b/addons/point_of_sale/wizard/pos_payment.py @@ -85,6 +85,7 @@ class pos_make_payment(osv.osv_memory): 'target': 'new', 'views': False, 'type': 'ir.actions.act_window', + 'context': context, } def print_report(self, cr, uid, ids, context=None): From 603a3030591988a6825bb263759756b15d99d5cd Mon Sep 17 00:00:00 2001 From: "Khushboo Bhatt (Open ERP)" Date: Tue, 23 Oct 2012 14:54:57 +0530 Subject: [PATCH 02/26] [IMP]bom_lines=False added in duplicating BOM bzr revid: kbh@tinyerp.com-20121023092457-o6d2ubyb7mzslwtp --- addons/mrp/mrp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 3ae27bf2c41..fb3ad899c88 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -371,7 +371,7 @@ class mrp_bom(osv.osv): if default is None: default = {} bom_data = self.read(cr, uid, id, [], context=context) - default.update(name=_("%s (copy)") % (bom_data['name']), bom_id=False) + default.update(name=_("%s (copy)") % (bom_data['name']), bom_id=False, bom_lines=False) return super(mrp_bom, self).copy_data(cr, uid, id, default, context=context) def create(self, cr, uid, vals, context=None): From c8f0bfc68cdf4b0c6d1d3036e373c6de0b496474 Mon Sep 17 00:00:00 2001 From: "Khushboo Bhatt (Open ERP)" Date: Tue, 23 Oct 2012 15:57:34 +0530 Subject: [PATCH 03/26] [REM]remove suffix copy from duplicating BOM bzr revid: kbh@tinyerp.com-20121023102734-1d0upye19ps64be1 --- addons/mrp/mrp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index fb3ad899c88..f760087d872 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -371,7 +371,7 @@ class mrp_bom(osv.osv): if default is None: default = {} bom_data = self.read(cr, uid, id, [], context=context) - default.update(name=_("%s (copy)") % (bom_data['name']), bom_id=False, bom_lines=False) + default.update(name=_("%s") % (bom_data['name']), bom_id=False) return super(mrp_bom, self).copy_data(cr, uid, id, default, context=context) def create(self, cr, uid, vals, context=None): From 3bde64f49c3c5d04b92cdf3cb0d0b67da9655149 Mon Sep 17 00:00:00 2001 From: "Khushboo Bhatt (Open ERP)" Date: Tue, 23 Oct 2012 17:44:07 +0530 Subject: [PATCH 04/26] [IMP]hr_expense:fields are readonly when expense is apporved bzr revid: kbh@tinyerp.com-20121023121407-6qarpm3ppdmgm8cu --- addons/hr_expense/hr_expense.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index 487e4f58782..ee79e03fa77 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -64,22 +64,22 @@ class hr_expense_expense(osv.osv): _description = "Expense" _order = "id desc" _columns = { - 'name': fields.char('Description', size=128, required=True), + 'name': fields.char('Description', size=128, required=True, readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}), 'id': fields.integer('Sheet ID', readonly=True), - 'date': fields.date('Date', select=True), + 'date': fields.date('Date', select=True, readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}), 'journal_id': fields.many2one('account.journal', 'Force Journal', help = "The journal used when the expense is done."), - 'employee_id': fields.many2one('hr.employee', "Employee", required=True), + 'employee_id': fields.many2one('hr.employee', "Employee", required=True, readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}), 'user_id': fields.many2one('res.users', 'User', required=True), 'date_confirm': fields.date('Confirmation Date', select=True, help = "Date of the confirmation of the sheet expense. It's filled when the button Confirm is pressed."), 'date_valid': fields.date('Validation Date', select=True, help = "Date of the acceptation of the sheet expense. It's filled when the button Accept is pressed."), - 'user_valid': fields.many2one('res.users', 'Validation User'), + 'user_valid': fields.many2one('res.users', 'Validation User', readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}), 'account_move_id': fields.many2one('account.move', 'Ledger Posting'), '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, string='Total Amount', digits_compute= dp.get_precision('Account')), 'voucher_id': fields.many2one('account.voucher', "Employee's Receipt"), - 'currency_id': fields.many2one('res.currency', 'Currency', required=True), - 'department_id':fields.many2one('hr.department','Department'), + 'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}), + 'department_id':fields.many2one('hr.department','Department', readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}), 'company_id': fields.many2one('res.company', 'Company', required=True), 'state': fields.selection([ ('draft', 'New'), From d4f970ff9ccb21d6e31982e70f8d41f9075b6cbd Mon Sep 17 00:00:00 2001 From: "Khushboo Bhatt (Open ERP)" Date: Tue, 23 Oct 2012 18:09:10 +0530 Subject: [PATCH 05/26] [IMP]hr_expense:delete only those expense which are in draft states bzr revid: kbh@tinyerp.com-20121023123910-v1sd0wtgis9cn0w6 --- addons/hr_expense/hr_expense.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index ee79e03fa77..06852e08e96 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -100,6 +100,12 @@ class hr_expense_expense(osv.osv): 'currency_id': _get_currency, } + def unlink(self, cr, uid, ids, context=None): + for rec in self.browse(cr, uid, ids, context=context): + if rec.state != 'draft': + raise osv.except_osv(_('Warning!'),_('You cannot delete an expense which is in %s state!')%(rec.state)) + return super(hr_expense_expense, self).unlink(cr, uid, ids, context) + def onchange_currency_id(self, cr, uid, ids, currency_id=False, company_id=False, context=None): res = {'value': {'journal_id': False}} journal_ids = self.pool.get('account.journal').search(cr, uid, [('type','=','purchase'), ('currency','=',currency_id), ('company_id', '=', company_id)], context=context) From 5a460a63fa961aab3d1f750481d04438d4414651 Mon Sep 17 00:00:00 2001 From: "Rucha (Open ERP)" Date: Thu, 25 Oct 2012 11:58:13 +0530 Subject: [PATCH 06/26] [FIX]: crm: Fixed problem of adding category by automated actions bzr revid: rpa@tinyerp.com-20121025062813-mfckkg0cc0ehsasu --- addons/crm/crm_action_rule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py index 910a1fca169..4a8ee98fbae 100644 --- a/addons/crm/crm_action_rule.py +++ b/addons/crm/crm_action_rule.py @@ -79,7 +79,7 @@ class base_action_rule(osv.osv): write['section_id'] = action.act_section_id.id if hasattr(action, 'act_categ_id') and action.act_categ_id: - write['categ_ids'] = [4, action.act_categ_id.id] + write['categ_ids'] = [(4, action.act_categ_id.id)] model_obj.write(cr, uid, [obj.id], write, context) return res From e2a021bdc016d8305bcc6a44034732feed3be994 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 31 Oct 2012 16:21:22 +0530 Subject: [PATCH 07/26] [FIX]account : fix the task problem for context bzr revid: mma@tinyerp.com-20121031105122-jmrpm5at8t3iqs7s --- addons/account/account_analytic_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py index f0a420f7496..066f8d1abec 100644 --- a/addons/account/account_analytic_line.py +++ b/addons/account/account_analytic_line.py @@ -107,7 +107,7 @@ class account_analytic_line(osv.osv): if journal_id: journal = analytic_journal_obj.browse(cr, uid, journal_id, context=context) if journal.type == 'sale': - product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','list_price')], context) + product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','list_price')], context=context) if product_price_type_ids: pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context=context)[0] # Take the company currency as the reference one From 74885bf20eceb5ed7e06c1bb9587cc63b16adc3e Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 31 Oct 2012 16:32:19 +0530 Subject: [PATCH 08/26] [FIX]l10_fr : change the worng account type and internal type in demo data bzr revid: mma@tinyerp.com-20121031110219-ocarfvdbl4lhlpi2 --- addons/l10n_fr/fr_tax.xml | 4 ++-- addons/l10n_fr/plan_comptable_general.xml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/l10n_fr/fr_tax.xml b/addons/l10n_fr/fr_tax.xml index fc5d4608f45..36c5feb47b6 100644 --- a/addons/l10n_fr/fr_tax.xml +++ b/addons/l10n_fr/fr_tax.xml @@ -131,8 +131,8 @@ - - + + diff --git a/addons/l10n_fr/plan_comptable_general.xml b/addons/l10n_fr/plan_comptable_general.xml index 525dabfcc8a..268f4bd6336 100644 --- a/addons/l10n_fr/plan_comptable_general.xml +++ b/addons/l10n_fr/plan_comptable_general.xml @@ -3903,7 +3903,7 @@ Associés - Comptes courants 455 view - + Pour frais avancés personnellement @@ -3912,8 +3912,8 @@ Principal 4551 - receivable - + payable + @@ -3921,8 +3921,8 @@ Intérêts courus 4558 - receivable - + payable + From c8c8c68cfe8d090efca1a11706a2a794af8dae54 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 31 Oct 2012 17:06:46 +0530 Subject: [PATCH 09/26] [FIX]account : removed ref of view mode as calender in act_window bzr revid: mma@tinyerp.com-20121031113646-2xhfdb52cjvb0mge --- addons/account/partner_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml index 4bee2002ffd..589c8bd376a 100644 --- a/addons/account/partner_view.xml +++ b/addons/account/partner_view.xml @@ -114,7 +114,7 @@ context="{'search_default_partner_id':[active_id], 'default_partner_id': active_id}" src_model="res.partner" view_type="form" - view_mode="tree,form,calendar"/> + view_mode="tree,form"/> From 15035d86bbcbc6702cd369c2773a31010fc145cf Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 31 Oct 2012 17:53:04 +0530 Subject: [PATCH 10/26] [FIX] document_ftp : when connecting using FTP client FileZilla and clicking on database named directory after logged in, it gives Invalid database path error bzr revid: mma@tinyerp.com-20121031122304-6ss91ml1ncnmah1f --- addons/document_ftp/ftpserver/abstracted_fs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/document_ftp/ftpserver/abstracted_fs.py b/addons/document_ftp/ftpserver/abstracted_fs.py index dbda715f614..4665de89370 100644 --- a/addons/document_ftp/ftpserver/abstracted_fs.py +++ b/addons/document_ftp/ftpserver/abstracted_fs.py @@ -272,7 +272,7 @@ class abstracted_fs(object): if path.startswith('/'): path = path[1:] - p_parts = path.split('/') # hard-code the unix sep here, by spec. + p_parts = path.split(os.sep) # hard-code the unix sep here, by spec. assert '..' not in p_parts From d21053e79b8db1ca43185edba7a980243f2b9ba2 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 31 Oct 2012 18:13:04 +0530 Subject: [PATCH 11/26] [FIX]document_ftp : remove comment bzr revid: mma@tinyerp.com-20121031124304-awyhksp0bxxqlvx7 --- addons/document_ftp/ftpserver/abstracted_fs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/document_ftp/ftpserver/abstracted_fs.py b/addons/document_ftp/ftpserver/abstracted_fs.py index 4665de89370..326c62f7a92 100644 --- a/addons/document_ftp/ftpserver/abstracted_fs.py +++ b/addons/document_ftp/ftpserver/abstracted_fs.py @@ -272,7 +272,7 @@ class abstracted_fs(object): if path.startswith('/'): path = path[1:] - p_parts = path.split(os.sep) # hard-code the unix sep here, by spec. + p_parts = path.split(os.sep) assert '..' not in p_parts From 91e4e5ac16d26a1a2cc3258c906e650d7511c941 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 31 Oct 2012 18:19:47 +0530 Subject: [PATCH 12/26] [FIX]account_budget : list view containing all budget lines are opened instead of only the ones related to the current account bzr revid: mma@tinyerp.com-20121031124947-aza2ikbwdivqwuf3 --- addons/account_budget/account_budget_view.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/addons/account_budget/account_budget_view.xml b/addons/account_budget/account_budget_view.xml index fdc358f5c98..4afe7fd90e3 100644 --- a/addons/account_budget/account_budget_view.xml +++ b/addons/account_budget/account_budget_view.xml @@ -220,7 +220,18 @@ - + + + account.budget.line.search + crossovered.budget.lines + search + + + + + + + crossovered.budget.line.tree crossovered.budget.lines From f4463db761a2c6622d210c4f79c82f5f98028e9c Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Thu, 1 Nov 2012 16:09:34 +0530 Subject: [PATCH 13/26] [FIX]stock : fix the problem picking is move in available state bzr revid: mma@tinyerp.com-20121101103934-wgs3o9pjt3b2y793 --- addons/stock/stock.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index dffe1d69cc1..e735c1e02ec 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2433,14 +2433,17 @@ class stock_move(osv.osv): if move.picking_id: picking_ids.append(move.picking_id.id) if move.move_dest_id.id and (move.state != 'done'): - self.write(cr, uid, [move.id], {'move_history_ids': [(4, move.move_dest_id.id)]}) - #cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)', (move.id, move.move_dest_id.id)) - if move.move_dest_id.state in ('waiting', 'confirmed'): - self.force_assign(cr, uid, [move.move_dest_id.id], context=context) - if move.move_dest_id.picking_id: - wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr) - if move.move_dest_id.auto_validate: - self.action_done(cr, uid, [move.move_dest_id.id], context=context) + # Downstream move should only be triggered if this move is the last pending upstream move + other_upstream_move_ids = self.search(cr, uid, [('id','!=',move.id),('state','not in',['done','cancel']), + ('move_dest_id','=',move.move_dest_id.id)], context=context) + if not other_upstream_move_ids: + self.write(cr, uid, [move.id], {'move_history_ids': [(4, move.move_dest_id.id)]}) + if move.move_dest_id.state in ('waiting', 'confirmed'): + self.force_assign(cr, uid, [move.move_dest_id.id], context=context) + if move.move_dest_id.picking_id: + wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr) + if move.move_dest_id.auto_validate: + self.action_done(cr, uid, [move.move_dest_id.id], context=context) self._create_product_valuation_moves(cr, uid, move, context=context) if move.state not in ('confirmed','done','assigned'): From eca2ee0fe276856b96b61a2f97efdc4d81be7b0f Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Thu, 1 Nov 2012 18:45:42 +0530 Subject: [PATCH 14/26] [FIX]account:fixed the issue of traceback instead of constraint while selecting account of view type during journal entry creation bzr revid: ssu@tinyerp.com-20121101131542-3mit3a2qok17q7uz --- addons/account/account_move_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 67a55d8f451..4f38b7dfe3d 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -582,7 +582,7 @@ class account_move_line(osv.osv): lines = self.browse(cr, uid, ids, context=context) for l in lines: if l.account_id.type == 'view': - raise osv.except_osv(_('Error!'), _('You cannot create journal items on “View” type account %s %s.') % (l.account_id.code, l.account_id.name)) + return False return True def _check_no_closed(self, cr, uid, ids, context=None): From eb4b42e85f77dda3790774852fd9876ea296b668 Mon Sep 17 00:00:00 2001 From: "Somesh Khare(OpenERP)" <> Date: Thu, 1 Nov 2012 19:00:24 +0530 Subject: [PATCH 15/26] [FIX]project: Error when no date given in the selected project in Scheduling Task Wizard and Press Compute button bzr revid: mma@tinyerp.com-20121101133024-cvg0lixafru3arjm --- addons/project/project.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/project/project.py b/addons/project/project.py index 3b0057c67b7..f097f541cc6 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -429,6 +429,8 @@ def Project(): return result def _schedule_project(self, cr, uid, project, context=None): + if not project.date_start: + raise osv.except_osv(_('Warning !'),_("You must assign Start Date on the Project '%s' !") % (project.name,)) resource_pool = self.pool.get('resource.resource') calendar_id = project.resource_calendar_id and project.resource_calendar_id.id or False working_days = resource_pool.compute_working_calendar(cr, uid, calendar_id, context=context) From 803bd10eb95e4d5e8ab20e5eb4fe0ab4d6cee72e Mon Sep 17 00:00:00 2001 From: "Somesh Khare(OpenERP)" <> Date: Fri, 2 Nov 2012 10:45:16 +0530 Subject: [PATCH 16/26] [FIX]base_iban: invalid literal Error when trying to save the Bank Accounts details without Account Number and BIC code bzr revid: mma@tinyerp.com-20121102051516-99b3vc97xxhcqn30 --- addons/base_iban/base_iban.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/base_iban/base_iban.py b/addons/base_iban/base_iban.py index c29647a1176..ff492a8d34b 100644 --- a/addons/base_iban/base_iban.py +++ b/addons/base_iban/base_iban.py @@ -99,6 +99,8 @@ class res_partner_bank(osv.osv): @param iban: IBAN as string @return: True if IBAN is valid, False otherwise """ + if not iban: + return False iban = _format_iban(iban).lower() if iban[:2] in _ref_iban and len(iban) != len(_format_iban(_ref_iban[iban[:2]])): return False @@ -128,9 +130,9 @@ class res_partner_bank(osv.osv): def _construct_constraint_msg(self, cr, uid, ids, context=None): def default_iban_check(iban_cn): - return iban_cn[0] in string.ascii_lowercase and iban_cn[1] in string.ascii_lowercase + return iban_cn and iban_cn[0] in string.ascii_lowercase and iban_cn[1] in string.ascii_lowercase - iban_country = self.browse(cr, uid, ids)[0].acc_number[:2].lower() + iban_country = self.browse(cr, uid, ids)[0].acc_number and self.browse(cr, uid, ids)[0].acc_number[:2].lower() if default_iban_check(iban_country): if iban_country in _ref_iban: return _('The IBAN does not seem to be correct. You should have entered something like this %s'), \ From 5cde51e636af826bad7b58bd2134e150632c2c66 Mon Sep 17 00:00:00 2001 From: "Khushboo Bhatt (Open ERP)" Date: Fri, 2 Nov 2012 11:41:26 +0530 Subject: [PATCH 17/26] [IMP]hr_payroll:added unlink method for deleteing draft and cancel payslip. bzr revid: kbh@tinyerp.com-20121102061126-uzkprztc5aoo0hjf --- addons/hr_payroll/hr_payroll.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index d1f38ad4a0f..e8c1d71922f 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -363,6 +363,12 @@ class hr_payslip(osv.osv): def check_done(self, cr, uid, ids, context=None): return True + def unlink(self, cr, uid, ids, context=None): + for payslip in self.browse(cr, uid, ids, context=context): + if payslip.state not in ['draft','cancel']: + raise osv.except_osv(_('Warning!'),_('You cannot delete a payslip which is in %s state!')%(payslip.state)) + return super(hr_payslip, self).unlink(cr, uid, ids, context) + #TODO move this function into hr_contract module, on hr.employee object def get_contract(self, cr, uid, employee, date_from, date_to, context=None): """ From 459270ebfffc615f82490a8878fda53cc03506e1 Mon Sep 17 00:00:00 2001 From: jacara <> Date: Fri, 2 Nov 2012 12:55:00 +0530 Subject: [PATCH 18/26] [FIX]account_asset:Fixes the expresion problem in lp bug: https://launchpad.net/bugs/1074228 fixed bzr revid: kbh@tinyerp.com-20121102072500-ylzaw1i75a13kimh --- addons/account_asset/account_asset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index 585798a5235..aed25285ea8 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -376,7 +376,7 @@ class account_asset_depreciation_line(osv.osv): current_currency = line.asset_id.currency_id.id context.update({'date': depreciation_date}) amount = currency_obj.compute(cr, uid, current_currency, company_currency, line.amount, context=context) - sign = line.asset_id.category_id.journal_id.type = 'purchase' and 1 or -1 + sign == (line.asset_id.category_id.journal_id.type == 'purchase' and 1) or -1 asset_name = line.asset_id.name reference = line.name move_vals = { From e519b2b9dc956c1a076714eca038a50e58d15549 Mon Sep 17 00:00:00 2001 From: "Somesh Khare(OpenERP)" <> Date: Fri, 2 Nov 2012 14:10:04 +0530 Subject: [PATCH 19/26] [FIX]product: when you search the product the limit into the name_search() goes None bzr revid: mma@tinyerp.com-20121102084004-af7m8wlov3w627ei --- addons/product/product.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index 6c6c5f2650c..99c36611e9c 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -657,9 +657,9 @@ class product_product(osv.osv): # Performing a quick memory merge of ids in Python will give much better performance ids = set() ids.update(self.search(cr, user, args + [('default_code',operator,name)], limit=limit, context=context)) - if len(ids) < limit: + if not limit or len(ids) < limit: # we may underrun the limit because of dupes in the results, that's fine - ids.update(self.search(cr, user, args + [('name',operator,name)], limit=(limit-len(ids)), context=context)) + ids.update(self.search(cr, user, args + [('name',operator,name)], limit=(limit-len(ids) if limit else limit) , context=context)) ids = list(ids) if not ids: ptrn = re.compile('(\[(.*?)\])') From e9942561c0530faddfbc06b01d08b2e10fcdd4c7 Mon Sep 17 00:00:00 2001 From: "Khushboo Bhatt (Open ERP)" Date: Fri, 2 Nov 2012 14:44:45 +0530 Subject: [PATCH 20/26] [FIX]account_asset:Fixes the expresion problem in asset bzr revid: kbh@tinyerp.com-20121102091445-xgsn8kvsu3glom1d --- addons/account_asset/account_asset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index aed25285ea8..6442723c6fc 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -376,7 +376,7 @@ class account_asset_depreciation_line(osv.osv): current_currency = line.asset_id.currency_id.id context.update({'date': depreciation_date}) amount = currency_obj.compute(cr, uid, current_currency, company_currency, line.amount, context=context) - sign == (line.asset_id.category_id.journal_id.type == 'purchase' and 1) or -1 + sign = (line.asset_id.category_id.journal_id.type == 'purchase' and 1) or -1 asset_name = line.asset_id.name reference = line.name move_vals = { From 907c98376018401ae1e58f0dbe6ae5c9f22284df Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Fri, 2 Nov 2012 18:33:17 +0530 Subject: [PATCH 21/26] [FIX]sale: Update context as it was none in method and was not able to translate raised exception bzr revid: mma@tinyerp.com-20121102130317-kmuxgk7vjdneq0da --- addons/sale/sale.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index da662acd768..180974adcc1 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -265,6 +265,9 @@ class sale_order(osv.osv): return osv.osv.unlink(self, cr, uid, unlink_ids, context=context) def onchange_pricelist_id(self, cr, uid, ids, pricelist_id, order_lines, context=None): + if context is None: + context = {} + context.update({'lang': self.pool.get('res.users').context_get(cr, uid, context)['lang']}) if not pricelist_id: return {} value = { @@ -601,6 +604,9 @@ class sale_order(osv.osv): } def action_wait(self, cr, uid, ids, context=None): + if context is None: + context = {} + context.update({'lang': self.pool.get('res.users').context_get(cr, uid, context)['lang']}) for o in self.browse(cr, uid, ids): if not o.order_line: raise osv.except_osv(_('Error!'),_('You cannot confirm a sale order which has no line.')) From b855f0bdd81e41c1596072e0e8061b3248b8121c Mon Sep 17 00:00:00 2001 From: Dhruti Shastri <> Date: Mon, 5 Nov 2012 11:45:18 +0530 Subject: [PATCH 22/26] [FIX]l10_be : Wizard thorws error instead of User Friendly Warning bzr revid: mma@tinyerp.com-20121105061518-9zixa8lr22z7v9j5 --- addons/l10n_be/wizard/l10n_be_partner_vat_listing.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py index d15b300597e..5234dadf479 100644 --- a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py +++ b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py @@ -65,6 +65,8 @@ class partner_vat(osv.osv_memory): partners = [] partner_ids = obj_partner.search(cr, uid, [('vat_subjected', '!=', False), ('vat','ilike','BE%')], context=context) + if not partner_ids: + raise osv.except_osv(_('Missing Partner Configuration'),_('Could not find VAT and Legal Statement Validation')) cr.execute("""SELECT sub1.partner_id, sub1.name, sub1.vat, sub1.turnover, sub2.vat_amount FROM (SELECT l.partner_id, p.name, p.vat, SUM(CASE WHEN c.code ='49' THEN -l.tax_amount ELSE l.tax_amount END) as turnover FROM account_move_line l @@ -190,7 +192,7 @@ class partner_vat_list(osv.osv_memory): addr = obj_partner.address_get(cr, uid, [obj_cmpny.partner_id.id], ['invoice']) if addr.get('invoice',False): ads = obj_partner.browse(cr, uid, [addr['invoice']], context=context)[0] - phone = ads.phone.replace(' ','') or '' + phone = ads.phone.replace(' ','') if ads.phone else '' email = ads.email or '' name = ads.name or '' city = ads.city or '' @@ -259,6 +261,8 @@ class partner_vat_list(osv.osv_memory): # Turnover and Farmer tags are not included client_datas = self._get_datas(cr, uid, ids, context=context) + if not client_datas: + raise osv.except_osv(_('Data Insufficient!'),_('No data available for the client.')) data_client_info = '' for amount_data in client_datas: data_client_info += """ @@ -309,6 +313,8 @@ class partner_vat_list(osv.osv_memory): datas['year'] = context['year'] datas['limit_amount'] = context['limit_amount'] datas['client_datas'] = self._get_datas(cr, uid, ids, context=context) + if not datas['client_datas']: + raise osv.except_osv(_('Error !'),_('No record to print.')) return { 'type': 'ir.actions.report.xml', 'report_name': 'partner.vat.listing.print', From 9a6e7799feac185e3273b45ad76b73b8b669cd35 Mon Sep 17 00:00:00 2001 From: "Nehal Panchal (OpenERP)" <> Date: Mon, 5 Nov 2012 11:58:07 +0530 Subject: [PATCH 23/26] [FIX]hr_payroll : Fixed Salary Rules Python Code and Quantity for payslip computation bzr revid: mma@tinyerp.com-20121105062807-byz6d0kd7scxq3r3 --- addons/hr_payroll/hr_payroll_demo.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_payroll/hr_payroll_demo.xml b/addons/hr_payroll/hr_payroll_demo.xml index 836814860c1..6fb30f1fb04 100644 --- a/addons/hr_payroll/hr_payroll_demo.xml +++ b/addons/hr_payroll/hr_payroll_demo.xml @@ -75,7 +75,7 @@ fix - worked_days.WORK100.number_of_days + worked_days.WORK100 and worked_days.WORK100.number_of_days MA @@ -89,7 +89,7 @@ Get 1% of sales - result = (inputs.SALEURO.amount + inputs.SALASIA.amount) * 0.01 + result = ((inputs.SALEURO and inputs.SALEURO.amount) + (inputs.SALASIA and inputs.SALASIA.amount)) * 0.01 From 3518a4f2dcdb111440c9e9dc6231b71f8ae72983 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Mon, 5 Nov 2012 15:44:07 +0530 Subject: [PATCH 24/26] [IMP]10_be : improved code bzr revid: mma@tinyerp.com-20121105101407-fsxjwisg9ajgim07 --- addons/l10n_be/wizard/l10n_be_partner_vat_listing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py index 5234dadf479..6d82541345f 100644 --- a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py +++ b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py @@ -66,7 +66,7 @@ class partner_vat(osv.osv_memory): partners = [] partner_ids = obj_partner.search(cr, uid, [('vat_subjected', '!=', False), ('vat','ilike','BE%')], context=context) if not partner_ids: - raise osv.except_osv(_('Missing Partner Configuration'),_('Could not find VAT and Legal Statement Validation')) + raise osv.except_osv(_('Missing Partner Configuration'),_('Could not find VAT and Legal Statement Validation'.)) cr.execute("""SELECT sub1.partner_id, sub1.name, sub1.vat, sub1.turnover, sub2.vat_amount FROM (SELECT l.partner_id, p.name, p.vat, SUM(CASE WHEN c.code ='49' THEN -l.tax_amount ELSE l.tax_amount END) as turnover FROM account_move_line l @@ -314,7 +314,7 @@ class partner_vat_list(osv.osv_memory): datas['limit_amount'] = context['limit_amount'] datas['client_datas'] = self._get_datas(cr, uid, ids, context=context) if not datas['client_datas']: - raise osv.except_osv(_('Error !'),_('No record to print.')) + raise osv.except_osv(_('Error!'),_('No record to print.')) return { 'type': 'ir.actions.report.xml', 'report_name': 'partner.vat.listing.print', From 81560c12fada241014b713dc83f29c9d3be75b36 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Mon, 5 Nov 2012 15:49:00 +0530 Subject: [PATCH 25/26] [FIX]hr_payroll : improved some code bzr revid: mma@tinyerp.com-20121105101900-bg5pjmsc5pt957pl --- addons/hr_payroll/hr_payroll_demo.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_payroll/hr_payroll_demo.xml b/addons/hr_payroll/hr_payroll_demo.xml index 6fb30f1fb04..a22809b00e3 100644 --- a/addons/hr_payroll/hr_payroll_demo.xml +++ b/addons/hr_payroll/hr_payroll_demo.xml @@ -75,7 +75,7 @@ fix - worked_days.WORK100 and worked_days.WORK100.number_of_days + worked_days.WORK100 and worked_days.WORK100.number_of_days MA From ce2d38922e409da2bc1e81b08e792a2c6e5b6db7 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Mon, 5 Nov 2012 15:51:02 +0530 Subject: [PATCH 26/26] [FIX]l10_be : imp little bit bzr revid: mma@tinyerp.com-20121105102102-sxbu9q584bp7gyfy --- addons/l10n_be/wizard/l10n_be_partner_vat_listing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py index 6d82541345f..4f5863d76b2 100644 --- a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py +++ b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py @@ -66,7 +66,7 @@ class partner_vat(osv.osv_memory): partners = [] partner_ids = obj_partner.search(cr, uid, [('vat_subjected', '!=', False), ('vat','ilike','BE%')], context=context) if not partner_ids: - raise osv.except_osv(_('Missing Partner Configuration'),_('Could not find VAT and Legal Statement Validation'.)) + raise osv.except_osv(_('Missing Partner Configuration'),_('Could not find VAT and Legal Statement Validation.')) cr.execute("""SELECT sub1.partner_id, sub1.name, sub1.vat, sub1.turnover, sub2.vat_amount FROM (SELECT l.partner_id, p.name, p.vat, SUM(CASE WHEN c.code ='49' THEN -l.tax_amount ELSE l.tax_amount END) as turnover FROM account_move_line l