[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:
commit
2b2153bc39
|
@ -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')
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -2072,41 +2072,46 @@ 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():
|
||||||
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])
|
# We group the moves by automatic move type, so it creates different pickings for different types
|
||||||
if picking:
|
moves_by_type = {}
|
||||||
# name of new picking according to its type
|
for move in chained_moves:
|
||||||
if ptype == 'internal':
|
moves_by_type.setdefault(move[1][1], []).append(move)
|
||||||
new_pick_name = seq_obj.get(cr, uid,'stock.picking')
|
for todo in moves_by_type.values():
|
||||||
else :
|
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])
|
||||||
new_pick_name = seq_obj.get(cr, uid, 'stock.picking.' + ptype)
|
if picking:
|
||||||
pickid = self._create_chained_picking(cr, uid, new_pick_name, picking, ptype, todo, context=context)
|
# name of new picking according to its type
|
||||||
# Need to check name of old picking because it always considers picking as "OUT" when created from Sales Order
|
if ptype == 'internal':
|
||||||
old_ptype = location_obj.picking_type_get(cr, uid, picking.move_lines[0].location_id, picking.move_lines[0].location_dest_id)
|
new_pick_name = seq_obj.get(cr, uid,'stock.picking')
|
||||||
if old_ptype != picking.type:
|
else :
|
||||||
old_pick_name = seq_obj.get(cr, uid, 'stock.picking.' + old_ptype)
|
new_pick_name = seq_obj.get(cr, uid, 'stock.picking.' + ptype)
|
||||||
self.pool.get('stock.picking').write(cr, uid, [picking.id], {'name': old_pick_name, 'type': old_ptype}, context=context)
|
pickid = self._create_chained_picking(cr, uid, new_pick_name, picking, ptype, todo, context=context)
|
||||||
else:
|
# Need to check name of old picking because it always considers picking as "OUT" when created from Sales Order
|
||||||
pickid = False
|
old_ptype = location_obj.picking_type_get(cr, uid, picking.move_lines[0].location_id, picking.move_lines[0].location_dest_id)
|
||||||
for move, (loc, dummy, delay, dummy, company_id, ptype, invoice_state) in todo:
|
if old_ptype != picking.type:
|
||||||
new_id = move_obj.copy(cr, uid, move.id, {
|
old_pick_name = seq_obj.get(cr, uid, 'stock.picking.' + old_ptype)
|
||||||
'location_id': move.location_dest_id.id,
|
self.pool.get('stock.picking').write(cr, uid, [picking.id], {'name': old_pick_name, 'type': old_ptype}, context=context)
|
||||||
'location_dest_id': loc.id,
|
else:
|
||||||
'date': time.strftime('%Y-%m-%d'),
|
pickid = False
|
||||||
'picking_id': pickid,
|
for move, (loc, dummy, delay, dummy, company_id, ptype, invoice_state) in todo:
|
||||||
'state': 'waiting',
|
new_id = move_obj.copy(cr, uid, move.id, {
|
||||||
'company_id': company_id or res_obj._company_default_get(cr, uid, 'stock.company', context=context) ,
|
'location_id': move.location_dest_id.id,
|
||||||
'move_history_ids': [],
|
'location_dest_id': loc.id,
|
||||||
'date_expected': (datetime.strptime(move.date, '%Y-%m-%d %H:%M:%S') + relativedelta(days=delay or 0)).strftime('%Y-%m-%d'),
|
'date': time.strftime('%Y-%m-%d'),
|
||||||
'move_history_ids2': []}
|
'picking_id': pickid,
|
||||||
)
|
'state': 'waiting',
|
||||||
move_obj.write(cr, uid, [move.id], {
|
'company_id': company_id or res_obj._company_default_get(cr, uid, 'stock.company', context=context) ,
|
||||||
'move_dest_id': new_id,
|
'move_history_ids': [],
|
||||||
'move_history_ids': [(4, new_id)]
|
'date_expected': (datetime.strptime(move.date, '%Y-%m-%d %H:%M:%S') + relativedelta(days=delay or 0)).strftime('%Y-%m-%d'),
|
||||||
})
|
'move_history_ids2': []}
|
||||||
new_moves.append(self.browse(cr, uid, [new_id])[0])
|
)
|
||||||
if pickid:
|
move_obj.write(cr, uid, [move.id], {
|
||||||
self.pool.get('stock.picking').signal_button_confirm(cr, uid, [pickid])
|
'move_dest_id': new_id,
|
||||||
|
'move_history_ids': [(4, new_id)]
|
||||||
|
})
|
||||||
|
new_moves.append(self.browse(cr, uid, [new_id])[0])
|
||||||
|
if pickid:
|
||||||
|
self.pool.get('stock.picking').signal_button_confirm(cr, uid, [pickid])
|
||||||
if new_moves:
|
if new_moves:
|
||||||
new_moves += self.create_chained_picking(cr, uid, new_moves, context)
|
new_moves += self.create_chained_picking(cr, uid, new_moves, context)
|
||||||
return new_moves
|
return new_moves
|
||||||
|
|
Loading…
Reference in New Issue