From 99a0d5077ad49fcdb6c212afa0ace47ef9e6429a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Apr 2012 10:53:45 +0200 Subject: [PATCH 01/24] [ADD] moved modules (lp:c2c-addons/6.1 rev 28.1.10) --- stock_available_immediately/__init__.py | 21 +++ stock_available_immediately/__openerp__.py | 41 ++++++ stock_available_immediately/product.py | 144 +++++++++++++++++++ stock_available_immediately/product_view.xml | 43 ++++++ 4 files changed, 249 insertions(+) create mode 100755 stock_available_immediately/__init__.py create mode 100644 stock_available_immediately/__openerp__.py create mode 100644 stock_available_immediately/product.py create mode 100644 stock_available_immediately/product_view.xml diff --git a/stock_available_immediately/__init__.py b/stock_available_immediately/__init__.py new file mode 100755 index 000000000..5d740e5ab --- /dev/null +++ b/stock_available_immediately/__init__.py @@ -0,0 +1,21 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Author Guewen Baconnier. Copyright Camptocamp SA +# +# 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 . +# +############################################################################## + +import product diff --git a/stock_available_immediately/__openerp__.py b/stock_available_immediately/__openerp__.py new file mode 100644 index 000000000..59ee9e846 --- /dev/null +++ b/stock_available_immediately/__openerp__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Guewen Baconnier +# Copyright 2010-2012 Camptocamp SA +# Copyright (C) 2011 Akretion Sébastien BEAU +# +# 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 . +# +############################################################################## + + +{ + "name" : "Immediately Usable Stock Quantity", + "version" : "1.0", + "depends" : ["product", "stock", ], + "author" : "Camptocamp", + "license": "AGPL-3", + "description": """ +Compute the immediately usable stock. +Immediately usable is computed : Quantity on Hand - Outgoing Stock. +""", + "website" : "http://tinyerp.com/module_account.html", + "category" : "Generic Modules/Stock", + "init_xml" : [], + "demo_xml" : [], + "update_xml" : ["product_view.xml", ], + "active": False, + "installable": True +} diff --git a/stock_available_immediately/product.py b/stock_available_immediately/product.py new file mode 100644 index 000000000..3c7891ba8 --- /dev/null +++ b/stock_available_immediately/product.py @@ -0,0 +1,144 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright 2010-2012 Camptocamp SA +# Copyright (C) 2011 Akretion Sébastien BEAU +# +# 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 . +# +############################################################################## + +import decimal_precision as dp + +from osv import fields, osv + + +class ProductImmediatelyUsable(osv.osv): + """ + Inherit Product in order to add an "immediately usable quantity" + stock field + Immediately usable quantity is : real stock - outgoing qty + """ + _inherit = 'product.product' + + def _product_available(self, cr, uid, ids, field_names=None, + arg=False, context=None): + """ + Get super() _product_available and compute immediately_usable_qty + """ + # We need available and outgoing quantities to compute + # immediately usable quantity. + # When immediately_usable_qty is displayed but + # not qty_available and outgoing_qty, + # they are not computed in the super method so we cannot + # compute immediately_usable_qty. + # To avoid this issue, we add the 2 fields in + # field_names to compute them. + if 'immediately_usable_qty' in field_names: + field_names.append('qty_available') + field_names.append('outgoing_qty') + + res = super(ProductImmediatelyUsable, self)._product_available( + cr, uid, ids, field_names, arg, context) + + if 'immediately_usable_qty' in field_names: + for product_id, stock_qty in res.iteritems(): + res[product_id]['immediately_usable_qty'] = \ + stock_qty['qty_available'] + stock_qty['outgoing_qty'] + + return res + + _columns = { + 'qty_available': fields.function( + _product_available, + multi='qty_available', + type='float', + digits_compute=dp.get_precision('Product UoM'), + string='Quantity On Hand', + help="Current quantity of products.\n" + "In a context with a single Stock Location, this includes " + "goods stored at this Location, or any of its children.\n" + "In a context with a single Warehouse, this includes " + "goods stored in the Stock Location of this Warehouse, " + "or any " + "of its children.\n" + "In a context with a single Shop, this includes goods " + "stored in the Stock Location of the Warehouse of this Shop, " + "or any of its children.\n" + "Otherwise, this includes goods stored in any Stock Location " + "typed as 'internal'."), + 'virtual_available': fields.function( + _product_available, + multi='qty_available', + type='float', + digits_compute=dp.get_precision('Product UoM'), + string='Quantity Available', + help="Forecast quantity (computed as Quantity On Hand " + "- Outgoing + Incoming)\n" + "In a context with a single Stock Location, this includes " + "goods stored at this Location, or any of its children.\n" + "In a context with a single Warehouse, this includes " + "goods stored in the Stock Location of this Warehouse, " + "or any " + "of its children.\n" + "In a context with a single Shop, this includes goods " + "stored in the Stock Location of the Warehouse of this Shop, " + "or any of its children.\n" + "Otherwise, this includes goods stored in any Stock Location " + "typed as 'internal'."), + 'incoming_qty': fields.function( + _product_available, + multi='qty_available', + type='float', + digits_compute=dp.get_precision('Product UoM'), + string='Incoming', + help="Quantity of products that are planned to arrive.\n" + "In a context with a single Stock Location, this includes " + "goods arriving to this Location, or any of its children.\n" + "In a context with a single Warehouse, this includes " + "goods arriving to the Stock Location of this Warehouse, or " + "any of its children.\n" + "In a context with a single Shop, this includes goods " + "arriving to the Stock Location of the Warehouse of this " + "Shop, or any of its children.\n" + "Otherwise, this includes goods arriving to any Stock " + "Location typed as 'internal'."), + 'outgoing_qty': fields.function( + _product_available, + multi='qty_available', + type='float', + digits_compute=dp.get_precision('Product UoM'), + string='Outgoing', + help="Quantity of products that are planned to leave.\n" + "In a context with a single Stock Location, this includes " + "goods leaving from this Location, or any of its children.\n" + "In a context with a single Warehouse, this includes " + "goods leaving from the Stock Location of this Warehouse, or " + "any of its children.\n" + "In a context with a single Shop, this includes goods " + "leaving from the Stock Location of the Warehouse of this " + "Shop, or any of its children.\n" + "Otherwise, this includes goods leaving from any Stock " + "Location typed as 'internal'."), + 'immediately_usable_qty': fields.function( + _product_available, + digits_compute=dp.get_precision('Product UoM'), + type='float', + string='Immediately Usable', + multi='qty_available', + help="Quantity of products really available for sale." \ + "Computed as: Quantity On Hand - Outgoing."), + } + +ProductImmediatelyUsable() diff --git a/stock_available_immediately/product_view.xml b/stock_available_immediately/product_view.xml new file mode 100644 index 000000000..147a05fe3 --- /dev/null +++ b/stock_available_immediately/product_view.xml @@ -0,0 +1,43 @@ + + + + + + + + product.normal.stock.active.qty.form.inherit + product.product + form + + + + + + + + + + + product_immediately_usable.product_product_tree_view + product.product + form + + + + + red:immediately_usable_qty<0;blue:immediately_usable_qty>=0 and state in ('draft', 'end', 'obsolete');black:immediately_usable_qty>=0 and state not in ('draft', 'end', 'obsolete') + + + + + + + + + + From c996bf90276d59b3d840b5a562ffb335500789d9 Mon Sep 17 00:00:00 2001 From: "@" <@> Date: Wed, 14 Mar 2012 16:36:18 +0100 Subject: [PATCH 02/24] [MRG] stock_available_immediately from c2c-ecom-addons (lp:c2c-addons/6.1 rev 45.1.7) --- stock_available_immediately/__openerp__.py | 32 ++-- stock_available_immediately/product.py | 171 +++++++-------------- 2 files changed, 72 insertions(+), 131 deletions(-) diff --git a/stock_available_immediately/__openerp__.py b/stock_available_immediately/__openerp__.py index 59ee9e846..2011f3f2e 100644 --- a/stock_available_immediately/__openerp__.py +++ b/stock_available_immediately/__openerp__.py @@ -1,21 +1,19 @@ -# -*- coding: utf-8 -*- +# -*- encoding: utf-8 -*- ############################################################################## # -# Author: Guewen Baconnier -# Copyright 2010-2012 Camptocamp SA -# Copyright (C) 2011 Akretion Sébastien BEAU +# Author Guewen Baconnier. Copyright Camptocamp SA # # 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. +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . # ############################################################################## @@ -24,18 +22,20 @@ { "name" : "Immediately Usable Stock Quantity", "version" : "1.0", - "depends" : ["product", "stock", ], + "depends" : [ + "base", + "product", + "stock", + ], "author" : "Camptocamp", - "license": "AGPL-3", - "description": """ -Compute the immediately usable stock. -Immediately usable is computed : Quantity on Hand - Outgoing Stock. -""", + "description": """Compute the immediately usable stock. Immediately usable is computed : Real Stock - Outgoing Stock. """, "website" : "http://tinyerp.com/module_account.html", "category" : "Generic Modules/Stock", "init_xml" : [], "demo_xml" : [], - "update_xml" : ["product_view.xml", ], + "update_xml" : [ + "product_view.xml", + ], "active": False, "installable": True } diff --git a/stock_available_immediately/product.py b/stock_available_immediately/product.py index 3c7891ba8..b071e1b33 100644 --- a/stock_available_immediately/product.py +++ b/stock_available_immediately/product.py @@ -1,144 +1,85 @@ -# -*- coding: utf-8 -*- +# -*- encoding: utf-8 -*- ############################################################################## # -# Copyright 2010-2012 Camptocamp SA -# Copyright (C) 2011 Akretion Sébastien BEAU +# Author Guewen Baconnier. Copyright Camptocamp SA +# Copyright (C) 2011 Akretion Sébastien BEAU # # 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. +# 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 Affero General Public License for more details. +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License +# You should have received a copy of the GNU General Public License # along with this program. If not, see . # ############################################################################## -import decimal_precision as dp from osv import fields, osv - +from tools.translate import _ class ProductImmediatelyUsable(osv.osv): """ - Inherit Product in order to add an "immediately usable quantity" - stock field + Inherit Product in order to add an "immediately usable quantity" stock field Immediately usable quantity is : real stock - outgoing qty """ _inherit = 'product.product' - - def _product_available(self, cr, uid, ids, field_names=None, - arg=False, context=None): - """ - Get super() _product_available and compute immediately_usable_qty - """ - # We need available and outgoing quantities to compute - # immediately usable quantity. - # When immediately_usable_qty is displayed but - # not qty_available and outgoing_qty, - # they are not computed in the super method so we cannot - # compute immediately_usable_qty. - # To avoid this issue, we add the 2 fields in - # field_names to compute them. + + def _product_available(self, cr, uid, ids, field_names=None, arg=False, context=None): + # We need available and outgoing quantities to compute immediately usable quantity. + # When immediately_usable_qty is displayed but not qty_available and outgoing_qty, + # they are not computed in the super method so we cannot compute immediately_usable_qty. + # To avoid this issue, we add the 2 fields in field_names to compute them. if 'immediately_usable_qty' in field_names: field_names.append('qty_available') field_names.append('outgoing_qty') - - res = super(ProductImmediatelyUsable, self)._product_available( - cr, uid, ids, field_names, arg, context) - - if 'immediately_usable_qty' in field_names: + + res = super(ProductImmediatelyUsable, self)._product_available(cr, uid, ids, field_names, arg, context) + + if 'immediately_usable_qty' in field_names: + # for each product we compute the stock for product_id, stock_qty in res.iteritems(): - res[product_id]['immediately_usable_qty'] = \ - stock_qty['qty_available'] + stock_qty['outgoing_qty'] - + res[product_id]['immediately_usable_qty'] = stock_qty['qty_available'] + stock_qty['outgoing_qty'] + return res - + _columns = { - 'qty_available': fields.function( - _product_available, - multi='qty_available', - type='float', - digits_compute=dp.get_precision('Product UoM'), - string='Quantity On Hand', - help="Current quantity of products.\n" - "In a context with a single Stock Location, this includes " - "goods stored at this Location, or any of its children.\n" - "In a context with a single Warehouse, this includes " - "goods stored in the Stock Location of this Warehouse, " - "or any " - "of its children.\n" - "In a context with a single Shop, this includes goods " - "stored in the Stock Location of the Warehouse of this Shop, " - "or any of its children.\n" - "Otherwise, this includes goods stored in any Stock Location " - "typed as 'internal'."), - 'virtual_available': fields.function( - _product_available, - multi='qty_available', - type='float', - digits_compute=dp.get_precision('Product UoM'), - string='Quantity Available', - help="Forecast quantity (computed as Quantity On Hand " - "- Outgoing + Incoming)\n" - "In a context with a single Stock Location, this includes " - "goods stored at this Location, or any of its children.\n" - "In a context with a single Warehouse, this includes " - "goods stored in the Stock Location of this Warehouse, " - "or any " - "of its children.\n" - "In a context with a single Shop, this includes goods " - "stored in the Stock Location of the Warehouse of this Shop, " - "or any of its children.\n" - "Otherwise, this includes goods stored in any Stock Location " - "typed as 'internal'."), - 'incoming_qty': fields.function( - _product_available, - multi='qty_available', - type='float', - digits_compute=dp.get_precision('Product UoM'), - string='Incoming', - help="Quantity of products that are planned to arrive.\n" - "In a context with a single Stock Location, this includes " - "goods arriving to this Location, or any of its children.\n" - "In a context with a single Warehouse, this includes " - "goods arriving to the Stock Location of this Warehouse, or " - "any of its children.\n" - "In a context with a single Shop, this includes goods " - "arriving to the Stock Location of the Warehouse of this " - "Shop, or any of its children.\n" - "Otherwise, this includes goods arriving to any Stock " - "Location typed as 'internal'."), - 'outgoing_qty': fields.function( - _product_available, - multi='qty_available', - type='float', - digits_compute=dp.get_precision('Product UoM'), - string='Outgoing', - help="Quantity of products that are planned to leave.\n" - "In a context with a single Stock Location, this includes " - "goods leaving from this Location, or any of its children.\n" - "In a context with a single Warehouse, this includes " - "goods leaving from the Stock Location of this Warehouse, or " - "any of its children.\n" - "In a context with a single Shop, this includes goods " - "leaving from the Stock Location of the Warehouse of this " - "Shop, or any of its children.\n" - "Otherwise, this includes goods leaving from any Stock " - "Location typed as 'internal'."), - 'immediately_usable_qty': fields.function( - _product_available, - digits_compute=dp.get_precision('Product UoM'), - type='float', - string='Immediately Usable', - multi='qty_available', - help="Quantity of products really available for sale." \ - "Computed as: Quantity On Hand - Outgoing."), + 'qty_available': fields.function(_product_available, + method=True, + type='float', + string='Real Stock', + multi='qty_available', + help="Current quantities of products in selected locations or all internal if none have been selected."), + 'virtual_available': fields.function(_product_available, + method=True, + type='float', + string='Virtual Stock', + multi='qty_available', + help="Futur stock for this product according to the selected location or all internal if none have been selected. Computed as: Real Stock - Outgoing + Incoming."), + 'incoming_qty': fields.function(_product_available, + method=True, + type='float', + string='Incoming', + multi='qty_available', + help="Quantities of products that are planned to arrive in selected locations or all internal if none have been selected."), + 'outgoing_qty': fields.function(_product_available, + method=True, + type='float', + string='Outgoing', + multi='qty_available', + help="Quantities of products that are planned to leave in selected locations or all internal if none have been selected."), + 'immediately_usable_qty': fields.function(_product_available, + method=True, + type='float', + string='Immediately Usable Stock', + multi='qty_available', + help="Quantities of products really available for sale. Computed as: Real Stock - Outgoing."), } - + + ProductImmediatelyUsable() From 9c7b507e04583728a59d13b733c00bcb095ddeac Mon Sep 17 00:00:00 2001 From: "@" <@> Date: Wed, 14 Mar 2012 16:36:38 +0100 Subject: [PATCH 03/24] [IMP] stock_available_immediately: licensed under AGPL-3 instead of GPL-3 with author agreement, improved help messages and pep8 (lp:c2c-addons/6.1 rev 45.1.8) --- stock_available_immediately/__openerp__.py | 32 ++-- stock_available_immediately/product.py | 171 ++++++++++++++------- 2 files changed, 131 insertions(+), 72 deletions(-) diff --git a/stock_available_immediately/__openerp__.py b/stock_available_immediately/__openerp__.py index 2011f3f2e..59ee9e846 100644 --- a/stock_available_immediately/__openerp__.py +++ b/stock_available_immediately/__openerp__.py @@ -1,19 +1,21 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # -# Author Guewen Baconnier. Copyright Camptocamp SA +# Author: Guewen Baconnier +# Copyright 2010-2012 Camptocamp SA +# Copyright (C) 2011 Akretion Sébastien BEAU # # 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. +# 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 General Public License for more details. +# GNU Affero General Public License for more details. # -# You should have received a copy of the GNU General Public License +# You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # ############################################################################## @@ -22,20 +24,18 @@ { "name" : "Immediately Usable Stock Quantity", "version" : "1.0", - "depends" : [ - "base", - "product", - "stock", - ], + "depends" : ["product", "stock", ], "author" : "Camptocamp", - "description": """Compute the immediately usable stock. Immediately usable is computed : Real Stock - Outgoing Stock. """, + "license": "AGPL-3", + "description": """ +Compute the immediately usable stock. +Immediately usable is computed : Quantity on Hand - Outgoing Stock. +""", "website" : "http://tinyerp.com/module_account.html", "category" : "Generic Modules/Stock", "init_xml" : [], "demo_xml" : [], - "update_xml" : [ - "product_view.xml", - ], + "update_xml" : ["product_view.xml", ], "active": False, "installable": True } diff --git a/stock_available_immediately/product.py b/stock_available_immediately/product.py index b071e1b33..3c7891ba8 100644 --- a/stock_available_immediately/product.py +++ b/stock_available_immediately/product.py @@ -1,85 +1,144 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # -# Author Guewen Baconnier. Copyright Camptocamp SA -# Copyright (C) 2011 Akretion Sébastien BEAU +# Copyright 2010-2012 Camptocamp SA +# Copyright (C) 2011 Akretion Sébastien BEAU # # 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. +# 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 General Public License for more details. +# GNU Affero General Public License for more details. # -# You should have received a copy of the GNU General Public License +# You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # ############################################################################## +import decimal_precision as dp from osv import fields, osv -from tools.translate import _ + class ProductImmediatelyUsable(osv.osv): """ - Inherit Product in order to add an "immediately usable quantity" stock field + Inherit Product in order to add an "immediately usable quantity" + stock field Immediately usable quantity is : real stock - outgoing qty """ _inherit = 'product.product' - - def _product_available(self, cr, uid, ids, field_names=None, arg=False, context=None): - # We need available and outgoing quantities to compute immediately usable quantity. - # When immediately_usable_qty is displayed but not qty_available and outgoing_qty, - # they are not computed in the super method so we cannot compute immediately_usable_qty. - # To avoid this issue, we add the 2 fields in field_names to compute them. + + def _product_available(self, cr, uid, ids, field_names=None, + arg=False, context=None): + """ + Get super() _product_available and compute immediately_usable_qty + """ + # We need available and outgoing quantities to compute + # immediately usable quantity. + # When immediately_usable_qty is displayed but + # not qty_available and outgoing_qty, + # they are not computed in the super method so we cannot + # compute immediately_usable_qty. + # To avoid this issue, we add the 2 fields in + # field_names to compute them. if 'immediately_usable_qty' in field_names: field_names.append('qty_available') field_names.append('outgoing_qty') - - res = super(ProductImmediatelyUsable, self)._product_available(cr, uid, ids, field_names, arg, context) - - if 'immediately_usable_qty' in field_names: - # for each product we compute the stock + + res = super(ProductImmediatelyUsable, self)._product_available( + cr, uid, ids, field_names, arg, context) + + if 'immediately_usable_qty' in field_names: for product_id, stock_qty in res.iteritems(): - res[product_id]['immediately_usable_qty'] = stock_qty['qty_available'] + stock_qty['outgoing_qty'] - + res[product_id]['immediately_usable_qty'] = \ + stock_qty['qty_available'] + stock_qty['outgoing_qty'] + return res - + _columns = { - 'qty_available': fields.function(_product_available, - method=True, - type='float', - string='Real Stock', - multi='qty_available', - help="Current quantities of products in selected locations or all internal if none have been selected."), - 'virtual_available': fields.function(_product_available, - method=True, - type='float', - string='Virtual Stock', - multi='qty_available', - help="Futur stock for this product according to the selected location or all internal if none have been selected. Computed as: Real Stock - Outgoing + Incoming."), - 'incoming_qty': fields.function(_product_available, - method=True, - type='float', - string='Incoming', - multi='qty_available', - help="Quantities of products that are planned to arrive in selected locations or all internal if none have been selected."), - 'outgoing_qty': fields.function(_product_available, - method=True, - type='float', - string='Outgoing', - multi='qty_available', - help="Quantities of products that are planned to leave in selected locations or all internal if none have been selected."), - 'immediately_usable_qty': fields.function(_product_available, - method=True, - type='float', - string='Immediately Usable Stock', - multi='qty_available', - help="Quantities of products really available for sale. Computed as: Real Stock - Outgoing."), + 'qty_available': fields.function( + _product_available, + multi='qty_available', + type='float', + digits_compute=dp.get_precision('Product UoM'), + string='Quantity On Hand', + help="Current quantity of products.\n" + "In a context with a single Stock Location, this includes " + "goods stored at this Location, or any of its children.\n" + "In a context with a single Warehouse, this includes " + "goods stored in the Stock Location of this Warehouse, " + "or any " + "of its children.\n" + "In a context with a single Shop, this includes goods " + "stored in the Stock Location of the Warehouse of this Shop, " + "or any of its children.\n" + "Otherwise, this includes goods stored in any Stock Location " + "typed as 'internal'."), + 'virtual_available': fields.function( + _product_available, + multi='qty_available', + type='float', + digits_compute=dp.get_precision('Product UoM'), + string='Quantity Available', + help="Forecast quantity (computed as Quantity On Hand " + "- Outgoing + Incoming)\n" + "In a context with a single Stock Location, this includes " + "goods stored at this Location, or any of its children.\n" + "In a context with a single Warehouse, this includes " + "goods stored in the Stock Location of this Warehouse, " + "or any " + "of its children.\n" + "In a context with a single Shop, this includes goods " + "stored in the Stock Location of the Warehouse of this Shop, " + "or any of its children.\n" + "Otherwise, this includes goods stored in any Stock Location " + "typed as 'internal'."), + 'incoming_qty': fields.function( + _product_available, + multi='qty_available', + type='float', + digits_compute=dp.get_precision('Product UoM'), + string='Incoming', + help="Quantity of products that are planned to arrive.\n" + "In a context with a single Stock Location, this includes " + "goods arriving to this Location, or any of its children.\n" + "In a context with a single Warehouse, this includes " + "goods arriving to the Stock Location of this Warehouse, or " + "any of its children.\n" + "In a context with a single Shop, this includes goods " + "arriving to the Stock Location of the Warehouse of this " + "Shop, or any of its children.\n" + "Otherwise, this includes goods arriving to any Stock " + "Location typed as 'internal'."), + 'outgoing_qty': fields.function( + _product_available, + multi='qty_available', + type='float', + digits_compute=dp.get_precision('Product UoM'), + string='Outgoing', + help="Quantity of products that are planned to leave.\n" + "In a context with a single Stock Location, this includes " + "goods leaving from this Location, or any of its children.\n" + "In a context with a single Warehouse, this includes " + "goods leaving from the Stock Location of this Warehouse, or " + "any of its children.\n" + "In a context with a single Shop, this includes goods " + "leaving from the Stock Location of the Warehouse of this " + "Shop, or any of its children.\n" + "Otherwise, this includes goods leaving from any Stock " + "Location typed as 'internal'."), + 'immediately_usable_qty': fields.function( + _product_available, + digits_compute=dp.get_precision('Product UoM'), + type='float', + string='Immediately Usable', + multi='qty_available', + help="Quantity of products really available for sale." \ + "Computed as: Quantity On Hand - Outgoing."), } - - + ProductImmediatelyUsable() From 1132bdf92c9beaeaf4528fe6641014f425c1d318 Mon Sep 17 00:00:00 2001 From: Joel Grand-Guillaume Date: Wed, 13 Feb 2013 09:46:41 +0100 Subject: [PATCH 04/24] [MIGR] Make all module uninstallable until we start migrating them. --- stock_available_immediately/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_available_immediately/__openerp__.py b/stock_available_immediately/__openerp__.py index 59ee9e846..65c402d98 100644 --- a/stock_available_immediately/__openerp__.py +++ b/stock_available_immediately/__openerp__.py @@ -37,5 +37,5 @@ Immediately usable is computed : Quantity on Hand - Outgoing Stock. "demo_xml" : [], "update_xml" : ["product_view.xml", ], "active": False, - "installable": True + "installable": False } From ff232b1e3d58c00a8769ba248bf4bf3295e6583f Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (Acsone)" Date: Mon, 16 Dec 2013 13:50:33 +0100 Subject: [PATCH 05/24] Migrate stock_available_immediately to 7.0 --- stock_available_immediately/__init__.py | 2 +- stock_available_immediately/__openerp__.py | 27 ++++++++++---------- stock_available_immediately/product.py | 10 +++----- stock_available_immediately/product_view.xml | 4 +-- 4 files changed, 19 insertions(+), 24 deletions(-) diff --git a/stock_available_immediately/__init__.py b/stock_available_immediately/__init__.py index 5d740e5ab..46f811108 100755 --- a/stock_available_immediately/__init__.py +++ b/stock_available_immediately/__init__.py @@ -18,4 +18,4 @@ # ############################################################################## -import product +from . import product diff --git a/stock_available_immediately/__openerp__.py b/stock_available_immediately/__openerp__.py index 65c402d98..41cbb52e2 100644 --- a/stock_available_immediately/__openerp__.py +++ b/stock_available_immediately/__openerp__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################## +# # # Author: Guewen Baconnier # Copyright 2010-2012 Camptocamp SA @@ -18,24 +18,23 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # -############################################################################## +# { - "name" : "Immediately Usable Stock Quantity", - "version" : "1.0", - "depends" : ["product", "stock", ], - "author" : "Camptocamp", + "name": "Immediately Usable Stock Quantity", + "version": "1.0", + "depends": ["product", "stock", ], + "author": "Camptocamp", "license": "AGPL-3", - "description": """ + "description": """ Compute the immediately usable stock. Immediately usable is computed : Quantity on Hand - Outgoing Stock. """, - "website" : "http://tinyerp.com/module_account.html", - "category" : "Generic Modules/Stock", - "init_xml" : [], - "demo_xml" : [], - "update_xml" : ["product_view.xml", ], - "active": False, - "installable": False + "website": "http://tinyerp.com/module_account.html", + "category": "Generic Modules/Stock", + "data": ["product_view.xml", + ], + "active": False, + "installable": True } diff --git a/stock_available_immediately/product.py b/stock_available_immediately/product.py index 3c7891ba8..51e3b3954 100644 --- a/stock_available_immediately/product.py +++ b/stock_available_immediately/product.py @@ -19,12 +19,12 @@ # ############################################################################## -import decimal_precision as dp +from openerp.addons import decimal_precision as dp -from osv import fields, osv +from openerp.osv import orm, fields -class ProductImmediatelyUsable(osv.osv): +class product_immediately_usable(orm.Model): """ Inherit Product in order to add an "immediately usable quantity" stock field @@ -49,7 +49,7 @@ class ProductImmediatelyUsable(osv.osv): field_names.append('qty_available') field_names.append('outgoing_qty') - res = super(ProductImmediatelyUsable, self)._product_available( + res = super(product_immediately_usable, self)._product_available( cr, uid, ids, field_names, arg, context) if 'immediately_usable_qty' in field_names: @@ -140,5 +140,3 @@ class ProductImmediatelyUsable(osv.osv): help="Quantity of products really available for sale." \ "Computed as: Quantity On Hand - Outgoing."), } - -ProductImmediatelyUsable() diff --git a/stock_available_immediately/product_view.xml b/stock_available_immediately/product_view.xml index 147a05fe3..058da3d14 100644 --- a/stock_available_immediately/product_view.xml +++ b/stock_available_immediately/product_view.xml @@ -12,8 +12,7 @@ product.normal.stock.active.qty.form.inherit product.product - form - + @@ -25,7 +24,6 @@ product_immediately_usable.product_product_tree_view product.product - form From d1c2fa742536ec8514a435ca7fd03a6370479325 Mon Sep 17 00:00:00 2001 From: gfcapalbo Date: Tue, 18 Nov 2014 16:48:13 +0100 Subject: [PATCH 06/24] [UPD] move out from unported to 8 for update [UPG] Upgraded to version 8, fixed references to new 8.0 views and moved fields that were in product.product to product.template [fix] remove duplicate view and correct view name [UPG][FIX] added outgoing field XML, that was in the base stock field in 7.0. [UPG] stock available immediately, corrected the calculation method of immediately_usable_qty to take in accountthe sign change in outgoing_qty (from negative to positive) in version 8. [FLAKE8] [FIX] renaming of a class, comment removing, useless code. [UPD] move out from unported to 8 for update [fix] remove duplicate view and correct view name [UPG][FIX] added outgoing field XML, that was in the base stock field in 7.0. [FIX] renaming of a class, comment removing, useless code. [fix] remove duplicate view and correct view name [UPG][FIX] added outgoing field XML, that was in the base stock field in 7.0. [UPD] move out from unported to 8 for update [fix] remove duplicate view and correct view name [UPG][FIX] added outgoing field XML, that was in the base stock field in 7.0. [FIX] renaming of a class, comment removing, useless code. [UPD] move out from unported to 8 for update [fix] remove duplicate view and correct view name [UPG][FIX] added outgoing field XML, that was in the base stock field in 7.0. [FIX] renaming of a class, comment removing, useless code. [UPD] move out from unported to 8 for update [fix] remove duplicate view and correct view name [UPG][FIX] added outgoing field XML, that was in the base stock field in 7.0. [FIX] renaming of a class, comment removing, useless code. [fix] remove duplicate view and correct view name [UPG][FIX] added outgoing field XML, that was in the base stock field in 7.0. [UPD] move out from unported to 8 for update [fix] remove duplicate view and correct view name [UPG][FIX] added outgoing field XML, that was in the base stock field in 7.0. [FIX] renaming of a class, comment removing, useless code. --- stock_available_immediately/__openerp__.py | 4 +-- stock_available_immediately/product.py | 28 ++++---------------- stock_available_immediately/product_view.xml | 16 ++++++----- 3 files changed, 17 insertions(+), 31 deletions(-) diff --git a/stock_available_immediately/__openerp__.py b/stock_available_immediately/__openerp__.py index 41cbb52e2..1cedaa84f 100644 --- a/stock_available_immediately/__openerp__.py +++ b/stock_available_immediately/__openerp__.py @@ -33,8 +33,8 @@ Immediately usable is computed : Quantity on Hand - Outgoing Stock. """, "website": "http://tinyerp.com/module_account.html", "category": "Generic Modules/Stock", - "data": ["product_view.xml", + "data": ["product_view.xml", ], "active": False, - "installable": True + 'installable': True } diff --git a/stock_available_immediately/product.py b/stock_available_immediately/product.py index 51e3b3954..8e6a7dc95 100644 --- a/stock_available_immediately/product.py +++ b/stock_available_immediately/product.py @@ -20,42 +20,24 @@ ############################################################################## from openerp.addons import decimal_precision as dp - from openerp.osv import orm, fields -class product_immediately_usable(orm.Model): +class ProductTemplate(orm.Model): """ - Inherit Product in order to add an "immediately usable quantity" - stock field Immediately usable quantity is : real stock - outgoing qty """ - _inherit = 'product.product' + _inherit = 'product.template' def _product_available(self, cr, uid, ids, field_names=None, arg=False, context=None): - """ - Get super() _product_available and compute immediately_usable_qty - """ - # We need available and outgoing quantities to compute - # immediately usable quantity. - # When immediately_usable_qty is displayed but - # not qty_available and outgoing_qty, - # they are not computed in the super method so we cannot - # compute immediately_usable_qty. - # To avoid this issue, we add the 2 fields in - # field_names to compute them. - if 'immediately_usable_qty' in field_names: - field_names.append('qty_available') - field_names.append('outgoing_qty') - - res = super(product_immediately_usable, self)._product_available( + res = super(ProductTemplate, self)._product_available( cr, uid, ids, field_names, arg, context) if 'immediately_usable_qty' in field_names: for product_id, stock_qty in res.iteritems(): res[product_id]['immediately_usable_qty'] = \ - stock_qty['qty_available'] + stock_qty['outgoing_qty'] + stock_qty['qty_available'] - stock_qty['outgoing_qty'] return res @@ -137,6 +119,6 @@ class product_immediately_usable(orm.Model): type='float', string='Immediately Usable', multi='qty_available', - help="Quantity of products really available for sale." \ + help="Quantity of products really available for sale." "Computed as: Quantity On Hand - Outgoing."), } diff --git a/stock_available_immediately/product_view.xml b/stock_available_immediately/product_view.xml index 058da3d14..bdd7873f9 100644 --- a/stock_available_immediately/product_view.xml +++ b/stock_available_immediately/product_view.xml @@ -11,20 +11,24 @@ product.normal.stock.active.qty.form.inherit - product.product - + product.template + + + + + - + - + product_immediately_usable.product_product_tree_view - product.product - + product.template + From bf86c4097ed55535c11e5f7cbb238e332eef8194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lionel=20Sausin=20=28Num=C3=A9rigraphe=29?= Date: Fri, 27 Feb 2015 13:43:56 +0100 Subject: [PATCH 07/24] [ADD] stock_available Generic module to compute the stock quantity available to promise using several implementations. stock_available_immediatly is changed to become the first optional implementation. Cherry pick of commit 0b060f619fa5d60f9fb343afe1154acd5c730148 from the v7 branch [IMP] stock_available* uses new API [IMP] READMEs and TODOs Cherry-picked from v7 at 8add4bea7e91924983fb29966e14a1f0d4d5332e Conflicts: __unported__/stock_available_mrp/__openerp__.py stock_available/__openerp__.py stock_available_immediately/__openerp__.py --- stock_available_immediately/README.rst | 30 ++++++ stock_available_immediately/__openerp__.py | 17 +-- stock_available_immediately/product.py | 108 ++----------------- stock_available_immediately/product_view.xml | 45 -------- 4 files changed, 44 insertions(+), 156 deletions(-) create mode 100644 stock_available_immediately/README.rst delete mode 100644 stock_available_immediately/product_view.xml diff --git a/stock_available_immediately/README.rst b/stock_available_immediately/README.rst new file mode 100644 index 000000000..5117d6025 --- /dev/null +++ b/stock_available_immediately/README.rst @@ -0,0 +1,30 @@ +Ignore planned receptions in quantity available to promise +========================================================== + +Normally the quantity available to promise is based on the virtual stock, +which includes both planned outgoing and incoming goods. +This module will subtract the planned receptions from the quantity available to +promise. + +Credits +======= + +Contributors +------------ + +* Author: Guewen Baconnier (Camptocamp SA) +* Sébastien BEAU (Akretion) +* Lionel Sausin (Numérigraphe) + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/stock_available_immediately/__openerp__.py b/stock_available_immediately/__openerp__.py index 1cedaa84f..197288c9b 100644 --- a/stock_available_immediately/__openerp__.py +++ b/stock_available_immediately/__openerp__.py @@ -20,21 +20,12 @@ # # - { - "name": "Immediately Usable Stock Quantity", - "version": "1.0", - "depends": ["product", "stock", ], + "name": "Ignore planned receptions in quantity available to promise", + "version": "2.0", + "depends": ["stock_available"], "author": "Camptocamp", "license": "AGPL-3", - "description": """ -Compute the immediately usable stock. -Immediately usable is computed : Quantity on Hand - Outgoing Stock. -""", - "website": "http://tinyerp.com/module_account.html", - "category": "Generic Modules/Stock", - "data": ["product_view.xml", - ], - "active": False, + "category": "Hidden", 'installable': True } diff --git a/stock_available_immediately/product.py b/stock_available_immediately/product.py index 8e6a7dc95..05d8ad2e7 100644 --- a/stock_available_immediately/product.py +++ b/stock_available_immediately/product.py @@ -19,106 +19,18 @@ # ############################################################################## -from openerp.addons import decimal_precision as dp -from openerp.osv import orm, fields +from openerp import models, fields, api -class ProductTemplate(orm.Model): - """ - Immediately usable quantity is : real stock - outgoing qty - """ +class ProductTemplate(models.Model): + """Subtract incoming qty from immediately_usable_qty""" _inherit = 'product.template' - def _product_available(self, cr, uid, ids, field_names=None, - arg=False, context=None): - res = super(ProductTemplate, self)._product_available( - cr, uid, ids, field_names, arg, context) + @api.depends('virtual_available') + def _product_available(self): + """Ignore the incoming goods in the quantity available to promise""" + super(ProductTemplate, self)._product_available() + for product in self: + product.immediately_usable_qty -= product.incoming_qty - if 'immediately_usable_qty' in field_names: - for product_id, stock_qty in res.iteritems(): - res[product_id]['immediately_usable_qty'] = \ - stock_qty['qty_available'] - stock_qty['outgoing_qty'] - - return res - - _columns = { - 'qty_available': fields.function( - _product_available, - multi='qty_available', - type='float', - digits_compute=dp.get_precision('Product UoM'), - string='Quantity On Hand', - help="Current quantity of products.\n" - "In a context with a single Stock Location, this includes " - "goods stored at this Location, or any of its children.\n" - "In a context with a single Warehouse, this includes " - "goods stored in the Stock Location of this Warehouse, " - "or any " - "of its children.\n" - "In a context with a single Shop, this includes goods " - "stored in the Stock Location of the Warehouse of this Shop, " - "or any of its children.\n" - "Otherwise, this includes goods stored in any Stock Location " - "typed as 'internal'."), - 'virtual_available': fields.function( - _product_available, - multi='qty_available', - type='float', - digits_compute=dp.get_precision('Product UoM'), - string='Quantity Available', - help="Forecast quantity (computed as Quantity On Hand " - "- Outgoing + Incoming)\n" - "In a context with a single Stock Location, this includes " - "goods stored at this Location, or any of its children.\n" - "In a context with a single Warehouse, this includes " - "goods stored in the Stock Location of this Warehouse, " - "or any " - "of its children.\n" - "In a context with a single Shop, this includes goods " - "stored in the Stock Location of the Warehouse of this Shop, " - "or any of its children.\n" - "Otherwise, this includes goods stored in any Stock Location " - "typed as 'internal'."), - 'incoming_qty': fields.function( - _product_available, - multi='qty_available', - type='float', - digits_compute=dp.get_precision('Product UoM'), - string='Incoming', - help="Quantity of products that are planned to arrive.\n" - "In a context with a single Stock Location, this includes " - "goods arriving to this Location, or any of its children.\n" - "In a context with a single Warehouse, this includes " - "goods arriving to the Stock Location of this Warehouse, or " - "any of its children.\n" - "In a context with a single Shop, this includes goods " - "arriving to the Stock Location of the Warehouse of this " - "Shop, or any of its children.\n" - "Otherwise, this includes goods arriving to any Stock " - "Location typed as 'internal'."), - 'outgoing_qty': fields.function( - _product_available, - multi='qty_available', - type='float', - digits_compute=dp.get_precision('Product UoM'), - string='Outgoing', - help="Quantity of products that are planned to leave.\n" - "In a context with a single Stock Location, this includes " - "goods leaving from this Location, or any of its children.\n" - "In a context with a single Warehouse, this includes " - "goods leaving from the Stock Location of this Warehouse, or " - "any of its children.\n" - "In a context with a single Shop, this includes goods " - "leaving from the Stock Location of the Warehouse of this " - "Shop, or any of its children.\n" - "Otherwise, this includes goods leaving from any Stock " - "Location typed as 'internal'."), - 'immediately_usable_qty': fields.function( - _product_available, - digits_compute=dp.get_precision('Product UoM'), - type='float', - string='Immediately Usable', - multi='qty_available', - help="Quantity of products really available for sale." - "Computed as: Quantity On Hand - Outgoing."), - } + immediately_usable_qty = fields.Float(compute='_product_available') diff --git a/stock_available_immediately/product_view.xml b/stock_available_immediately/product_view.xml deleted file mode 100644 index bdd7873f9..000000000 --- a/stock_available_immediately/product_view.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - product.normal.stock.active.qty.form.inherit - product.template - - - - - - - - - - - - - - - product_immediately_usable.product_product_tree_view - product.template - - - - - red:immediately_usable_qty<0;blue:immediately_usable_qty>=0 and state in ('draft', 'end', 'obsolete');black:immediately_usable_qty>=0 and state not in ('draft', 'end', 'obsolete') - - - - - - - - - - From eb245e0ab9cb400a11fe7b34c7fc68b72e9c155f Mon Sep 17 00:00:00 2001 From: gfcapalbo Date: Wed, 18 Mar 2015 13:20:03 +0100 Subject: [PATCH 08/24] [FIX] corrected calculation of immediately_usable_qty on product.product and product.template, now takes in account variants and correctly displays value. [FLAKE8] Removing duplicate modules and moving README.rst into __unported__ --- stock_available_immediately/product.py | 13 +- stock_available_immediately/tests/__init__.py | 1 + .../tests/test_stock_available_immediately.py | 120 ++++++++++++++++++ 3 files changed, 126 insertions(+), 8 deletions(-) create mode 100644 stock_available_immediately/tests/__init__.py create mode 100644 stock_available_immediately/tests/test_stock_available_immediately.py diff --git a/stock_available_immediately/product.py b/stock_available_immediately/product.py index 05d8ad2e7..491e44d1d 100644 --- a/stock_available_immediately/product.py +++ b/stock_available_immediately/product.py @@ -19,18 +19,15 @@ # ############################################################################## -from openerp import models, fields, api +from openerp import models -class ProductTemplate(models.Model): +class Product(models.Model): """Subtract incoming qty from immediately_usable_qty""" - _inherit = 'product.template' + _inherit = 'product.product' - @api.depends('virtual_available') - def _product_available(self): + def _immediately_usable_qty(self): """Ignore the incoming goods in the quantity available to promise""" - super(ProductTemplate, self)._product_available() + super(Product, self)._immediately_usable_qty() for product in self: product.immediately_usable_qty -= product.incoming_qty - - immediately_usable_qty = fields.Float(compute='_product_available') diff --git a/stock_available_immediately/tests/__init__.py b/stock_available_immediately/tests/__init__.py new file mode 100644 index 000000000..84148ecde --- /dev/null +++ b/stock_available_immediately/tests/__init__.py @@ -0,0 +1 @@ +from . import test_stock_available_immediately diff --git a/stock_available_immediately/tests/test_stock_available_immediately.py b/stock_available_immediately/tests/test_stock_available_immediately.py new file mode 100644 index 000000000..2c46f6460 --- /dev/null +++ b/stock_available_immediately/tests/test_stock_available_immediately.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2015 Therp BV +# +# 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 . +# +############################################################################## +from openerp.tests.common import TransactionCase + + +class testStockLogisticsWarehouse(TransactionCase): + + def test01_stock_levels(self): + """checking that immediately_usable_qty actually reflects \ +the variations in stock, both on product and template""" + moveObj = self.env['stock.move'] + productObj = self.env['product.product'] + templateObj = self.env['product.template'] + supplier_location = self.env.ref('stock.stock_location_suppliers') + stock_location = self.env.ref('stock.stock_location_stock') + customer_location = self.env.ref('stock.stock_location_customers') + uom_unit = self.env.ref('product.product_uom_unit') + + # Create product template + templateAB = templateObj.create( + {'name': 'templAB', + 'uom_id': uom_unit.id, + }) + + # Create product A and B + productA = productObj.create( + {'name': 'product A', + 'standard_price': 1, + 'type': 'product', + 'uom_id': uom_unit.id, + 'default_code': 'A', + 'product_tmpl_id': templateAB.id, + }) + + productB = productObj.create( + {'name': 'product B', + 'standard_price': 1, + 'type': 'product', + 'uom_id': uom_unit.id, + 'default_code': 'B', + 'product_tmpl_id': templateAB.id, + }) + + # Create a stock move from INCOMING to STOCK + stockMoveInA = moveObj.create( + {'location_id': supplier_location.id, + 'location_dest_id': stock_location.id, + 'name': 'MOVE INCOMING -> STOCK ', + 'product_id': productA.id, + 'product_uom': productA.uom_id.id, + 'product_uom_qty': 2, + }) + + stockMoveInB = moveObj.create( + {'location_id': supplier_location.id, + 'location_dest_id': stock_location.id, + 'name': 'MOVE INCOMING -> STOCK ', + 'product_id': productB.id, + 'product_uom': productB.uom_id.id, + 'product_uom_qty': 3, + }) + + def compare_product_usable_qty(product, value): + # Refresh, because the function field is not recalculated between + # transactions + product.refresh() + self.assertEqual(product.immediately_usable_qty, value) + + compare_product_usable_qty(productA, 0) + compare_product_usable_qty(templateAB, 0) + + stockMoveInA.action_confirm() + compare_product_usable_qty(productA, 0) + compare_product_usable_qty(templateAB, 0) + + stockMoveInA.action_assign() + compare_product_usable_qty(productA, 0) + compare_product_usable_qty(templateAB, 0) + + stockMoveInA.action_done() + compare_product_usable_qty(productA, 2) + compare_product_usable_qty(templateAB, 2) + + # will directly trigger action_done on productB + stockMoveInB.action_done() + compare_product_usable_qty(productA, 2) + compare_product_usable_qty(productB, 3) + compare_product_usable_qty(templateAB, 5) + + # Create a stock move from STOCK to CUSTOMER + stockMoveOutA = moveObj.create( + {'location_id': stock_location.id, + 'location_dest_id': customer_location.id, + 'name': ' STOCK --> CUSTOMER ', + 'product_id': productA.id, + 'product_uom': productA.uom_id.id, + 'product_uom_qty': 1, + 'state': 'confirmed', + }) + + stockMoveOutA.action_done() + compare_product_usable_qty(productA, 1) + compare_product_usable_qty(templateAB, 4) From 58e4012fee9d27e541606d57c095e18269be28b8 Mon Sep 17 00:00:00 2001 From: Lionel Sausin Date: Wed, 16 Sep 2015 09:35:18 +0200 Subject: [PATCH 09/24] Fix the beta lint checks of Travis --- stock_available_immediately/__init__.py | 2 +- stock_available_immediately/__openerp__.py | 2 +- stock_available_immediately/tests/__init__.py | 2 ++ .../tests/test_stock_available_immediately.py | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) mode change 100755 => 100644 stock_available_immediately/__init__.py diff --git a/stock_available_immediately/__init__.py b/stock_available_immediately/__init__.py old mode 100755 new mode 100644 index 46f811108..b88029cff --- a/stock_available_immediately/__init__.py +++ b/stock_available_immediately/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Author Guewen Baconnier. Copyright Camptocamp SA diff --git a/stock_available_immediately/__openerp__.py b/stock_available_immediately/__openerp__.py index 197288c9b..21e5c8be5 100644 --- a/stock_available_immediately/__openerp__.py +++ b/stock_available_immediately/__openerp__.py @@ -22,7 +22,7 @@ { "name": "Ignore planned receptions in quantity available to promise", - "version": "2.0", + "version": "8.0.2.0.0", "depends": ["stock_available"], "author": "Camptocamp", "license": "AGPL-3", diff --git a/stock_available_immediately/tests/__init__.py b/stock_available_immediately/tests/__init__.py index 84148ecde..8185fdf1f 100644 --- a/stock_available_immediately/tests/__init__.py +++ b/stock_available_immediately/tests/__init__.py @@ -1 +1,3 @@ +# -*- coding: utf-8 -*- + from . import test_stock_available_immediately diff --git a/stock_available_immediately/tests/test_stock_available_immediately.py b/stock_available_immediately/tests/test_stock_available_immediately.py index 2c46f6460..be9f43006 100644 --- a/stock_available_immediately/tests/test_stock_available_immediately.py +++ b/stock_available_immediately/tests/test_stock_available_immediately.py @@ -20,7 +20,7 @@ from openerp.tests.common import TransactionCase -class testStockLogisticsWarehouse(TransactionCase): +class TestStockLogisticsWarehouse(TransactionCase): def test01_stock_levels(self): """checking that immediately_usable_qty actually reflects \ From 4f7440eb7be9161c71116df49fabe521e85b57c0 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Mon, 5 Oct 2015 06:16:20 -0400 Subject: [PATCH 10/24] OCA Transbot updated translations from Transifex --- stock_available_immediately/i18n/es.po | 23 +++++++++++++++++++++++ stock_available_immediately/i18n/fi.po | 23 +++++++++++++++++++++++ stock_available_immediately/i18n/fr.po | 23 +++++++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 stock_available_immediately/i18n/es.po create mode 100644 stock_available_immediately/i18n/fi.po create mode 100644 stock_available_immediately/i18n/fr.po diff --git a/stock_available_immediately/i18n/es.po b/stock_available_immediately/i18n/es.po new file mode 100644 index 000000000..82214d142 --- /dev/null +++ b/stock_available_immediately/i18n/es.po @@ -0,0 +1,23 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-09-23 20:23+0000\n" +"PO-Revision-Date: 2015-09-17 15:40+0000\n" +"Last-Translator: <>\n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Producto" diff --git a/stock_available_immediately/i18n/fi.po b/stock_available_immediately/i18n/fi.po new file mode 100644 index 000000000..01b5cd802 --- /dev/null +++ b/stock_available_immediately/i18n/fi.po @@ -0,0 +1,23 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-09-23 20:23+0000\n" +"PO-Revision-Date: 2015-09-17 15:40+0000\n" +"Last-Translator: <>\n" +"Language-Team: Finnish (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/fi/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fi\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Tuote" diff --git a/stock_available_immediately/i18n/fr.po b/stock_available_immediately/i18n/fr.po new file mode 100644 index 000000000..2883b5214 --- /dev/null +++ b/stock_available_immediately/i18n/fr.po @@ -0,0 +1,23 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-09-23 20:23+0000\n" +"PO-Revision-Date: 2015-09-17 15:40+0000\n" +"Last-Translator: <>\n" +"Language-Team: French (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Article" From 398e62bc96691e8cc3829bf4f117331857f1c746 Mon Sep 17 00:00:00 2001 From: "Atchuthan, Sodexis" Date: Wed, 10 Feb 2016 11:42:16 +0530 Subject: [PATCH 11/24] [9.0][PORT] Stock available immediately --- stock_available_immediately/README.rst | 1 + stock_available_immediately/__init__.py | 20 ++--------------- stock_available_immediately/__openerp__.py | 26 ++++------------------ stock_available_immediately/product.py | 21 ++--------------- 4 files changed, 9 insertions(+), 59 deletions(-) diff --git a/stock_available_immediately/README.rst b/stock_available_immediately/README.rst index 5117d6025..957dd59db 100644 --- a/stock_available_immediately/README.rst +++ b/stock_available_immediately/README.rst @@ -15,6 +15,7 @@ Contributors * Author: Guewen Baconnier (Camptocamp SA) * Sébastien BEAU (Akretion) * Lionel Sausin (Numérigraphe) +* Sodexis Maintainer ---------- diff --git a/stock_available_immediately/__init__.py b/stock_available_immediately/__init__.py index b88029cff..5678916ad 100644 --- a/stock_available_immediately/__init__.py +++ b/stock_available_immediately/__init__.py @@ -1,21 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author Guewen Baconnier. Copyright Camptocamp SA -# -# 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 . -# -############################################################################## +# © 2014 Camptocamp, Akretion, Numérigraphe, Sodexis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import product diff --git a/stock_available_immediately/__openerp__.py b/stock_available_immediately/__openerp__.py index 21e5c8be5..5894ba55c 100644 --- a/stock_available_immediately/__openerp__.py +++ b/stock_available_immediately/__openerp__.py @@ -1,30 +1,12 @@ # -*- coding: utf-8 -*- -# -# -# Author: Guewen Baconnier -# Copyright 2010-2012 Camptocamp SA -# Copyright (C) 2011 Akretion Sébastien BEAU -# -# 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 . -# -# +# © 2014 Camptocamp, Akretion, Numérigraphe, Sodexis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Ignore planned receptions in quantity available to promise", - "version": "8.0.2.0.0", + "version": "9.0.1.0.0", "depends": ["stock_available"], - "author": "Camptocamp", + "author": "Camptocamp,Sodexis,Odoo Community Association (OCA)", "license": "AGPL-3", "category": "Hidden", 'installable': True diff --git a/stock_available_immediately/product.py b/stock_available_immediately/product.py index 491e44d1d..c41e090b6 100644 --- a/stock_available_immediately/product.py +++ b/stock_available_immediately/product.py @@ -1,23 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Copyright 2010-2012 Camptocamp SA -# Copyright (C) 2011 Akretion Sébastien BEAU -# -# 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 . -# -############################################################################## +# © 2014 Camptocamp, Akretion, Numérigraphe, Sodexis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models From e5a878f1c504fee1850f45b1010e36e6fcf4a8fb Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sun, 28 Feb 2016 02:17:52 -0500 Subject: [PATCH 12/24] OCA Transbot updated translations from Transifex --- stock_available_immediately/i18n/en.po | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 stock_available_immediately/i18n/en.po diff --git a/stock_available_immediately/i18n/en.po b/stock_available_immediately/i18n/en.po new file mode 100644 index 000000000..0366f3f61 --- /dev/null +++ b/stock_available_immediately/i18n/en.po @@ -0,0 +1,23 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-02-27 01:43+0000\n" +"PO-Revision-Date: 2016-02-26 12:25+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: English (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/en/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Product" From 7e0c51aecbe6f9fe9efcafeeb5f099f8451d2033 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Mon, 26 Oct 2015 13:56:24 +0100 Subject: [PATCH 13/24] product_available improvements * fix the dependencies for the computed field * use api.multi instead of api.one to avoid calling super()._immediately_usable_qty in a loop (this improves perfs on a tree view display) --- stock_available_immediately/product.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/stock_available_immediately/product.py b/stock_available_immediately/product.py index c41e090b6..845ef63e7 100644 --- a/stock_available_immediately/product.py +++ b/stock_available_immediately/product.py @@ -9,8 +9,10 @@ class Product(models.Model): """Subtract incoming qty from immediately_usable_qty""" _inherit = 'product.product' + @api.multi + @api.depends('virtual_available', 'incoming_qty') def _immediately_usable_qty(self): """Ignore the incoming goods in the quantity available to promise""" - super(Product, self)._immediately_usable_qty() - for product in self: - product.immediately_usable_qty -= product.incoming_qty + super(ProductProduct, self)._immediately_usable_qty() + for prod in self: + prod.immediately_usable_qty -= prod.incoming_qty From 082f748bd159e9450015ff0ef4009740a7141915 Mon Sep 17 00:00:00 2001 From: Lionel Sausin Date: Fri, 6 Nov 2015 17:19:14 +0100 Subject: [PATCH 14/24] [IMP] Decouple the quantity for templates and variants There are cases where we dot NOT want to simply sum the quantities of all the variants. For example when dealing with manufacturing capacities, we may have to chose between variants because we can't make ALL of them with the same components. So instead of a simple non-modular implementation, we'll let each module define his own implementation of how to compute the product template's quantity available for sale. Conflicts: stock_available/__openerp__.py stock_available_immediately/__openerp__.py --- stock_available_immediately/__init__.py | 3 +- stock_available_immediately/__openerp__.py | 2 +- .../models/product_template.py | 35 +++++++++++++++++++ stock_available_immediately/product.py | 4 ++- 4 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 stock_available_immediately/models/product_template.py diff --git a/stock_available_immediately/__init__.py b/stock_available_immediately/__init__.py index 5678916ad..4fce57c9b 100644 --- a/stock_available_immediately/__init__.py +++ b/stock_available_immediately/__init__.py @@ -2,4 +2,5 @@ # © 2014 Camptocamp, Akretion, Numérigraphe, Sodexis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from . import product +from . import product_product +from . import product_template diff --git a/stock_available_immediately/__openerp__.py b/stock_available_immediately/__openerp__.py index 5894ba55c..f246cad5a 100644 --- a/stock_available_immediately/__openerp__.py +++ b/stock_available_immediately/__openerp__.py @@ -4,7 +4,7 @@ { "name": "Ignore planned receptions in quantity available to promise", - "version": "9.0.1.0.0", + "version": "9.0.1.1.0", "depends": ["stock_available"], "author": "Camptocamp,Sodexis,Odoo Community Association (OCA)", "license": "AGPL-3", diff --git a/stock_available_immediately/models/product_template.py b/stock_available_immediately/models/product_template.py new file mode 100644 index 000000000..d8cd5ed34 --- /dev/null +++ b/stock_available_immediately/models/product_template.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# This module is copyright (C) 2014 Numérigraphe SARL. All Rights Reserved. +# +# 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 . +# +############################################################################## + +from openerp import models, api + + +class ProductTemplate(models.Model): + _inherit = 'product.template' + + @api.multi + @api.depends('virtual_available', 'incoming_qty') + def _immediately_usable_qty(self): + """Ignore the incoming goods in the quantity available to promise + + This is the same implementation as for variants.""" + super(ProductTemplate, self)._immediately_usable_qty() + for tmpl in self: + tmpl.immediately_usable_qty -= tmpl.incoming_qty diff --git a/stock_available_immediately/product.py b/stock_available_immediately/product.py index 845ef63e7..93200460f 100644 --- a/stock_available_immediately/product.py +++ b/stock_available_immediately/product.py @@ -12,7 +12,9 @@ class Product(models.Model): @api.multi @api.depends('virtual_available', 'incoming_qty') def _immediately_usable_qty(self): - """Ignore the incoming goods in the quantity available to promise""" + """Ignore the incoming goods in the quantity available to promise + + This is the same implementation as for templates.""" super(ProductProduct, self)._immediately_usable_qty() for prod in self: prod.immediately_usable_qty -= prod.incoming_qty From 10a9d078c39050f21e2ce9d49ba20aa750ac78f3 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sun, 27 Mar 2016 06:59:39 -0400 Subject: [PATCH 15/24] OCA Transbot updated translations from Transifex --- stock_available_immediately/i18n/de.po | 29 +++++++++++++++++++ stock_available_immediately/i18n/es.po | 15 ++++++---- stock_available_immediately/i18n/fi.po | 15 ++++++---- stock_available_immediately/i18n/fr.po | 15 ++++++---- stock_available_immediately/i18n/hr_HR.po | 28 ++++++++++++++++++ .../i18n/{en.po => it.po} | 15 ++++++---- stock_available_immediately/i18n/pt_BR.po | 28 ++++++++++++++++++ stock_available_immediately/i18n/sl.po | 28 ++++++++++++++++++ stock_available_immediately/i18n/zh_CN.po | 29 +++++++++++++++++++ 9 files changed, 182 insertions(+), 20 deletions(-) create mode 100644 stock_available_immediately/i18n/de.po create mode 100644 stock_available_immediately/i18n/hr_HR.po rename stock_available_immediately/i18n/{en.po => it.po} (60%) create mode 100644 stock_available_immediately/i18n/pt_BR.po create mode 100644 stock_available_immediately/i18n/sl.po create mode 100644 stock_available_immediately/i18n/zh_CN.po diff --git a/stock_available_immediately/i18n/de.po b/stock_available_immediately/i18n/de.po new file mode 100644 index 000000000..af867b67e --- /dev/null +++ b/stock_available_immediately/i18n/de.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# Rudolf Schnapka , 2016 +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-14 12:02+0000\n" +"PO-Revision-Date: 2016-04-22 09:17+0000\n" +"Last-Translator: Rudolf Schnapka \n" +"Language-Team: German (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produkt" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_template +msgid "Product Template" +msgstr "Produktvorlage" diff --git a/stock_available_immediately/i18n/es.po b/stock_available_immediately/i18n/es.po index 82214d142..1559eb4ed 100644 --- a/stock_available_immediately/i18n/es.po +++ b/stock_available_immediately/i18n/es.po @@ -5,12 +5,12 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Project-Id-Version: stock-logistics-warehouse (9.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-23 20:23+0000\n" -"PO-Revision-Date: 2015-09-17 15:40+0000\n" -"Last-Translator: <>\n" -"Language-Team: Spanish (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/es/)\n" +"POT-Creation-Date: 2016-03-23 01:46+0000\n" +"PO-Revision-Date: 2016-03-22 10:04+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -21,3 +21,8 @@ msgstr "" #: model:ir.model,name:stock_available_immediately.model_product_product msgid "Product" msgstr "Producto" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_template +msgid "Product Template" +msgstr "Plantilla de producto" diff --git a/stock_available_immediately/i18n/fi.po b/stock_available_immediately/i18n/fi.po index 01b5cd802..b6c025ccb 100644 --- a/stock_available_immediately/i18n/fi.po +++ b/stock_available_immediately/i18n/fi.po @@ -5,12 +5,12 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Project-Id-Version: stock-logistics-warehouse (9.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-23 20:23+0000\n" -"PO-Revision-Date: 2015-09-17 15:40+0000\n" -"Last-Translator: <>\n" -"Language-Team: Finnish (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/fi/)\n" +"POT-Creation-Date: 2016-03-23 01:46+0000\n" +"PO-Revision-Date: 2016-03-22 10:04+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Finnish (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -21,3 +21,8 @@ msgstr "" #: model:ir.model,name:stock_available_immediately.model_product_product msgid "Product" msgstr "Tuote" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_template +msgid "Product Template" +msgstr "Tuotteen malli" diff --git a/stock_available_immediately/i18n/fr.po b/stock_available_immediately/i18n/fr.po index 2883b5214..cda55dfb5 100644 --- a/stock_available_immediately/i18n/fr.po +++ b/stock_available_immediately/i18n/fr.po @@ -5,12 +5,12 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Project-Id-Version: stock-logistics-warehouse (9.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-23 20:23+0000\n" -"PO-Revision-Date: 2015-09-17 15:40+0000\n" -"Last-Translator: <>\n" -"Language-Team: French (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/fr/)\n" +"POT-Creation-Date: 2016-03-23 01:46+0000\n" +"PO-Revision-Date: 2016-03-22 10:04+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -21,3 +21,8 @@ msgstr "" #: model:ir.model,name:stock_available_immediately.model_product_product msgid "Product" msgstr "Article" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_template +msgid "Product Template" +msgstr "Modèle de produit" diff --git a/stock_available_immediately/i18n/hr_HR.po b/stock_available_immediately/i18n/hr_HR.po new file mode 100644 index 000000000..5d39c5282 --- /dev/null +++ b/stock_available_immediately/i18n/hr_HR.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-05-01 15:38+0000\n" +"PO-Revision-Date: 2016-05-31 20:20+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Croatian (Croatia) (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/hr_HR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr_HR\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Proizvod" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_template +msgid "Product Template" +msgstr "Predložak proizvoda" diff --git a/stock_available_immediately/i18n/en.po b/stock_available_immediately/i18n/it.po similarity index 60% rename from stock_available_immediately/i18n/en.po rename to stock_available_immediately/i18n/it.po index 0366f3f61..224297fbb 100644 --- a/stock_available_immediately/i18n/en.po +++ b/stock_available_immediately/i18n/it.po @@ -7,17 +7,22 @@ msgid "" msgstr "" "Project-Id-Version: stock-logistics-warehouse (9.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-02-27 01:43+0000\n" -"PO-Revision-Date: 2016-02-26 12:25+0000\n" +"POT-Creation-Date: 2016-09-04 10:11+0000\n" +"PO-Revision-Date: 2016-09-09 11:33+0000\n" "Last-Translator: OCA Transbot \n" -"Language-Team: English (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/en/)\n" +"Language-Team: Italian (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/it/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: en\n" +"Language: it\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_available_immediately #: model:ir.model,name:stock_available_immediately.model_product_product msgid "Product" -msgstr "Product" +msgstr "Prodotto" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_template +msgid "Product Template" +msgstr "" diff --git a/stock_available_immediately/i18n/pt_BR.po b/stock_available_immediately/i18n/pt_BR.po new file mode 100644 index 000000000..a4e1a3119 --- /dev/null +++ b/stock_available_immediately/i18n/pt_BR.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-03 20:56+0000\n" +"PO-Revision-Date: 2016-07-07 19:33+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produto" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_template +msgid "Product Template" +msgstr "Modelo Produto" diff --git a/stock_available_immediately/i18n/sl.po b/stock_available_immediately/i18n/sl.po new file mode 100644 index 000000000..f92f1d39d --- /dev/null +++ b/stock_available_immediately/i18n/sl.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-30 03:10+0000\n" +"PO-Revision-Date: 2016-04-27 11:10+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Proizvod" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_template +msgid "Product Template" +msgstr "Predloga proizvoda" diff --git a/stock_available_immediately/i18n/zh_CN.po b/stock_available_immediately/i18n/zh_CN.po new file mode 100644 index 000000000..44ee05bc8 --- /dev/null +++ b/stock_available_immediately/i18n/zh_CN.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# Jeffery Chenn , 2016 +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-28 10:00+0000\n" +"PO-Revision-Date: 2016-09-04 06:05+0000\n" +"Last-Translator: Jeffery Chenn \n" +"Language-Team: Chinese (China) (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/zh_CN/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: zh_CN\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "产品" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_template +msgid "Product Template" +msgstr "产品模板" From 0f014950f1d1ff9e163dea08596d6aadc099452d Mon Sep 17 00:00:00 2001 From: SodexisTeam Date: Fri, 25 Nov 2016 12:20:18 +0530 Subject: [PATCH 16/24] [10.0][MIG] stock_available & stock_available_immediately (#219) --- stock_available_immediately/README.rst | 35 ++++++++++++++++-- stock_available_immediately/__init__.py | 3 +- stock_available_immediately/__openerp__.py | 5 ++- .../models/product_template.py | 27 +++----------- stock_available_immediately/product.py | 9 +++-- .../static/description/icon.png | Bin 0 -> 9455 bytes .../tests/test_stock_available_immediately.py | 28 +++++--------- 7 files changed, 56 insertions(+), 51 deletions(-) create mode 100644 stock_available_immediately/static/description/icon.png diff --git a/stock_available_immediately/README.rst b/stock_available_immediately/README.rst index 957dd59db..540678a5e 100644 --- a/stock_available_immediately/README.rst +++ b/stock_available_immediately/README.rst @@ -1,3 +1,8 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +========================================================== Ignore planned receptions in quantity available to promise ========================================================== @@ -6,9 +11,29 @@ which includes both planned outgoing and incoming goods. This module will subtract the planned receptions from the quantity available to promise. +Usage +===== + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/153/10.0 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. + Credits ======= +Images +------ + +* Odoo Community Association: `Icon `_. + Contributors ------------ @@ -20,12 +45,14 @@ Contributors Maintainer ---------- -.. image:: http://odoo-community.org/logo.png +.. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association - :target: http://odoo-community.org + :target: https://odoo-community.org This module is maintained by the OCA. -OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. +To contribute to this module, please visit https://odoo-community.org. \ No newline at end of file diff --git a/stock_available_immediately/__init__.py b/stock_available_immediately/__init__.py index 4fce57c9b..e1a1a2e8e 100644 --- a/stock_available_immediately/__init__.py +++ b/stock_available_immediately/__init__.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- -# © 2014 Camptocamp, Akretion, Numérigraphe, Sodexis +# Copyright 2014 Camptocamp, Akretion, Numérigraphe +# Copyright 2016 Sodexis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import product_product diff --git a/stock_available_immediately/__openerp__.py b/stock_available_immediately/__openerp__.py index f246cad5a..5844931c6 100644 --- a/stock_available_immediately/__openerp__.py +++ b/stock_available_immediately/__openerp__.py @@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- -# © 2014 Camptocamp, Akretion, Numérigraphe, Sodexis +# Copyright 2014 Camptocamp, Akretion, Numérigraphe +# Copyright 2016 Sodexis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Ignore planned receptions in quantity available to promise", - "version": "9.0.1.1.0", + "version": "10.0.1.0.0", "depends": ["stock_available"], "author": "Camptocamp,Sodexis,Odoo Community Association (OCA)", "license": "AGPL-3", diff --git a/stock_available_immediately/models/product_template.py b/stock_available_immediately/models/product_template.py index d8cd5ed34..ab89a602f 100644 --- a/stock_available_immediately/models/product_template.py +++ b/stock_available_immediately/models/product_template.py @@ -1,24 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# This module is copyright (C) 2014 Numérigraphe SARL. All Rights Reserved. -# -# 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 . -# -############################################################################## +# Copyright 2014 Camptocamp, Akretion, Numérigraphe +# Copyright 2016 Sodexis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, api +from odoo import models, api class ProductTemplate(models.Model): @@ -26,10 +11,10 @@ class ProductTemplate(models.Model): @api.multi @api.depends('virtual_available', 'incoming_qty') - def _immediately_usable_qty(self): + def _compute_immediately_usable_qty(self): """Ignore the incoming goods in the quantity available to promise This is the same implementation as for variants.""" - super(ProductTemplate, self)._immediately_usable_qty() + super(ProductTemplate, self)._compute_immediately_usable_qty() for tmpl in self: tmpl.immediately_usable_qty -= tmpl.incoming_qty diff --git a/stock_available_immediately/product.py b/stock_available_immediately/product.py index 93200460f..5df94fc85 100644 --- a/stock_available_immediately/product.py +++ b/stock_available_immediately/product.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- -# © 2014 Camptocamp, Akretion, Numérigraphe, Sodexis +# Copyright 2014 Camptocamp, Akretion, Numérigraphe +# Copyright 2016 Sodexis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models +from odoo import models, api class Product(models.Model): @@ -11,10 +12,10 @@ class Product(models.Model): @api.multi @api.depends('virtual_available', 'incoming_qty') - def _immediately_usable_qty(self): + def _compute_immediately_usable_qty(self): """Ignore the incoming goods in the quantity available to promise This is the same implementation as for templates.""" - super(ProductProduct, self)._immediately_usable_qty() + super(ProductProduct, self)._compute_immediately_usable_qty() for prod in self: prod.immediately_usable_qty -= prod.incoming_qty diff --git a/stock_available_immediately/static/description/icon.png b/stock_available_immediately/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_ zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&qHA5EJw1>>=%q2f&^X>IQ{!GJ4e9U z&KlB)z(84HmNgm2hg2C0>WM{E(DdPr+EeU_N@57;PC2&DmGFW_9kP&%?X4}+xWi)( z;)z%wI5>D4a*5XwD)P--sPkoY(a~WBw;E~AW`Yue4kFa^LM3X`8x|}ZUeMnqr}>kH zG%WWW>3ml$Yez?i%)2pbKPI7?5o?hydokgQyZsNEr{a|mLdt;X2TX(#B1j35xPnPW z*bMSSOauW>o;*=kO8ojw91VX!qoOQb)zHJ!odWB}d+*K?#sY_jqPdg{Sm2HdYzdEx zOGVPhVRTGPtv0o}RfVP;Nd(|CB)I;*t&QO8h zFfekr30S!-LHmV_Su-W+rEwYXJ^;6&3|L$mMC8*bQptyOo9;>Qb9Q9`ySe3%V$A*9 zeKEe+b0{#KWGp$F+tga)0RtI)nhMa-K@JS}2krK~n8vJ=Ngm?R!9G<~RyuU0d?nz# z-5EK$o(!F?hmX*2Yt6+coY`6jGbb7tF#6nHA zuKk=GGJ;ZwON1iAfG$E#Y7MnZVmrY|j0eVI(DN_MNFJmyZ|;w4tf@=CCDZ#5N_0K= z$;R~bbk?}TpfDjfB&aiQ$VA}s?P}xPERJG{kxk5~R`iRS(SK5d+Xs9swCozZISbnS zk!)I0>t=A<-^z(cmSFz3=jZ23u13X><0b)P)^1T_))Kr`e!-pb#q&J*Q`p+B6la%C zuVl&0duN<;uOsB3%T9Fp8t{ED108<+W(nOZd?gDnfNBC3>M8WE61$So|P zVvqH0SNtDTcsUdzaMDpT=Ty0pDHHNL@Z0w$Y`XO z2M-_r1S+GaH%pz#Uy0*w$Vdl=X=rQXEzO}d6J^R6zjM1u&c9vYLvLp?W7w(?np9x1 zE_0JSAJCPB%i7p*Wvg)pn5T`8k3-uR?*NT|J`eS#_#54p>!p(mLDvmc-3o0mX*mp_ zN*AeS<>#^-{S%W<*mz^!X$w_2dHWpcJ6^j64qFBft-o}o_Vx80o0>}Du;>kLts;$8 zC`7q$QI(dKYG`Wa8#wl@V4jVWBRGQ@1dr-hstpQL)Tl+aqVpGpbSfN>5i&QMXfiZ> zaA?T1VGe?rpQ@;+pkrVdd{klI&jVS@I5_iz!=UMpTsa~mBga?1r}aRBm1WS;TT*s0f0lY=JBl66Upy)-k4J}lh=P^8(SXk~0xW=T9v*B|gzIhN z>qsO7dFd~mgxAy4V?&)=5ieYq?zi?ZEoj)&2o)RLy=@hbCRcfT5jigwtQGE{L*8<@Yd{zg;CsL5mvzfDY}P-wos_6PfprFVaeqNE%h zKZhLtcQld;ZD+>=nqN~>GvROfueSzJD&BE*}XfU|H&(FssBqY=hPCt`d zH?@s2>I(|;fcW&YM6#V#!kUIP8$Nkdh0A(bEVj``-AAyYgwY~jB zT|I7Bf@%;7aL7Wf4dZ%VqF$eiaC38OV6oy3Z#TER2G+fOCd9Iaoy6aLYbPTN{XRPz z;U!V|vBf%H!}52L2gH_+j;`bTcQRXB+y9onc^wLm5wi3-Be}U>k_u>2Eg$=k!(l@I zcCg+flakT2Nej3i0yn+g+}%NYb?ta;R?(g5SnwsQ49U8Wng8d|{B+lyRcEDvR3+`O{zfmrmvFrL6acVP%yG98X zo&+VBg@px@i)%o?dG(`T;n*$S5*rnyiR#=wW}}GsAcfyQpE|>a{=$Hjg=-*_K;UtD z#z-)AXwSRY?OPefw^iI+ z)AXz#PfEjlwTes|_{sB?4(O@fg0AJ^g8gP}ex9Ucf*@_^J(s_5jJV}c)s$`Myn|Kd z$6>}#q^n{4vN@+Os$m7KV+`}c%4)4pv@06af4-x5#wj!KKb%caK{A&Y#Rfs z-po?Dcb1({W=6FKIUirH&(yg=*6aLCekcKwyfK^JN5{wcA3nhO(o}SK#!CINhI`-I z1)6&n7O&ZmyFMuNwvEic#IiOAwNkR=u5it{B9n2sAJV5pNhar=j5`*N!Na;c7g!l$ z3aYBqUkqqTJ=Re-;)s!EOeij=7SQZ3Hq}ZRds%IM*PtM$wV z@;rlc*NRK7i3y5BETSKuumEN`Xu_8GP1Ri=OKQ$@I^ko8>H6)4rjiG5{VBM>B|%`&&s^)jS|-_95&yc=GqjNo{zFkw%%HHhS~e=s zD#sfS+-?*t|J!+ozP6KvtOl!R)@@-z24}`9{QaVLD^9VCSR2b`b!KC#o;Ki<+wXB6 zx3&O0LOWcg4&rv4QG0)4yb}7BFSEg~=IR5#ZRj8kg}dS7_V&^%#Do==#`u zpy6{ox?jWuR(;pg+f@mT>#HGWHAJRRDDDv~@(IDw&R>9643kK#HN`!1vBJHnC+RM&yIh8{gG2q zA%e*U3|N0XSRa~oX-3EAneep)@{h2vvd3Xvy$7og(sayr@95+e6~Xvi1tUqnIxoIH zVWo*OwYElb#uyW{Imam6f2rGbjR!Y3`#gPqkv57dB6K^wRGxc9B(t|aYDGS=m$&S!NmCtrMMaUg(c zc2qC=2Z`EEFMW-me5B)24AqF*bV5Dr-M5ig(l-WPS%CgaPzs6p_gnCIvTJ=Y<6!gT zVt@AfYCzjjsMEGi=rDQHo0yc;HqoRNnNFeWZgcm?f;cp(6CNylj36DoL(?TS7eU#+ z7&mfr#y))+CJOXQKUMZ7QIdS9@#-}7y2K1{8)cCt0~-X0O!O?Qx#E4Og+;A2SjalQ zs7r?qn0H044=sDN$SRG$arw~n=+T_DNdSrarmu)V6@|?1-ZB#hRn`uilTGPJ@fqEy zGt(f0B+^JDP&f=r{#Y_wi#AVDf-y!RIXU^0jXsFpf>=Ji*TeqSY!H~AMbJdCGLhC) zn7Rx+sXw6uYj;WRYrLd^5IZq@6JI1C^YkgnedZEYy<&4(z%Q$5yv#Boo{AH8n$a zhb4Y3PWdr269&?V%uI$xMcUrMzl=;w<_nm*qr=c3Rl@i5wWB;e-`t7D&c-mcQl7x! zZWB`UGcw=Y2=}~wzrfLx=uet<;m3~=8I~ZRuzvMQUQdr+yTV|ATf1Uuomr__nDf=X zZ3WYJtHp_ri(}SQAPjv+Y+0=fH4krOP@S&=zZ-t1jW1o@}z;xk8 z(Nz1co&El^HK^NrhVHa-_;&88vTU>_J33=%{if;BEY*J#1n59=07jrGQ#IP>@u#3A z;!q+E1Rj3ZJ+!4bq9F8PXJ@yMgZL;>&gYA0%_Kbi8?S=XGM~dnQZQ!yBSgcZhY96H zrWnU;k)qy`rX&&xlDyA%(a1Hhi5CWkmg(`Gb%m(HKi-7Z!LKGRP_B8@`7&hdDy5n= z`OIxqxiVfX@OX1p(mQu>0Ai*v_cTMiw4qRt3~NBvr9oBy0)r>w3p~V0SCm=An6@3n)>@z!|o-$HvDK z|3D2ZMJkLE5loMKl6R^ez@Zz%S$&mbeoqH5`Bb){Ei21q&VP)hWS2tjShfFtGE+$z zzCR$P#uktu+#!w)cX!lWN1XU%K-r=s{|j?)Akf@q#3b#{6cZCuJ~gCxuMXRmI$nGtnH+-h z+GEi!*X=AP<|fG`1>MBdTb?28JYc=fGvAi2I<$B(rs$;eoJCyR6_bc~p!XR@O-+sD z=eH`-ye})I5ic1eL~TDmtfJ|8`0VJ*Yr=hNCd)G1p2MMz4C3^Mj?7;!w|Ly%JqmuW zlIEW^Ft%z?*|fpXda>Jr^1noFZEwFgVV%|*XhH@acv8rdGxeEX{M$(vG{Zw+x(ei@ zmfXb22}8-?Fi`vo-YVrTH*C?a8%M=Hv9MqVH7H^J$KsD?>!SFZ;ZsvnHr_gn=7acz z#W?0eCdVhVMWN12VV^$>WlQ?f;P^{(&pYTops|btm6aj>_Uz+hqpGwB)vWp0Cf5y< zft8-je~nn?W11plq}N)4A{l8I7$!ks_x$PXW-2XaRFswX_BnF{R#6YIwMhAgd5F9X zGmwdadS6(a^fjHtXg8=l?Rc0Sm%hk6E9!5cLVloEy4eh(=FwgP`)~I^5~pBEWo+F6 zSf2ncyMurJN91#cJTy_u8Y}@%!bq1RkGC~-bV@SXRd4F{R-*V`bS+6;W5vZ(&+I<9$;-V|eNfLa5n-6% z2(}&uGRF;p92eS*sE*oR$@pexaqr*meB)VhmIg@h{uzkk$9~qh#cHhw#>O%)b@+(| z^IQgqzuj~Sk(J;swEM-3TrJAPCq9k^^^`q{IItKBRXYe}e0Tdr=Huf7da3$l4PdpwWDop%^}n;dD#K4s#DYA8SHZ z&1!riV4W4R7R#C))JH1~axJ)RYnM$$lIR%6fIVA@zV{XVyx}C+a-Dt8Y9M)^KU0+H zR4IUb2CJ{Hg>CuaXtD50jB(_Tcx=Z$^WYu2u5kubqmwp%drJ6 z?Fo40g!Qd<-l=TQxqHEOuPX0;^z7iX?Ke^a%XT<13TA^5`4Xcw6D@Ur&VT&CUe0d} z1GjOVF1^L@>O)l@?bD~$wzgf(nxX1OGD8fEV?TdJcZc2KoUe|oP1#=$$7ee|xbY)A zDZq+cuTpc(fFdj^=!;{k03C69lMQ(|>uhRfRu%+!k&YOi-3|1QKB z z?n?eq1XP>p-IM$Z^C;2L3itnbJZAip*Zo0aw2bs8@(s^~*8T9go!%dHcAz2lM;`yp zD=7&xjFV$S&5uDaiScyD?B-i1ze`+CoRtz`Wn+Zl&#s4&}MO{@N!ufrzjG$B79)Y2d3tBk&)TxUTw@QS0TEL_?njX|@vq?Uz(nBFK5Pq7*xj#u*R&i|?7+6# z+|r_n#SW&LXhtheZdah{ZVoqwyT{D>MC3nkFF#N)xLi{p7J1jXlmVeb;cP5?e(=f# zuT7fvjSbjS781v?7{)-X3*?>tq?)Yd)~|1{BDS(pqC zC}~H#WXlkUW*H5CDOo<)#x7%RY)A;ShGhI5s*#cRDA8YgqG(HeKDx+#(ZQ?386dv! zlXCO)w91~Vw4AmOcATuV653fa9R$fyK8ul%rG z-wfS zihugoZyr38Im?Zuh6@RcF~t1anQu7>#lPpb#}4cOA!EM11`%f*07RqOVkmX{p~KJ9 z^zP;K#|)$`^Rb{rnHGH{~>1(fawV0*Z#)}M`m8-?ZJV<+e}s9wE# z)l&az?w^5{)`S(%MRzxdNqrs1n*-=jS^_jqE*5XDrA0+VE`5^*p3CuM<&dZEeCjoz zR;uu_H9ZPZV|fQq`Cyw4nscrVwi!fE6ciMmX$!_hN7uF;jjKG)d2@aC4ropY)8etW=xJvni)8eHi`H$%#zn^WJ5NLc-rqk|u&&4Z6fD_m&JfSI1Bvb?b<*n&sfl0^t z=HnmRl`XrFvMKB%9}>PaA`m-fK6a0(8=qPkWS5bb4=v?XcWi&hRY?O5HdulRi4?fN zlsJ*N-0Qw+Yic@s0(2uy%F@ib;GjXt01Fmx5XbRo6+n|pP(&nodMoap^z{~q ziEeaUT@Mxe3vJSfI6?uLND(CNr=#^W<1b}jzW58bIfyWTDle$mmS(|x-0|2UlX+9k zQ^EX7Nw}?EzVoBfT(-LT|=9N@^hcn-_p&sqG z&*oVs2JSU+N4ZD`FhCAWaS;>|wH2G*Id|?pa#@>tyxX`+4HyIArWDvVrX)2WAOQff z0qyHu&-S@i^MS-+j--!pr4fPBj~_8({~e1bfcl0wI1kaoN>mJL6KUPQm5N7lB(ui1 zE-o%kq)&djzWJ}ob<-GfDlkB;F31j-VHKvQUGQ3sp`CwyGJk_i!y^sD0fqC@$9|jO zOqN!r!8-p==F@ZVP=U$qSpY(gQ0)59P1&t@y?5rvg<}E+GB}26NYPp4f2YFQrQtot5mn3wu_qprZ=>Ig-$ zbW26Ws~IgY>}^5w`vTB(G`PTZaDiGBo5o(tp)qli|NeV( z@H_=R8V39rt5J5YB2Ky?4eJJ#b`_iBe2ot~6%7mLt5t8Vwi^Jy7|jWXqa3amOIoRb zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4 z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/stock_available_immediately/tests/test_stock_available_immediately.py b/stock_available_immediately/tests/test_stock_available_immediately.py index be9f43006..0cfccf411 100644 --- a/stock_available_immediately/tests/test_stock_available_immediately.py +++ b/stock_available_immediately/tests/test_stock_available_immediately.py @@ -1,23 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2015 Therp BV -# -# 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 . -# -############################################################################## -from openerp.tests.common import TransactionCase +# Copyright 2014 Camptocamp, Akretion, Numérigraphe +# Copyright 2016 Sodexis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.tests.common import TransactionCase class TestStockLogisticsWarehouse(TransactionCase): @@ -118,3 +104,7 @@ the variations in stock, both on product and template""" stockMoveOutA.action_done() compare_product_usable_qty(productA, 1) compare_product_usable_qty(templateAB, 4) + + # Potential Qty is set as 0.0 by default + self.assertEquals(templateAB.potential_qty, 0.0) + self.assertEquals(productA.potential_qty, 0.0) From a4f5a028b6adfb8a0944ab7d0f89cf080142d04e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pigeon?= Date: Tue, 9 May 2017 12:35:23 +0200 Subject: [PATCH 17/24] [10.0][CHG]stock_available...: improve stock methods computation optimize stock computation by avoiding to call useless compute --- stock_available_immediately/README.rst | 3 ++- stock_available_immediately/__init__.py | 1 - .../models/product_template.py | 20 ------------------- stock_available_immediately/product.py | 19 ++++++++++-------- 4 files changed, 13 insertions(+), 30 deletions(-) delete mode 100644 stock_available_immediately/models/product_template.py diff --git a/stock_available_immediately/README.rst b/stock_available_immediately/README.rst index 540678a5e..e4640d3ce 100644 --- a/stock_available_immediately/README.rst +++ b/stock_available_immediately/README.rst @@ -41,6 +41,7 @@ Contributors * Sébastien BEAU (Akretion) * Lionel Sausin (Numérigraphe) * Sodexis +* Cédric Pigeon Maintainer ---------- @@ -55,4 +56,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. \ No newline at end of file +To contribute to this module, please visit https://odoo-community.org. diff --git a/stock_available_immediately/__init__.py b/stock_available_immediately/__init__.py index e1a1a2e8e..3dfea9e01 100644 --- a/stock_available_immediately/__init__.py +++ b/stock_available_immediately/__init__.py @@ -4,4 +4,3 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import product_product -from . import product_template diff --git a/stock_available_immediately/models/product_template.py b/stock_available_immediately/models/product_template.py deleted file mode 100644 index ab89a602f..000000000 --- a/stock_available_immediately/models/product_template.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2014 Camptocamp, Akretion, Numérigraphe -# Copyright 2016 Sodexis -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from odoo import models, api - - -class ProductTemplate(models.Model): - _inherit = 'product.template' - - @api.multi - @api.depends('virtual_available', 'incoming_qty') - def _compute_immediately_usable_qty(self): - """Ignore the incoming goods in the quantity available to promise - - This is the same implementation as for variants.""" - super(ProductTemplate, self)._compute_immediately_usable_qty() - for tmpl in self: - tmpl.immediately_usable_qty -= tmpl.incoming_qty diff --git a/stock_available_immediately/product.py b/stock_available_immediately/product.py index 5df94fc85..e7fd22532 100644 --- a/stock_available_immediately/product.py +++ b/stock_available_immediately/product.py @@ -3,7 +3,7 @@ # Copyright 2016 Sodexis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, api +from odoo import api, models class Product(models.Model): @@ -11,11 +11,14 @@ class Product(models.Model): _inherit = 'product.product' @api.multi - @api.depends('virtual_available', 'incoming_qty') - def _compute_immediately_usable_qty(self): - """Ignore the incoming goods in the quantity available to promise + def _compute_available_quantities_dict(self): + res, stock_dict = super(ProductProduct, + self)._compute_available_quantities_dict() + for product in self: + res[product.id]['immediately_usable_qty'] -= \ + stock_dict[product.id]['incoming_qty'] + return res, stock_dict - This is the same implementation as for templates.""" - super(ProductProduct, self)._compute_immediately_usable_qty() - for prod in self: - prod.immediately_usable_qty -= prod.incoming_qty + @api.depends('virtual_available', 'incoming_qty') + def _compute_available_quantities(self): + return super(ProductProduct, self)._compute_available_quantities() From d77083ecb1e0c7fa4cff287db367871d90d3255c Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 3 Jun 2017 11:41:08 +0200 Subject: [PATCH 18/24] OCA Transbot updated translations from Transifex --- stock_available_immediately/i18n/ca.po | 24 ++++++++++++++++ stock_available_immediately/i18n/cs_CZ.po | 25 +++++++++++++++++ stock_available_immediately/i18n/de.po | 21 ++++++-------- stock_available_immediately/i18n/el_GR.po | 25 +++++++++++++++++ stock_available_immediately/i18n/es.po | 20 ++++++------- stock_available_immediately/i18n/es_ES.po | 25 +++++++++++++++++ stock_available_immediately/i18n/es_MX.po | 28 +++++++++++++++++++ stock_available_immediately/i18n/eu.po | 24 ++++++++++++++++ stock_available_immediately/i18n/fi.po | 20 ++++++------- stock_available_immediately/i18n/fr.po | 20 ++++++------- stock_available_immediately/i18n/fr_CH.po | 25 +++++++++++++++++ stock_available_immediately/i18n/fr_FR.po | 25 +++++++++++++++++ stock_available_immediately/i18n/gl.po | 24 ++++++++++++++++ stock_available_immediately/i18n/hr.po | 25 +++++++++++++++++ stock_available_immediately/i18n/hr_HR.po | 24 ++++++++-------- stock_available_immediately/i18n/it.po | 20 ++++++------- stock_available_immediately/i18n/nl.po | 24 ++++++++++++++++ stock_available_immediately/i18n/nl_NL.po | 25 +++++++++++++++++ stock_available_immediately/i18n/pt.po | 24 ++++++++++++++++ stock_available_immediately/i18n/pt_BR.po | 21 ++++++-------- stock_available_immediately/i18n/ro.po | 25 +++++++++++++++++ stock_available_immediately/i18n/ru.po | 26 +++++++++++++++++ stock_available_immediately/i18n/sl.po | 23 +++++++-------- .../i18n/stock_available_immediately.pot | 20 +++++++++++++ stock_available_immediately/i18n/tr.po | 24 ++++++++++++++++ stock_available_immediately/i18n/tr_TR.po | 25 +++++++++++++++++ stock_available_immediately/i18n/vi_VN.po | 25 +++++++++++++++++ stock_available_immediately/i18n/zh_CN.po | 22 ++++++--------- 28 files changed, 547 insertions(+), 112 deletions(-) create mode 100644 stock_available_immediately/i18n/ca.po create mode 100644 stock_available_immediately/i18n/cs_CZ.po create mode 100644 stock_available_immediately/i18n/el_GR.po create mode 100644 stock_available_immediately/i18n/es_ES.po create mode 100644 stock_available_immediately/i18n/es_MX.po create mode 100644 stock_available_immediately/i18n/eu.po create mode 100644 stock_available_immediately/i18n/fr_CH.po create mode 100644 stock_available_immediately/i18n/fr_FR.po create mode 100644 stock_available_immediately/i18n/gl.po create mode 100644 stock_available_immediately/i18n/hr.po create mode 100644 stock_available_immediately/i18n/nl.po create mode 100644 stock_available_immediately/i18n/nl_NL.po create mode 100644 stock_available_immediately/i18n/pt.po create mode 100644 stock_available_immediately/i18n/ro.po create mode 100644 stock_available_immediately/i18n/ru.po create mode 100644 stock_available_immediately/i18n/stock_available_immediately.pot create mode 100644 stock_available_immediately/i18n/tr.po create mode 100644 stock_available_immediately/i18n/tr_TR.po create mode 100644 stock_available_immediately/i18n/vi_VN.po diff --git a/stock_available_immediately/i18n/ca.po b/stock_available_immediately/i18n/ca.po new file mode 100644 index 000000000..11cbdd34a --- /dev/null +++ b/stock_available_immediately/i18n/ca.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Producte" diff --git a/stock_available_immediately/i18n/cs_CZ.po b/stock_available_immediately/i18n/cs_CZ.po new file mode 100644 index 000000000..2150a116f --- /dev/null +++ b/stock_available_immediately/i18n/cs_CZ.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# Lukáš Spurný , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-27 11:37+0000\n" +"PO-Revision-Date: 2018-02-27 11:37+0000\n" +"Last-Translator: Lukáš Spurný , 2018\n" +"Language-Team: Czech (Czech Republic) (https://www.transifex.com/oca/" +"teams/23907/cs_CZ/)\n" +"Language: cs_CZ\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produkt" diff --git a/stock_available_immediately/i18n/de.po b/stock_available_immediately/i18n/de.po index af867b67e..1b9f9e29c 100644 --- a/stock_available_immediately/i18n/de.po +++ b/stock_available_immediately/i18n/de.po @@ -1,29 +1,24 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_available_immediately -# +# # Translators: -# Rudolf Schnapka , 2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: stock-logistics-warehouse (9.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-04-14 12:02+0000\n" -"PO-Revision-Date: 2016-04-22 09:17+0000\n" -"Last-Translator: Rudolf Schnapka \n" -"Language-Team: German (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/de/)\n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_available_immediately #: model:ir.model,name:stock_available_immediately.model_product_product msgid "Product" msgstr "Produkt" - -#. module: stock_available_immediately -#: model:ir.model,name:stock_available_immediately.model_product_template -msgid "Product Template" -msgstr "Produktvorlage" diff --git a/stock_available_immediately/i18n/el_GR.po b/stock_available_immediately/i18n/el_GR.po new file mode 100644 index 000000000..fba06d96c --- /dev/null +++ b/stock_available_immediately/i18n/el_GR.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 01:23+0000\n" +"PO-Revision-Date: 2017-06-03 01:23+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Greek (Greece) (https://www.transifex.com/oca/teams/23907/" +"el_GR/)\n" +"Language: el_GR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Προϊόν" diff --git a/stock_available_immediately/i18n/es.po b/stock_available_immediately/i18n/es.po index 1559eb4ed..92c181447 100644 --- a/stock_available_immediately/i18n/es.po +++ b/stock_available_immediately/i18n/es.po @@ -1,28 +1,24 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_available_immediately -# +# # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: stock-logistics-warehouse (9.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-03-23 01:46+0000\n" -"PO-Revision-Date: 2016-03-22 10:04+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: Spanish (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/es/)\n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_available_immediately #: model:ir.model,name:stock_available_immediately.model_product_product msgid "Product" msgstr "Producto" - -#. module: stock_available_immediately -#: model:ir.model,name:stock_available_immediately.model_product_template -msgid "Product Template" -msgstr "Plantilla de producto" diff --git a/stock_available_immediately/i18n/es_ES.po b/stock_available_immediately/i18n/es_ES.po new file mode 100644 index 000000000..4595b90f5 --- /dev/null +++ b/stock_available_immediately/i18n/es_ES.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 01:23+0000\n" +"PO-Revision-Date: 2017-06-03 01:23+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (Spain) (https://www.transifex.com/oca/teams/23907/" +"es_ES/)\n" +"Language: es_ES\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Producto" diff --git a/stock_available_immediately/i18n/es_MX.po b/stock_available_immediately/i18n/es_MX.po new file mode 100644 index 000000000..e2c5f9ff8 --- /dev/null +++ b/stock_available_immediately/i18n/es_MX.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 01:23+0000\n" +"PO-Revision-Date: 2017-06-03 01:23+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (Mexico) (https://www.transifex.com/oca/teams/23907/" +"es_MX/)\n" +"Language: es_MX\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "" + +#~ msgid "Product Template" +#~ msgstr "Plantilla del producto" diff --git a/stock_available_immediately/i18n/eu.po b/stock_available_immediately/i18n/eu.po new file mode 100644 index 000000000..1e696cd1d --- /dev/null +++ b/stock_available_immediately/i18n/eu.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 01:23+0000\n" +"PO-Revision-Date: 2017-06-03 01:23+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Basque (https://www.transifex.com/oca/teams/23907/eu/)\n" +"Language: eu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produktua" diff --git a/stock_available_immediately/i18n/fi.po b/stock_available_immediately/i18n/fi.po index b6c025ccb..6c5f4e970 100644 --- a/stock_available_immediately/i18n/fi.po +++ b/stock_available_immediately/i18n/fi.po @@ -1,28 +1,24 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_available_immediately -# +# # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: stock-logistics-warehouse (9.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-03-23 01:46+0000\n" -"PO-Revision-Date: 2016-03-22 10:04+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: Finnish (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/fi/)\n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" +"Language: fi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_available_immediately #: model:ir.model,name:stock_available_immediately.model_product_product msgid "Product" msgstr "Tuote" - -#. module: stock_available_immediately -#: model:ir.model,name:stock_available_immediately.model_product_template -msgid "Product Template" -msgstr "Tuotteen malli" diff --git a/stock_available_immediately/i18n/fr.po b/stock_available_immediately/i18n/fr.po index cda55dfb5..346d567f3 100644 --- a/stock_available_immediately/i18n/fr.po +++ b/stock_available_immediately/i18n/fr.po @@ -1,28 +1,24 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_available_immediately -# +# # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: stock-logistics-warehouse (9.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-03-23 01:46+0000\n" -"PO-Revision-Date: 2016-03-22 10:04+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: French (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/fr/)\n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: stock_available_immediately #: model:ir.model,name:stock_available_immediately.model_product_product msgid "Product" msgstr "Article" - -#. module: stock_available_immediately -#: model:ir.model,name:stock_available_immediately.model_product_template -msgid "Product Template" -msgstr "Modèle de produit" diff --git a/stock_available_immediately/i18n/fr_CH.po b/stock_available_immediately/i18n/fr_CH.po new file mode 100644 index 000000000..5b3ea4eb5 --- /dev/null +++ b/stock_available_immediately/i18n/fr_CH.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (Switzerland) (https://www.transifex.com/oca/" +"teams/23907/fr_CH/)\n" +"Language: fr_CH\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produit" diff --git a/stock_available_immediately/i18n/fr_FR.po b/stock_available_immediately/i18n/fr_FR.po new file mode 100644 index 000000000..b45424fdb --- /dev/null +++ b/stock_available_immediately/i18n/fr_FR.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 01:23+0000\n" +"PO-Revision-Date: 2017-06-03 01:23+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (France) (https://www.transifex.com/oca/teams/23907/" +"fr_FR/)\n" +"Language: fr_FR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produit" diff --git a/stock_available_immediately/i18n/gl.po b/stock_available_immediately/i18n/gl.po new file mode 100644 index 000000000..748a5aa9e --- /dev/null +++ b/stock_available_immediately/i18n/gl.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 01:23+0000\n" +"PO-Revision-Date: 2017-06-03 01:23+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Galician (https://www.transifex.com/oca/teams/23907/gl/)\n" +"Language: gl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produto" diff --git a/stock_available_immediately/i18n/hr.po b/stock_available_immediately/i18n/hr.po new file mode 100644 index 000000000..48707b334 --- /dev/null +++ b/stock_available_immediately/i18n/hr.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Proizvod" diff --git a/stock_available_immediately/i18n/hr_HR.po b/stock_available_immediately/i18n/hr_HR.po index 5d39c5282..761931224 100644 --- a/stock_available_immediately/i18n/hr_HR.po +++ b/stock_available_immediately/i18n/hr_HR.po @@ -1,28 +1,26 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_available_immediately -# +# # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: stock-logistics-warehouse (9.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-05-01 15:38+0000\n" -"PO-Revision-Date: 2016-05-31 20:20+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: Croatian (Croatia) (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/hr_HR/)\n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/" +"hr_HR/)\n" +"Language: hr_HR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: hr_HR\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: stock_available_immediately #: model:ir.model,name:stock_available_immediately.model_product_product msgid "Product" msgstr "Proizvod" - -#. module: stock_available_immediately -#: model:ir.model,name:stock_available_immediately.model_product_template -msgid "Product Template" -msgstr "Predložak proizvoda" diff --git a/stock_available_immediately/i18n/it.po b/stock_available_immediately/i18n/it.po index 224297fbb..7d371ca6d 100644 --- a/stock_available_immediately/i18n/it.po +++ b/stock_available_immediately/i18n/it.po @@ -1,28 +1,24 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_available_immediately -# +# # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: stock-logistics-warehouse (9.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-09-04 10:11+0000\n" -"PO-Revision-Date: 2016-09-09 11:33+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: Italian (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/it/)\n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: it\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_available_immediately #: model:ir.model,name:stock_available_immediately.model_product_product msgid "Product" msgstr "Prodotto" - -#. module: stock_available_immediately -#: model:ir.model,name:stock_available_immediately.model_product_template -msgid "Product Template" -msgstr "" diff --git a/stock_available_immediately/i18n/nl.po b/stock_available_immediately/i18n/nl.po new file mode 100644 index 000000000..7069a746d --- /dev/null +++ b/stock_available_immediately/i18n/nl.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 01:23+0000\n" +"PO-Revision-Date: 2017-06-03 01:23+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Product" diff --git a/stock_available_immediately/i18n/nl_NL.po b/stock_available_immediately/i18n/nl_NL.po new file mode 100644 index 000000000..1b6deae0f --- /dev/null +++ b/stock_available_immediately/i18n/nl_NL.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Product" diff --git a/stock_available_immediately/i18n/pt.po b/stock_available_immediately/i18n/pt.po new file mode 100644 index 000000000..84a55d679 --- /dev/null +++ b/stock_available_immediately/i18n/pt.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 01:23+0000\n" +"PO-Revision-Date: 2017-06-03 01:23+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produto" diff --git a/stock_available_immediately/i18n/pt_BR.po b/stock_available_immediately/i18n/pt_BR.po index a4e1a3119..0a83f9145 100644 --- a/stock_available_immediately/i18n/pt_BR.po +++ b/stock_available_immediately/i18n/pt_BR.po @@ -1,28 +1,25 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_available_immediately -# +# # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: stock-logistics-warehouse (9.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-07-03 20:56+0000\n" -"PO-Revision-Date: 2016-07-07 19:33+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/pt_BR/)\n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: stock_available_immediately #: model:ir.model,name:stock_available_immediately.model_product_product msgid "Product" msgstr "Produto" - -#. module: stock_available_immediately -#: model:ir.model,name:stock_available_immediately.model_product_template -msgid "Product Template" -msgstr "Modelo Produto" diff --git a/stock_available_immediately/i18n/ro.po b/stock_available_immediately/i18n/ro.po new file mode 100644 index 000000000..d51379315 --- /dev/null +++ b/stock_available_immediately/i18n/ro.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n" +"Language: ro\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?" +"2:1));\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produs" diff --git a/stock_available_immediately/i18n/ru.po b/stock_available_immediately/i18n/ru.po new file mode 100644 index 000000000..b684c031d --- /dev/null +++ b/stock_available_immediately/i18n/ru.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Russian (https://www.transifex.com/oca/teams/23907/ru/)\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n" +"%100>=11 && n%100<=14)? 2 : 3);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Товар/Услуга" diff --git a/stock_available_immediately/i18n/sl.po b/stock_available_immediately/i18n/sl.po index f92f1d39d..e4404449d 100644 --- a/stock_available_immediately/i18n/sl.po +++ b/stock_available_immediately/i18n/sl.po @@ -1,28 +1,25 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_available_immediately -# +# # Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: stock-logistics-warehouse (9.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-04-30 03:10+0000\n" -"PO-Revision-Date: 2016-04-27 11:10+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/sl/)\n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: sl\n" -"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" #. module: stock_available_immediately #: model:ir.model,name:stock_available_immediately.model_product_product msgid "Product" msgstr "Proizvod" - -#. module: stock_available_immediately -#: model:ir.model,name:stock_available_immediately.model_product_template -msgid "Product Template" -msgstr "Predloga proizvoda" diff --git a/stock_available_immediately/i18n/stock_available_immediately.pot b/stock_available_immediately/i18n/stock_available_immediately.pot new file mode 100644 index 000000000..ae626fccb --- /dev/null +++ b/stock_available_immediately/i18n/stock_available_immediately.pot @@ -0,0 +1,20 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \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_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "" + diff --git a/stock_available_immediately/i18n/tr.po b/stock_available_immediately/i18n/tr.po new file mode 100644 index 000000000..61375ee76 --- /dev/null +++ b/stock_available_immediately/i18n/tr.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Ürün" diff --git a/stock_available_immediately/i18n/tr_TR.po b/stock_available_immediately/i18n/tr_TR.po new file mode 100644 index 000000000..6beabb80f --- /dev/null +++ b/stock_available_immediately/i18n/tr_TR.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Turkish (Turkey) (https://www.transifex.com/oca/teams/23907/" +"tr_TR/)\n" +"Language: tr_TR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Ürün" diff --git a/stock_available_immediately/i18n/vi_VN.po b/stock_available_immediately/i18n/vi_VN.po new file mode 100644 index 000000000..a9217cd97 --- /dev/null +++ b/stock_available_immediately/i18n/vi_VN.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Vietnamese (Viet Nam) (https://www.transifex.com/oca/" +"teams/23907/vi_VN/)\n" +"Language: vi_VN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Sản phẩm" diff --git a/stock_available_immediately/i18n/zh_CN.po b/stock_available_immediately/i18n/zh_CN.po index 44ee05bc8..15df1d1e9 100644 --- a/stock_available_immediately/i18n/zh_CN.po +++ b/stock_available_immediately/i18n/zh_CN.po @@ -1,29 +1,25 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_available_immediately -# +# # Translators: -# Jeffery Chenn , 2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: stock-logistics-warehouse (9.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-08-28 10:00+0000\n" -"PO-Revision-Date: 2016-09-04 06:05+0000\n" -"Last-Translator: Jeffery Chenn \n" -"Language-Team: Chinese (China) (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/zh_CN/)\n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/" +"zh_CN/)\n" +"Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #. module: stock_available_immediately #: model:ir.model,name:stock_available_immediately.model_product_product msgid "Product" msgstr "产品" - -#. module: stock_available_immediately -#: model:ir.model,name:stock_available_immediately.model_product_template -msgid "Product Template" -msgstr "产品模板" From 53b5c4542fad4fe1a0e3d4983408f56998c99be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20D=C3=ADaz?= Date: Fri, 29 Nov 2019 16:28:15 +0100 Subject: [PATCH 19/24] [MIG] stock_available_immediately: Migration to 11.0 --- stock_available_immediately/README.rst | 1 + stock_available_immediately/__init__.py | 2 +- stock_available_immediately/__openerp__.py | 6 +- .../i18n/stock_available_immediately.pot | 2 +- stock_available_immediately/product.py | 6 +- stock_available_immediately/tests/__init__.py | 2 - .../tests/test_stock_available_immediately.py | 109 +++++++++--------- 7 files changed, 65 insertions(+), 63 deletions(-) diff --git a/stock_available_immediately/README.rst b/stock_available_immediately/README.rst index e4640d3ce..09c2b8074 100644 --- a/stock_available_immediately/README.rst +++ b/stock_available_immediately/README.rst @@ -42,6 +42,7 @@ Contributors * Lionel Sausin (Numérigraphe) * Sodexis * Cédric Pigeon +* Sergio Díaz Maintainer ---------- diff --git a/stock_available_immediately/__init__.py b/stock_available_immediately/__init__.py index 3dfea9e01..03169e1a7 100644 --- a/stock_available_immediately/__init__.py +++ b/stock_available_immediately/__init__.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- # Copyright 2014 Camptocamp, Akretion, Numérigraphe # Copyright 2016 Sodexis +# Copyright 2019 Sergio Díaz # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import product_product diff --git a/stock_available_immediately/__openerp__.py b/stock_available_immediately/__openerp__.py index 5844931c6..5ab798627 100644 --- a/stock_available_immediately/__openerp__.py +++ b/stock_available_immediately/__openerp__.py @@ -1,13 +1,13 @@ -# -*- coding: utf-8 -*- # Copyright 2014 Camptocamp, Akretion, Numérigraphe # Copyright 2016 Sodexis +# Copyright 2019 Sergio Díaz # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Ignore planned receptions in quantity available to promise", - "version": "10.0.1.0.0", + "version": "11.0.1.0.0", "depends": ["stock_available"], - "author": "Camptocamp,Sodexis,Odoo Community Association (OCA)", + "author": "Camptocamp,Sodexis,Odoo Community Association (OCA),Sergio Díaz", "license": "AGPL-3", "category": "Hidden", 'installable': True diff --git a/stock_available_immediately/i18n/stock_available_immediately.pot b/stock_available_immediately/i18n/stock_available_immediately.pot index ae626fccb..3b9789d1b 100644 --- a/stock_available_immediately/i18n/stock_available_immediately.pot +++ b/stock_available_immediately/i18n/stock_available_immediately.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" diff --git a/stock_available_immediately/product.py b/stock_available_immediately/product.py index e7fd22532..561c18995 100644 --- a/stock_available_immediately/product.py +++ b/stock_available_immediately/product.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- # Copyright 2014 Camptocamp, Akretion, Numérigraphe # Copyright 2016 Sodexis +# Copyright 2019 Sergio Díaz # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import api, models @@ -12,8 +12,8 @@ class Product(models.Model): @api.multi def _compute_available_quantities_dict(self): - res, stock_dict = super(ProductProduct, - self)._compute_available_quantities_dict() + res, stock_dict = \ + super(ProductProduct, self)._compute_available_quantities_dict() for product in self: res[product.id]['immediately_usable_qty'] -= \ stock_dict[product.id]['incoming_qty'] diff --git a/stock_available_immediately/tests/__init__.py b/stock_available_immediately/tests/__init__.py index 8185fdf1f..84148ecde 100644 --- a/stock_available_immediately/tests/__init__.py +++ b/stock_available_immediately/tests/__init__.py @@ -1,3 +1 @@ -# -*- coding: utf-8 -*- - from . import test_stock_available_immediately diff --git a/stock_available_immediately/tests/test_stock_available_immediately.py b/stock_available_immediately/tests/test_stock_available_immediately.py index 0cfccf411..436d35a59 100644 --- a/stock_available_immediately/tests/test_stock_available_immediately.py +++ b/stock_available_immediately/tests/test_stock_available_immediately.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- # Copyright 2014 Camptocamp, Akretion, Numérigraphe # Copyright 2016 Sodexis +# Copyright 2019 Sergio Díaz # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo.tests.common import TransactionCase @@ -9,8 +9,10 @@ from odoo.tests.common import TransactionCase class TestStockLogisticsWarehouse(TransactionCase): def test01_stock_levels(self): - """checking that immediately_usable_qty actually reflects \ -the variations in stock, both on product and template""" + """ + Checking that immediately_usable_qty actually reflects the variations + in stock, both on product and template. + """ moveObj = self.env['stock.move'] productObj = self.env['product.product'] templateObj = self.env['product.template'] @@ -20,48 +22,43 @@ the variations in stock, both on product and template""" uom_unit = self.env.ref('product.product_uom_unit') # Create product template - templateAB = templateObj.create( - {'name': 'templAB', - 'uom_id': uom_unit.id, - }) + templateAB = templateObj.create({ + 'name': 'templAB', + 'uom_id': uom_unit.id}) # Create product A and B - productA = productObj.create( - {'name': 'product A', - 'standard_price': 1, - 'type': 'product', - 'uom_id': uom_unit.id, - 'default_code': 'A', - 'product_tmpl_id': templateAB.id, - }) + productA = productObj.create({ + 'name': 'product A', + 'standard_price': 1, + 'type': 'product', + 'uom_id': uom_unit.id, + 'default_code': 'A', + 'product_tmpl_id': templateAB.id}) - productB = productObj.create( - {'name': 'product B', - 'standard_price': 1, - 'type': 'product', - 'uom_id': uom_unit.id, - 'default_code': 'B', - 'product_tmpl_id': templateAB.id, - }) + productB = productObj.create({ + 'name': 'product B', + 'standard_price': 1, + 'type': 'product', + 'uom_id': uom_unit.id, + 'default_code': 'B', + 'product_tmpl_id': templateAB.id}) # Create a stock move from INCOMING to STOCK - stockMoveInA = moveObj.create( - {'location_id': supplier_location.id, - 'location_dest_id': stock_location.id, - 'name': 'MOVE INCOMING -> STOCK ', - 'product_id': productA.id, - 'product_uom': productA.uom_id.id, - 'product_uom_qty': 2, - }) + stockMoveInA = moveObj.create({ + 'location_id': supplier_location.id, + 'location_dest_id': stock_location.id, + 'name': 'MOVE INCOMING -> STOCK ', + 'product_id': productA.id, + 'product_uom': productA.uom_id.id, + 'product_uom_qty': 2}) - stockMoveInB = moveObj.create( - {'location_id': supplier_location.id, - 'location_dest_id': stock_location.id, - 'name': 'MOVE INCOMING -> STOCK ', - 'product_id': productB.id, - 'product_uom': productB.uom_id.id, - 'product_uom_qty': 3, - }) + stockMoveInB = moveObj.create({ + 'location_id': supplier_location.id, + 'location_dest_id': stock_location.id, + 'name': 'MOVE INCOMING -> STOCK ', + 'product_id': productB.id, + 'product_uom': productB.uom_id.id, + 'product_uom_qty': 3}) def compare_product_usable_qty(product, value): # Refresh, because the function field is not recalculated between @@ -72,36 +69,42 @@ the variations in stock, both on product and template""" compare_product_usable_qty(productA, 0) compare_product_usable_qty(templateAB, 0) - stockMoveInA.action_confirm() + stockMoveInA._action_confirm() compare_product_usable_qty(productA, 0) compare_product_usable_qty(templateAB, 0) - stockMoveInA.action_assign() + stockMoveInA._action_assign() compare_product_usable_qty(productA, 0) compare_product_usable_qty(templateAB, 0) - stockMoveInA.action_done() + stockMoveInA.move_line_ids.write({'qty_done': 2.0}) + stockMoveInA._action_done() compare_product_usable_qty(productA, 2) compare_product_usable_qty(templateAB, 2) # will directly trigger action_done on productB - stockMoveInB.action_done() + stockMoveInB._action_confirm() + stockMoveInB._action_assign() + stockMoveInB.move_line_ids.write({'qty_done': 3.0}) + stockMoveInB._action_done() compare_product_usable_qty(productA, 2) compare_product_usable_qty(productB, 3) compare_product_usable_qty(templateAB, 5) # Create a stock move from STOCK to CUSTOMER - stockMoveOutA = moveObj.create( - {'location_id': stock_location.id, - 'location_dest_id': customer_location.id, - 'name': ' STOCK --> CUSTOMER ', - 'product_id': productA.id, - 'product_uom': productA.uom_id.id, - 'product_uom_qty': 1, - 'state': 'confirmed', - }) + stockMoveOutA = moveObj.create({ + 'location_id': stock_location.id, + 'location_dest_id': customer_location.id, + 'name': ' STOCK --> CUSTOMER ', + 'product_id': productA.id, + 'product_uom': productA.uom_id.id, + 'product_uom_qty': 1, + 'state': 'confirmed'}) - stockMoveOutA.action_done() + stockMoveOutA._action_confirm() + stockMoveOutA._action_assign() + stockMoveOutA.move_line_ids.write({'qty_done': 1.0}) + stockMoveOutA._action_done() compare_product_usable_qty(productA, 1) compare_product_usable_qty(templateAB, 4) From 55b72b9e0b58505052c983114d84efbfcbec8776 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 19 Mar 2020 17:35:57 +0100 Subject: [PATCH 20/24] [FIX] stock_available_immediately: Restore current code Due to merge mess, we need to restore current code this way --- stock_available_immediately/__init__.py | 2 +- .../{__openerp__.py => __manifest__.py} | 0 stock_available_immediately/models/__init__.py | 6 ++++++ .../{product.py => models/product_product.py} | 3 +-- 4 files changed, 8 insertions(+), 3 deletions(-) rename stock_available_immediately/{__openerp__.py => __manifest__.py} (100%) create mode 100644 stock_available_immediately/models/__init__.py rename stock_available_immediately/{product.py => models/product_product.py} (89%) diff --git a/stock_available_immediately/__init__.py b/stock_available_immediately/__init__.py index 03169e1a7..738466a87 100644 --- a/stock_available_immediately/__init__.py +++ b/stock_available_immediately/__init__.py @@ -3,4 +3,4 @@ # Copyright 2019 Sergio Díaz # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from . import product_product +from . import models diff --git a/stock_available_immediately/__openerp__.py b/stock_available_immediately/__manifest__.py similarity index 100% rename from stock_available_immediately/__openerp__.py rename to stock_available_immediately/__manifest__.py diff --git a/stock_available_immediately/models/__init__.py b/stock_available_immediately/models/__init__.py new file mode 100644 index 000000000..03169e1a7 --- /dev/null +++ b/stock_available_immediately/models/__init__.py @@ -0,0 +1,6 @@ +# Copyright 2014 Camptocamp, Akretion, Numérigraphe +# Copyright 2016 Sodexis +# Copyright 2019 Sergio Díaz +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import product_product diff --git a/stock_available_immediately/product.py b/stock_available_immediately/models/product_product.py similarity index 89% rename from stock_available_immediately/product.py rename to stock_available_immediately/models/product_product.py index 561c18995..05987c215 100644 --- a/stock_available_immediately/product.py +++ b/stock_available_immediately/models/product_product.py @@ -6,8 +6,7 @@ from odoo import api, models -class Product(models.Model): - """Subtract incoming qty from immediately_usable_qty""" +class ProductProduct(models.Model): _inherit = 'product.product' @api.multi From 9a28d257ede0518c448c87b1aa297448bc1c82b3 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 19 Mar 2020 17:47:52 +0100 Subject: [PATCH 21/24] [MIG] stock_available_immediately: Migration to 12.0 * New README by fragments * Bump manifest version * Adapted tests --- stock_available_immediately/README.rst | 70 ++- stock_available_immediately/__init__.py | 3 - stock_available_immediately/__manifest__.py | 5 +- .../models/__init__.py | 3 - .../readme/CONTRIBUTORS.rst | 9 + .../readme/DESCRIPTION.rst | 4 + .../static/description/index.html | 433 ++++++++++++++++++ .../tests/test_stock_available_immediately.py | 3 +- 8 files changed, 499 insertions(+), 31 deletions(-) create mode 100644 stock_available_immediately/readme/CONTRIBUTORS.rst create mode 100644 stock_available_immediately/readme/DESCRIPTION.rst create mode 100644 stock_available_immediately/static/description/index.html diff --git a/stock_available_immediately/README.rst b/stock_available_immediately/README.rst index 09c2b8074..b303a871f 100644 --- a/stock_available_immediately/README.rst +++ b/stock_available_immediately/README.rst @@ -1,41 +1,62 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - ========================================================== Ignore planned receptions in quantity available to promise ========================================================== +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_available_immediately + :alt: OCA/stock-logistics-warehouse +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_available_immediately + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/153/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + Normally the quantity available to promise is based on the virtual stock, which includes both planned outgoing and incoming goods. This module will subtract the planned receptions from the quantity available to promise. -Usage -===== +**Table of contents** -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/153/10.0 +.. contents:: + :local: Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed feedback. +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* Camptocamp +* Sodexis +* Sergio Díaz Contributors ------------- +~~~~~~~~~~~~ * Author: Guewen Baconnier (Camptocamp SA) * Sébastien BEAU (Akretion) @@ -43,18 +64,23 @@ Contributors * Sodexis * Cédric Pigeon * Sergio Díaz +* `Tecnativa `_: -Maintainer ----------- + * Pedro M. Baeza + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. +This module is part of the `OCA/stock-logistics-warehouse `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_available_immediately/__init__.py b/stock_available_immediately/__init__.py index 738466a87..83e553ac4 100644 --- a/stock_available_immediately/__init__.py +++ b/stock_available_immediately/__init__.py @@ -1,6 +1,3 @@ -# Copyright 2014 Camptocamp, Akretion, Numérigraphe -# Copyright 2016 Sodexis -# Copyright 2019 Sergio Díaz # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models diff --git a/stock_available_immediately/__manifest__.py b/stock_available_immediately/__manifest__.py index 5ab798627..85fca7b1b 100644 --- a/stock_available_immediately/__manifest__.py +++ b/stock_available_immediately/__manifest__.py @@ -1,14 +1,15 @@ # Copyright 2014 Camptocamp, Akretion, Numérigraphe # Copyright 2016 Sodexis # Copyright 2019 Sergio Díaz +# Copyright 2020 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Ignore planned receptions in quantity available to promise", - "version": "11.0.1.0.0", + "version": "12.0.1.0.0", "depends": ["stock_available"], "author": "Camptocamp,Sodexis,Odoo Community Association (OCA),Sergio Díaz", "license": "AGPL-3", "category": "Hidden", - 'installable': True + 'installable': True, } diff --git a/stock_available_immediately/models/__init__.py b/stock_available_immediately/models/__init__.py index 03169e1a7..586a7eff4 100644 --- a/stock_available_immediately/models/__init__.py +++ b/stock_available_immediately/models/__init__.py @@ -1,6 +1,3 @@ -# Copyright 2014 Camptocamp, Akretion, Numérigraphe -# Copyright 2016 Sodexis -# Copyright 2019 Sergio Díaz # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import product_product diff --git a/stock_available_immediately/readme/CONTRIBUTORS.rst b/stock_available_immediately/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..08fdae8b1 --- /dev/null +++ b/stock_available_immediately/readme/CONTRIBUTORS.rst @@ -0,0 +1,9 @@ +* Author: Guewen Baconnier (Camptocamp SA) +* Sébastien BEAU (Akretion) +* Lionel Sausin (Numérigraphe) +* Sodexis +* Cédric Pigeon +* Sergio Díaz +* `Tecnativa `_: + + * Pedro M. Baeza diff --git a/stock_available_immediately/readme/DESCRIPTION.rst b/stock_available_immediately/readme/DESCRIPTION.rst new file mode 100644 index 000000000..920e88bb4 --- /dev/null +++ b/stock_available_immediately/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +Normally the quantity available to promise is based on the virtual stock, +which includes both planned outgoing and incoming goods. +This module will subtract the planned receptions from the quantity available to +promise. diff --git a/stock_available_immediately/static/description/index.html b/stock_available_immediately/static/description/index.html new file mode 100644 index 000000000..6ed9b16f8 --- /dev/null +++ b/stock_available_immediately/static/description/index.html @@ -0,0 +1,433 @@ + + + + + + +Ignore planned receptions in quantity available to promise + + + +
+

