[MERGE] project cleanup

bzr revid: fp@tinyerp.com-20121022175311-9dqift6jop58qw7m
This commit is contained in:
Fabien Pinckaers 2012-10-22 19:53:11 +02:00
commit a21cc373bf
4 changed files with 14 additions and 4 deletions

View File

@ -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"/>

View File

@ -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>

View File

@ -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:

View File

@ -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>