[MERGE] project cleanup
bzr revid: fp@tinyerp.com-20121022175311-9dqift6jop58qw7m
This commit is contained in:
commit
a21cc373bf
|
@ -141,7 +141,7 @@
|
|||
</div>
|
||||
</group>
|
||||
<group string="Product Information">
|
||||
<field name="product_id"/>
|
||||
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
|
||||
<label for="unit_amount"/>
|
||||
<div>
|
||||
<field name="unit_amount" class="oe_inline"/>
|
||||
|
|
|
@ -415,10 +415,10 @@
|
|||
<field name="description" attrs="{'readonly':[('state','=','done')]}" placeholder="Add a Description..."/>
|
||||
<field name="work_ids" groups="project.group_tasks_work_on_tasks">
|
||||
<tree string="Task Work" editable="top">
|
||||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
<field name="hours" widget="float_time" sum="Spent Hours"/>
|
||||
<field name="date"/>
|
||||
<field name="user_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
<group>
|
||||
|
|
|
@ -272,6 +272,16 @@ res_partner()
|
|||
class account_analytic_line(osv.osv):
|
||||
_inherit = "account.analytic.line"
|
||||
|
||||
def get_product(self, cr, uid, context=None):
|
||||
emp_obj = self.pool.get('hr.employee')
|
||||
emp_ids = emp_obj.search(cr, uid, [('user_id', '=', uid)], context=context)
|
||||
if emp_ids:
|
||||
employee = emp_obj.browse(cr, uid, emp_ids, context=context)[0]
|
||||
if employee.product_id:return employee.product_id.id
|
||||
return False
|
||||
|
||||
_defaults = {'product_id': get_product,}
|
||||
|
||||
def on_change_account_id(self, cr, uid, ids, account_id):
|
||||
res = {}
|
||||
if not account_id:
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<field name="inherit_id" ref="account.view_account_analytic_line_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="account_id" position="replace">
|
||||
<field name="account_id" string="Analytic account/project"/>
|
||||
<field name="account_id" string="Analytic account/project" on_change="on_change_account_id(account_id)"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
|
Loading…
Reference in New Issue