Merge pull request #146 from cyrilgdn/9.0-obsolete_modules

[9.0] remove V8 deleted modules.
This commit is contained in:
Alexandre Fayolle
2016-03-21 14:42:47 +01:00
19 changed files with 0 additions and 945 deletions

View File

@@ -1,24 +0,0 @@
# -*- 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
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -1,52 +0,0 @@
# -*- 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" : "Inventory Extended",
"version" : "1.0",
"author" : "Julius Network Solutions,Odoo Community Association (OCA)",
"description" : """
Presentation:
This module adds a new field based on lines into the inventory
to know what are lines correctly in the system.
This module adds a new tab 'Lines' in Physical Inventories with correct lines of Stock Inventory Lines.
""",
"website" : "http://www.julius.fr",
"depends" : [
"stock",
],
"category" : "Customs/Stock",
"init_xml" : [],
"demo_xml" : [],
"images" : ['images/Inventory existing lines.png'],
"update_xml" : [
'stock_view.xml',
"security/ir.model.access.csv",
],
'test': [],
'installable': False,
'active': False,
'certificate': '',
}

View File

@@ -1,100 +0,0 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * stock_inventory_existing_lines
#
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:50+0000\n"
"PO-Revision-Date: 2011-12-19 10:50+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_inventory_existing_lines
#: view:stock.inventory:0
msgid "General Informations"
msgstr "Informations générales"
#. module: stock_inventory_existing_lines
#: field:stock.inventory.line2,product_id:0
msgid "Product"
msgstr "Produit"
#. module: stock_inventory_existing_lines
#: model:ir.model,name:stock_inventory_existing_lines.model_stock_inventory_line2
msgid "stock.inventory.line2"
msgstr "stock.inventory.line2"
#. module: stock_inventory_existing_lines
#: field:stock.inventory.line2,state:0
msgid "State"
msgstr "Statut"
#. module: stock_inventory_existing_lines
#: field:stock.inventory.line2,company_id:0
msgid "Company"
msgstr "Société"
#. module: stock_inventory_existing_lines
#: view:stock.inventory:0
msgid "Lines"
msgstr "Lignes correspondantes"
#. module: stock_inventory_existing_lines
#: model:ir.module.module,description:stock_inventory_existing_lines.module_meta_information
msgid " This module adds a new field based on lines into the inventory\n"
" to know what are lines correctly in the system "
msgstr " Ce module ajoute un nouveau champ basé sur des lignes dans l'inventaire\n"
" pour savoir quelles sont les lignes qui existent déjà dans le système "
#. module: stock_inventory_existing_lines
#: view:stock.inventory.line2:0
msgid "Stock Inventory Lines"
msgstr "Lignes d'inventaires des stocks"
#. module: stock_inventory_existing_lines
#: model:ir.module.module,shortdesc:stock_inventory_existing_lines.module_meta_information
msgid "Invetory Extended"
msgstr "Inventaire étendu"
#. module: stock_inventory_existing_lines
#: field:stock.inventory.line2,product_qty:0
msgid "Quantity"
msgstr "Quantité"
#. module: stock_inventory_existing_lines
#: field:stock.inventory.line2,product_uom:0
msgid "Product UOM"
msgstr "Produit UdM"
#. module: stock_inventory_existing_lines
#: model:ir.model,name:stock_inventory_existing_lines.model_stock_inventory
#: field:stock.inventory.line2,inventory_id:0
msgid "Inventory"
msgstr "Inventaire"
#. module: stock_inventory_existing_lines
#: view:stock.inventory:0
msgid "Correct lines"
msgstr "Lignes correspondantes"
#. module: stock_inventory_existing_lines
#: field:stock.inventory,inventory_line_id2:0
msgid "Inventories"
msgstr "Inventaires"
#. module: stock_inventory_existing_lines
#: field:stock.inventory.line2,prod_lot_id:0
msgid "Production Lot"
msgstr "Numéro de série"
#. module: stock_inventory_existing_lines
#: field:stock.inventory.line2,location_id:0
msgid "Location"
msgstr "Stockage"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

View File

@@ -1,3 +0,0 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_stock_inventory_line2_user","stock.inventory.line2 user","model_stock_inventory_line2","stock.group_stock_user",1,1,1,1
"access_stock_inventory_line2_manager","stock.inventory.line2 manager","model_stock_inventory_line2","stock.group_stock_manager",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_stock_inventory_line2_user stock.inventory.line2 user model_stock_inventory_line2 stock.group_stock_user 1 1 1 1
3 access_stock_inventory_line2_manager stock.inventory.line2 manager model_stock_inventory_line2 stock.group_stock_manager 1 1 1 1

View File

@@ -1,92 +0,0 @@
# -*- 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 _
import decimal_precision as dp
class stock_inventory(osv.osv):
_inherit = "stock.inventory"
_columns = {
'inventory_line_id2': fields.one2many('stock.inventory.line2', 'inventory_id', 'Inventories', states={'done': [('readonly', True)]}),
}
def action_confirm(self, cr, uid, ids, context=None):
if context is None:
context = {}
''' to perform the correct inventory corrections we need analyze stock location by
location, never recursively, so we use a special context '''
product_context = dict(context, compute_child=False)
location_obj = self.pool.get('stock.location')
line_obj = self.pool.get('stock.inventory.line')
line2_obj = self.pool.get('stock.inventory.line2')
for inv in self.browse(cr, uid, ids, context=context):
move_ids = []
for line in inv.inventory_line_id:
# ''' if the production lot is tracked but do not have a serial code then it is not taken into account '''
# if line.product_id.categ_id.tracked and not line.prod_lot_id:
# continue
if not line.product_qty:
continue
pid = line.product_id.id
date = line.date or inv.date
product_context.update(uom=line.product_uom.id, date=date, to_date=date, prodlot_id=line.prod_lot_id.id)
amount = location_obj._product_get(cr, uid, line.location_id.id, [pid], product_context)[pid]
if not amount:
continue
val_qty = min(line.product_qty,amount)
if val_qty and val_qty > 0:
vals = line_obj.copy_data(cr, uid, line.id)
line2_obj.create(cr, uid, vals)
# location_id = line.product_id.product_tmpl_id.property_stock_inventory.id
res = super(stock_inventory, self).action_confirm(cr, uid, ids, context)
return res
stock_inventory()
#class stock_move(osv.osv):
# _inherit = "stock.move"
#
# _columns = {
# 'inventory_type': fields.selection([('in','In'),('out','Out')], 'Inventory type')
# }
#stock_move()
class stock_inventory_line2(osv.osv):
_name = "stock.inventory.line2"
_columns = {
'inventory_id': fields.many2one('stock.inventory', 'Inventory', ondelete='cascade', select=True),
'location_id': fields.many2one('stock.location', 'Location', required=True),
'product_id': fields.many2one('product.product', 'Product', required=True, select=True),
'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),
'product_qty': fields.float('Quantity', digits_compute=dp.get_precision('Product UoM')),
'company_id': fields.related('inventory_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, select=True, readonly=True),
'prod_lot_id': fields.many2one('stock.production.lot', 'Production Lot', domain="[('product_id','=',product_id)]"),
'state': fields.related('inventory_id', 'state', type='char', string='State',readonly=True),
}
stock_inventory_line2()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -1,51 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="stock_inventory_line2_tree" model="ir.ui.view">
<field name="name">stock.inventory.line2.tree</field>
<field name="model">stock.inventory.line2</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Stock Inventory Lines">
<field name="product_id"/>
<field name="product_qty"/>
<field name="product_uom"/>
<field name="prod_lot_id" groups="base.group_extended"/>
<field name="location_id"/>
</tree>
</field>
</record>
<record id="view_inventory_line2_form" model="ir.ui.view">
<field name="name">stock.inventory.line2.form</field>
<field name="model">stock.inventory.line2</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Stock Inventory Lines">
<field context="{'location':location_id, 'uom':product_uom, 'to_date':parent.date}" name="product_id" on_change="on_change_product_id(location_id,product_id,product_uom,parent.date)" select="1" domain="[('type','&lt;&gt;','service')]"/>
<field name="product_qty"/>
<field name="product_uom"/>
<field name="prod_lot_id" groups="base.group_extended"/>
<field colspan="4" domain="[('usage','=','internal')]" name="location_id" select="1"/>
</form>
</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">
<page string="General Informations" position="after">
<page string="Lines">
<group colspan="4" col="4">
<separator string="Correct lines" colspan="4"/>
<field name="inventory_line_id2" colspan="4" nolabel="1"/>
</group>
</page>
</page>
</field>
</record>
</data>
</openerp>

View File

@@ -1,25 +0,0 @@
# -*- 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:

View File

@@ -1,50 +0,0 @@
# -*- 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 Inventory Extended",
"version" : "1.0",
"author" : "Julius Network Solutions,Odoo Community Association (OCA)",
"description" : """
Presentation:
This module adds a new field based on lines into the inventory
to get all lines pre-filled and all lines scanned
""",
"website" : "http://www.julius.fr",
"depends" : [
"stock",
],
"category" : "Customs/Stock",
"init_xml" : [],
"demo_xml" : [],
"images" : ['images/Inventory extended.png'],
"update_xml" : [
'stock_view.xml',
# 'wizard/stock_fill_inventory_view.xml',
],
'test': [],
'installable': False,
'active': False,
'certificate': '',
}

