[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
This commit is contained in:
parent
96837ce080
commit
c829e12bd2
|
@ -46,7 +46,7 @@ class hr_employee(osv.osv):
|
||||||
def _getEmployeeProduct(self, cr, uid, context=None):
|
def _getEmployeeProduct(self, cr, uid, context=None):
|
||||||
md = self.pool.get('ir.model.data')
|
md = self.pool.get('ir.model.data')
|
||||||
try:
|
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]
|
return result[1]
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -2,19 +2,8 @@
|
||||||
<openerp>
|
<openerp>
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<record id="product_consultant" model="product.product">
|
|
||||||
<field name="list_price">75.0</field>
|
|
||||||
<field name="standard_price">30.0</field>
|
|
||||||
<field name="uom_id" ref="product.uom_hour"/>
|
|
||||||
<field name="uom_po_id" ref="product.uom_hour"/>
|
|
||||||
<field name="name">Service on Timesheet</field>
|
|
||||||
<field name="categ_id" ref="product.cat0"/>
|
|
||||||
<field name="type">service</field>
|
|
||||||
<field eval="False" name="purchase_ok"/>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="hr.employee" model="hr.employee">
|
<record id="hr.employee" model="hr.employee">
|
||||||
<field name="product_id" ref="product_consultant"/>
|
<field name="product_id" ref="product.product_consultant"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="analytic_journal" model="account.analytic.journal">
|
<record id="analytic_journal" model="account.analytic.journal">
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
<data noupdate="1">
|
<data noupdate="1">
|
||||||
|
|
||||||
<record id="hr.employee" model="hr.employee">
|
<record id="hr.employee" model="hr.employee">
|
||||||
<field name="product_id" ref="product_consultant"/>
|
<field name="product_id" ref="product.product_consultant"/>
|
||||||
<field name="journal_id" ref="analytic_journal"/>
|
<field name="journal_id" ref="analytic_journal"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- complete our example employee -->
|
<!-- complete our example employee -->
|
||||||
<record id="hr.employee1" model="hr.employee">
|
<record id="hr.employee1" model="hr.employee">
|
||||||
<field name="product_id" ref="product_consultant"/>
|
<field name="product_id" ref="product.product_consultant"/>
|
||||||
<field name="journal_id" ref="analytic_journal"/>
|
<field name="journal_id" ref="analytic_journal"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
<field name="user_id" ref="base.user_root"/>
|
<field name="user_id" ref="base.user_root"/>
|
||||||
<field eval="time.strftime('%Y-%m-%d')" name="date"/>
|
<field eval="time.strftime('%Y-%m-%d')" name="date"/>
|
||||||
<field eval="2.00" name="unit_amount"/>
|
<field eval="2.00" name="unit_amount"/>
|
||||||
<field name="product_id" ref="product_consultant"/>
|
<field name="product_id" ref="product.product_consultant"/>
|
||||||
<field name="product_uom_id" ref="product.uom_hour"/>
|
<field name="product_uom_id" ref="product.uom_hour"/>
|
||||||
<field name="account_id" model="account.analytic.account" search="[('code','=','1')]"></field>
|
<field name="account_id" model="account.analytic.account" search="[('code','=','1')]"></field>
|
||||||
<field eval="-60.00" name="amount"/>
|
<field eval="-60.00" name="amount"/>
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
<field name="user_id" ref="base.user_root"/>
|
<field name="user_id" ref="base.user_root"/>
|
||||||
<field eval="time.strftime('%Y-%m-%d')" name="date"/>
|
<field eval="time.strftime('%Y-%m-%d')" name="date"/>
|
||||||
<field eval="1.00" name="unit_amount"/>
|
<field eval="1.00" name="unit_amount"/>
|
||||||
<field name="product_id" ref="product_consultant"/>
|
<field name="product_id" ref="product.product_consultant"/>
|
||||||
<field name="product_uom_id" ref="product.uom_hour"/>
|
<field name="product_uom_id" ref="product.uom_hour"/>
|
||||||
<field name="account_id" model="account.analytic.account" search="[('code','=','1')]"></field>
|
<field name="account_id" model="account.analytic.account" search="[('code','=','1')]"></field>
|
||||||
<field eval="-30.00" name="amount"/>
|
<field eval="-30.00" name="amount"/>
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
<field name="user_id" ref="base.user_root"/>
|
<field name="user_id" ref="base.user_root"/>
|
||||||
<field eval="time.strftime('%Y-%m-%d')" name="date"/>
|
<field eval="time.strftime('%Y-%m-%d')" name="date"/>
|
||||||
<field eval="03.00" name="unit_amount"/>
|
<field eval="03.00" name="unit_amount"/>
|
||||||
<field name="product_id" ref="product_consultant"/>
|
<field name="product_id" ref="product.product_consultant"/>
|
||||||
<field name="product_uom_id" ref="product.uom_hour"/>
|
<field name="product_uom_id" ref="product.uom_hour"/>
|
||||||
<field name="account_id" model="account.analytic.account" search="[('code','=','1')]"></field>
|
<field name="account_id" model="account.analytic.account" search="[('code','=','1')]"></field>
|
||||||
<field eval="-90.00" name="amount"/>
|
<field eval="-90.00" name="amount"/>
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
<field name="user_id" ref="base.user_root"/>
|
<field name="user_id" ref="base.user_root"/>
|
||||||
<field eval="time.strftime('%Y-%m-%d')" name="date"/>
|
<field eval="time.strftime('%Y-%m-%d')" name="date"/>
|
||||||
<field eval="01.00" name="unit_amount"/>
|
<field eval="01.00" name="unit_amount"/>
|
||||||
<field name="product_id" ref="product_consultant"/>
|
<field name="product_id" ref="product.product_consultant"/>
|
||||||
<field name="product_uom_id" ref="product.uom_hour"/>
|
<field name="product_uom_id" ref="product.uom_hour"/>
|
||||||
<field name="account_id" model="account.analytic.account" search="[('code','=','1')]"></field>
|
<field name="account_id" model="account.analytic.account" search="[('code','=','1')]"></field>
|
||||||
<field eval="-30.00" name="amount"/>
|
<field eval="-30.00" name="amount"/>
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
<field name="user_id" ref="base.user_root"/>
|
<field name="user_id" ref="base.user_root"/>
|
||||||
<field eval="time.strftime('%Y-%m-%d')" name="date"/>
|
<field eval="time.strftime('%Y-%m-%d')" name="date"/>
|
||||||
<field eval="01.00" name="unit_amount"/>
|
<field eval="01.00" name="unit_amount"/>
|
||||||
<field name="product_id" ref="product_consultant"/>
|
<field name="product_id" ref="product.product_consultant"/>
|
||||||
<field name="product_uom_id" ref="product.uom_hour"/>
|
<field name="product_uom_id" ref="product.uom_hour"/>
|
||||||
<field name="account_id" model="account.analytic.account" search="[('code','=','1')]"></field>
|
<field name="account_id" model="account.analytic.account" search="[('code','=','1')]"></field>
|
||||||
<field eval="-30.00" name="amount"/>
|
<field eval="-30.00" name="amount"/>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
general_account_id: account.a_expense
|
general_account_id: account.a_expense
|
||||||
journal_id: hr_timesheet.analytic_journal
|
journal_id: hr_timesheet.analytic_journal
|
||||||
name: develop yaml for hr module
|
name: develop yaml for hr module
|
||||||
product_id: hr_timesheet.product_consultant
|
product_id: product.product_consultant
|
||||||
product_uom_id: product.uom_hour
|
product_uom_id: product.uom_hour
|
||||||
to_invoice: hr_timesheet_invoice.timesheet_invoice_factor2
|
to_invoice: hr_timesheet_invoice.timesheet_invoice_factor2
|
||||||
unit_amount: 5.00
|
unit_amount: 5.00
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
date: 1
|
date: 1
|
||||||
name: 1
|
name: 1
|
||||||
price: 1
|
price: 1
|
||||||
product: hr_timesheet.product_consultant
|
product: product.product_consultant
|
||||||
time: 1
|
time: 1
|
||||||
|
|
||||||
-
|
-
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
I create final invoice for this analytic account.
|
I create final invoice for this analytic account.
|
||||||
-
|
-
|
||||||
!record {model: hr.timesheet.invoice.create.final, id: hr_timesheet_invoice_create_final_0}:
|
!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
|
date: 1
|
||||||
name: 1
|
name: 1
|
||||||
price: 1
|
price: 1
|
||||||
|
|
|
@ -97,7 +97,7 @@
|
||||||
name: 'Develop yaml for hr module'
|
name: 'Develop yaml for hr module'
|
||||||
unit_amount: 3.00
|
unit_amount: 3.00
|
||||||
amount: -90.00
|
amount: -90.00
|
||||||
product_id: hr_timesheet.product_consultant
|
product_id: product_consultant
|
||||||
general_account_id: account.a_expense
|
general_account_id: account.a_expense
|
||||||
user_id: base.user_root
|
user_id: base.user_root
|
||||||
journal_id: hr_timesheet.analytic_journal
|
journal_id: hr_timesheet.analytic_journal
|
||||||
|
@ -128,7 +128,7 @@
|
||||||
name: 'Develop yaml for hr module'
|
name: 'Develop yaml for hr module'
|
||||||
unit_amount: 2.0
|
unit_amount: 2.0
|
||||||
amount: -90.00
|
amount: -90.00
|
||||||
product_id: hr_timesheet.product_consultant
|
product_id: product_consultant
|
||||||
general_account_id: account.a_expense
|
general_account_id: account.a_expense
|
||||||
user_id: base.user_root
|
user_id: base.user_root
|
||||||
journal_id: hr_timesheet.analytic_journal
|
journal_id: hr_timesheet.analytic_journal
|
||||||
|
|
|
@ -168,5 +168,19 @@ parameter) will see those record just disappear.
|
||||||
<field name="name">Product UoS</field>
|
<field name="name">Product UoS</field>
|
||||||
<field name="digits" eval="3"/>
|
<field name="digits" eval="3"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Product
|
||||||
|
-->
|
||||||
|
<record id="product_consultant" model="product.product">
|
||||||
|
<field name="list_price">75.0</field>
|
||||||
|
<field name="standard_price">30.0</field>
|
||||||
|
<field name="uom_id" ref="product.uom_hour"/>
|
||||||
|
<field name="uom_po_id" ref="product.uom_hour"/>
|
||||||
|
<field name="name">Service on Timesheet</field>
|
||||||
|
<field name="categ_id" ref="product.cat0"/>
|
||||||
|
<field name="type">service</field>
|
||||||
|
<field eval="False" name="purchase_ok"/>
|
||||||
|
</record>
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -4,13 +4,13 @@
|
||||||
<!-- Example employee -->
|
<!-- Example employee -->
|
||||||
<record id="hr.employee2" model="hr.employee">
|
<record id="hr.employee2" model="hr.employee">
|
||||||
<field name="user_id" ref="project.res_users_technical_leader"/>
|
<field name="user_id" ref="project.res_users_technical_leader"/>
|
||||||
<field name="product_id" ref="hr_timesheet.product_consultant"/>
|
<field name="product_id" ref="product.product_consultant"/>
|
||||||
<field name="journal_id" ref="hr_timesheet.analytic_journal"/>
|
<field name="journal_id" ref="hr_timesheet.analytic_journal"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="hr.employee3" model="hr.employee">
|
<record id="hr.employee3" model="hr.employee">
|
||||||
<field name="user_id" ref="project.res_users_project_manager"/>
|
<field name="user_id" ref="project.res_users_project_manager"/>
|
||||||
<field name="product_id" ref="hr_timesheet.product_consultant"/>
|
<field name="product_id" ref="product.product_consultant"/>
|
||||||
<field name="journal_id" ref="hr_timesheet.analytic_journal"/>
|
<field name="journal_id" ref="hr_timesheet.analytic_journal"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
<field name="calendar_id" ref="resource.timesheet_group1"/>
|
<field name="calendar_id" ref="resource.timesheet_group1"/>
|
||||||
<field name="user_id" ref="project.res_users_analyst"/>
|
<field name="user_id" ref="project.res_users_analyst"/>
|
||||||
<field name="category_ids" eval="[(6, 0, [ref('hr.category_employee')])]"/>
|
<field name="category_ids" eval="[(6, 0, [ref('hr.category_employee')])]"/>
|
||||||
<field name="product_id" ref="hr_timesheet.product_consultant"/>
|
<field name="product_id" ref="product.product_consultant"/>
|
||||||
<field name="journal_id" ref="hr_timesheet.analytic_journal"/>
|
<field name="journal_id" ref="hr_timesheet.analytic_journal"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
<field name="calendar_id" ref="resource.timesheet_group1"/>
|
<field name="calendar_id" ref="resource.timesheet_group1"/>
|
||||||
<field name="user_id" ref="project.res_users_developer"/>
|
<field name="user_id" ref="project.res_users_developer"/>
|
||||||
<field name="category_ids" eval="[(6, 0, [ref('hr.category_employee')])]"/>
|
<field name="category_ids" eval="[(6, 0, [ref('hr.category_employee')])]"/>
|
||||||
<field name="product_id" ref="hr_timesheet.product_consultant"/>
|
<field name="product_id" ref="product.product_consultant"/>
|
||||||
<field name="journal_id" ref="hr_timesheet.analytic_journal"/>
|
<field name="journal_id" ref="hr_timesheet.analytic_journal"/>
|
||||||
</record>
|
</record>
|
||||||
<record id="hr.employee6" model="hr.employee">
|
<record id="hr.employee6" model="hr.employee">
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
<field name="calendar_id" ref="resource.timesheet_group1"/>
|
<field name="calendar_id" ref="resource.timesheet_group1"/>
|
||||||
<field name="user_id" ref="project.res_users_designer"/>
|
<field name="user_id" ref="project.res_users_designer"/>
|
||||||
<field name="category_ids" eval="[(6, 0, [ref('hr.category_employee')])]"/>
|
<field name="category_ids" eval="[(6, 0, [ref('hr.category_employee')])]"/>
|
||||||
<field name="product_id" ref="hr_timesheet.product_consultant"/>
|
<field name="product_id" ref="product.product_consultant"/>
|
||||||
<field name="journal_id" ref="hr_timesheet.analytic_journal"/>
|
<field name="journal_id" ref="hr_timesheet.analytic_journal"/>
|
||||||
</record>
|
</record>
|
||||||
<record id="hr.employee7" model="hr.employee">
|
<record id="hr.employee7" model="hr.employee">
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
<field name="calendar_id" ref="resource.timesheet_group1"/>
|
<field name="calendar_id" ref="resource.timesheet_group1"/>
|
||||||
<field name="user_id" ref="project.res_users_tester"/>
|
<field name="user_id" ref="project.res_users_tester"/>
|
||||||
<field name="category_ids" eval="[(6, 0, [ref('hr.category_employee')])]"/>
|
<field name="category_ids" eval="[(6, 0, [ref('hr.category_employee')])]"/>
|
||||||
<field name="product_id" ref="hr_timesheet.product_consultant"/>
|
<field name="product_id" ref="product.product_consultant"/>
|
||||||
<field name="journal_id" ref="hr_timesheet.analytic_journal"/>
|
<field name="journal_id" ref="hr_timesheet.analytic_journal"/>
|
||||||
</record>
|
</record>
|
||||||
<record id="hr.employee8" model="hr.employee">
|
<record id="hr.employee8" model="hr.employee">
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
<field name="calendar_id" ref="resource.timesheet_group1"/>
|
<field name="calendar_id" ref="resource.timesheet_group1"/>
|
||||||
<field name="user_id" ref="project.res_users_finacial_manager"/>
|
<field name="user_id" ref="project.res_users_finacial_manager"/>
|
||||||
<field name="category_ids" eval="[(6, 0, [ref('hr.category_employee')])]"/>
|
<field name="category_ids" eval="[(6, 0, [ref('hr.category_employee')])]"/>
|
||||||
<field name="product_id" ref="hr_timesheet.product_consultant"/>
|
<field name="product_id" ref="product.product_consultant"/>
|
||||||
<field name="journal_id" ref="hr_timesheet.analytic_journal"/>
|
<field name="journal_id" ref="hr_timesheet.analytic_journal"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
|
@ -1312,7 +1312,7 @@ class sale_config_picking_policy(osv.osv_memory):
|
||||||
pooler.restart_pool(cr.dbname, update_module=True)[1]
|
pooler.restart_pool(cr.dbname, update_module=True)[1]
|
||||||
|
|
||||||
if wizard.time_unit:
|
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 = 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})
|
product_obj.write(cr, uid, prod_id, {'uom_id':wizard.time_unit.id, 'uom_po_id': wizard.time_unit.id})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue