Merge lp:~numerigraphe-team/stock-logistic-warehouse/7.0-add-stock-available into lp:stock-logistic-warehouse

Proposed by Lionel Sausin - Initiatives/Numérigraphe
Status: Rejected
Rejected by: Pedro Manuel Baeza
Proposed branch: lp:~numerigraphe-team/stock-logistic-warehouse/7.0-add-stock-available
Merge into: lp:stock-logistic-warehouse
Diff against target: 549 lines (+299/-129)
10 files modified
configurable_stock_level/product.py (+1/-1)
stock_available/__init__.py (+24/-0)
stock_available/__openerp__.py (+42/-0)
stock_available/product.py (+125/-0)
stock_available/product_view.xml (+15/-13)
stock_available/res_config.py (+34/-0)
stock_available/res_config_view.xml (+25/-0)
stock_available_immediately/__openerp__.py (+18/-13)
stock_available_immediately/product.py (+14/-101)
stock_inventory_existing_lines/stock.py (+1/-1)
To merge this branch: bzr merge lp:~numerigraphe-team/stock-logistic-warehouse/7.0-add-stock-available
Reviewer Review Type Date Requested Status
Alexandre Fayolle - camptocamp Needs Resubmitting
Sébastien BEAU - http://www.akretion.com Pending
Guewen Baconnier @ Camptocamp Pending
Laurent Mignon (Acsone) Pending
Review via email: mp+220758@code.launchpad.net

Description of the change

Add a generic module to compute the stock quantity available to promise using several implementations and make stock_available_immediately the first configurable implementation.

stock_available_immediately is rewritten to compute "virtual - incoming" instead of "real - outgoing", which should be mostly the same except for rounding.
The field name "immediately_usable_qty" is unchanged for compatibility, but the field is now called "Available to promise" in the views and help texts (this wording seems more widespread).

By default function fields are not very modular (you need to redefine the whole field to override the method). stock_available takes care of this by making the function fields call the pool instead, so that stock_available_immediately and other future implementations need only override the function _product_available.

The new module also has a context trick that lets it return the value of the stock available to promise in the field "virtual stock". This lets future sub-modules change the behavior of modules that were written to use the virtual stock, to use the new value instead with minimal impact.

Module Co-authored by Loïc Bellier and your humble servant.

To post a comment you must log in.
36. By Numérigraphe

[IMP] Change category to 'warehouse'

37. By Numérigraphe

[MERGE] merge an unrelated fix regarding the UoM precision, to avoid conflicts

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

The source code management for this project has been moved to https://github.com/OCA/stock-logistics-warehouse

Could you resubmit this MP on the new site?

review: Needs Resubmitting
Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

I'm migrating this to github, please mark "refused".

Unmerged revisions

37. By Numérigraphe

[MERGE] merge an unrelated fix regarding the UoM precision, to avoid conflicts

36. By Numérigraphe

[IMP] Change category to 'warehouse'

35. By Numérigraphe

[ADD] stock_available: generic module to compute the stock quantity available to promise using several implementations. Make stock_available_immediatly the first configurable implementation

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configurable_stock_level/product.py'
--- configurable_stock_level/product.py 2012-04-04 11:20:48 +0000
+++ configurable_stock_level/product.py 2014-06-20 09:38:06 +0000
@@ -48,7 +48,7 @@
48 48
49 _columns = {'configurable_stock_level': fields.function(_compute_configurable_level,49 _columns = {'configurable_stock_level': fields.function(_compute_configurable_level,
50 type='float',50 type='float',
51 digits_compute=dp.get_precision('Product UoM'),51 digits_compute=dp.get_precision('Product Unit of Measure'),
52 string='Custom level')}52 string='Custom level')}
5353
54 54
5555
=== added directory 'stock_available'
=== added file 'stock_available/__init__.py'
--- stock_available/__init__.py 1970-01-01 00:00:00 +0000
+++ stock_available/__init__.py 2014-06-20 09:38:06 +0000
@@ -0,0 +1,24 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# This module is copyright (C) 2014 Numérigraphe SARL. All Rights Reserved.
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU Affero General Public License as
8# published by the Free Software Foundation, either version 3 of the
9# License, or (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Affero General Public License for more details.
15#
16# You should have received a copy of the GNU Affero General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#
19##############################################################################
20
21from . import product
22from . import res_config
23
24from .product import _product_available_fnct
025
=== added file 'stock_available/__openerp__.py'
--- stock_available/__openerp__.py 1970-01-01 00:00:00 +0000
+++ stock_available/__openerp__.py 2014-06-20 09:38:06 +0000
@@ -0,0 +1,42 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# This module is copyright (C) 2014 Numérigraphe SARL. All Rights Reserved.
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU Affero General Public License as
8# published by the Free Software Foundation, either version 3 of the
9# License, or (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Affero General Public License for more details.
15#
16# You should have received a copy of the GNU Affero General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#
19##############################################################################
20
21{
22 'name': 'Stock available to promise',
23 'version': '2.0',
24 'author': u'Numérigraphe',
25 'category': 'Warehouse',
26 'depends': ['stock'],
27 'description': """
28Stock available to promise
29==========================
30This module proposes several options to compute the quantity available to
31promise for each product.
32This quantity is based on the projected stock and, depending on the
33configuration, it can account for various data such as sales quotations or
34immediate production capacity.
35This can be configured in the menu Settings > Configuration > Warehouse.
36""",
37 'license': 'AGPL-3',
38 'data': [
39 'product_view.xml',
40 'res_config_view.xml',
41 ]
42}
043
=== added file 'stock_available/product.py'
--- stock_available/product.py 1970-01-01 00:00:00 +0000
+++ stock_available/product.py 2014-06-20 09:38:06 +0000
@@ -0,0 +1,125 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# This module is copyright (C) 2014 Numérigraphe SARL. All Rights Reserved.
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU Affero General Public License as
8# published by the Free Software Foundation, either version 3 of the
9# License, or (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Affero General Public License for more details.
15#
16# You should have received a copy of the GNU Affero General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#
19##############################################################################
20
21from openerp.osv import orm, fields
22import openerp.addons.decimal_precision as dp
23
24
25# Expose the method as a function, like when the fields are defined,
26# and use the pool to call the method from the other modules too.
27def _product_available_fnct(self, cr, uid, ids, field_names=None, arg=False,
28 context=None):
29 return self.pool['product.product']._product_available(
30 cr, uid, ids, field_names=field_names, arg=arg, context=context)
31
32
33class ProductProduct(orm.Model):
34 """Add a field for the stock available to promise.
35
36 Useful implementations need to be installed through the Settings menu or by
37 installing one of the modules stock_available_*
38 """
39 _inherit = 'product.product'
40
41 def __init__(self, pool, cr):
42 """Use _product_available_fnct to compute all the quantities."""
43 # Doing this lets us change the function and not redefine fields
44 super(ProductProduct, self).__init__(pool, cr)
45 for coldef in self._columns.values():
46 if (isinstance(coldef, fields.function)
47 and coldef._multi == 'qty_available'):
48 coldef._fnct = _product_available_fnct
49
50 def _product_available(self, cr, uid, ids, field_names=None, arg=False,
51 context=None):
52 """Dummy field for the stock available to promise.
53
54 Must be overridden by another module that actually implement
55 computations.
56 The sub-modules MUST call super()._product_available BEFORE their own
57 computations with
58 context['virtual_is_immediately_usable_qty']=False
59 AND call _update_virtual_available() AFTER their own computations
60 with the context from the caller.
61
62 @param context: see _update_virtual_available()"""
63 if context is None:
64 context = {}
65 if field_names is None:
66 field_names = []
67 else:
68 # We don't want to change the caller's list
69 field_names = list(field_names)
70
71 # Load virtual_available if it's not already asked for
72 # We need it to compute immediately_usable_qty
73 if ('virtual_available' not in field_names
74 and 'immediately_usable_qty' in field_names):
75 field_names.append('virtual_available')
76 if context.get('virtual_is_immediately_usable', False):
77 # _update_virtual_available will get/set these fields
78 if 'virtual_available' not in field_names:
79 field_names.append('virtual_available')
80 if 'immediately_usable_qty' not in field_names:
81 field_names.append('immediately_usable_qty')
82
83 # Compute the core quantities
84 res = super(ProductProduct, self)._product_available(
85 cr, uid, ids, field_names=field_names, arg=arg, context=context)
86
87 # By default, available to promise = forecasted quantity
88 if ('immediately_usable_qty' in field_names):
89 for stock_qty in res.itervalues():
90 stock_qty['immediately_usable_qty'] = \
91 stock_qty['virtual_available']
92
93 return self.pool['product.product']._update_virtual_available(
94 cr, uid, res, context=context)
95
96 def _update_virtual_available(self, cr, uid, res, context=None):
97 """Copy immediately_usable_qty to virtual_available if context asks
98
99 @param context: If the key virtual_is_immediately_usable is True,
100 then the virtual stock is computed as the stock
101 available to promise. This lets existing code base
102 their computations on the new value with a minimum of
103 change (i.e.: warn salesmen when the stock available
104 for sale is insufficient to honor a quotation)"""
105 if (context is None
106 or not context.get('virtual_is_immediately_usable', False)):
107 return res
108 for stock_qty in res.itervalues():
109 # _product_available makes sure both fields are loaded
110 # We're changing the caller's state but it's not be a problem
111 stock_qty['virtual_available'] = \
112 stock_qty['immediately_usable_qty']
113 return res
114
115 _columns = {
116 'immediately_usable_qty': fields.function(
117 _product_available_fnct, multi='qty_available',
118 type='float',
119 digits_compute=dp.get_precision('Product Unit of Measure'),
120 string='Available to promise',
121 help="Stock for this Product that can be safely proposed "
122 "for sale to Customers.\n"
123 "The definition of this value can be configured to suit "
124 "your needs"),
125 }
0126
=== renamed file 'stock_available_immediately/product_view.xml' => 'stock_available/product_view.xml'
--- stock_available_immediately/product_view.xml 2014-01-24 17:11:21 +0000
+++ stock_available/product_view.xml 2014-06-20 09:38:06 +0000
@@ -1,27 +1,19 @@
1<?xml version="1.0" encoding="utf-8"?>1<?xml version="1.0" encoding="utf-8"?>
2
3<!--
4 stock available_immediately for OpenERP
5 Author Guewen Baconnier. Copyright Camptocamp SA
6 Copyright (C) 2011 Akretion Sébastien BEAU <sebastien.beau@akretion.com>
7 The licence is in the file __openerp__.py
8-->
9
10<openerp>2<openerp>
11 <data>3 <data>
12 <record model="ir.ui.view" id="view_normal_stock_active_qty_form">4 <record model="ir.ui.view" id="view_stock_available_form">
13 <field name="name">product.normal.stock.active.qty.form.inherit</field>5 <field name="name">Stock available to promise (form)</field>
14 <field name="model">product.product</field>6 <field name="model">product.product</field>
15 <field name="inherit_id" ref="stock.view_normal_procurement_locations_form"/>7 <field name="inherit_id" ref="stock.view_normal_procurement_locations_form"/>
16 <field name="arch" type="xml">8 <field name="arch" type="xml">
17 <field name="virtual_available" position="after">9 <field name="virtual_available" position="after">
18 <newline/>10 <newline/>
19 <field name="immediately_usable_qty" />11 <field name="immediately_usable_qty" />
20 </field> 12 </field>
21 </field>13 </field>
22 </record>14 </record>
23 15
24 <record model="ir.ui.view" id="product_product_tree_view">16 <record model="ir.ui.view" id="view_stock_available_tree">
25 <field name="name">product_immediately_usable.product_product_tree_view</field>17 <field name="name">product_immediately_usable.product_product_tree_view</field>
26 <field name="model">product.product</field>18 <field name="model">product.product</field>
27 <field name="inherit_id" ref="product.product_product_tree_view"/>19 <field name="inherit_id" ref="product.product_product_tree_view"/>
@@ -30,12 +22,22 @@
30 <tree position="attributes">22 <tree position="attributes">
31 <attribute name="colors">red:immediately_usable_qty&lt;0;blue:immediately_usable_qty&gt;=0 and state in ('draft', 'end', 'obsolete');black:immediately_usable_qty&gt;=0 and state not in ('draft', 'end', 'obsolete')</attribute>23 <attribute name="colors">red:immediately_usable_qty&lt;0;blue:immediately_usable_qty&gt;=0 and state in ('draft', 'end', 'obsolete');black:immediately_usable_qty&gt;=0 and state not in ('draft', 'end', 'obsolete')</attribute>
32 </tree>24 </tree>
33 <field name="virtual_available" position="replace">25 <field name="virtual_available" position="after">
34 <field name="immediately_usable_qty" />26 <field name="immediately_usable_qty" />
35 </field>27 </field>
36 </data>28 </data>
37 </field>29 </field>
38 </record>30 </record>
3931
32 <record model="ir.ui.view" id="view_stock_available_kanban">
33 <field name="name">Product Kanban Stock</field>
34 <field name="model">product.product</field>
35 <field name="inherit_id" ref="stock.product_kanban_stock_view"/>
36 <field name="arch" type="xml">
37 <xpath expr="//field[@name='virtual_available']/.." position="replace">
38 <li t-if="record.type.raw_value != 'service'">Available to promise: <field name="immediately_usable_qty"/> <field name="uom_id"/></li>
39 </xpath>
40 </field>
41 </record>
40 </data>42 </data>
41</openerp>43</openerp>
4244
=== added file 'stock_available/res_config.py'
--- stock_available/res_config.py 1970-01-01 00:00:00 +0000
+++ stock_available/res_config.py 2014-06-20 09:38:06 +0000
@@ -0,0 +1,34 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# This module is copyright (C) 2014 Numérigraphe SARL. All Rights Reserved.
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#
19##############################################################################
20
21from openerp.osv import orm, fields
22
23
24class StockConfig(orm.TransientModel):
25 """Add options to easily install the submodules"""
26 _inherit = 'stock.config.settings'
27
28 _columns = {
29 'module_stock_available_immediately': fields.boolean(
30 'Exclude incoming goods',
31 help="This will subtract incoming quantities from the quantities"
32 "available to promise.\n"
33 "This installs the module stock_available_immediately."),
34 }
035
=== added file 'stock_available/res_config_view.xml'
--- stock_available/res_config_view.xml 1970-01-01 00:00:00 +0000
+++ stock_available/res_config_view.xml 2014-06-20 09:38:06 +0000
@@ -0,0 +1,25 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="view_stock_configuration" model="ir.ui.view">
5 <field name="name">Stock settings: quantity available to promise</field>
6 <field name="model">stock.config.settings</field>
7 <field name="inherit_id" ref="stock.view_stock_config_settings" />
8 <field name="arch" type="xml">
9 <data>
10 <xpath expr="//group[last()]" position="after">
11 <group>
12 <label for="id" string="Stock available to promise" />
13 <div>
14 <div>
15 <field name="module_stock_available_immediately" class="oe_inline" />
16 <label for="module_stock_available_immediately" />
17 </div>
18 </div>
19 </group>
20 </xpath>
21 </data>
22 </field>
23 </record>
24 </data>
25</openerp>
0\ No newline at end of file26\ No newline at end of file
127
=== modified file 'stock_available_immediately/__openerp__.py'
--- stock_available_immediately/__openerp__.py 2014-01-24 17:11:21 +0000
+++ stock_available_immediately/__openerp__.py 2014-06-20 09:38:06 +0000
@@ -20,21 +20,26 @@
20#20#
21#21#
2222
23
24{23{
25 "name": "Immediately Usable Stock Quantity",24 "name": "Ignore planned receptions in quantity available to promise",
26 "version": "1.0",25 "version": "2.0",
27 "depends": ["product", "stock", ],26 "depends": ["stock_available"],
28 "author": "Camptocamp",27 "author": "Camptocamp",
29 "license": "AGPL-3",28 "license": "AGPL-3",
30 "description": """29 "description": u"""
31Compute the immediately usable stock.30Ignore planned receptions in quantity available to promise
32Immediately usable is computed : Quantity on Hand - Outgoing Stock.31----------------------------------------------------------
32
33Normally the quantity available to promise is based on the virtual stock,
34which includes both planned outgoing and incoming goods.
35This module will subtract the planned receptions from the quantity available to
36promise.
37
38Contributors
39------------
40 * Author: Guewen Baconnier (Camptocamp SA)
41 * Sébastien BEAU (Akretion) <sebastien.beau@akretion.com>
42 * Lionel Sausin (Numérigraphe) <ls@numerigraphe.com>
33""",43""",
34 "website": "http://tinyerp.com/module_account.html",44 "category": "Hidden",
35 "category": "Generic Modules/Stock",
36 "data": ["product_view.xml",
37 ],
38 "active": False,
39 "installable": True
40}45}
4146
=== modified file 'stock_available_immediately/product.py'
--- stock_available_immediately/product.py 2014-02-19 11:43:35 +0000
+++ stock_available_immediately/product.py 2014-06-20 09:38:06 +0000
@@ -19,124 +19,37 @@
19#19#
20##############################################################################20##############################################################################
2121
22from openerp.addons import decimal_precision as dp22from openerp.osv import orm
23
24from openerp.osv import orm, fields
2523
2624
27class product_immediately_usable(orm.Model):25class product_immediately_usable(orm.Model):
28 """26 """Subtract incoming qty from immediately_usable_qty
29 Inherit Product in order to add an "immediately usable quantity"27
30 stock field28 We don't need to override the function fields, the module stock_available
31 Immediately usable quantity is : real stock - outgoing qty29 takes of it for us."""
32 """
33 _inherit = 'product.product'30 _inherit = 'product.product'
3431
35 def _product_available(self, cr, uid, ids, field_names=None,32 def _product_available(self, cr, uid, ids, field_names=None,
36 arg=False, context=None):33 arg=False, context=None):
37 """34 """Ignore the incoming goods in the quantity available to promise"""
38 Get super() _product_available and compute immediately_usable_qty35 # We need available and incoming quantities to compute
39 """
40 # We need available and outgoing quantities to compute
41 # immediately usable quantity.36 # immediately usable quantity.
42 # When immediately_usable_qty is displayed but37 # When immediately_usable_qty is displayed but
43 # not qty_available and outgoing_qty,38 # not qty_available and incoming_qty,
44 # they are not computed in the super method so we cannot39 # they are not computed in the super method so we cannot
45 # compute immediately_usable_qty.40 # compute immediately_usable_qty.
46 # To avoid this issue, we add the 2 fields in41 # To avoid this issue, we add the 2 fields in
47 # field_names to compute them.42 # field_names to compute them.
48 if 'immediately_usable_qty' in field_names:43 if 'immediately_usable_qty' in field_names:
49 field_names.append('qty_available')44 field_names.append('qty_available')
50 field_names.append('outgoing_qty')45 field_names.append('incoming_qty')
5146
52 res = super(product_immediately_usable, self)._product_available(47 res = super(product_immediately_usable, self)._product_available(
53 cr, uid, ids, field_names, arg, context)48 cr, uid, ids, field_names, arg, context)
5449
55 if 'immediately_usable_qty' in field_names:50 if 'immediately_usable_qty' in field_names:
56 for product_id, stock_qty in res.iteritems():51 for stock_qty in res.itervalues():
57 res[product_id]['immediately_usable_qty'] = \52 stock_qty['immediately_usable_qty'] -= \
58 stock_qty['qty_available'] + stock_qty['outgoing_qty']53 stock_qty['incoming_qty']
5954
60 return res55 return self._update_virtual_available(cr, uid, res, context=context)
61
62 _columns = {
63 'qty_available': fields.function(
64 _product_available,
65 multi='qty_available',
66 type='float',
67 digits_compute=dp.get_precision('Product UoM'),
68 string='Quantity On Hand',
69 help="Current quantity of products.\n"
70 "In a context with a single Stock Location, this includes "
71 "goods stored at this Location, or any of its children.\n"
72 "In a context with a single Warehouse, this includes "
73 "goods stored in the Stock Location of this Warehouse, "
74 "or any "
75 "of its children.\n"
76 "In a context with a single Shop, this includes goods "
77 "stored in the Stock Location of the Warehouse of this Shop, "
78 "or any of its children.\n"
79 "Otherwise, this includes goods stored in any Stock Location "
80 "typed as 'internal'."),
81 'virtual_available': fields.function(
82 _product_available,
83 multi='qty_available',
84 type='float',
85 digits_compute=dp.get_precision('Product UoM'),
86 string='Quantity Available',
87 help="Forecast quantity (computed as Quantity On Hand "
88 "- Outgoing + Incoming)\n"
89 "In a context with a single Stock Location, this includes "
90 "goods stored at this Location, or any of its children.\n"
91 "In a context with a single Warehouse, this includes "
92 "goods stored in the Stock Location of this Warehouse, "
93 "or any "
94 "of its children.\n"
95 "In a context with a single Shop, this includes goods "
96 "stored in the Stock Location of the Warehouse of this Shop, "
97 "or any of its children.\n"
98 "Otherwise, this includes goods stored in any Stock Location "
99 "typed as 'internal'."),
100 'incoming_qty': fields.function(
101 _product_available,
102 multi='qty_available',
103 type='float',
104 digits_compute=dp.get_precision('Product UoM'),
105 string='Incoming',
106 help="Quantity of products that are planned to arrive.\n"
107 "In a context with a single Stock Location, this includes "
108 "goods arriving to this Location, or any of its children.\n"
109 "In a context with a single Warehouse, this includes "
110 "goods arriving to the Stock Location of this Warehouse, or "
111 "any of its children.\n"
112 "In a context with a single Shop, this includes goods "
113 "arriving to the Stock Location of the Warehouse of this "
114 "Shop, or any of its children.\n"
115 "Otherwise, this includes goods arriving to any Stock "
116 "Location typed as 'internal'."),
117 'outgoing_qty': fields.function(
118 _product_available,
119 multi='qty_available',
120 type='float',
121 digits_compute=dp.get_precision('Product UoM'),
122 string='Outgoing',
123 help="Quantity of products that are planned to leave.\n"
124 "In a context with a single Stock Location, this includes "
125 "goods leaving from this Location, or any of its children.\n"
126 "In a context with a single Warehouse, this includes "
127 "goods leaving from the Stock Location of this Warehouse, or "
128 "any of its children.\n"
129 "In a context with a single Shop, this includes goods "
130 "leaving from the Stock Location of the Warehouse of this "
131 "Shop, or any of its children.\n"
132 "Otherwise, this includes goods leaving from any Stock "
133 "Location typed as 'internal'."),
134 'immediately_usable_qty': fields.function(
135 _product_available,
136 digits_compute=dp.get_precision('Product UoM'),
137 type='float',
138 string='Immediately Usable',
139 multi='qty_available',
140 help="Quantity of products really available for sale." \
141 "Computed as: Quantity On Hand - Outgoing."),
142 }
14356
=== modified file 'stock_inventory_existing_lines/stock.py'
--- stock_inventory_existing_lines/stock.py 2012-03-07 12:56:37 +0000
+++ stock_inventory_existing_lines/stock.py 2014-06-20 09:38:06 +0000
@@ -81,7 +81,7 @@
81 'location_id': fields.many2one('stock.location', 'Location', required=True),81 'location_id': fields.many2one('stock.location', 'Location', required=True),
82 'product_id': fields.many2one('product.product', 'Product', required=True, select=True),82 'product_id': fields.many2one('product.product', 'Product', required=True, select=True),
83 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),83 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),
84 'product_qty': fields.float('Quantity', digits_compute=dp.get_precision('Product UoM')),84 'product_qty': fields.float('Quantity', digits_compute=dp.get_precision('Product Unit of Measure')),
85 'company_id': fields.related('inventory_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, select=True, readonly=True),85 'company_id': fields.related('inventory_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, select=True, readonly=True),
86 'prod_lot_id': fields.many2one('stock.production.lot', 'Production Lot', domain="[('product_id','=',product_id)]"),86 'prod_lot_id': fields.many2one('stock.production.lot', 'Production Lot', domain="[('product_id','=',product_id)]"),
87 'state': fields.related('inventory_id', 'state', type='char', string='State',readonly=True),87 'state': fields.related('inventory_id', 'state', type='char', string='State',readonly=True),

Subscribers

People subscribed via source and target branches