[MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9991 revid:dle@openerp.com-20140417110435-u8uwwcf5ji1b54ao

bzr revid: dle@openerp.com-20140417112655-eeaiokbqzokpwx4i
This commit is contained in:
Denis Ledoux 2014-04-17 13:26:55 +02:00
commit 2b2153bc39
6 changed files with 65 additions and 46 deletions

View File

@ -123,6 +123,8 @@ class account_invoice_line(osv.osv):
if a == line['account_id'] and i_line.product_id.id == line['product_id']: if a == line['account_id'] and i_line.product_id.id == line['product_id']:
uom = i_line.product_id.uos_id or i_line.product_id.uom_id uom = i_line.product_id.uos_id or i_line.product_id.uom_id
valuation_price_unit = self.pool.get('product.uom')._compute_price(cr, uid, uom.id, i_line.product_id.standard_price, i_line.uos_id.id) valuation_price_unit = self.pool.get('product.uom')._compute_price(cr, uid, uom.id, i_line.product_id.standard_price, i_line.uos_id.id)
if inv.currency_id.id != company_currency:
standard_price = self.pool.get('res.currency').compute(cr, uid, company_currency, inv.currency_id.id, standard_price, context={'date': inv.date_invoice})
if i_line.product_id.cost_method != 'standard' and i_line.purchase_line_id: if i_line.product_id.cost_method != 'standard' and i_line.purchase_line_id:
#for average/fifo/lifo costing method, fetch real cost price from incomming moves #for average/fifo/lifo costing method, fetch real cost price from incomming moves
stock_move_obj = self.pool.get('stock.move') stock_move_obj = self.pool.get('stock.move')

View File

@ -52,7 +52,7 @@
</group> </group>
<group string="Categorization"> <group string="Categorization">
<field name="priority"/> <field name="priority"/>
<field name="categ_id" domain="[('object_id.model', '=', 'crm.helpdesk')]"/> <field name="categ_id" domain="[('object_id.model', '=', 'crm.helpdesk')]" context="{'object_name': 'crm.helpdesk'}"/>
<field name="channel_id"/> <field name="channel_id"/>
</group> </group>
</group> </group>

View File

@ -38,6 +38,17 @@
</field> </field>
</record> </record>
<record model="ir.ui.view" id="project_task_crm_form">
<field name="name">project.task.form.crm</field>
<field name="model">project.task</field>
<field name="priority">20</field>
<field name="inherit_id" ref="project.view_task_form2" />
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="lead_id" invisible="not context.get('lead_id', False)"/>
</field>
</field>
</record>
<record model="ir.actions.act_window" id="crm_todo_action"> <record model="ir.actions.act_window" id="crm_todo_action">
<field name="name">My Tasks</field> <field name="name">My Tasks</field>

View File

@ -395,7 +395,7 @@ class email_template(osv.osv):
is taken from template definition) is taken from template definition)
:returns: a dict containing all relevant fields for creating a new :returns: a dict containing all relevant fields for creating a new
mail.mail entry, with one extra key ``attachments``, in the mail.mail entry, with one extra key ``attachments``, in the
format expected by :py:meth:`mail_thread.message_post`. format [(report_name, data)] where data is base64 encoded.
""" """
if context is None: if context is None:
context = {} context = {}
@ -447,6 +447,7 @@ class email_template(osv.osv):
if template.lang: if template.lang:
ctx['lang'] = self.render_template_batch(cr, uid, template.lang, template.model, [res_id], context)[res_id] # take 0 ? ctx['lang'] = self.render_template_batch(cr, uid, template.lang, template.model, [res_id], context)[res_id] # take 0 ?
result, format = openerp.report.render_report(cr, uid, [res_id], report_service, {'model': template.model}, ctx) result, format = openerp.report.render_report(cr, uid, [res_id], report_service, {'model': template.model}, ctx)
# TODO in trunk, change return format to binary to match message_post expected format
result = base64.b64encode(result) result = base64.b64encode(result)
if not report_name: if not report_name:
report_name = 'report.' + report_service report_name = 'report.' + report_service

View File

@ -128,16 +128,15 @@ class note_note(osv.osv):
current_stage_ids = self.pool.get('note.stage').search(cr,uid,[('user_id','=',uid)], context=context) current_stage_ids = self.pool.get('note.stage').search(cr,uid,[('user_id','=',uid)], context=context)
if current_stage_ids: #if the user have some stages if current_stage_ids: #if the user have some stages
stages = self.pool['note.stage'].browse(cr, uid, current_stage_ids, context=context)
#dict of stages: map les ids sur les noms
stage_name = dict(self.pool.get('note.stage').name_get(cr, uid, current_stage_ids, context=context))
result = [{ #notes by stage for stages user result = [{ #notes by stage for stages user
'__context': {'group_by': groupby[1:]}, '__context': {'group_by': groupby[1:]},
'__domain': domain + [('stage_ids.id', '=', current_stage_id)], '__domain': domain + [('stage_ids.id', '=', stage.id)],
'stage_id': (current_stage_id, stage_name[current_stage_id]), 'stage_id': (stage.id, stage.name),
'stage_id_count': self.search(cr,uid, domain+[('stage_ids', '=', current_stage_id)], context=context, count=True) 'stage_id_count': self.search(cr,uid, domain+[('stage_ids', '=', stage.id)], context=context, count=True),
} for current_stage_id in current_stage_ids] '__fold': stage.fold,
} for stage in stages]
#note without user's stage #note without user's stage
nb_notes_ws = self.search(cr,uid, domain+[('stage_ids', 'not in', current_stage_ids)], context=context, count=True) nb_notes_ws = self.search(cr,uid, domain+[('stage_ids', 'not in', current_stage_ids)], context=context, count=True)
@ -153,8 +152,9 @@ class note_note(osv.osv):
result = [{ result = [{
'__context': {'group_by': groupby[1:]}, '__context': {'group_by': groupby[1:]},
'__domain': domain + [dom_not_in], '__domain': domain + [dom_not_in],
'stage_id': (current_stage_ids[0], stage_name[current_stage_ids[0]]), 'stage_id': (stages[0].id, stages[0].name),
'stage_id_count':nb_notes_ws 'stage_id_count':nb_notes_ws,
'__fold': stages[0].name,
}] + result }] + result
else: # if stage_ids is empty else: # if stage_ids is empty

View File

@ -2072,7 +2072,12 @@ class stock_move(osv.osv):
if context is None: if context is None:
context = {} context = {}
seq_obj = self.pool.get('ir.sequence') seq_obj = self.pool.get('ir.sequence')
for picking, todo in self._chain_compute(cr, uid, moves, context=context).items(): for picking, chained_moves in self._chain_compute(cr, uid, moves, context=context).items():
# We group the moves by automatic move type, so it creates different pickings for different types
moves_by_type = {}
for move in chained_moves:
moves_by_type.setdefault(move[1][1], []).append(move)
for todo in moves_by_type.values():
ptype = todo[0][1][5] and todo[0][1][5] or location_obj.picking_type_get(cr, uid, todo[0][0].location_dest_id, todo[0][1][0]) ptype = todo[0][1][5] and todo[0][1][5] or location_obj.picking_type_get(cr, uid, todo[0][0].location_dest_id, todo[0][1][0])
if picking: if picking:
# name of new picking according to its type # name of new picking according to its type