Ignore planned receptions in quantity available to promise

+ + +

Beta License: AGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runbot

+

Normally the quantity available to promise is based on the virtual stock, +which includes both planned outgoing and incoming goods. +This module will subtract the planned receptions from the quantity available to +promise.

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Camptocamp
  • +
  • Sodexis
  • +
  • Sergio Díaz
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/stock-logistics-warehouse project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/stock_available_immediately/tests/test_stock_available_immediately.py b/stock_available_immediately/tests/test_stock_available_immediately.py index 436d35a59..a1e9d2c56 100644 --- a/stock_available_immediately/tests/test_stock_available_immediately.py +++ b/stock_available_immediately/tests/test_stock_available_immediately.py @@ -1,6 +1,7 @@ # Copyright 2014 Camptocamp, Akretion, Numérigraphe # Copyright 2016 Sodexis # Copyright 2019 Sergio Díaz +# Copyright 2020 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo.tests.common import TransactionCase @@ -19,7 +20,7 @@ class TestStockLogisticsWarehouse(TransactionCase): supplier_location = self.env.ref('stock.stock_location_suppliers') stock_location = self.env.ref('stock.stock_location_stock') customer_location = self.env.ref('stock.stock_location_customers') - uom_unit = self.env.ref('product.product_uom_unit') + uom_unit = self.env.ref('uom.product_uom_unit') # Create product template templateAB = templateObj.create({ From d9d2ba35f2fd6876afaf887a5b2a92adbcc20c32 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Wed, 25 Mar 2020 18:45:20 +0000 Subject: [PATCH 22/24] [UPD] Update stock_available_immediately.pot --- .../i18n/stock_available_immediately.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_available_immediately/i18n/stock_available_immediately.pot b/stock_available_immediately/i18n/stock_available_immediately.pot index 3b9789d1b..9e76183b6 100644 --- a/stock_available_immediately/i18n/stock_available_immediately.pot +++ b/stock_available_immediately/i18n/stock_available_immediately.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" From cff9044692bfbfc683dd306f1b36140354da86cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Thu, 18 Feb 2021 12:19:26 +0100 Subject: [PATCH 23/24] [IMP] stock_available_immediately: black, isort, prettier --- .../odoo/addons/stock_available_immediately | 1 + setup/stock_available_immediately/setup.py | 6 + stock_available_immediately/__manifest__.py | 2 +- .../models/product_product.py | 14 ++- .../tests/test_stock_available_immediately.py | 112 ++++++++++-------- 5 files changed, 78 insertions(+), 57 deletions(-) create mode 120000 setup/stock_available_immediately/odoo/addons/stock_available_immediately create mode 100644 setup/stock_available_immediately/setup.py diff --git a/setup/stock_available_immediately/odoo/addons/stock_available_immediately b/setup/stock_available_immediately/odoo/addons/stock_available_immediately new file mode 120000 index 000000000..8ab3a1f19 --- /dev/null +++ b/setup/stock_available_immediately/odoo/addons/stock_available_immediately @@ -0,0 +1 @@ +../../../../stock_available_immediately \ No newline at end of file diff --git a/setup/stock_available_immediately/setup.py b/setup/stock_available_immediately/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/stock_available_immediately/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/stock_available_immediately/__manifest__.py b/stock_available_immediately/__manifest__.py index 85fca7b1b..9fe70564e 100644 --- a/stock_available_immediately/__manifest__.py +++ b/stock_available_immediately/__manifest__.py @@ -11,5 +11,5 @@ "author": "Camptocamp,Sodexis,Odoo Community Association (OCA),Sergio Díaz", "license": "AGPL-3", "category": "Hidden", - 'installable': True, + "installable": True, } diff --git a/stock_available_immediately/models/product_product.py b/stock_available_immediately/models/product_product.py index 05987c215..7c63e7c95 100644 --- a/stock_available_immediately/models/product_product.py +++ b/stock_available_immediately/models/product_product.py @@ -7,17 +7,19 @@ from odoo import api, models class ProductProduct(models.Model): - _inherit = 'product.product' + _inherit = "product.product" @api.multi def _compute_available_quantities_dict(self): - res, stock_dict = \ - super(ProductProduct, self)._compute_available_quantities_dict() + res, stock_dict = super( + ProductProduct, self + )._compute_available_quantities_dict() for product in self: - res[product.id]['immediately_usable_qty'] -= \ - stock_dict[product.id]['incoming_qty'] + res[product.id]["immediately_usable_qty"] -= stock_dict[product.id][ + "incoming_qty" + ] return res, stock_dict - @api.depends('virtual_available', 'incoming_qty') + @api.depends("virtual_available", "incoming_qty") def _compute_available_quantities(self): return super(ProductProduct, self)._compute_available_quantities() diff --git a/stock_available_immediately/tests/test_stock_available_immediately.py b/stock_available_immediately/tests/test_stock_available_immediately.py index a1e9d2c56..26405d2eb 100644 --- a/stock_available_immediately/tests/test_stock_available_immediately.py +++ b/stock_available_immediately/tests/test_stock_available_immediately.py @@ -8,58 +8,67 @@ from odoo.tests.common import TransactionCase class TestStockLogisticsWarehouse(TransactionCase): - def test01_stock_levels(self): """ Checking that immediately_usable_qty actually reflects the variations in stock, both on product and template. """ - moveObj = self.env['stock.move'] - productObj = self.env['product.product'] - templateObj = self.env['product.template'] - supplier_location = self.env.ref('stock.stock_location_suppliers') - stock_location = self.env.ref('stock.stock_location_stock') - customer_location = self.env.ref('stock.stock_location_customers') - uom_unit = self.env.ref('uom.product_uom_unit') + moveObj = self.env["stock.move"] + productObj = self.env["product.product"] + templateObj = self.env["product.template"] + supplier_location = self.env.ref("stock.stock_location_suppliers") + stock_location = self.env.ref("stock.stock_location_stock") + customer_location = self.env.ref("stock.stock_location_customers") + uom_unit = self.env.ref("uom.product_uom_unit") # Create product template - templateAB = templateObj.create({ - 'name': 'templAB', - 'uom_id': uom_unit.id}) + templateAB = templateObj.create({"name": "templAB", "uom_id": uom_unit.id}) # Create product A and B - productA = productObj.create({ - 'name': 'product A', - 'standard_price': 1, - 'type': 'product', - 'uom_id': uom_unit.id, - 'default_code': 'A', - 'product_tmpl_id': templateAB.id}) + productA = productObj.create( + { + "name": "product A", + "standard_price": 1, + "type": "product", + "uom_id": uom_unit.id, + "default_code": "A", + "product_tmpl_id": templateAB.id, + } + ) - productB = productObj.create({ - 'name': 'product B', - 'standard_price': 1, - 'type': 'product', - 'uom_id': uom_unit.id, - 'default_code': 'B', - 'product_tmpl_id': templateAB.id}) + productB = productObj.create( + { + "name": "product B", + "standard_price": 1, + "type": "product", + "uom_id": uom_unit.id, + "default_code": "B", + "product_tmpl_id": templateAB.id, + } + ) # Create a stock move from INCOMING to STOCK - stockMoveInA = moveObj.create({ - 'location_id': supplier_location.id, - 'location_dest_id': stock_location.id, - 'name': 'MOVE INCOMING -> STOCK ', - 'product_id': productA.id, - 'product_uom': productA.uom_id.id, - 'product_uom_qty': 2}) + stockMoveInA = moveObj.create( + { + "location_id": supplier_location.id, + "location_dest_id": stock_location.id, + "name": "MOVE INCOMING -> STOCK ", + "product_id": productA.id, + "product_uom": productA.uom_id.id, + "product_uom_qty": 2, + } + ) - stockMoveInB = moveObj.create({ - 'location_id': supplier_location.id, - 'location_dest_id': stock_location.id, - 'name': 'MOVE INCOMING -> STOCK ', - 'product_id': productB.id, - 'product_uom': productB.uom_id.id, - 'product_uom_qty': 3}) + stockMoveInB = moveObj.create( + { + "location_id": supplier_location.id, + "location_dest_id": stock_location.id, + "name": "MOVE INCOMING -> STOCK ", + "product_id": productB.id, + "product_uom": productB.uom_id.id, + "product_uom_qty": 3, + } + ) def compare_product_usable_qty(product, value): # Refresh, because the function field is not recalculated between @@ -78,7 +87,7 @@ class TestStockLogisticsWarehouse(TransactionCase): compare_product_usable_qty(productA, 0) compare_product_usable_qty(templateAB, 0) - stockMoveInA.move_line_ids.write({'qty_done': 2.0}) + stockMoveInA.move_line_ids.write({"qty_done": 2.0}) stockMoveInA._action_done() compare_product_usable_qty(productA, 2) compare_product_usable_qty(templateAB, 2) @@ -86,25 +95,28 @@ class TestStockLogisticsWarehouse(TransactionCase): # will directly trigger action_done on productB stockMoveInB._action_confirm() stockMoveInB._action_assign() - stockMoveInB.move_line_ids.write({'qty_done': 3.0}) + stockMoveInB.move_line_ids.write({"qty_done": 3.0}) stockMoveInB._action_done() compare_product_usable_qty(productA, 2) compare_product_usable_qty(productB, 3) compare_product_usable_qty(templateAB, 5) # Create a stock move from STOCK to CUSTOMER - stockMoveOutA = moveObj.create({ - 'location_id': stock_location.id, - 'location_dest_id': customer_location.id, - 'name': ' STOCK --> CUSTOMER ', - 'product_id': productA.id, - 'product_uom': productA.uom_id.id, - 'product_uom_qty': 1, - 'state': 'confirmed'}) + stockMoveOutA = moveObj.create( + { + "location_id": stock_location.id, + "location_dest_id": customer_location.id, + "name": " STOCK --> CUSTOMER ", + "product_id": productA.id, + "product_uom": productA.uom_id.id, + "product_uom_qty": 1, + "state": "confirmed", + } + ) stockMoveOutA._action_confirm() stockMoveOutA._action_assign() - stockMoveOutA.move_line_ids.write({'qty_done': 1.0}) + stockMoveOutA.move_line_ids.write({"qty_done": 1.0}) stockMoveOutA._action_done() compare_product_usable_qty(productA, 1) compare_product_usable_qty(templateAB, 4) From ea9fb67d49bf9ab6894860b5e32f1e98a08f3c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Thu, 18 Feb 2021 12:33:14 +0100 Subject: [PATCH 24/24] [MIG] stock_available_immediately: Migration to 13.0 --- stock_available_immediately/__manifest__.py | 3 +- .../models/product_product.py | 7 +-- .../readme/CONTRIBUTORS.rst | 1 + .../tests/test_stock_available_immediately.py | 47 +++++++++---------- 4 files changed, 28 insertions(+), 30 deletions(-) diff --git a/stock_available_immediately/__manifest__.py b/stock_available_immediately/__manifest__.py index 9fe70564e..fb758c052 100644 --- a/stock_available_immediately/__manifest__.py +++ b/stock_available_immediately/__manifest__.py @@ -6,8 +6,9 @@ { "name": "Ignore planned receptions in quantity available to promise", - "version": "12.0.1.0.0", + "version": "13.0.1.0.0", "depends": ["stock_available"], + "website": "https://github.com/stock-logistics-warehouse", "author": "Camptocamp,Sodexis,Odoo Community Association (OCA),Sergio Díaz", "license": "AGPL-3", "category": "Hidden", diff --git a/stock_available_immediately/models/product_product.py b/stock_available_immediately/models/product_product.py index 7c63e7c95..90a0d4bb6 100644 --- a/stock_available_immediately/models/product_product.py +++ b/stock_available_immediately/models/product_product.py @@ -9,11 +9,8 @@ from odoo import api, models class ProductProduct(models.Model): _inherit = "product.product" - @api.multi def _compute_available_quantities_dict(self): - res, stock_dict = super( - ProductProduct, self - )._compute_available_quantities_dict() + res, stock_dict = super()._compute_available_quantities_dict() for product in self: res[product.id]["immediately_usable_qty"] -= stock_dict[product.id][ "incoming_qty" @@ -22,4 +19,4 @@ class ProductProduct(models.Model): @api.depends("virtual_available", "incoming_qty") def _compute_available_quantities(self): - return super(ProductProduct, self)._compute_available_quantities() + return super()._compute_available_quantities() diff --git a/stock_available_immediately/readme/CONTRIBUTORS.rst b/stock_available_immediately/readme/CONTRIBUTORS.rst index 08fdae8b1..f7743fe84 100644 --- a/stock_available_immediately/readme/CONTRIBUTORS.rst +++ b/stock_available_immediately/readme/CONTRIBUTORS.rst @@ -7,3 +7,4 @@ * `Tecnativa `_: * Pedro M. Baeza + * Víctor Martínez diff --git a/stock_available_immediately/tests/test_stock_available_immediately.py b/stock_available_immediately/tests/test_stock_available_immediately.py index 26405d2eb..2f4957902 100644 --- a/stock_available_immediately/tests/test_stock_available_immediately.py +++ b/stock_available_immediately/tests/test_stock_available_immediately.py @@ -14,38 +14,37 @@ class TestStockLogisticsWarehouse(TransactionCase): in stock, both on product and template. """ moveObj = self.env["stock.move"] - productObj = self.env["product.product"] templateObj = self.env["product.template"] supplier_location = self.env.ref("stock.stock_location_suppliers") stock_location = self.env.ref("stock.stock_location_stock") customer_location = self.env.ref("stock.stock_location_customers") uom_unit = self.env.ref("uom.product_uom_unit") - # Create product template - templateAB = templateObj.create({"name": "templAB", "uom_id": uom_unit.id}) + # Create product template with 2 variant + templateAB = templateObj.create( + {"name": "templAB", "uom_id": uom_unit.id, "type": "product"} + ) + + self.env["product.template.attribute.line"].create( + { + "product_tmpl_id": templateAB.id, + "attribute_id": self.env.ref("product.product_attribute_2").id, + "value_ids": [ + ( + 6, + 0, + [ + self.env.ref("product.product_attribute_value_3").id, + self.env.ref("product.product_attribute_value_4").id, + ], + ) + ], + } + ) # Create product A and B - productA = productObj.create( - { - "name": "product A", - "standard_price": 1, - "type": "product", - "uom_id": uom_unit.id, - "default_code": "A", - "product_tmpl_id": templateAB.id, - } - ) - - productB = productObj.create( - { - "name": "product B", - "standard_price": 1, - "type": "product", - "uom_id": uom_unit.id, - "default_code": "B", - "product_tmpl_id": templateAB.id, - } - ) + productA = templateAB.product_variant_ids[0] + productB = templateAB.product_variant_ids[1] # Create a stock move from INCOMING to STOCK stockMoveInA = moveObj.create(