bzr revid: apa@tinyerp.com-20120330091603-c46u2zcdjiddpogq
This commit is contained in:
Amit Patel (OpenERP) 2012-03-30 14:46:03 +05:30
parent 1a7f595bb2
commit 67255539f9
2 changed files with 4 additions and 9 deletions

View File

@ -56,19 +56,16 @@ class project_project(osv.osv):
context = {}
value = {}
data_obj = self.pool.get('ir.model.data')
if context.get('btn'):
context.update({
'search_default_to_invoice':1,
})
to_invoice = False
if context.get('invoice'):to_invoice = context.get('invoice')
for project in self.browse(cr, uid, ids, context=context):
# Get Timesheet views
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')
search_view = data_obj.get_object_reference(cr, uid, 'project_timesheet', 'view_account_analytic_line_search_account_inherit')
context.update({
#'search_default_user_id': uid,
'search_default_to_invoice': to_invoice,
'search_default_account_id':project.analytic_account_id.id,
#'search_default_open':1,
})
value = {
'name': _('Bill Tasks Works'),
@ -77,8 +74,6 @@ class project_project(osv.osv):
'view_mode': 'form,tree',
'res_model': 'account.analytic.line',
'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')],
'type': 'ir.actions.act_window',
'search_view_id': search_view and search_view[1] or False,

View File

@ -58,7 +58,7 @@
<div class="manager"><b><field name="amount_invoiced"/> <field name="currency_id"/></b></div>
</div>
<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>
</xpath>
</field>