[IMP]stock: Improvement in view of stock.picking and set appropriate wizard Button string to related view

bzr revid: mma@tinyerp.com-20120315090155-c4dlraav8vgxyb0l
This commit is contained in:
Mayur Maheshwari (OpenERP) 2012-03-15 14:31:55 +05:30
parent 82aeb704bc
commit e2ad516fd6
5 changed files with 52 additions and 26 deletions

View File

@ -19,7 +19,7 @@
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<field name="auto_picking" position="after">
<field name="purchase_id"/>
<field name="purchase_id" invisible="1"/>
</field>
</field>
</record>
@ -52,9 +52,9 @@
<field name="type">form</field>
<field name="inherit_id" ref="stock.view_picking_in_form"/>
<field name="arch" type="xml">
<field name="backorder_id" position="after">
<xpath expr="/form/notebook/page/field[@name='date']" position="before">
<field name="purchase_id"/>
</field>
</xpath>
</field>
</record>

View File

@ -8,7 +8,7 @@
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<field name="auto_picking" position="after">
<field name="sale_id"/>
<field name="sale_id" invisible="1"/>
</field>
</field>
</record>
@ -57,9 +57,9 @@
<field name="type">form</field>
<field name="inherit_id" ref="stock.view_picking_out_form"/>
<field name="arch" type="xml">
<field name="move_type" position="after">
<xpath expr="/form/notebook/page/field[@name='date']" position="after">
<field name="sale_id"/>
</field>
</xpath>
</field>
</record>

View File

@ -639,7 +639,7 @@ class stock_picking(osv.osv):
"* Done: has been processed, can't be modified or cancelled anymore\n"\
"* Cancelled: has been cancelled, can't be confirmed anymore"),
'min_date': fields.function(get_min_max_date, fnct_inv=_set_minimum_date, multi="min_max_date",
store=True, type='datetime', string='Expected Date', select=1, help="Expected date for the picking to be processed"),
store=True, type='datetime', string='Scheduled Date', select=1, help="Expected date for the picking to be processed"),
'date': fields.datetime('Order Date', help="Date of Order", select=True),
'date_done': fields.datetime('Date Done', help="Date of Completion"),
'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date",

View File

