[IMP] purchase: Improve the serch view and put the waring in Purchase Order Merge wizard
bzr revid: sbh@tinyerp.com-20100916093238-ji70a4c1dsq19ugi
This commit is contained in:
parent
71a8ce0337
commit
21c7ee711d
|
@ -174,7 +174,7 @@
|
|||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" separator="1" help="Purchase order which are in the exception state"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-gtk-go-back-rtl" string="To Invoice" domain="[('invoiced','=',1)]" separator="1" help="Purchase order to be invoiced"/>
|
||||
<filter icon="terp-gtk-go-back-rtl" string="To be Invoiced" domain="[('invoiced','=',1)]" separator="1" help="Purchase order to be invoiced"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1" string="Reference"/>
|
||||
<field name="partner_id" select="1"/>
|
||||
|
@ -184,7 +184,7 @@
|
|||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="10" groups="base.group_extended">
|
||||
<filter string="Supplier" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Source Document" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
|
||||
<filter string="Origin" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
|
|
@ -24,11 +24,28 @@ from osv import fields, osv
|
|||
import netsvc
|
||||
import pooler
|
||||
from osv.orm import browse_record, browse_null
|
||||
from tools.translate import _
|
||||
|
||||
class purchase_order_group(osv.osv_memory):
|
||||
_name = "purchase.order.group"
|
||||
_description = "Purchase Order Merge"
|
||||
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form',
|
||||
context=None, toolbar=False, submenu=False):
|
||||
"""
|
||||
Changes the view dynamically
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param context: A standard dictionary
|
||||
@return: New arch of view.
|
||||
"""
|
||||
if not context:
|
||||
context={}
|
||||
res = super(purchase_order_group, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
|
||||
if context.get('active_model','') == 'purchase.order' and len(context['active_ids']) < 2:
|
||||
raise osv.except_osv(_('Warning'),
|
||||
_('Please select multiple order inventories to merge in the list view.'))
|
||||
def merge_orders(self, cr, uid, ids, context):
|
||||
"""
|
||||
To merge similar type of purchase orders.
|
||||
|
|
Loading…
Reference in New Issue