Amit Patel (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-project-apa into lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-project-apa/+merge/129649
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-project-apa/+merge/129649
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-project-apa.
=== modified file 'account/project/project_view.xml'
--- account/project/project_view.xml	2012-09-28 17:50:12 +0000
+++ account/project/project_view.xml	2012-10-16 09:34:20 +0000
@@ -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"/>

=== modified file 'project/project_view.xml'
--- project/project_view.xml	2012-10-12 05:14:04 +0000
+++ project/project_view.xml	2012-10-16 09:34:20 +0000
@@ -416,10 +416,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="name"/>
+                                    <field name="hours" widget="float_time" sum="Spent Hours"/>
                                     <field name="date"/>
-                                    <field name="name"/>
                                     <field name="user_id"/>
-                                    <field name="hours" widget="float_time" sum="Spent Hours"/>
                                 </tree>
                             </field>
                             <group>

=== modified file 'project_timesheet/project_timesheet.py'
--- project_timesheet/project_timesheet.py	2012-10-03 14:38:09 +0000
+++ project_timesheet/project_timesheet.py	2012-10-16 09:34:20 +0000
@@ -272,6 +272,16 @@
 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:

=== modified file 'project_timesheet/project_timesheet_view.xml'
--- project_timesheet/project_timesheet_view.xml	2012-09-24 08:19:34 +0000
+++ project_timesheet/project_timesheet_view.xml	2012-10-16 09:34:20 +0000
@@ -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>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to