View File

@@ -1,86 +0,0 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * stock_inventory_extended
#
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:54+0000\n"
"PO-Revision-Date: 2011-12-19 10:54+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_inventory_extended
#: code:addons/stock_inventory_extended/wizard/stock_fill_inventory.py:47
#, python-format
msgid "You cannot perform this operation on more than one Stock Inventories."
msgstr "Vous ne pouvez pas effectuer cette opération sur plusieurs inventaires de stock."
#. module: stock_inventory_extended
#: model:ir.model,name:stock_inventory_extended.model_stock_fill_inventory
msgid "Import Inventory"
msgstr "Importer un inventaire"
#. module: stock_inventory_extended
#: model:ir.model,name:stock_inventory_extended.model_stock_inventory_line
msgid "Inventory Line"
msgstr "Lignes d'inventaire"
#. module: stock_inventory_extended
#: field:stock.inventory.line,note:0
msgid "Notes"
msgstr "Notes"
#. module: stock_inventory_extended
#: code:addons/stock_inventory_extended/wizard/stock_fill_inventory.py:47
#, python-format
msgid "Error!"
msgstr "Erreur!"
#. module: stock_inventory_extended
#: code:addons/stock_inventory_extended/wizard/stock_fill_inventory.py:111
#, python-format
msgid "No product in this location."
msgstr "Aucun produit à cet endroit."
#. module: stock_inventory_extended
#: code:addons/stock_inventory_extended/wizard/stock_fill_inventory.py:53
#, python-format
msgid "Stock Inventory is already Validated."
msgstr "L'inventaire est déjà validé."
#. module: stock_inventory_extended
#: code:addons/stock_inventory_extended/stock.py:77
#: model:ir.model,name:stock_inventory_extended.model_stock_inventory
#, python-format
msgid "Inventory"
msgstr "Inventaire"
#. module: stock_inventory_extended
#: field:stock.inventory.line,date:0
msgid "Date"
msgstr "Date"
#. module: stock_inventory_extended
#: code:addons/stock_inventory_extended/wizard/stock_fill_inventory.py:111
#, python-format
msgid "Warning !"
msgstr "Attention !"
#. module: stock_inventory_extended
#: code:addons/stock_inventory_extended/stock.py:77
#, python-format
msgid "is done."
msgstr "est fait."
#. module: stock_inventory_extended
#: code:addons/stock_inventory_extended/wizard/stock_fill_inventory.py:53
#, python-format
msgid "Warning!"
msgstr "Attention!"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

View File

