[IMP]change color and improved as per said
authorSanjay Gohel (Open ERP) <sgo@tinyerp.com>
Mon, 30 Apr 2012 10:49:34 +0000 (16:19 +0530)
committerSanjay Gohel (Open ERP) <sgo@tinyerp.com>
Mon, 30 Apr 2012 10:49:34 +0000 (16:19 +0530)
bzr revid: sgo@tinyerp.com-20120430104934-34tsnkf24rms9izx

addons/project/static/src/css/project.css
addons/project_long_term/project_long_term_view.xml
addons/project_timesheet/project_timesheet.py
addons/project_timesheet/project_timesheet_view.xml

index be87c7c..cfe0559 100644 (file)
@@ -24,6 +24,7 @@
   .project_vignettes .project_fields {
     width: 100%; }
     .project_vignettes .project_fields th {
+      width: 120px;
       font-weight: normal; }
     .project_vignettes .project_fields td {
       color: #888888; }
@@ -117,7 +118,7 @@ a.oe_project_kanban_action {
     background: #B1DCFE;
 }
 .oe_kanban_color_2 {
-    background: firebrick;
+    background: #FFB8B8;
 }
 .oe_kanban_color_3 {
     background: khaki;
index 2e90659..1f258ff 100644 (file)
             <field name="inherit_id" ref="project.view_task_form2"/>
             <field name="arch" type="xml">
                 <xpath expr="//field[@name='effective_hours']" position="after">
-                    <field name="phase_id"/>
+                    <field name="phase_id" context="{'default_project_id' : project_id}"/>
                 </xpath>
             </field>
         </record>
index 64b9c7f..cd2821e 100644 (file)
@@ -76,6 +76,15 @@ class project_project(osv.osv):
                 factor_id = data_obj.browse(cr, uid, data_id).res_id
                 res['value'].update({'to_invoice': factor_id})
         return res
+    
+    def getAnalyticJournal(self, cr, uid, context=None):
+        md = self.pool.get('ir.model.data')
+        try:
+            result = md.get_object_reference(cr, uid, 'hr_timesheet', 'analytic_journal')
+            return result[1]
+        except ValueError:
+            pass
+        return False
 
     def open_timesheets(self, cr, uid, ids, context=None):
         #Open the View for the Timesheet of the project
@@ -87,7 +96,7 @@ class project_project(osv.osv):
             context = {}
         if ids:
             project = self.browse(cr, uid, ids[0], context=context)
-            context = dict(context, search_default_account_id=project.analytic_account_id.id)
+            context = dict(context, search_default_account_id=project.analytic_account_id.id,default_account_id=project.analytic_account_id.id,default_journal_id=self.getAnalyticJournal(cr, uid, context))
         return {
                 'name': _('Bill Tasks Works'),
                 'context': context,
index 6f7277f..0efc228 100644 (file)
@@ -32,7 +32,7 @@
             <field name="inherit_id" ref="project.view_project_kanban"/>
             <field name="arch" type="xml">
                   <field name="task" position="after">
-                    <field name="timesheets"/>
+                    <field name="timesheets" context="{'search_default_account_id': project_id, 'default_account_id': project_id}"/>
                     <field name="total_timesheet"/>
                    <field name="currency_id"/>
                 </field>
 
                <xpath expr="//tr[@id='deadline']" position="before">
                    <tr >
-                       <th align="left">To invoice</th>
+                       <th align="left">Amount to invoice</th>
                        <td align="left">
                            <field name="amt_to_invoice"/> <t t-esc="record.currency_id.raw_value[1].split(' ')[1][1]"/>
                        </td>
                    </tr>
                    <tr>
-                       <th align="left">To hours</th>
+                       <th align="left">Hours to Invoice</th>
                        <td align="left">
                            <field name="hrs_to_invoice"/> h
                        </td>