[ADD]: config wizard for hr_expense and data file

bzr revid: ksa@tinyerp.co.in-20110407050810-t2bzvqpvmb4ikrkj
This commit is contained in:
ksa (Open ERP) 2011-04-07 10:38:10 +05:30
parent cbfe43975a
commit 6d9e38a658
6 changed files with 45 additions and 4 deletions

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -54,7 +54,9 @@ re-invoice your customer's expenses if your work by project.
'security/ir_rule.xml',
'report/hr_expense_report_view.xml',
'board_hr_expense_view.xml',
'board_hr_expense_manager_view.xml'
'board_hr_expense_manager_view.xml',
'installer_view.xml',
'hr_expense_data.xml'
],
'demo_xml': [
'hr_expense_demo.xml',

View File

@ -229,6 +229,12 @@ class product_product(osv.osv):
'hr_expense_ok': fields.boolean('Can Constitute an Expense', help="Determines if the product can be visible in the list of product within a selection from an HR expense sheet line."),
}
def on_change_hr_expense_ok(self, cr, uid, id, hr_expense_ok):
if not hr_expense_ok:
return {}
res = {'value' : {'type':'service','procure_method':'make_to_stock','supply_method':'buy','purchase_ok':True,'sale_ok' :False,'categ_id':19 }}
return res
product_product()
class hr_expense_line(osv.osv):

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<!--
Resource: product.uom.categ
-->
<record id="cat_expense" model="product.category">
<field name="parent_id" ref="product.cat0"/>
<field name="name">Expenses</field>
</record>
</data>
</openerp>

View File

@ -189,7 +189,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<field name="purchase_ok" position="after">
<field name="hr_expense_ok"/>
<field name="hr_expense_ok" on_change="on_change_hr_expense_ok(hr_expense_ok)"/>
</field>
</field>
</record>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.actions.act_window" id="product_normal_form_view_installer">
<field name="name">Expences Product</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.product</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'default_type':'service','default_procure_method':'make_to_stock','default_supply_method':'buy','default_purchase_ok':True,'default_sale_ok':False,'default_hr_expense_ok':True,'default_categ_id':19}</field>
<field name="view_id" ref="product.product_normal_form_view"/>
</record>
<record id="product_normal_form_view_todo" model="ir.actions.todo">
<field name="action_id" ref="product_normal_form_view_installer"/>
<field name="sequence">3</field>
<field name="restart">always</field>
</record>
</data>
</openerp>