@@ -1,96 +0,0 @@
# -*- 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_inventory(osv.osv):
_inherit = "stock.inventory"
_columns = {
'comments':fields.text('Comments'),
}
def action_confirm(self, cr, uid, ids, context=None):
""" Confirm the inventory and writes its finished date
@return: True
"""
res = super(stock_inventory, self).action_confirm(cr, uid, ids, context)
if context is None:
context = {}
# to perform the correct inventory corrections we need analyze stock location by
# location, never recursively, so we use a special 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):
move_ids = []
self.write(cr, uid, [inv.id], {'move_ids': [(6, 0, move_ids)]})
for line in inv.inventory_line_id:
pid = line.product_id.id
date = line.date or inv.date
product_context.update(uom=line.product_uom.id, date=date, to_date=date, prodlot_id=line.prod_lot_id.id)
amount = location_obj._product_get(cr, uid, line.location_id.id, [pid], product_context)[pid]
change = line.product_qty - amount
lot_id = line.prod_lot_id.id
if change:
location_id = line.product_id.product_tmpl_id.property_stock_inventory.id
value = {
'name': 'INV:' + str(line.inventory_id.id) + ':' + line.inventory_id.name,
'product_id': line.product_id.id,
'product_uom': line.product_uom.id,
'prodlot_id': lot_id,
'date': date,
'note': line.note or inv.comments or False,
}
if change > 0:
value.update( {
'product_qty': change,
'location_id': location_id,
'location_dest_id': line.location_id.id,
})
else:
value.update( {
'product_qty': -change,
'location_id': line.location_id.id,
'location_dest_id': location_id,
})
move_ids.append(self._inventory_line_hook(cr, uid, line, value))
message = _('Inventory') + " '" + 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 res
stock_inventory()
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:

View File

@@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<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="priority">16</field>
<field name="arch" type="xml">
<field name="company_id" position="after">
<field name="comments" colspan="4"/>
</field>
<xpath expr="/form/notebook/page/field[@name='inventory_line_id']/tree/field[@name='prod_lot_id']" position="after">
<field name="date"/>
<field name="note"/>
</xpath>
<xpath expr="/form/notebook/page/field[@name='inventory_line_id']/form/field[@name='product_uom']" position="after">
<field name="date"/>
<newline/>
<field name="note" colspan="4" nolabel="1"/>
<newline/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@@ -1,27 +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/>.
#
##############################################################################
import stock_fill_inventory
#import stock_inventory_line_split
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -1,132 +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 _
class stock_fill_inventory(osv.osv_memory):
_inherit = "stock.fill.inventory"
# _description = "Import Inventory"
# _columns = {
# 'location_id': fields.many2one('stock.location', 'Location', required=True),
# 'recursive': fields.boolean("Include children",help="If checked, products contained in child locations of selected location will be included as well."),
# 'set_stock_zero': fields.boolean("Set to zero",help="If checked, all product quantities will be set to zero to help ensure a real physical inventory is done"),
# }
# def view_init(self, cr, uid, fields_list, context=None):
# """
# Creates view dynamically and adding fields at runtime.
# @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 with new columns.
# """
# if context is None:
# context = {}
# super(stock_fill_inventory2, self).view_init(cr, uid, fields_list, context=context)
#
# if len(context.get('active_ids',[])) > 1:
# raise osv.except_osv(_('Error!'), _('You cannot perform this operation on more than one Stock Inventories.'))
#
# if context.get('active_id', False):
# stock = self.pool.get('stock.inventory').browse(cr, uid, context.get('active_id', False))
#
# if stock.state == 'done':
# raise osv.except_osv(_('Warning!'), _('Stock Inventory is already Validated.'))
# return True
def fill_inventory(self, cr, uid, ids, context=None):
""" To Import stock inventory according to products available in the selected locations.
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@param ids: the ID or list of IDs if we want more than one
@param context: A standard dictionary
@return:
"""
if context is None:
context = {}
inventory_line_obj = self.pool.get('stock.inventory.line')
location_obj = self.pool.get('stock.location')
product_obj = self.pool.get('product.product')
move_obj = self.pool.get('stock.move')
fill_inventory = self.browse(cr, uid, ids[0], context=context)
res = {}
res_location = {}
if fill_inventory.recursive:
location_ids = location_obj.search(cr, uid, [('location_id',
'child_of', [fill_inventory.location_id.id])],context=context)
else:
location_ids = [fill_inventory.location_id.id]
res = {}
flag = False
for location in location_ids:
datas = {}
res[location] = {}
domain = [('location_dest_id','=',location),('state','=','done')]
active_ids = context.get('active_ids', False)
if active_ids:
date = self.pool.get('stock.inventory').browse(cr, uid, active_ids[0]).date
domain.append(('date','<=',date))
move_ids = move_obj.search(cr, uid, domain, context=context)
for move in move_obj.browse(cr, uid, move_ids, context=context):
lot_id = move.prodlot_id.id
prod_id = move.product_id.id
qty = move.product_qty
if datas.get((prod_id, lot_id)):
qty += datas[(prod_id, lot_id)]['product_qty']
datas[(prod_id, lot_id)] = {'product_id': prod_id, 'location_id': location, 'product_qty': qty, 'product_uom': move.product_id.uom_id.id, 'prod_lot_id': lot_id}
if datas:
flag = True
res[location] = datas
if not flag:
raise osv.except_osv(_('Warning !'), _('No product in this location.'))
for stock_move in res.values():
for stock_move_details in stock_move.values():
stock_move_details.update({'inventory_id': context['active_ids'][0]})
domain = []
if fill_inventory.set_stock_zero:
stock_move_details.update({'product_qty': 0})
for field, value in stock_move_details.items():
domain.append((field, '=', value))
line_ids = inventory_line_obj.search(cr, uid, domain, context=context)
if not line_ids:
inventory_line_obj.create(cr, uid, stock_move_details, context=context)
return {'type': 'ir.actions.act_window_close'}
stock_fill_inventory()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_stock_fill_inventory2" model="ir.ui.view">
<field name="name">Import Inventory</field>
<field name="model">stock.fill.inventory2</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Import Inventory">
<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 Inventory" type="object" icon="gtk-ok"/>
</form>
</field>
</record>
<act_window name="Import Inventory 2"
res_model="stock.fill.inventory2"
src_model="stock.inventory"
view_mode="form"
target="new"
context="{'search_default_in_location':1}"
key2="client_action_multi"
id="action_view_stock_fill_inventory2"/>
<!--<record id="view_stock_fill_inventory_inherit" model="ir.ui.view">
<field name="name">Import Inventory</field>
<field name="model">stock.fill.inventory</field>
<field name="inherit_id" ref="stock.view_stock_fill_inventory"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="recursive" position="replace">
<field name="recursive" string="Inclure les sous-stocks"/>
</field>
<field name="set_stock_zero" position="replace">
<field name="set_stock_zero" invisible="1"/>
</field>
</field>
</record>-->
</data>
</openerp>

