[IMP]stock:Improvement in yml
bzr revid: mma@tinyerp.com-20110802132714-jh8jam8fgdwv3t5g
This commit is contained in:
parent
fc8e82c29a
commit
6138453497
|
@ -141,15 +141,23 @@
|
|||
state: assigned
|
||||
|
||||
-
|
||||
I Check onchange and _getSSCC function of stock.move object
|
||||
I Check onchange function of stock.move object
|
||||
-
|
||||
!python {model: stock.move }: |
|
||||
self.onchange_lot_id(cr, uid, [ref("stock_move_test0")], ref("stock.stock_production_lot0"), 5, ref("stock.stock_location_suppliers"), ref("product.product_product_pc1"), ref("product.product_uom_unit"), None)
|
||||
self.onchange_quantity(cr, uid, [ref("stock_move_test0")], ref("product.product_product_pc1"), 10, ref("product.product_uom_unit"), ref("product.product_uom_unit"))
|
||||
self.onchange_uos_quantity(cr, uid, [ref("stock_move_test0")], ref("product.product_product_pc1"), 10, ref("product.product_uom_unit"), ref("product.product_uom_unit"))
|
||||
self.onchange_product_id(cr, uid, [ref("stock_move_test0")], ref("product.product_product_pc1"), ref("stock.stock_location_suppliers"), ref("stock.stock_location_shop0"), False)
|
||||
self._getSSCC(cr, uid , {"lang": 'en_US', "default_location_dest_id": ref("stock.stock_location_shop0"), "active_model":
|
||||
"stock.move", "search_default_receive": 1, 'product_receive': True, "default_location_id": ref("stock.stock_location_suppliers"),"active_ids":[ref("stock_move_test0")], "tz": False, "active_id":ref("stock_move_test0")})
|
||||
|
||||
-
|
||||
I Check _getSSCC and action_partial_move function of stock.move object
|
||||
-
|
||||
!python {model: stock.move }: |
|
||||
context = {"lang": 'en_US', "default_location_dest_id": ref("stock.stock_location_shop0"), "active_model":
|
||||
"stock.move", "search_default_receive": 1, 'product_receive': True, "default_location_id": ref("stock.stock_location_suppliers"),"active_ids":[ref("stock_move_test0")], "tz": False, "active_id":ref("stock_move_test0")}
|
||||
self._getSSCC(cr, uid , context)
|
||||
self.action_partial_move(cr, uid , [ref("stock_move_test0")], context)
|
||||
|
||||
-
|
||||
I check write function
|
||||
-
|
||||
|
|
|
@ -24,7 +24,6 @@ import stock_move
|
|||
import stock_splitinto
|
||||
import stock_partial_picking
|
||||
import stock_partial_move
|
||||
import stock_replacement
|
||||
import stock_inventory_merge
|
||||
import stock_fill_inventory
|
||||
import stock_inventory_line_split
|
||||
|
|
|
@ -23,35 +23,6 @@ from osv import fields, osv
|
|||
|
||||
import decimal_precision as dp
|
||||
|
||||
class stock_move_track(osv.osv_memory):
|
||||
_name = "stock.move.track"
|
||||
_description = "Track moves"
|
||||
|
||||
_columns = {
|
||||
'tracking_prefix': fields.char('Tracking prefix', size=64),
|
||||
'quantity': fields.float("Quantity per lot")
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'quantity': lambda *x: 1
|
||||
}
|
||||
|
||||
def track_lines(self, cr, uid, ids, context=None):
|
||||
""" To track stock moves lines
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param ids: An ID or list of IDs if we want more than one
|
||||
@param context: A standard dictionary
|
||||
@return:
|
||||
"""
|
||||
datas = self.read(cr, uid, ids)[0]
|
||||
move_obj = self.pool.get('stock.move')
|
||||
move_obj._track_lines(cr, uid, context['active_id'], datas, context=context)
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
stock_move_track()
|
||||
|
||||
class stock_move_consume(osv.osv_memory):
|
||||
_name = "stock.move.consume"
|
||||
_description = "Consume Products"
|
||||
|
|
|
@ -1,35 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_stock_move_track_wizard" model="ir.ui.view">
|
||||
<field name="name">Tracking a move</field>
|
||||
<field name="model">stock.move.track</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Tracking a move">
|
||||
<field name="tracking_prefix" colspan="4"/>
|
||||
<field name="quantity" colspan="4"/>
|
||||
<newline/>
|
||||
<separator string="" colspan="4" />
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="_Cancel" />
|
||||
<button name="track_lines" string="Ok"
|
||||
type="object" icon="gtk-ok" />
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="track_line_old" model="ir.actions.act_window">
|
||||
<field name="name">Tracking a move</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">stock.move.track</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Consume, scrap move -->
|
||||
|
||||
<record id="view_stock_move_consume_wizard" model="ir.ui.view">
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import time
|
||||
|
||||
class stock_replacement(osv.osv_memory):
|
||||
"""
|
||||
This class has been defined for replacement wizard
|
||||
"""
|
||||
_name = "stock.replacement"
|
||||
_description = "Stock Replacement"
|
||||
|
||||
def get_composant(self, cr, uid, ids, context=None):
|
||||
return {}
|
||||
|
||||
def replace_composant(self, cr, uid, ids, context=None):
|
||||
""" To open a new wizard that acknowledge, a replacement task
|
||||
@return: It returns the replacement acknowledgement form
|
||||
"""
|
||||
return {
|
||||
'name': False,
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'stock.replacement.result',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
|
||||
stock_replacement()
|
||||
|
||||
class stock_replacement_result(osv.osv_memory):
|
||||
"""
|
||||
This class has been defined for replacement result
|
||||
"""
|
||||
_name = "stock.replacement.result"
|
||||
_description = "Stock Replacement result"
|
||||
|
||||
stock_replacement_result()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_stock_replacement" model="ir.ui.view">
|
||||
<field name="name">Stock Replacement</field>
|
||||
<field name="model">stock.replacement</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Replace a component">
|
||||
<label string="Component" colspan="4"/>
|
||||
<separator string="" colspan="4" />
|
||||
<button icon='gtk-cancel' special="cancel" string="_Cancel" />
|
||||
<button name="replace_composant" string="Replace" type="object" />
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window name="Stock Replacement"
|
||||
res_model="stock.replacement"
|
||||
src_model=""
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_view_stock_replacement"/>
|
||||
|
||||
|
||||
<record id="view_stock_replacement_result" model="ir.ui.view">
|
||||
<field name="name">Stock Replacement result</field>
|
||||
<field name="model">stock.replacement.result</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Replace result">
|
||||
<label string="Replacing successful !" colspan="4"/>
|
||||
<separator string="" colspan="4" />
|
||||
<button special="cancel" string="Ok" />
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
Loading…
Reference in New Issue