[IMP] contract management
bzr revid: fp@tinyerp.com-20121210192810-eff3qaqn90vgl5q3
This commit is contained in:
parent
456ce8cd36
commit
2f96683e20
|
@ -10,7 +10,6 @@
|
|||
<tree toolbar="1" colors="red:state=='pending';grey:state in ('cancelled','close');blue:type=='view'" string="Analytic Accounts">
|
||||
<field name="complete_name"/>
|
||||
<field name="code"/>
|
||||
<field name="quantity"/>
|
||||
<field name="date"/>
|
||||
<field name="date_start" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
<field name="res_model">account.analytic.account</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{'default_type':'contract', 'search_default_open':1, 'search_default_pending':1}</field>
|
||||
<field name="context">{'default_type':'contract', 'search_default_open':1, 'search_default_pending':1, 'default_manager_id':uid}</field>
|
||||
<field name="domain">[('type','=','contract')]</field>
|
||||
<field name="search_view_id" ref="view_account_analytic_account_overdue_search"/>
|
||||
<field name="help" type="html">
|
||||
|
|
|
@ -21,7 +21,13 @@
|
|||
<xpath expr='//div[@name="duration"]' position="after" version="7.0">
|
||||
<label for="quantity_max"/>
|
||||
<div>
|
||||
<field name="quantity_max" class="oe_inline"/>
|
||||
<field name="quantity_max"/>
|
||||
<div attrs="{'invisible': [('quantity','=',0)]}" class="oe_grey">
|
||||
<field name="quantity" class="oe_inline"/> Units Done
|
||||
</div>
|
||||
<div attrs="{'invisible': [('quantity_max','=',0)]}" class="oe_grey">
|
||||
<field name="remaining_hours" class="oe_inline"/> Units Remaining
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr='//group[@name="invoice_on_timesheets"]' position="replace">
|
||||
|
@ -141,6 +147,7 @@
|
|||
<field name="inherit_id" ref="account.view_account_analytic_account_list"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="date" position="before">
|
||||
<field name="remaining_hours"/>
|
||||
<field name="last_invoice_date"/>
|
||||
<field name="toinvoice_total"/>
|
||||
</field>
|
||||
|
|
|
@ -548,7 +548,8 @@ def Project():
|
|||
model_name=vals.get('alias_model', 'project.task'),
|
||||
context=context)
|
||||
vals['alias_id'] = alias_id
|
||||
vals['type'] = 'contract'
|
||||
if vals.get('type', False) not in ('template','contract'):
|
||||
vals['type'] = 'contract'
|
||||
project_id = super(project, self).create(cr, uid, vals, context)
|
||||
mail_alias.write(cr, uid, [vals['alias_id']], {'alias_defaults': {'project_id': project_id} }, context)
|
||||
self.create_send_note(cr, uid, [project_id], context=context)
|
||||
|
@ -1377,6 +1378,7 @@ class account_analytic_account(osv.osv):
|
|||
project_values = {
|
||||
'name': vals.get('name'),
|
||||
'analytic_account_id': analytic_account_id,
|
||||
'type': vals.get('type','contract'),
|
||||
}
|
||||
return project_pool.create(cr, uid, project_values, context=context)
|
||||
return False
|
||||
|
@ -1395,6 +1397,7 @@ class account_analytic_account(osv.osv):
|
|||
for account in self.browse(cr, uid, ids, context=context):
|
||||
if not name:
|
||||
vals['name'] = account.name
|
||||
vals['type'] = account.type
|
||||
self.project_create(cr, uid, account.id, vals, context=context)
|
||||
return super(account_analytic_account, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
|
|
Loading…
Reference in New Issue