[merge]
authorRaphaël Valyi <rvalyi@gmail.com>
Mon, 12 Jul 2010 14:27:10 +0000 (11:27 -0300)
committerRaphaël Valyi <rvalyi@gmail.com>
Mon, 12 Jul 2010 14:27:10 +0000 (11:27 -0300)
bzr revid: rvalyi@gmail.com-20100712142710-6erw06givmv5g93j

addons/account/invoice.py
addons/mrp/mrp.py
addons/project_long_term/project_long_term.py
addons/project_long_term/project_long_term_view.xml

index 423c39d..dcc7383 100644 (file)
@@ -1241,6 +1241,7 @@ class account_invoice_line(osv.osv):
         return {'price_unit': price_unit,'invoice_line_tax_id': tax_id}
 
     def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None):
+        print "2222*", uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id, context
         if context is None:
             context = {}
         company_id = context.get('company_id',False)
index 13ded3a..98acbba 100644 (file)
@@ -61,6 +61,7 @@ class mrp_workcenter(osv.osv):
     }
     _defaults = {
         'capacity_per_cycle': lambda *a: 1.0,
+        'resource_type': lambda *a: 'material',
      }
 mrp_workcenter()
 
index f76ab41..2e86426 100644 (file)
@@ -248,6 +248,8 @@ class project_resource_allocation(osv.osv):
         'resource_id': fields.many2one('resource.resource', 'Resource', required=True),
         'phase_id': fields.many2one('project.phase', 'Project Phase', required=True),
         'useability': fields.float('Usability', help="Usability of this resource for this project phase in percentage (=50%)"),
+        'date_start': fields.related('phase_id', 'date_start', type='datetime', string='Start Date'),
+        'date_end': fields.related('phase_id', 'date_end', type='datetime', string='End Date'),
     }
     _defaults = {
         'useability': 100,
index 4170c00..6fb26c2 100644 (file)
                     <field name="resource_id"/>
                     <field name="phase_id"/>
                     <field name="useability"/>
+                    <field name="date_start"/>
+                    <field name="date_end"/>
                 </tree>
             </field>
         </record>
+        
+        <record id="view_project_resource_allocation_calendar" model="ir.ui.view">
+            <field name="name">project.resource.allocation.calendar</field>
+            <field name="model">project.resource.allocation</field>
+            <field name="type">calendar</field>
+            <field name="arch" type="xml">
+                <calendar color="resource_id" date_stop="date_end" date_start="date_start" string="Resource Allocations">
+                    <field name="resource_id"/>
+                    <field name="useability"/>
+                </calendar>
+            </field>
+        </record>
+        <record id="view_project_resource_allocation_gantt" model="ir.ui.view">
+            <field name="name">project.resource.allocation.gantt</field>
+            <field name="model">project.resource.allocation</field>
+            <field name="type">gantt</field>
+            <field name="arch" type="xml">
+                <gantt color="phase_id" date_stop="date_end" date_start="date_start" string="Resource Allocations">
+                    <level object="resource.resource" link="resource_id" domain="[]">
+                        <field name="useability"/>
+                    </level>
+                </gantt>
+            </field>
+        </record>
 
        <record id="view_project_resource_allocation_search" model="ir.ui.view">
             <field name="name">project.resource.allocation.search</field>
@@ -58,7 +85,7 @@
             <field name="name">Resource Allocations</field>
             <field name="res_model">project.resource.allocation</field>
             <field name="view_type">form</field>
-            <field name="view_mode">tree,form</field>
+            <field name="view_mode">tree,form,calendar,gantt</field>
              <field name="context">{'search_default_resource': 1} </field>
             <!--<field name="search_view_id" ref="view_project_phase_search"/>-->
         </record>