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)
'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,
<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>
<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>