[IMP] better views, hr timesheet and expenses
bzr revid: fp@tinyerp.com-20101017220823-cflmo1s0kcr02v4y
This commit is contained in:
parent
47e7b2c78f
commit
ed5019c385
|
@ -1,40 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- Latest Activities -->
|
||||
<record model="ir.actions.act_window" id="action_latest_activities_tree">
|
||||
<field name="name">Latest Activities</field>
|
||||
<field name="res_model">res.log</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<record id="board_administration_form" model="ir.ui.view">
|
||||
<field name="name">board.administration.form</field>
|
||||
<field name="model">board.board</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Administration Dashboard">
|
||||
<hpaned position="100">
|
||||
<child1>
|
||||
<action name="%(action_latest_activities_tree)d" string="Latest Activities" sequence="1"/>
|
||||
</child1>
|
||||
<child2>
|
||||
</child2>
|
||||
</hpaned>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="open_board_administration_form" model="ir.actions.act_window">
|
||||
<field name="name">Administration Dashboard</field>
|
||||
<field name="res_model">board.board</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="board_administration_form"/>
|
||||
</record>
|
||||
<menuitem id="board.admin_menu_dasboard" name="Dashboard" sequence="0" parent="base.menu_reporting"/>
|
||||
<menuitem id="menu_board_admin" action="open_board_administration_form" icon="terp-graph" parent="board.admin_menu_dasboard" />
|
||||
|
||||
<!-- User Connection -->
|
||||
<record model="ir.ui.view" id="view_user_connection_tree">
|
||||
<field name="name">user.connection.tree</field>
|
||||
|
@ -55,17 +21,39 @@
|
|||
<field name="view_id" ref="view_user_connection_tree"></field>
|
||||
</record>
|
||||
|
||||
<record id="board_user_connection_form" model="ir.ui.view">
|
||||
<field name="name">board.user.connection.form</field>
|
||||
<!-- Latest Activities -->
|
||||
<record model="ir.actions.act_window" id="action_latest_activities_tree">
|
||||
<field name="name">Latest Activities</field>
|
||||
<field name="res_model">res.log</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<record id="board_administration_form" model="ir.ui.view">
|
||||
<field name="name">board.administration.form</field>
|
||||
<field name="model">board.board</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="board_administration_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/hpaned/child1/action[@string='Latest Activities']" position="after">
|
||||
<action width="510" name="%(action_user_connection_tree)d" string="Latest Connections" />
|
||||
</xpath>
|
||||
<form string="Administration Dashboard">
|
||||
<hpaned position="100">
|
||||
<child1>
|
||||
<action name="%(action_latest_activities_tree)d" string="Latest Activities" sequence="1"/>
|
||||
<action width="510" name="%(action_user_connection_tree)d" string="Latest Connections" />
|
||||
</child1>
|
||||
<child2>
|
||||
</child2>
|
||||
</hpaned>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="open_board_administration_form" model="ir.actions.act_window">
|
||||
<field name="name">Administration Dashboard</field>
|
||||
<field name="res_model">board.board</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="board_administration_form"/>
|
||||
</record>
|
||||
<menuitem id="board.admin_menu_dasboard" name="Dashboard" sequence="0" parent="base.menu_reporting"/>
|
||||
<menuitem id="menu_board_admin" action="open_board_administration_form" icon="terp-graph" parent="board.admin_menu_dasboard" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -226,7 +226,7 @@ class hr_expense_line(osv.osv):
|
|||
return res
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Short Description', size=128, required=True),
|
||||
'name': fields.char('Expense Note', size=128, required=True),
|
||||
'date_value': fields.date('Date', required=True),
|
||||
'expense_id': fields.many2one('hr.expense.expense', 'Expense', ondelete='cascade', select=True),
|
||||
'total_amount': fields.function(_amount, method=True, string='Total'),
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<field domain="[('type','=','normal'), ('parent_id','!=',False)]" name="analytic_account" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="unit_amount"/>
|
||||
<field name="unit_quantity"/>
|
||||
<field name="total_amount"/>
|
||||
<field name="total_amount" sum="Total"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -68,10 +68,9 @@
|
|||
<form string="Expenses Sheet">
|
||||
<group colspan="4" col="6">
|
||||
<field name="employee_id" on_change="onchange_employee_id(employee_id)"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="name"/>
|
||||
<field name="ref" groups="base.group_extended"/>
|
||||
<field name="date" select="1"/>
|
||||
<field name="amount"/>
|
||||
<field name="date"/>
|
||||
<field name="currency_id"/>
|
||||
<field name="department_id" groups="base.group_extended"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
|
@ -81,17 +80,23 @@
|
|||
<newline/>
|
||||
<field colspan="4" name="line_ids" nolabel="1">
|
||||
<form string="Expense Lines">
|
||||
<field name="product_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id)"/>
|
||||
<field name="uom_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id)" widget="selection"/>
|
||||
<field name="name" />
|
||||
<field name="date_value" />
|
||||
<field name="unit_quantity"/>
|
||||
<field name="unit_amount"/>
|
||||
<field name="ref"/>
|
||||
<field name="sequence" groups="base.group_extended"/>
|
||||
<field domain="[('type','=','normal'), ('parent_id','!=',False)]" name="analytic_account" groups="base.group_extended"/>
|
||||
<newline/>
|
||||
<field name="total_amount"/>
|
||||
<group col="6" colspan="4">
|
||||
<field name="product_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id)"/>
|
||||
<field name="name" colspan="4"/>
|
||||
<newline/>
|
||||
<field name="unit_amount"/>
|
||||
<field name="unit_quantity"/>
|
||||
<field name="uom_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id)" widget="selection"/>
|
||||
</group>
|
||||
<group colspan="2" col="2" groups="analytic.group_analytic_accounting">
|
||||
<separator string="Customer Project" colspan="2"/>
|
||||
<field domain="[('type','=','normal')]" name="analytic_account"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="References" colspan="2"/>
|
||||
<field name="date_value" />
|
||||
<field name="ref"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
<field name="state"/>
|
||||
|
@ -99,8 +104,8 @@
|
|||
<button name="draft" states="confirm,cancelled" string="Set to Draft" type="workflow" icon="gtk-convert"/>
|
||||
<button name="refuse" states="confirm,accepted" string="Refuse" type="workflow" icon="gtk-no" groups="base.group_hr_manager" />
|
||||
<button name="confirm" states="draft" string="Confirm" type="workflow" icon="gtk-apply"/>
|
||||
<button name="invoice" states="accepted" string="Invoice" type="workflow" icon="gtk-execute"/>
|
||||
<button name="validate" states="confirm" string="Approve" type="workflow" icon="terp-camera_test"/>
|
||||
<button name="invoice" states="accepted" string="Invoice" type="workflow" icon="gtk-go-forward"/>
|
||||
<button name="validate" states="confirm" string="Approve" type="workflow" icon="gtk-go-forward"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Other Info" groups="base.group_extended">
|
||||
|
|
|
@ -87,7 +87,9 @@ class hr_analytic_timesheet(osv.osv):
|
|||
if prod_id and unit_amount:
|
||||
# find company
|
||||
company_id = self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=context)
|
||||
res.update(self.pool.get('account.analytic.line').on_change_unit_amount(cr, uid, id, prod_id, unit_amount, company_id, unit, journal_id, context=context))
|
||||
r = self.pool.get('account.analytic.line').on_change_unit_amount(cr, uid, id, prod_id, unit_amount, company_id, unit, journal_id, context=context)
|
||||
if r:
|
||||
res.update(r)
|
||||
# update unit of measurement
|
||||
if prod_id:
|
||||
uom = self.pool.get('product.product').browse(cr, uid, prod_id, context=context)
|
||||
|
|
|
@ -69,9 +69,8 @@
|
|||
<filter name="today" icon="terp-go-today" domain="[('date', '=', time.strftime('%%Y-%%m-%%d'))]" string="Today"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="user_id"/>
|
||||
<field name="account_id" select="1" widget="selection"/>
|
||||
<field name="product_id" select="1"/>
|
||||
<field name="date" select="1"/>
|
||||
<field name="account_id"/>
|
||||
<field name="date"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
|
|
Loading…
Reference in New Issue