From 7d4e5af835536604b37819675f1eef12f39774cd Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Wed, 20 Oct 2010 15:43:08 +0530 Subject: [PATCH 1/8] [FIX] mrp_repair: yaml corrected. bzr revid: uco@tinyerp.com-20101020101308-cdjs4am5f9wgzbi8 --- addons/mrp_repair/test/test_mrp_repair.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mrp_repair/test/test_mrp_repair.yml b/addons/mrp_repair/test/test_mrp_repair.yml index 1cf82635825..3d9e85aa3ac 100644 --- a/addons/mrp_repair/test/test_mrp_repair.yml +++ b/addons/mrp_repair/test/test_mrp_repair.yml @@ -85,7 +85,7 @@ obj_lines = self.pool.get('account.invoice.line') inv_obj = self.pool.get('account.invoice') repair_id = self.browse(cr, uid, [ref('mrp_repair_rma0')], context=context)[0] - invoice_ids = inv_obj.search(cr, uid, [('partner_id', '=', repair_id.partner_invoice_id.id)]) + invoice_ids = inv_obj.search(cr, uid, [('partner_id', '=', repair_id.partner_id.id)]) invoice_id = inv_obj.browse(cr, uid, invoice_ids)[0] - assert repair_id.partner_invoice_id.id == invoice_id.partner_id.id, "No invoice existing for the same partner" + assert repair_id.partner_id.id == invoice_id.partner_id.id, "No invoice existing for the same partner" From 988d4d488b187ab3af1dd1aaf2c5bca8f3df468e Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Wed, 20 Oct 2010 19:27:35 +0530 Subject: [PATCH 2/8] [IMP] mrp, stock: Improvements suggested by buildbot. bzr revid: uco@tinyerp.com-20101020135735-hofrhxqqpvkycjje --- addons/mrp/mrp.py | 2 -- addons/stock/stock.py | 1 - 2 files changed, 3 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index cee60e63023..751cf384b6e 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -19,8 +19,6 @@ # ############################################################################## -from itertools import groupby -from operator import itemgetter from datetime import datetime from osv import osv, fields from tools.translate import _ diff --git a/addons/stock/stock.py b/addons/stock/stock.py index fe984b10f22..4f760936e11 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2008,7 +2008,6 @@ class stock_move(osv.osv): for id in ids: wf_service.trg_trigger(uid, 'stock.move', id, cr) - picking_obj = self.pool.get('stock.picking') wf_service = netsvc.LocalService("workflow") for pick_id in picking_ids: wf_service.trg_write(uid, 'stock.picking', pick_id, cr) From 8d2be57afa67e85019fe6b2219613424d0c67014 Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Thu, 21 Oct 2010 16:03:45 +0530 Subject: [PATCH 3/8] [FIX] auction: Fixed unicode character error from Report. bzr revid: uco@tinyerp.com-20101021103345-48ook5fhyr8p7ff2 --- addons/auction/report/catalog2.xsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/auction/report/catalog2.xsl b/addons/auction/report/catalog2.xsl index ea27162428d..c44d0e83047 100755 --- a/addons/auction/report/catalog2.xsl +++ b/addons/auction/report/catalog2.xsl @@ -1,5 +1,5 @@ - - + + @@ -30,7 +30,7 @@ - - Vente antiquitée le      + Antiques on sale From bbbcdbdbdbf76cfcecac5450d577ff17ab3fa18c Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Mon, 25 Oct 2010 10:51:11 +0530 Subject: [PATCH 4/8] [IMP] mrp_repair: Giving access rights to mrp manager to make invoice for repair order. bzr revid: uco@tinyerp.com-20101025052111-zja70wp086r60ooy --- addons/mrp_repair/security/ir.model.access.csv | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/mrp_repair/security/ir.model.access.csv b/addons/mrp_repair/security/ir.model.access.csv index e8b611bd933..b7f0c156fb9 100644 --- a/addons/mrp_repair/security/ir.model.access.csv +++ b/addons/mrp_repair/security/ir.model.access.csv @@ -21,4 +21,9 @@ "access_account_tax_manager","account.tax manager","account.model_account_tax","mrp.group_mrp_manager",1,0,0,0 "access_mrp_repair_fee_user_mrp","MRP Repair Fee user mrp","model_mrp_repair_fee","mrp.group_mrp_user",1,1,1,1 "access_mrp_repair_fee_mgr","MRP Repair Fee mgr","model_mrp_repair_fee","mrp.group_mrp_manager",1,0,0,0 - +"access_account_invoice_user","account.invoice","account.model_account_invoice","mrp.group_mrp_user",1,1,1,1 +"access_account_invoice_manager","account.invoice manager","account.model_account_invoice","mrp.group_mrp_manager",1,0,0,0 +"access_account_invoice_line_user","account.invoice.line","account.model_account_invoice_line","mrp.group_mrp_user",1,1,1,1 +"access_account_invoice_line_manager","account.invoice.line manager","account.model_account_invoice_line","mrp.group_mrp_manager",1,0,0,0 +"access_account_journal_user","account.journal","account.model_account_journal","mrp.group_mrp_user",1,1,1,1 +"access_account_journal_manager","account.journal manager","account.model_account_journal","mrp.group_mrp_manager",1,0,0,0 From c6df9c4b1dff3ea33cba2a233df39fd5861d2e3e Mon Sep 17 00:00:00 2001 From: Thibault Francois Date: Wed, 27 Oct 2010 12:06:05 +0200 Subject: [PATCH 5/8] [FIX] deadline_change.yml : fix date format deadline bzr revid: tfr@openerp.com-20101027100605-b6xsqvwfvvgbt3x3 --- addons/project_retro_planning/test/deadline_change.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project_retro_planning/test/deadline_change.yml b/addons/project_retro_planning/test/deadline_change.yml index 3e778916792..012bc62a4eb 100644 --- a/addons/project_retro_planning/test/deadline_change.yml +++ b/addons/project_retro_planning/test/deadline_change.yml @@ -10,7 +10,7 @@ Create task 'Plan all projects' - !record {model: project.task, id: project_task_planallprojects0}: - date_deadline: '2010-06-07' + date_deadline: '2010-06-07 12:00:00' date_end: '2010-06-04 14:00:00' date_start: '2010-06-01 17:25:32' name: Plan all projects From 8cebff4d9f0ed6a07d1942d3b7f0777c9b8192f2 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 27 Oct 2010 15:36:24 +0530 Subject: [PATCH 6/8] [FIX] stock_invoice_directly: fixed yml issue bzr revid: hmo@tinyerp.com-20101027100624-4c14kfvzrwxmp7j0 --- .../test/stock_invoice_directly.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/addons/stock_invoice_directly/test/stock_invoice_directly.yml b/addons/stock_invoice_directly/test/stock_invoice_directly.yml index 4a0708b84d9..b5ecb83caf2 100644 --- a/addons/stock_invoice_directly/test/stock_invoice_directly.yml +++ b/addons/stock_invoice_directly/test/stock_invoice_directly.yml @@ -60,16 +60,12 @@ } pick_obj.do_partial(cr, uid, [ref('stock_picking_out0')], partial_datas, context=context) - - As the Invoice state of the picking order is To be invoiced. I create a record for create invoice. -- - !record {model: stock.invoice.onshipping, id: stock_invoice_onshipping_0}: - invoice_date: '2010-08-04' - journal_id: account.bank_journal -- - I create a Customer invoice for my outgoing picking order. + As the Invoice state of the picking order is To be invoiced. I create invoice for my outgoing picking order. - !python {model: stock.invoice.onshipping}: | - self.create_invoice(cr, uid, [ref("stock_invoice_onshipping_0")], {"lang": "en_US", + wiz_id = self.create(cr, uid, {'invoice_date': '2010-08-04', 'journal_id': ref('account.bank_journal')}, + {'active_ids': [ref("stock_picking_out0")]}) + self.create_invoice(cr, uid, [wiz_id], {"lang": "en_US", "search_default_available": 1, "tz": False, "active_model": "stock.picking", "contact_display": "partner", "active_ids": [ref("stock_picking_out0")], "active_id": ref("stock_picking_out0")}) - From abc40474e03ee0f6f1a855ecd461a7561adfe579 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 27 Oct 2010 16:02:08 +0530 Subject: [PATCH 7/8] [FIX] account: fixed yml issue of account cash statement bzr revid: hmo@tinyerp.com-20101027103208-xvtzje41n2rb5kl1 --- addons/account/account_cash_statement.py | 4 ++-- addons/account/test/account_cash_statement.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py index 07767328a55..818bfef978e 100644 --- a/addons/account/account_cash_statement.py +++ b/addons/account/account_cash_statement.py @@ -328,8 +328,8 @@ class account_cash_statement(osv.osv): statement_pool = self.pool.get('account.bank.statement') for statement in statement_pool.browse(cr, uid, ids, context=context): vals = {} - - if not self._user_allow(cr, uid, statement.id, context=context): + force_allow = context.get('force_allow',False) + if not force_allow and not self._user_allow(cr, uid, statement.id, context=context): raise osv.except_osv(_('Error !'), _('User %s does not have rights to access %s journal !' % (statement.user_id.name, statement.journal_id.name))) if statement.name and statement.name == '/': diff --git a/addons/account/test/account_cash_statement.yml b/addons/account/test/account_cash_statement.yml index 03d0d54db83..67e6d4d2607 100644 --- a/addons/account/test/account_cash_statement.yml +++ b/addons/account/test/account_cash_statement.yml @@ -26,7 +26,7 @@ I clicked on Open CashBox button to open the cashbox - !python {model: account.bank.statement}: | - self.button_open(cr, uid, [ref("account_bank_statement_1")], {"lang": "en_US", "tz": False, "active_model": "account.bank.statement", "active_ids": [ref("account_bank_statement_1")], "active_id": ref("account_bank_statement_1"), }) + self.button_open(cr, uid, [ref("account_bank_statement_1")], {"force_allow":True, "lang": "en_US", "tz": False, "active_model": "account.bank.statement", "active_ids": [ref("account_bank_statement_1")], "active_id": ref("account_bank_statement_1"), }) - I check that now bank statement is in the "Open" state From a91878d868070be7f707c86de524b9283c86c61b Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 27 Oct 2010 17:07:15 +0530 Subject: [PATCH 8/8] [FIX] project: fixed yml issue bzr revid: hmo@tinyerp.com-20101027113715-b6973r91ravjljjg --- addons/project/test/test_project.yml | 10 +-- addons/project_caldav/project_caldav.py | 1 + .../test/deadline_change.yml | 2 +- addons/project_timesheet/project_timesheet.py | 68 +++++++++---------- 4 files changed, 41 insertions(+), 40 deletions(-) diff --git a/addons/project/test/test_project.yml b/addons/project/test/test_project.yml index d417debac8c..bca3bcbff41 100644 --- a/addons/project/test/test_project.yml +++ b/addons/project/test/test_project.yml @@ -134,7 +134,7 @@ - Make a work task entry 'Training on OpenERP modules, models and classes' of 10 hours - - !record {model: project.task, id: project_task_technicaltraining0}: + !record {model: project.task, id: project_task_technicaltraining0, context:{'no_analytic_entry':True}}: work_ids: - date: '2010-05-31 15:04:22' hours: 10.0 @@ -149,7 +149,7 @@ - Make a work task entry 'Training on OpenERP xml views' of 10 hours - - !record {model: project.task, id: project_task_technicaltraining0}: + !record {model: project.task, id: project_task_technicaltraining0, context:{'no_analytic_entry':True}}: work_ids: - date: '2010-06-01 15:04:46' hours: 10.0 @@ -164,7 +164,7 @@ - Make a work task entry 'Training on workflows' of 10 hours - - !record {model: project.task, id: project_task_technicaltraining0}: + !record {model: project.task, id: project_task_technicaltraining0, context:{'no_analytic_entry':True}}: work_ids: - date: '2010-06-02 15:05:24' hours: 10.0 @@ -200,7 +200,7 @@ - Make a work task entry 'Training on reports and wizards' of 10 hours - - !record {model: project.task, id: project_task_technicaltraining0}: + !record {model: project.task, id: project_task_technicaltraining0, context:{'no_analytic_entry':True}}: work_ids: - date: '2010-05-31 15:08:40' hours: 10.0 @@ -251,7 +251,7 @@ - Make a work task entry 'Training on yml' of 5 hours - - !record {model: project.task, id: project_task_technicaltraining0}: + !record {model: project.task, id: project_task_technicaltraining0, context:{'no_analytic_entry':True}}: work_ids: - date: '2010-05-31 16:55:27' hours: 5.0 diff --git a/addons/project_caldav/project_caldav.py b/addons/project_caldav/project_caldav.py index ea6c02bc2cb..fb2d62a9684 100644 --- a/addons/project_caldav/project_caldav.py +++ b/addons/project_caldav/project_caldav.py @@ -32,6 +32,7 @@ class project_task(osv.osv): # force inherit from project.project_task so that # calendar.todo.active is masked oute 'active': base_project_task._columns['active'], + 'date_deadline': base_project_task._columns['date_deadline'], 'write_date': fields.datetime('Write Date'), 'create_date': fields.datetime('Create Date', readonly=True), 'attendee_ids': fields.many2many('calendar.attendee', \ diff --git a/addons/project_retro_planning/test/deadline_change.yml b/addons/project_retro_planning/test/deadline_change.yml index 012bc62a4eb..3e778916792 100644 --- a/addons/project_retro_planning/test/deadline_change.yml +++ b/addons/project_retro_planning/test/deadline_change.yml @@ -10,7 +10,7 @@ Create task 'Plan all projects' - !record {model: project.task, id: project_task_planallprojects0}: - date_deadline: '2010-06-07 12:00:00' + date_deadline: '2010-06-07' date_end: '2010-06-04 14:00:00' date_start: '2010-06-01 17:25:32' name: Plan all projects diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index 601fbfa578b..42104fcddc1 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -80,42 +80,42 @@ class project_work(osv.osv): vals_line = {} context = kwargs.get('context', {}) + if not context.get('no_analytic_entry',False): + obj_task = task_obj.browse(cr, uid, vals['task_id']) + result = self.get_user_related_details(cr, uid, vals.get('user_id', uid)) + vals_line['name'] = '%s: %s' % (tools.ustr(obj_task.name), tools.ustr(vals['name']) or '/') + vals_line['user_id'] = vals['user_id'] + vals_line['product_id'] = result['product_id'] + vals_line['date'] = vals['date'][:10] + + #calculate quantity based on employee's product's uom + vals_line['unit_amount'] = vals['hours'] - obj_task = task_obj.browse(cr, uid, vals['task_id']) - result = self.get_user_related_details(cr, uid, vals.get('user_id', uid)) - vals_line['name'] = '%s: %s' % (tools.ustr(obj_task.name), tools.ustr(vals['name']) or '/') - vals_line['user_id'] = vals['user_id'] - vals_line['product_id'] = result['product_id'] - vals_line['date'] = vals['date'][:10] - - #calculate quantity based on employee's product's uom - vals_line['unit_amount'] = vals['hours'] + default_uom = self.pool.get('res.users').browse(cr, uid, uid).company_id.project_time_mode_id.id + if result['product_uom_id'] != default_uom: + vals_line['unit_amount'] = uom_obj._compute_qty(cr, uid, default_uom, vals['hours'], result['product_uom_id']) + acc_id = obj_task.project_id and obj_task.project_id.analytic_account_id.id or False + if acc_id: + vals_line['account_id'] = acc_id + res = obj_timesheet.on_change_account_id(cr, uid, False, acc_id) + if res.get('value'): + vals_line.update(res['value']) + vals_line['general_account_id'] = result['general_account_id'] + vals_line['journal_id'] = result['journal_id'] + vals_line['amount'] = 0.0 + vals_line['product_uom_id'] = result['product_uom_id'] + amount = vals_line['unit_amount'] + prod_id = vals_line['product_id'] + unit = False + timeline_id = obj_timesheet.create(cr, uid, vals=vals_line, context=context) - default_uom = self.pool.get('res.users').browse(cr, uid, uid).company_id.project_time_mode_id.id - if result['product_uom_id'] != default_uom: - vals_line['unit_amount'] = uom_obj._compute_qty(cr, uid, default_uom, vals['hours'], result['product_uom_id']) - acc_id = obj_task.project_id and obj_task.project_id.analytic_account_id.id or False - if acc_id: - vals_line['account_id'] = acc_id - res = obj_timesheet.on_change_account_id(cr, uid, False, acc_id) - if res.get('value'): - vals_line.update(res['value']) - vals_line['general_account_id'] = result['general_account_id'] - vals_line['journal_id'] = result['journal_id'] - vals_line['amount'] = 0.0 - vals_line['product_uom_id'] = result['product_uom_id'] - amount = vals_line['unit_amount'] - prod_id = vals_line['product_id'] - unit = False - timeline_id = obj_timesheet.create(cr, uid, vals=vals_line, context=context) - - # Compute based on pricetype - amount_unit = obj_timesheet.on_change_unit_amount(cr, uid, timeline_id, - prod_id, amount, False, unit, context=context) - if amount_unit and 'amount' in amount_unit.get('value',{}): - updv = { 'amount': amount_unit['value']['amount'] } - obj_timesheet.write(cr, uid, [timeline_id], updv, context=context) - vals['hr_analytic_timesheet_id'] = timeline_id + # Compute based on pricetype + amount_unit = obj_timesheet.on_change_unit_amount(cr, uid, timeline_id, + prod_id, amount, False, unit, context=context) + if amount_unit and 'amount' in amount_unit.get('value',{}): + updv = { 'amount': amount_unit['value']['amount'] } + obj_timesheet.write(cr, uid, [timeline_id], updv, context=context) + vals['hr_analytic_timesheet_id'] = timeline_id return super(project_work,self).create(cr, uid, vals, *args, **kwargs) def write(self, cr, uid, ids, vals, context=None):