bzr revid: apa@tinyerp.com-20120330084619-erxlcdabcchzzeux
This commit is contained in:
Amit Patel (OpenERP)
2012-03-30 14:16:19 +05:30
2 changed files with 7 additions and 3 deletions
@@ -30,7 +30,7 @@ class project_project(osv.osv):
_inherit = 'project.project'
_columns = {
'timesheets' : fields.boolean('Timesheets',help = "If you check this field timesheets appears in kanban view")
'timesheets' : fields.boolean('Timesheets',help = "If you check this field timesheets appears in kanban view"),
}
_defaults = {
'timesheets' : True,
@@ -56,6 +56,10 @@ 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,
})
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')
@@ -63,7 +67,7 @@ class project_project(osv.osv):
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_account_id':project.id,
'search_default_account_id':project.analytic_account_id.id,
#'search_default_open':1,
})
value = {
@@ -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">Invoice</button>
<button name="open_timesheets" class="oe_to_invoice_buttons" type="object" context="{'btn':'invoice'}">Invoice</button>
</div>
</xpath>
</field>