mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[ADD] stock_move_location
This commit is contained in:
committed by
Alex Cuellar
parent
e661818253
commit
bc165ae2fb
25
stock_move_location/__init__.py
Normal file
25
stock_move_location/__init__.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#################################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#################################################################################
|
||||
|
||||
import stock
|
||||
import wizard
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
51
stock_move_location/__openerp__.py
Normal file
51
stock_move_location/__openerp__.py
Normal file
@@ -0,0 +1,51 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#################################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#################################################################################
|
||||
|
||||
{
|
||||
"name" : "Move Stock Location",
|
||||
"version" : "1.0",
|
||||
"author" : "Julius Network Solutions,Odoo Community Association (OCA)",
|
||||
"description" : """
|
||||
|
||||
Presentation:
|
||||
|
||||
This module allows to move all stock in a stock location to an other one.
|
||||
And adds fields and buttons to advance in Physical Inventories.
|
||||
|
||||
""",
|
||||
"website" : "http://www.julius.fr",
|
||||
"depends" : [
|
||||
"stock",
|
||||
"stock_barcode_reader",
|
||||
],
|
||||
"category" : "Customs/Stock",
|
||||
"init_xml" : [],
|
||||
"demo_xml" : [],
|
||||
"update_xml" : [
|
||||
'stock_view.xml',
|
||||
'stock_move_sequence.xml',
|
||||
'wizard/move_location_view.xml',
|
||||
],
|
||||
'test': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '',
|
||||
}
|
||||
143
stock_move_location/i18n/fr.po
Normal file
143
stock_move_location/i18n/fr.po
Normal file
@@ -0,0 +1,143 @@
|
||||
# Translation of OpenERP Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * stock_move_location
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 6.0.3\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2011-12-19 10:48+0000\n"
|
||||
"PO-Revision-Date: 2011-12-19 10:48+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: field:stock.inventory,location_id:0
|
||||
msgid "Location"
|
||||
msgstr "Stockage"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: view:stock.inventory:0
|
||||
msgid "Start Acquisition"
|
||||
msgstr "Demarrer la saisie"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: view:stock.inventory:0
|
||||
msgid "Get Stock"
|
||||
msgstr "Remplir"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: view:stock.inventory:0
|
||||
msgid "Validate Move"
|
||||
msgstr "Valider le transfert"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: model:ir.model,name:stock_move_location.model_stock_fill_inventory
|
||||
msgid "Import Inventory"
|
||||
msgstr "Importer un inventaire"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: code:addons/stock_move_location/stock.py:54
|
||||
#, python-format
|
||||
msgid "Error !"
|
||||
msgstr "Erreur !"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: constraint:stock.move:0
|
||||
msgid "You try to assign a lot which is not from the same product"
|
||||
msgstr "Vous essayez d'affecter un lot qui n'est pas pour le bon produit."
|
||||
|
||||
#. module: stock_move_location
|
||||
#: model:ir.model,name:stock_move_location.model_stock_move
|
||||
msgid "Stock Move"
|
||||
msgstr "Transfert de Stock à Stock"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: model:ir.module.module,description:stock_move_location.module_meta_information
|
||||
msgid " This module allows to move all stock in a stock location to an other one "
|
||||
msgstr " Ce module permet de déplacer tout le stock situé dans un ou plusieurs emplacement vers un autre emplacement "
|
||||
|
||||
#. module: stock_move_location
|
||||
#: field:stock.inventory,location_dest_id:0
|
||||
msgid "Destination Location"
|
||||
msgstr "Emplacement de destination"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: model:ir.actions.act_window,name:stock_move_location.action_move_stock_form
|
||||
#: model:ir.ui.menu,name:stock_move_location.menu_action_move_stock_form
|
||||
msgid "Move stock"
|
||||
msgstr "Transfert de Stock à Stock"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: code:addons/stock_move_location/stock.py:70
|
||||
#, python-format
|
||||
msgid "Move"
|
||||
msgstr "Transfert"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: view:stock.inventory:0
|
||||
msgid "Confirm Inventory"
|
||||
msgstr "Confirmer l'inventaire"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: field:stock.inventory,comments:0
|
||||
msgid "Comments"
|
||||
msgstr "Commentaires"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: constraint:stock.move:0
|
||||
msgid "You must assign a production lot for this product"
|
||||
msgstr "Vous devez affecter un lot de fabrication pour ce produit."
|
||||
|
||||
#. module: stock_move_location
|
||||
#: selection:stock.inventory,type:0
|
||||
msgid "Location Move"
|
||||
msgstr "Transfert de Stock à Stock"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: view:stock.inventory:0
|
||||
msgid "Move Stock"
|
||||
msgstr "Transfert de Stock à Stock"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: model:ir.model,name:stock_move_location.model_stock_inventory
|
||||
#: selection:stock.inventory,type:0
|
||||
msgid "Inventory"
|
||||
msgstr "Inventaire"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: code:addons/stock_move_location/stock.py:54
|
||||
#, python-format
|
||||
msgid "Please inform the destination of your move"
|
||||
msgstr "S'il vous plaît informer la destination de votre transfert"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: code:addons/stock_move_location/stock.py:70
|
||||
#, python-format
|
||||
msgid "is done."
|
||||
msgstr "est fait."
|
||||
|
||||
#. module: stock_move_location
|
||||
#: field:stock.inventory,type:0
|
||||
msgid "Type"
|
||||
msgstr "Type"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: model:ir.module.module,shortdesc:stock_move_location.module_meta_information
|
||||
msgid "Move Stock Location"
|
||||
msgstr "Tranfert de stock à stock"
|
||||
|
||||
#. module: stock_move_location
|
||||
#: model:ir.actions.act_window,help:stock_move_location.action_move_stock_form
|
||||
msgid "You can use this to move a stock from a location to an other one."
|
||||
msgstr "Vous pouvez l'utiliser pour passer d'un stockage vers un autre."
|
||||
|
||||
#. module: stock_move_location
|
||||
#: field:stock.move,pack_history_id:0
|
||||
msgid "History pack"
|
||||
msgstr "Historique du colis"
|
||||
|
||||
182
stock_move_location/stock.py
Normal file
182
stock_move_location/stock.py
Normal file
@@ -0,0 +1,182 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#################################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#################################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
|
||||
#class stock_fill_inventory(osv.osv_memory):
|
||||
# _inherit = "stock.fill.inventory"
|
||||
# def fill_inventory(self, cr, uid, ids, context=None):
|
||||
# res = super(stock_fill_inventory, self).fill_inventory(cr, uid, ids, context=context)
|
||||
# stock_inventory_obj = self.pool.get('stock.inventory')
|
||||
# fill_inventory = self.browse(cr, uid, ids[0], context=context)
|
||||
# if stock_inventory_obj.browse(cr, uid, context.get('active_id', False), context).location_id:
|
||||
# stock_inventory_obj.write(cr, uid, context.get('active_id', False), {'location_id': fill_inventory.location_id.id})
|
||||
# return res
|
||||
#stock_fill_inventory()
|
||||
|
||||
class stock_inventory(osv.osv):
|
||||
_inherit = "stock.inventory"
|
||||
|
||||
_columns = {
|
||||
'type': fields.selection([('normal', 'Inventory'),('move', 'Location Move')], 'Type'),
|
||||
'location_id': fields.many2one('stock.location', 'Location'),
|
||||
'location_dest_id': fields.many2one('stock.location', 'Destination Location'),
|
||||
'comments':fields.text('Comments'),
|
||||
}
|
||||
|
||||
def get_sequence(self, cr , uid, context):
|
||||
if context.get('type', False) == 'move':
|
||||
return self.pool.get('ir.sequence').get(cr, uid, 'stock.inventory.move') or '/'
|
||||
else:
|
||||
return self.pool.get('ir.sequence').get(cr, uid, 'stock.inventory') or '/'
|
||||
|
||||
_defaults = {
|
||||
'type': lambda *a: 'normal',
|
||||
'name': lambda x, y, z, c: x.get_sequence(y,z,c),
|
||||
}
|
||||
|
||||
def move_stock(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
product_context = dict(context, compute_child=False)
|
||||
|
||||
location_obj = self.pool.get('stock.location')
|
||||
for inv in self.browse(cr, uid, ids, context=context):
|
||||
if not inv.location_dest_id:
|
||||
raise osv.except_osv(_('Error !'), _('Please inform the destination of your move'))
|
||||
move_ids = []
|
||||
for line in inv.inventory_line_id:
|
||||
location_id = inv.location_dest_id.id
|
||||
date = line.date or inv.date
|
||||
value = {
|
||||
'name': 'MOVE:' + str(line.inventory_id.id) + ':' + line.inventory_id.name,
|
||||
'product_id': line.product_id.id,
|
||||
'product_uom': line.product_uom.id,
|
||||
'prodlot_id': line.prod_lot_id.id,
|
||||
'date': date,
|
||||
'product_qty': line.product_qty,
|
||||
'location_id': line.location_id.id,
|
||||
'location_dest_id': location_id,
|
||||
'note': line.note or inv.comments or False,
|
||||
}
|
||||
move_ids.append(self._inventory_line_hook(cr, uid, line, value))
|
||||
message = _('Move') + " '" + inv.name + "' "+ _("is done.")
|
||||
self.log(cr, uid, inv.id, message)
|
||||
self.write(cr, uid, [inv.id], {'state': 'confirm', 'move_ids': [(6, 0, move_ids)]})
|
||||
return True
|
||||
|
||||
def fill_inventory(self, cr, uid, ids, context=False):
|
||||
res = {}
|
||||
stock_fill_inventory_obj = self.pool.get('stock.fill.inventory')
|
||||
inventory_data = self.browse(cr, uid, ids[0], context)
|
||||
if context.get('type',[]) == 'move':
|
||||
set_stock_zero = False
|
||||
else:
|
||||
set_stock_zero = True
|
||||
if inventory_data.location_id:
|
||||
context['location_id'] = inventory_data.location_id.id
|
||||
fill_inventory_id = stock_fill_inventory_obj.create(cr, uid, {
|
||||
'location_id': inventory_data.location_id.id,
|
||||
'set_stock_zero': set_stock_zero})
|
||||
context_temp = context
|
||||
context_temp['active_ids'] = [inventory_data.id]
|
||||
context_temp['active_id'] = inventory_data.id
|
||||
stock_fill_inventory_obj.fill_inventory(cr, uid, [fill_inventory_id], context_temp)
|
||||
|
||||
|
||||
if context.get('type',[]) == 'move':
|
||||
act = {}
|
||||
# mod_obj = self.pool.get('ir.model.data')
|
||||
# act_obj = self.pool.get('ir.actions.act_window')
|
||||
# model_id = mod_obj.search(cr, uid, [('name', '=', 'move_stock_acquisition_link_2')])[0]
|
||||
# act_id = mod_obj.read(cr, uid, model_id, ['res_id'])['res_id']
|
||||
# act = act_obj.read(cr, uid, act_id)
|
||||
else:
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
act_obj = self.pool.get('ir.actions.act_window')
|
||||
model_id = mod_obj.search(cr, uid, [('name', '=', 'inventory_acquisition_link_1')])[0]
|
||||
act_id = mod_obj.read(cr, uid, model_id, ['res_id'])['res_id']
|
||||
act = act_obj.read(cr, uid, act_id)
|
||||
context = eval(act['context'])
|
||||
context['default_inventory_id'] = inventory_data.id
|
||||
context['default_name'] = inventory_data.name
|
||||
act['context'] = context
|
||||
return act
|
||||
|
||||
|
||||
stock_inventory()
|
||||
|
||||
class stock_move(osv.osv):
|
||||
|
||||
_inherit = 'stock.move'
|
||||
|
||||
# def _check_move(self, cr, uid, ids, context=None):
|
||||
# """ Checks if the given production lot belong to a pack
|
||||
# Return false if the production lot is in a pack
|
||||
# """
|
||||
# production_lot_obj = self.pool.get('stock.production.lot')
|
||||
#
|
||||
# for move in self.browse(cr, uid, ids, context=context):
|
||||
# if move.prodlot_id:
|
||||
# if self.search(cr, uid, [('prodlot_id', '=', move.prodlot_id.id), ('state','not in',('cancel','done')), ('id', '!=', move.id)]):
|
||||
# if move.prodlot_id.tracking_id:
|
||||
# return False
|
||||
# return True
|
||||
|
||||
_columns = {
|
||||
'pack_history_id': fields.many2one('stock.tracking.history', 'History pack'),
|
||||
}
|
||||
|
||||
# _constraints =[
|
||||
# (_check_move, 'You try to assign a move to a lot which is already in a pack', ['prodlot_id'])
|
||||
# ]
|
||||
''' Solution to move all pack and production lot if one in a pack is move '''
|
||||
# def move_parent(self, cr, uid, ids, context=None):
|
||||
# """ Checks if the given production lot belong to a pack
|
||||
# Move the pack in the same destination
|
||||
# """
|
||||
# ''' variables '''
|
||||
# production_lot_obj = self.pool.get('stock.production.lot')
|
||||
# move_packaging_obj = self.pool.get('stock.move.packaging')
|
||||
# ''' init '''
|
||||
# if context == None:
|
||||
# context = {}
|
||||
# ''' process '''
|
||||
# for move in self.browse(cr, uid, ids, context=context):
|
||||
# if move.prodlot_id:
|
||||
# if move.prodlot_id.tracking_id:
|
||||
# move_packaging_obj.move_pack(cr, uid, move.prodlot_id.tracking_id, context)
|
||||
# return {}
|
||||
|
||||
stock_move()
|
||||
|
||||
class stock_inventory_line(osv.osv):
|
||||
_inherit = "stock.inventory.line"
|
||||
|
||||
_columns = {
|
||||
'date': fields.datetime('Date'),
|
||||
'note': fields.text('Notes'),
|
||||
}
|
||||
|
||||
stock_inventory_line()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
19
stock_move_location/stock_move_sequence.xml
Normal file
19
stock_move_location/stock_move_sequence.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<!-- Sequences for stock.inventory -->
|
||||
<record id="seq_type_inventory_order" model="ir.sequence.type">
|
||||
<field name="name">Inventory Order</field>
|
||||
<field name="code">stock.inventory.move</field>
|
||||
</record>
|
||||
|
||||
<record id="seq_sale_order" model="ir.sequence">
|
||||
<field name="name">Inventory Order</field>
|
||||
<field name="code">stock.inventory.move</field>
|
||||
<field name="prefix">MOV</field>
|
||||
<field name="padding">3</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
67
stock_move_location/stock_view.xml
Executable file
67
stock_move_location/stock_view.xml
Executable file
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_inventory_tree" model="ir.ui.view">
|
||||
<field name="name">stock.inventory.tree</field>
|
||||
<field name="model">stock.inventory</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit_id" ref="stock.view_inventory_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="state" position="after">
|
||||
<field name="type" invisible="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_inventory_form" model="ir.ui.view">
|
||||
<field name="name">stock.inventory.form</field>
|
||||
<field name="model">stock.inventory</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="stock.view_inventory_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="company_id" position="after">
|
||||
<field name="type" invisible="1"/>
|
||||
<group colspan="4"><!-- attrs="{'invisible':[('type','=','normal')]}">-->
|
||||
<field name="location_id" required="1"/>
|
||||
<field name="location_dest_id" attrs="{'required':[('type','=','move')],'invisible':[('type','=','normal')]}"/>
|
||||
<button name="fill_inventory" string="Start Acquisition" type="object" icon="gtk-apply" colspan="4" attrs="{'invisible':['|',('type','=','move'),('state','!=','draft')]}"/>
|
||||
<button name="fill_inventory" string="Get Stock" type="object" icon="gtk-apply" colspan="4" attrs="{'invisible':['|',('type','=','normal'),('state','!=','draft')]}" context="{'type':'move'}"/>
|
||||
</group>
|
||||
</field>
|
||||
<button name="action_confirm" position="replace">
|
||||
<button name="action_confirm" string="Confirm Inventory" type="object" icon="gtk-apply" attrs="{'invisible':['|',('type','=','move'),('state','!=','draft')]}"/>
|
||||
<button name="move_stock" string="Move Stock" type="object" icon="gtk-apply" attrs="{'invisible':['|',('type','=','normal'),('state','!=','draft')]}"/>
|
||||
</button>
|
||||
<button name="action_done" position="replace">
|
||||
<button name="action_done" string="Validate Inventory" attrs="{'invisible':['|',('type','=','move'),('state','!=','confirm')]}" type="object" icon="gtk-jump-to"/>
|
||||
<button name="action_done" string="Validate Move" attrs="{'invisible':['|',('type','=','normal'),('state','!=','confirm')]}" type="object" icon="gtk-jump-to"/>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock.action_inventory_form" model="ir.actions.act_window">
|
||||
<field name="context">{'full':'1', 'type':'normal', 'default_type': 'normal'}</field>
|
||||
<field name="domain">[('type', '=', 'normal')]</field>
|
||||
</record>
|
||||
|
||||
<record id="stock.action_inventory_form_draft" model="ir.actions.act_window">
|
||||
<field name="domain">[('state','=','draft'), ('type', '=', 'normal')]</field>
|
||||
</record>
|
||||
|
||||
<record id="action_move_stock_form" model="ir.actions.act_window">
|
||||
<field name="name">Move stock</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">stock.inventory</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="stock.view_inventory_tree"/>
|
||||
<field name="context">{'full':'1', 'type':'move', 'default_type': 'move'}</field>
|
||||
<field name="domain">[('type', '=', 'move')]</field>
|
||||
<field name="search_view_id" ref="stock.view_inventory_filter" />
|
||||
<field name="help">You can use this to move a stock from a location to an other one.</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_move_stock_form" id="menu_action_move_stock_form" parent="stock.menu_stock_inventory_control" sequence="30"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
24
stock_move_location/wizard/__init__.py
Normal file
24
stock_move_location/wizard/__init__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#################################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#################################################################################
|
||||
|
||||
import move_location
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
46
stock_move_location/wizard/move_location.py
Normal file
46
stock_move_location/wizard/move_location.py
Normal file
@@ -0,0 +1,46 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#################################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#################################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
|
||||
class stock_fill_inventory(osv.osv_memory):
|
||||
_inherit = "stock.fill.inventory"
|
||||
|
||||
def _get_location(self, cr, uid, active_id, context={}):
|
||||
res = False
|
||||
if active_id:
|
||||
inv = self.pool.get('stock.inventory').browse(cr, uid, active_id)
|
||||
if inv.location_id:
|
||||
res = inv.location_id.id
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'location_id': fields.many2one('stock.location', 'Location', required=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'location_id': lambda s,cr,uid,c: s._get_location(cr, uid, c.get('active_id',False), c),
|
||||
}
|
||||
|
||||
stock_fill_inventory()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
34
stock_move_location/wizard/move_location_view.xml
Executable file
34
stock_move_location/wizard/move_location_view.xml
Executable file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!--<record id="view_stock_move_stock" model="ir.ui.view">
|
||||
<field name="name">Import Stock</field>
|
||||
<field name="model">stock.fill.inventory</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Import Stock">
|
||||
<separator string="Import current product inventory from the following location" colspan="4" />
|
||||
<field name="location_id"/>
|
||||
<newline/>
|
||||
<field name="recursive"/>
|
||||
<newline/>
|
||||
<field name="set_stock_zero"/>
|
||||
<separator string="" colspan="4" />
|
||||
<button special="cancel" string="_Cancel" icon='gtk-cancel'/>
|
||||
<button name="fill_inventory" string="Fill Location" type="object" icon="gtk-ok"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window name="Import Stock"
|
||||
res_model="stock.fill.inventory"
|
||||
src_model="stock.inventory"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
context="{'search_default_in_location':1}"
|
||||
key2="client_action_multi"
|
||||
id="action_view_stock_move_stock"/>-->
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user