[IMP] purchase: usability improvements + linked the stock move to the procurement that created the PO line, in order to be able to propagate any information on it

bzr revid: qdp-launchpad@openerp.com-20131210151326-rrlfgnx27114gbq0
This commit is contained in:
Quentin (OpenERP) 2013-12-10 16:13:26 +01:00
parent 06bd943846
commit 9aa559a3a1
2 changed files with 12 additions and 12 deletions

View File

@ -625,7 +625,7 @@ class purchase_order(osv.osv):
for pick in purchase.picking_ids:
if pick.state not in ('draft', 'cancel'):
raise osv.except_osv(
_('Unable to cancel this purchase order.'),
_('Unable to cancel the purchase order %s.') % (purchase.name),
_('First cancel all receptions related to this purchase order.'))
self.pool.get('stock.picking') \
.signal_button_cancel(cr, uid, map(attrgetter('id'), purchase.picking_ids))
@ -672,7 +672,6 @@ class purchase_order(osv.osv):
if order.currency_id.id != order.company_id.currency_id.id:
#we don't round the price_unit, as we may want to store the standard price with more digits than allowed by the currency
price_unit = self.pool.get('res.currency').compute(cr, uid, order.currency_id.id, order.company_id.currency_id.id, price_unit, round=False, context=context)
return {
'name': order_line.name or '',
'product_id': order_line.product_id.id,
@ -693,6 +692,7 @@ class purchase_order(osv.osv):
'price_unit': price_unit,
'picking_type_id': order.picking_type_id.id,
'group_id': group_id,
'procurement_id': order_line.procurement_ids and order_line.procurement_ids[0].id or False,
'route_ids': order.picking_type_id.warehouse_id and [(6, 0, [x.id for x in order.picking_type_id.warehouse_id.route_ids])] or [],
}

View File

@ -173,7 +173,7 @@
<button name="invoice_ok" states="except_invoice" string="Manually Corrected"/>
<button name="purchase_approve" states="confirmed" string="Approve Order" class="oe_highlight" groups="purchase.group_purchase_manager"/>
<button name="wkf_send_rfq" states="approved" string="Send PO by Email" type="object" context="{'send_rfq':False}"/>
<button name="view_picking" string="Receptions" type="object" attrs="{'invisible': ['|', ('shipped','=',True), ('state','!=', 'approved')]}" class="oe_highlight"/>
<button name="view_picking" string="Receive Products" type="object" attrs="{'invisible': ['|', ('shipped','=',True), ('state','!=', 'approved')]}" class="oe_highlight"/>
<button name="view_invoice" string="Receive Invoice" type="object" attrs="{'invisible': ['|', ('invoice_method','=','picking'), '|', ('state','!=', 'approved'), ('invoiced','=',True) ]}" class="oe_highlight"/>
<button name="action_cancel_draft" states="cancel,sent,confirmed" string="Set to Draft" type="object" />
<button name="purchase_cancel" states="draft,confirmed,sent,bid" string="Cancel"/>
@ -418,7 +418,7 @@
<notebook>
<page string="Notes">
<field name="name"/>
</page><page string="Invoices and Receptions">
</page><page string="Invoices and Incoming Shipments">
<field name="invoice_lines"/>
<field name="move_ids"/>
</page>