@ -696,14 +696,12 @@
<group colspan="4" col="4">
<field name="name" readonly="1"/>
<field name="origin"/>
<field name="address_id" on_change="onchange_partner_in(address_id)" context="{'contact_display':'partner'}" colspan="4"/>
<field name="address_id" string="Warehouse" on_change="onchange_partner_in(address_id)" context="{'contact_display':'partner'}" colspan="4"/>
<field name="invoice_state" string="Invoice Control" groups="base.group_extended"/>
<field name="backorder_id" readonly="1" groups="base.group_extended"/>
</group>
<group colspan="2" col="2">
<field name="date"/>
<field name="backorder_id" readonly="1" groups="base.group_extended"/>
<field name="min_date" readonly="1"/>
<field name="stock_journal_id" groups="base.group_extended" widget="selection"/>
</group>
</group>
<notebook colspan="4">
@ -737,8 +735,9 @@
groups="base.group_extended"
icon="terp-stock_effects-object-colorize"
states="draft,assigned,confirmed"/>
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="date_expected" string="Date Expected"/>
<field name="date_expected" />
<field name="state"/>
</tree>
<form string="Stock Moves">
@ -809,10 +808,12 @@
</page>
<page string="Additional info" groups="base.group_extended,base.group_multi_company">
<field name="auto_picking" groups="base.group_extended"/>
<field name="date_done" groups="base.group_extended"/>
<field name="move_type" groups="base.group_extended"/>
<field name="type" groups="base.group_extended"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="move_type" groups="base.group_extended"/>
<field name="date"/>
<field name="type" groups="base.group_extended" invisible="1"/>
<field name="stock_journal_id" groups="base.group_extended" widget="selection"/>
<field name="date_done" string="Received Date" groups="base.group_extended"/>
</page>
<page string="Notes">
<field colspan="4" name="note" nolabel="1"/>
@ -889,12 +890,12 @@
<group colspan="4" col="4">
<field name="name" readonly="1"/>
<field name="origin" readonly="1"/>
<field name="address_id" on_change="onchange_partner_in(address_id)" context="{'contact_display':'partner'}" colspan="4"/>
<field name="address_id" string="Customer" on_change="onchange_partner_in(address_id)" context="{'contact_display':'partner'}" colspan="4"/>
<field name="invoice_state"/>
<field name="backorder_id" readonly="1" groups="base.group_extended"/>
</group>
<group colspan="2" col="2">
<field name="date"/>
<field name="backorder_id" readonly="1" groups="base.group_extended"/>
<field name="min_date" readonly="1"/>
<field name="stock_journal_id" groups="base.group_extended" widget="selection"/>
</group>
@ -928,7 +929,7 @@
groups="base.group_extended"
states="draft,assigned,confirmed"/>
<field name="location_id"/>
<field name="date"/>
<field name="date_expected"/>
<field name="state"/>
<button name="%(action_partial_move_server)d" string="Process" type="action" states="confirmed,assigned" icon="gtk-go-forward"/>
</tree>
@ -1001,10 +1002,11 @@
</page>
<page string="Additional info" groups="base.group_extended,base.group_multi_company">
<field name="auto_picking" groups="base.group_extended"/>
<field name="date_done" groups="base.group_extended"/>
<field name="move_type" groups="base.group_extended"/>
<field name="type" groups="base.group_extended"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="move_type" groups="base.group_extended"/>
<field name="date"/>
<field name="date_done" string="Delivery Date" groups="base.group_extended"/>
<field name="type" groups="base.group_extended" invisible="1"/>
</page>
<page string="Notes">
<field colspan="4" name="note" nolabel="1"/>
@ -1110,12 +1112,12 @@
<group colspan="4" col="4">
<field name="name" readonly="1"/>
<field name="origin"/>
<field name="address_id" on_change="onchange_partner_in(address_id)" context="{'contact_display':'partner'}" domain="[('partner_id','&lt;&gt;',False)]" colspan="4"/>
<field name="address_id" string="Supplier" on_change="onchange_partner_in(address_id)" context="{'contact_display':'partner'}" domain="[('partner_id','&lt;&gt;',False)]" colspan="4"/>
<field name="invoice_state" string="Invoice Control"/>
<field name="backorder_id" readonly="1" groups="base.group_extended"/>
</group>
<group colspan="2" col="2">
<field name="date"/>
<field name="backorder_id" readonly="1" groups="base.group_extended"/>
<field name="min_date" readonly="1"/>
<field name="stock_journal_id" groups="base.group_extended" widget="selection"/>
</group>
@ -1220,7 +1222,8 @@
</group>
</page>
<page string="Additional Info" groups="base.group_extended,base.group_multi_company">
<field name="type" groups="base.group_extended"/>
<field name="type" groups="base.group_extended" invisible="1"/>
<field name="date"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</page>
<page string="Notes">

View File

@ -23,6 +23,7 @@ import time
from osv import fields, osv
from tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
import decimal_precision as dp
from lxml import etree
from tools.translate import _
class stock_partial_picking_line(osv.TransientModel):
@ -71,6 +72,28 @@ class stock_partial_picking(osv.osv_memory):
'picking_id': fields.many2one('stock.picking', 'Picking', required=True, ondelete='CASCADE'),
'hide_tracking': fields.function(_hide_tracking, string='Tracking', type='boolean', help='This field is for internal purpose. It is used to decide if the column prodlot has to be shown on the move_ids field or not'),
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form',
context=None, toolbar=False, submenu=False):
if context is None:
context={}
res = super(stock_partial_picking, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
type = context.get('default_type', False)
doc = etree.XML(res['arch'])
nodes = doc.xpath("//group/button[@string='_Validate']")
for field in res['fields']:
if type == 'in':
for node in nodes:
node.set('string', '_Receive')
if type == 'internal':
for node in nodes:
node.set('string', '_Move')
if type == 'out':
for node in nodes:
node.set('string', '_Deliver')
res['arch'] = etree.tostring(doc)
return res
def default_get(self, cr, uid, fields, context=None):
if context is None: context = {}