[Merge] lp:openobject-addons

bzr revid: dbr@tinyerp.com-20130822125445-pur4h2bjzjw4p2nx
This commit is contained in:
DBR (OpenERP) 2013-08-22 18:24:45 +05:30
commit f3b0c35df4
6 changed files with 41 additions and 23 deletions

View File

@ -955,10 +955,8 @@ class crm_lead(format_address, osv.osv):
"""
if custom_values is None:
custom_values = {}
desc = html2plaintext(msg.get('body')) if msg.get('body') else ''
defaults = {
'name': msg.get('subject') or _("No Subject"),
'description': desc,
'email_from': msg.get('from'),
'email_cc': msg.get('cc'),
'partner_id': msg.get('author_id', False),

View File

@ -351,7 +351,7 @@ class fleet_vehicle(osv.Model):
'fuel_type': fields.selection([('gasoline', 'Gasoline'), ('diesel', 'Diesel'), ('electric', 'Electric'), ('hybrid', 'Hybrid')], 'Fuel Type', help='Fuel Used by the vehicle'),
'horsepower': fields.integer('Horsepower'),
'horsepower_tax': fields.float('Horsepower Taxation'),
'power': fields.integer('Power (kW)', help='Power in kW of the vehicle'),
'power': fields.integer('Power', help='Power in kW of the vehicle'),
'co2': fields.float('CO2 Emissions', help='CO2 emissions of the vehicle'),
'image': fields.related('model_id', 'image', type="binary", string="Logo"),
'image_medium': fields.related('model_id', 'image_medium', type="binary", string="Logo"),
@ -392,9 +392,12 @@ class fleet_vehicle(osv.Model):
}
def create(self, cr, uid, data, context=None):
if not context:
context = {}
context.update({'mail_create_nolog': True})
vehicle_id = super(fleet_vehicle, self).create(cr, uid, data, context=context)
vehicle = self.browse(cr, uid, vehicle_id, context=context)
self.message_post(cr, uid, [vehicle_id], body=_('Vehicle %s has been added to the fleet!') % (vehicle.license_plate), context=context)
self.message_post(cr, uid, [vehicle_id], body=_('%s %s has been added to the fleet!') % (vehicle.model_id.name,vehicle.license_plate), context=context)
return vehicle_id
def write(self, cr, uid, ids, vals, context=None):

View File

@ -13,7 +13,7 @@
<h1>
<field name="modelname" />
</h1>
<label for="brand" class="oe_edit_only"/>
<label for="brand_id" class="oe_edit_only"/>
<h2>
<field name="brand_id" on_change="on_change_brand(brand_id)"/>
</h2>
@ -242,11 +242,17 @@
<group string="Engine Options">
<field name="transmission" />
<field name="fuel_type" />
<field name="co2" />
<label for="co2"/>
<div>
<field name="co2" class="oe_inline"/> g/km
</div>
<field name="horsepower" />
<field name="horsepower_tax" />
<field name="power" />
</group>
<label for="power"/>
<div>
<field name="power" class="oe_inline"/> kW
</div>
</group>
</group>
</sheet>
<div class="oe_chatter">
@ -287,6 +293,10 @@
<field name="location"/>
<field name="state_id" />
<filter name="alert_true" domain="['|',('contract_renewal_due_soon','=',True),('contract_renewal_overdue','=',True)]" string="Has Alert(s)"/>
<group expand="1" string="Group By...">
<filter name="groupby_status" context="{'group_by' : 'state_id'}" string="Status"/>
<filter name="groupby_model" context="{'group_by' : 'model_id'}" string="Model"/>
</group>
</search>
</field>
</record>
@ -400,7 +410,7 @@
<group string="Contract details">
<field name="vehicle_id" on_change="on_change_vehicle(vehicle_id)"/>
<field name="cost_subtype_id" required="1" domain="['|',('category','=','contract'),('category','=','both')]"/>
<field name="amount" string="Activation Cost"/>
<field name="amount" string="Activation Cost" help="Cost that is paid only once at the creation of the contract"/>
<label for="cost_generated"/>
<div>
<field name="cost_generated" class="oe_inline" attrs="{'invisible': [('cost_frequency','=','no')]}" />
@ -440,7 +450,7 @@
</group>
<div class="oe_right"><group><field name="sum_cost" string="Indicative Costs Total"/></group></div>
</page>
<page string="Generated Costs">
<page string="Generated Recurring Costs">
<group>
<field name="generated_cost_ids" context="{'vehicle_id': vehicle_id}" nolabel="1" sum="amount">
<tree version="7.0" editable="bottom" >
@ -704,7 +714,7 @@
<group string="Services Details">
<field name="vehicle_id" on_change="on_change_vehicle(vehicle_id)"/>
<field name="cost_subtype_id" string="Service Type" domain="['|',('category','=','service'),('category','=','both')]" required="1"/>
<field name="amount" string="Price"/>
<field name="amount"/>
</group>
<group string="Odometer Details">
<label for="odometer"/>
@ -726,7 +736,7 @@
<field name="cost_ids" nolabel="1">
<tree string="Included Services" version="7.0" editable="bottom">
<field name="cost_subtype_id" string="Service" domain="[('category','=','service')]"/>
<field name="amount" sum="Price" string="Cost"/>
<field name="amount" sum="Price" string="Indicative Cost"/>
</tree>
</field>
</group>
@ -767,6 +777,17 @@
</field>
</record>
<record model='ir.ui.view' id='fleet_vehicle_log_services_search'>
<field name="name">fleet.vehicle.log.services.search</field>
<field name="model">fleet.vehicle.log.services</field>
<field name="arch" type="xml">
<search string="Services Logs" >
<field name="vehicle_id"/>
<field name="cost_subtype_id"/>
</search>
</field>
</record>
<record model='ir.actions.act_window' id='fleet_vehicle_log_services_act'>
<field name="name">Vehicles Services Logs</field>
<field name="res_model">fleet.vehicle.log.services</field>
@ -789,7 +810,7 @@
<field name="name">fleet.service.type.tree</field>
<field name="model">fleet.service.type</field>
<field name="arch" type="xml">
<tree string="Service types" editable="bottom">
<tree string="Service types" editable="top">
<field name="name" />
<field name="category"/>
</tree>

View File

@ -15,4 +15,4 @@ Changelog
- Removed ``hired.employee`` wizard.
- Add new method ``log_meeting_in_parent``.
- Add new method ``log_meeting_in_parent``

View File

@ -338,10 +338,8 @@ class hr_applicant(osv.Model):
"""
if custom_values is None: custom_values = {}
val = msg.get('from').split('<')[0]
desc = html2plaintext(msg.get('body')) if msg.get('body') else ''
defaults = {
'name': msg.get('subject') or _("No Subject"),
'description': desc,
'partner_name':val,
'email_from': msg.get('from'),
'email_cc': msg.get('cc'),

View File

@ -495,21 +495,19 @@ class project_issue(osv.Model):
through message_process.
This override updates the document according to the email.
"""
if custom_values is None: custom_values = {}
if context is None: context = {}
if custom_values is None:
custom_values = {}
if context is None:
context = {}
context['state_to'] = 'draft'
desc = html2plaintext(msg.get('body')) if msg.get('body') else ''
defaults = {
'name': msg.get('subject') or _("No Subject"),
'description': desc,
'email_from': msg.get('from'),
'email_cc': msg.get('cc'),
'partner_id': msg.get('author_id', False),
'user_id': False,
}
if msg.get('priority'):
if msg.get('priority'):
defaults['priority'] = msg.get('priority')
defaults.update(custom_values)