From c829e12bd2d4d29dbb36ec38f1aae4decd7f4c1f Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Tue, 18 Oct 2011 17:31:52 +0200 Subject: [PATCH] [FIX] moved product_consultant data into the module product, as the hr_timesheet module is not the only one using it (sale do as well) lp bug: https://launchpad.net/bugs/877495 fixed bzr revid: qdp-launchpad@openerp.com-20111018153152-s7op06lppfu2p0up --- addons/hr_timesheet/hr_timesheet.py | 2 +- addons/hr_timesheet/hr_timesheet_data.xml | 13 +------------ addons/hr_timesheet/hr_timesheet_demo.xml | 14 +++++++------- .../test/test_hr_timesheet_invoice.yml | 6 +++--- .../test/test_hr_timesheet_sheet.yml | 4 ++-- addons/product/product_data.xml | 14 ++++++++++++++ .../project_timesheet/project_timesheet_demo.xml | 14 +++++++------- addons/sale/sale.py | 2 +- 8 files changed, 36 insertions(+), 33 deletions(-) diff --git a/addons/hr_timesheet/hr_timesheet.py b/addons/hr_timesheet/hr_timesheet.py index 4613c9251b5..a936a18a02d 100644 --- a/addons/hr_timesheet/hr_timesheet.py +++ b/addons/hr_timesheet/hr_timesheet.py @@ -46,7 +46,7 @@ class hr_employee(osv.osv): def _getEmployeeProduct(self, cr, uid, context=None): md = self.pool.get('ir.model.data') try: - result = md.get_object_reference(cr, uid, 'hr_timesheet', 'product_consultant') + result = md.get_object_reference(cr, uid, 'product', 'product_consultant') return result[1] except ValueError: pass diff --git a/addons/hr_timesheet/hr_timesheet_data.xml b/addons/hr_timesheet/hr_timesheet_data.xml index e6130806b2e..5dc95cf9ddc 100644 --- a/addons/hr_timesheet/hr_timesheet_data.xml +++ b/addons/hr_timesheet/hr_timesheet_data.xml @@ -2,19 +2,8 @@ - - 75.0 - 30.0 - - - Service on Timesheet - - service - - - - + diff --git a/addons/hr_timesheet/hr_timesheet_demo.xml b/addons/hr_timesheet/hr_timesheet_demo.xml index ab33c4218a5..f6f2729c4d4 100644 --- a/addons/hr_timesheet/hr_timesheet_demo.xml +++ b/addons/hr_timesheet/hr_timesheet_demo.xml @@ -3,13 +3,13 @@ - + - + @@ -18,7 +18,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -44,7 +44,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -70,7 +70,7 @@ - + diff --git a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml index d7b59c02124..cf068ac9ce9 100644 --- a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml +++ b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml @@ -11,7 +11,7 @@ general_account_id: account.a_expense journal_id: hr_timesheet.analytic_journal name: develop yaml for hr module - product_id: hr_timesheet.product_consultant + product_id: product.product_consultant product_uom_id: product.uom_hour to_invoice: hr_timesheet_invoice.timesheet_invoice_factor2 unit_amount: 5.00 @@ -31,7 +31,7 @@ date: 1 name: 1 price: 1 - product: hr_timesheet.product_consultant + product: product.product_consultant time: 1 - @@ -67,7 +67,7 @@ I create final invoice for this analytic account. - !record {model: hr.timesheet.invoice.create.final, id: hr_timesheet_invoice_create_final_0}: - balance_product: hr_timesheet.product_consultant + balance_product: product.product_consultant date: 1 name: 1 price: 1 diff --git a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml index 1808c325a07..405c6585cf9 100644 --- a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml +++ b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml @@ -97,7 +97,7 @@ name: 'Develop yaml for hr module' unit_amount: 3.00 amount: -90.00 - product_id: hr_timesheet.product_consultant + product_id: product_consultant general_account_id: account.a_expense user_id: base.user_root journal_id: hr_timesheet.analytic_journal @@ -128,7 +128,7 @@ name: 'Develop yaml for hr module' unit_amount: 2.0 amount: -90.00 - product_id: hr_timesheet.product_consultant + product_id: product_consultant general_account_id: account.a_expense user_id: base.user_root journal_id: hr_timesheet.analytic_journal diff --git a/addons/product/product_data.xml b/addons/product/product_data.xml index 023cb431382..fc085aab922 100644 --- a/addons/product/product_data.xml +++ b/addons/product/product_data.xml @@ -168,5 +168,19 @@ parameter) will see those record just disappear. Product UoS + + + + 75.0 + 30.0 + + + Service on Timesheet + + service + + diff --git a/addons/project_timesheet/project_timesheet_demo.xml b/addons/project_timesheet/project_timesheet_demo.xml index 8eec74bc9e5..8c3f4e2b72a 100644 --- a/addons/project_timesheet/project_timesheet_demo.xml +++ b/addons/project_timesheet/project_timesheet_demo.xml @@ -4,13 +4,13 @@ - + - + @@ -19,7 +19,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -36,7 +36,7 @@ - + @@ -44,7 +44,7 @@ - + @@ -52,7 +52,7 @@ - + diff --git a/addons/sale/sale.py b/addons/sale/sale.py index f6392935988..37f4f7f29f8 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -1312,7 +1312,7 @@ class sale_config_picking_policy(osv.osv_memory): pooler.restart_pool(cr.dbname, update_module=True)[1] if wizard.time_unit: - prod_id = data_obj.get_object(cr, uid, 'hr_timesheet', 'product_consultant').id + prod_id = data_obj.get_object(cr, uid, 'product', 'product_consultant').id product_obj = self.pool.get('product.product') product_obj.write(cr, uid, prod_id, {'uom_id':wizard.time_unit.id, 'uom_po_id': wizard.time_unit.id})