bzr revid: sgo@tinyerp.com-20120330131624-bm5ylnwd20lg6c18
This commit is contained in:
Sanjay Gohel (Open ERP)
2012-03-30 18:46:24 +05:30
5 changed files with 10 additions and 5 deletions
+1
View File
@@ -758,6 +758,7 @@ class task(osv.osv):
'sequence': 10,
'active': True,
'user_id': lambda obj, cr, uid, context: uid,
'project_id':lambda self, cr, uid, context: context.get('active_id',False),
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'project.task', context=c)
}
+3 -1
View File
@@ -255,7 +255,9 @@ class project_issue(crm.crm_case, osv.osv):
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
if user.context_project_id:
return user.context_project_id.id
return False
else:
project_id = context.get('active_id',False)
return project_id
def on_change_project(self, cr, uid, ids, project_id, context=None):
return {}
@@ -123,6 +123,7 @@ class project_phase(osv.osv):
_defaults = {
'state': 'draft',
'sequence': 10,
'project_id':lambda self, cr, uid, context: context.get('active_id',False),
'product_uom': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('Day'))], context=c)[0]
}
_order = "project_id, date_start, sequence"
@@ -29,7 +29,7 @@ from tools.translate import _
class project_project(osv.osv):
_inherit = 'project.project'
def _amt_to_invoice(self, cr, uid, ids,field_name, arg, context=None):
def _to_invoice(self, cr, uid, ids,field_name, arg, context=None):
res = {}
aal_pool = self.pool.get("account.analytic.line")
for project in self.browse(cr,uid,ids,context=context):
@@ -50,8 +50,8 @@ class project_project(osv.osv):
_columns = {
'timesheets' : fields.boolean('Timesheets',help = "If you check this field timesheets appears in kanban view"),
'amt_to_invoice': fields.function(_amt_to_invoice,string="Amount to Invoice",multi="sums"),
'hrs_to_invoice': fields.function(_amt_to_invoice,string="Hours to Invoice",multi="sums")
'amt_to_invoice': fields.function(_to_invoice,string="Amount to Invoice",multi="sums"),
'hrs_to_invoice': fields.function(_to_invoice,string="Hours to Invoice",multi="sums")
}
_defaults = {
'timesheets' : True,
@@ -33,6 +33,7 @@
<field name="arch" type="xml">
<field name="task" position="after">
<field name="timesheets"/>
<field name="currency_id"/>
</field>
<xpath expr="//t[@t-name='tasks']" position="after">
<t t-name="timesheets">
@@ -58,7 +59,7 @@
</div>
<div class="sequence">
<kbd class="user">Amount</kbd>
<div class="manager"><b><field name="amt_to_invoice"/> <field name="currency_id"/></b></div>
<div class="manager"><b><field name="amt_to_invoice"/> <t t-esc="record.currency_id.raw_value[1].split(' ')[1][1]"/></b></div>
</div>
<div class="sequence">
<kbd class="user">Hours</kbd>