View File

@@ -1,24 +0,0 @@
# -*- 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
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -1,46 +0,0 @@
# -*- 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 Inventory Extended",
"version" : "1.0",
"author" : "Julius Network Solutions,Odoo Community Association (OCA)",
"description" : """
Presentation:
This module get the product real location if exists instead of inventory location.
""",
"website" : "http://www.julius.fr",
"depends" : [
"stock",
"stock_tracking_extended",
],
"category" : "Customs/Stock",
"init_xml" : [],
"demo_xml" : [],
"update_xml" : [],
'test': [],
'installable': False,
'active': False,
'certificate': '',
}

View File

@@ -1,60 +0,0 @@
# -*- 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_inventory(osv.osv):
_inherit = "stock.inventory"
_columns = {
}
def action_confirm(self, cr, uid, ids, context=None):
""" Confirm the inventory and writes its finished date
@return: True
"""
res = super(stock_inventory, self).action_confirm(cr, uid, ids, context)
if context is None:
context = {}
location_obj = self.pool.get('stock.location')
move_obj = self.pool.get('stock.move')
for inv in self.browse(cr, uid, ids, context=context):
for line in inv.move_ids:
location_id = line.product_id.product_tmpl_id.property_stock_inventory.id
if line.location_id.id == location_id and line.prodlot_id:
move_ids = move_obj.search(cr, uid, [
('prodlot_id', '=', line.prodlot_id.id),
('state', '=', 'done'),
('date', '<=', line.date),
], order='date desc', limit=1)
if move_ids:
move_id = move_obj.browse(cr, uid , move_ids[0])
real_location_id = move_id.location_dest_id and move_id.location_dest_id.id
if real_location_id and real_location_id != location_id:
move_obj.write(cr, uid, line.id, {'location_id': real_location_id})
return res
stock_inventory()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: