parent
1a7f595bb2
commit
67255539f9
|
@ -56,19 +56,16 @@ class project_project(osv.osv):
|
||||||
context = {}
|
context = {}
|
||||||
value = {}
|
value = {}
|
||||||
data_obj = self.pool.get('ir.model.data')
|
data_obj = self.pool.get('ir.model.data')
|
||||||
if context.get('btn'):
|
to_invoice = False
|
||||||
context.update({
|
if context.get('invoice'):to_invoice = context.get('invoice')
|
||||||
'search_default_to_invoice':1,
|
|
||||||
})
|
|
||||||
for project in self.browse(cr, uid, ids, context=context):
|
for project in self.browse(cr, uid, ids, context=context):
|
||||||
# Get Timesheet views
|
# Get Timesheet views
|
||||||
tree_view = data_obj.get_object_reference(cr, uid, 'project_timesheet', 'view_account_analytic_line_tree_inherit_account_id')
|
tree_view = data_obj.get_object_reference(cr, uid, 'project_timesheet', 'view_account_analytic_line_tree_inherit_account_id')
|
||||||
form_view = data_obj.get_object_reference(cr, uid, 'project_timesheet', 'view_account_analytic_line_form_inherit_account_id')
|
form_view = data_obj.get_object_reference(cr, uid, 'project_timesheet', 'view_account_analytic_line_form_inherit_account_id')
|
||||||
search_view = data_obj.get_object_reference(cr, uid, 'project_timesheet', 'view_account_analytic_line_search_account_inherit')
|
search_view = data_obj.get_object_reference(cr, uid, 'project_timesheet', 'view_account_analytic_line_search_account_inherit')
|
||||||
context.update({
|
context.update({
|
||||||
#'search_default_user_id': uid,
|
'search_default_to_invoice': to_invoice,
|
||||||
'search_default_account_id':project.analytic_account_id.id,
|
'search_default_account_id':project.analytic_account_id.id,
|
||||||
#'search_default_open':1,
|
|
||||||
})
|
})
|
||||||
value = {
|
value = {
|
||||||
'name': _('Bill Tasks Works'),
|
'name': _('Bill Tasks Works'),
|
||||||
|
@ -77,8 +74,6 @@ class project_project(osv.osv):
|
||||||
'view_mode': 'form,tree',
|
'view_mode': 'form,tree',
|
||||||
'res_model': 'account.analytic.line',
|
'res_model': 'account.analytic.line',
|
||||||
'view_id': False,
|
'view_id': False,
|
||||||
# 'domain':[('project_id','=', context.get('active_id',False))],
|
|
||||||
#'context': context,
|
|
||||||
'views': [(tree_view and tree_view[1] or False, 'tree'),(form_view and form_view[1] or False, 'form')],
|
'views': [(tree_view and tree_view[1] or False, 'tree'),(form_view and form_view[1] or False, 'form')],
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
'search_view_id': search_view and search_view[1] or False,
|
'search_view_id': search_view and search_view[1] or False,
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
<div class="manager"><b><field name="amount_invoiced"/> <field name="currency_id"/></b></div>
|
<div class="manager"><b><field name="amount_invoiced"/> <field name="currency_id"/></b></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sequence">
|
<div class="sequence">
|
||||||
<button name="open_timesheets" class="oe_to_invoice_buttons" type="object" context="{'btn':'invoice'}">Invoice</button>
|
<button name="open_timesheets" class="oe_to_invoice_buttons" type="object" context="{'invoice':1}">Invoice</button>
|
||||||
</div>
|
</div>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
|
|
Loading…
Reference in New Issue