[FIX] stock.partial.move fix for web client act_window replace by act_server to create the osv.memory object before opening the wizard
bzr revid: tfr@openerp.com-20110114150133-vk0240cnim03jgwo
This commit is contained in:
parent
1d5bb22c6f
commit
f6bda97aa2
|
@ -1456,6 +1456,25 @@ class stock_move(osv.osv):
|
|||
_description = "Stock Move"
|
||||
_order = 'date_expected desc, id'
|
||||
_log_create = False
|
||||
|
||||
def action_partial_move(self, cr, uid, ids, context=None):
|
||||
if context is None: context = {}
|
||||
partial_id = self.pool.get("stock.partial.move").create(
|
||||
cr, uid, {}, context=context)
|
||||
return {
|
||||
'name':_("Products to Process"),
|
||||
'view_mode': 'form',
|
||||
'view_id': False,
|
||||
'view_type': 'form',
|
||||
'res_model': 'stock.partial.move',
|
||||
'res_id': partial_id,
|
||||
'type': 'ir.actions.act_window',
|
||||
'nodestroy': True,
|
||||
'target': 'new',
|
||||
'domain': '[]',
|
||||
'context': context
|
||||
}
|
||||
|
||||
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
res = []
|
||||
|
|
|
@ -342,9 +342,9 @@
|
|||
<page string="Stock Moves">
|
||||
<field colspan="2" name="move_ids" nolabel="1" widget="one2many_list">
|
||||
<tree string="Stock Moves">
|
||||
<field name="picking_id" string="Reference"/>
|
||||
<field name="origin"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="picking_id" string="Reference"/>
|
||||
<field name="origin"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="product_id"/>
|
||||
<field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
|
||||
<field name="product_uom" string="UoM"/>
|
||||
|
@ -900,7 +900,7 @@
|
|||
<field name="location_id"/>
|
||||
<field name="date"/>
|
||||
<field name="state"/>
|
||||
<button name="%(action_partial_move)d" string="Partial" type="action" states="confirmed,assigned" icon="gtk-justify-fill"/>
|
||||
<button name="%(action_partial_move_server)d" string="Partial" type="action" states="confirmed,assigned" icon="gtk-justify-fill"/>
|
||||
<button name="action_done" states="confirmed,assigned" string="Process" type="object" icon="gtk-go-forward"/>
|
||||
</tree>
|
||||
<form string="Stock Moves">
|
||||
|
@ -1226,7 +1226,7 @@
|
|||
<group expand="0" string="Extended Filters..." colspan="4" col="8">
|
||||
<filter string="To invoice" name="to_invoice" icon="terp-dolar" domain="[('invoice_state', '=', '2binvoiced')]" />
|
||||
</group>
|
||||
<newline/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="8">
|
||||
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<separator orientation="vertical" />
|
||||
|
@ -1510,7 +1510,7 @@
|
|||
====================================
|
||||
Reception Picking (By Stock Move)
|
||||
====================================
|
||||
<!-- from stock_partial_move_view -->
|
||||
<!-- from stock_partial_move_view -->
|
||||
|
||||
|
||||
|
||||
|
@ -1550,7 +1550,7 @@
|
|||
<field name="date"/>
|
||||
<field name="state"/>
|
||||
<button name="action_assign" states="confirmed" string="Set Available" type="object" icon="gtk-yes"/>
|
||||
<button name="%(action_partial_move)d" string="Partial" type="action" states="confirmed,assigned" icon="gtk-justify-fill"/>
|
||||
<button name="%(action_partial_move_server)d" string="Partial" type="action" states="confirmed,assigned" icon="gtk-justify-fill"/>
|
||||
<button name="action_done" states="confirmed,assigned" string="Process" type="object" icon="gtk-go-forward"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
@ -1639,7 +1639,7 @@
|
|||
<button name="action_cancel" states="assigned,confirmed" string="_Cancel" type="object" icon="gtk-cancel"/>
|
||||
<button name="action_confirm" states="draft" string="Process Later" type="object" icon="gtk-apply"/>
|
||||
<button name="force_assign" states="confirmed" string="Set Available" type="object" icon="gtk-yes"/>
|
||||
<button name="%(action_partial_move)d" states="assigned" string="Partial" type="action" icon="gtk-justify-fill"/>
|
||||
<button name="%(action_partial_move_server)d" states="assigned" string="Partial" type="action" icon="gtk-justify-fill"/>
|
||||
<button name="action_done" states="draft,assigned,confirmed" string="Process Now" type="object" icon="gtk-jump-to"/>
|
||||
</group>
|
||||
</form>
|
||||
|
|
|
@ -2,29 +2,38 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<act_window name="Deliver/Receive Products"
|
||||
res_model="stock.partial.move"
|
||||
src_model="stock.move"
|
||||
view_mode="form"
|
||||
multi="True"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_partial_move">
|
||||
</act_window>
|
||||
|
||||
|
||||
<record id="action_partial_move_server" model="ir.actions.server">
|
||||
<field name="name">Deliver/Receive Products</field>
|
||||
<field name="model_id" ref="model_stock_move"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = obj.action_partial_move(context=context)</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_open_partial_move_wizard" model="ir.values">
|
||||
<field eval="'client_action_multi'" name="key2"/>
|
||||
<field eval="'stock.move'" name="model"/>
|
||||
<field name="name">Deliver/Receive Products</field>
|
||||
<field eval="'ir.actions.server,%d'%action_partial_move_server" name="value"/>
|
||||
<field eval="True" name="object"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<record id="stock_move_memory_tree_in" model="ir.ui.view">
|
||||
<record id="stock_move_memory_tree_in" model="ir.ui.view">
|
||||
<field name="name">stock.move.memory.tree</field>
|
||||
<field name="model">stock.move.memory.in</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree editable="bottom" string="Product Moves">
|
||||
<field name="product_id" />
|
||||
<field name="product_id" />
|
||||
<field name="quantity" />
|
||||
<field name="product_uom" />
|
||||
<field name="prodlot_id" domain="[('product_id', '=', product_id)]" groups="base.group_extended" />
|
||||
<field name="cost" />
|
||||
<field name="currency" />
|
||||
</tree>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
@ -34,7 +43,7 @@
|
|||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<field name="product_id" />
|
||||
<field name="product_id" />
|
||||
<field name="quantity" />
|
||||
<field name="product_uom" />
|
||||
<field name="prodlot_id" domain="[('product_id', '=', product_id)]" groups="base.group_extended" />
|
||||
|
@ -42,9 +51,9 @@
|
|||
<field name="currency" />
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</record>
|
||||
|
||||
<record id="stock_move_memory_tree_out" model="ir.ui.view">
|
||||
<record id="stock_move_memory_tree_out" model="ir.ui.view">
|
||||
<field name="name">stock.move.memory.tree</field>
|
||||
<field name="model">stock.move.memory.out</field>
|
||||
<field name="type">tree</field>
|
||||
|
@ -64,13 +73,13 @@
|
|||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<field name="product_id" />
|
||||
<field name="product_id" />
|
||||
<field name="quantity" />
|
||||
<field name="product_uom" />
|
||||
<field name="prodlot_id" domain="[('product_id', '=', product_id)]" groups="base.group_extended" />
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue