[9.0][PORT] Stock available

This commit is contained in:
Atchuthan, Sodexis
2016-02-10 11:41:48 +05:30
committed by ps-tubtim
parent 12c9c3a241
commit 94d1fb7ac6
10 changed files with 69 additions and 145 deletions

View File

@@ -31,6 +31,7 @@ Contributors
------------
* Lionel Sausin (Numérigraphe) <ls@numerigraphe.com>
* Sodexis <sodexis@sodexis.com>
* many others contributed to sub-modules, please refer to each sub-module's credits
Maintainer

View File

@@ -1,21 +1,5 @@
# -*- 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
# © 2014 Numérigraphe, Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models

View File

@@ -1,27 +1,11 @@
# -*- 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
# © 2014 Numérigraphe, Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Stock available to promise',
'version': '8.0.2.0.0',
"author": u"Numérigraphe,Odoo Community Association (OCA)",
'version': '9.0.1.0.0',
"author": "Numérigraphe, Sodexis, Odoo Community Association (OCA)",
'category': 'Warehouse',
'depends': ['stock'],
'license': 'AGPL-3',
@@ -30,4 +14,5 @@
'views/product_product_view.xml',
'views/res_config_view.xml',
],
'installable': True,
}

View File

@@ -1,23 +1,5 @@
# -*- 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
# © 2014 Numérigraphe, Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import product_template
from . import product_product
from . import res_config
from . import product_template, product_product, res_config

View File

@@ -1,28 +1,13 @@
#-*- 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2014 Numérigraphe, Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
from openerp.addons import decimal_precision as dp
class ProductProduct(models.Model):
"""Add a field for the stock available to promise.
Useful implementations need to be installed through the Settings menu or by
installing one of the modules stock_available_*

View File

@@ -1,22 +1,6 @@
# -*- 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
# © 2014 Numérigraphe, Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
from openerp.addons import decimal_precision as dp

View File

@@ -1,27 +1,12 @@
# -*- 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 General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# © 2014 Numérigraphe, Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
class StockConfig(models.TransientModel):
"""Add options to easily install the submodules"""
_inherit = 'stock.config.settings'

View File

@@ -1,20 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- © 2014 Numérigraphe, Sodexis
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<openerp>
<data>
<record model="ir.ui.view" id="view_stock_available_tree_variant">
<record model="ir.ui.view" id="product_normal_form_view">
<field name="name">Quantity available to promise (variant tree)</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="stock.view_stock_product_tree"/>
<field name="inherit_id" ref="stock.product_form_view_procurement_button" />
<field name="arch" type="xml">
<data>
<tree position="attributes">
<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>
</tree>
<field name="virtual_available" position="after">
<field name="immediately_usable_qty" />
</field>
</data>
<xpath expr="//button[@name='%(stock.action_stock_level_forecast_report_product)d']"
position="after">
<button type="action" name="%(stock.product_open_quants)d"
attrs="{'invisible':[('type', '!=', 'product')]}"
class="oe_stat_button" icon="fa-building-o">
<div class="o_form_field o_stat_info">
<field name="immediately_usable_qty"
widget="statinfo" nolabel="1" />
<span class="o_stat_text">Available</span>
</div>
</button>
</xpath>
</field>
</record>
</data>
</openerp>
</openerp>

View File

@@ -1,43 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- © 2014 Numérigraphe, Sodexis
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<openerp>
<data>
<record model="ir.ui.view" id="view_stock_available_form">
<field name="name">Quantity available to promise (form)</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="stock.view_template_property_form"/>
<field name="inherit_id" ref="stock.product_template_form_view_procurement_button" />
<field name="arch" type="xml">
<field name="virtual_available" position="after">
<newline/>
<field name="immediately_usable_qty" />
</field>
<xpath expr="//button[@name='%(stock.action_stock_level_forecast_report_template)d']"
position="after">
<button type="object" name="action_open_quants"
attrs="{'invisible':[('type', '!=', 'product')]}"
class="oe_stat_button" icon="fa-building-o">
<div class="o_form_field o_stat_info">
<field name="immediately_usable_qty"
widget="statinfo" nolabel="1" />
<span class="o_stat_text">Available</span>
</div>
</button>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="view_stock_available_tree">
<field name="name">Quantity available to promise (tree)</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="stock.view_stock_product_template_tree"/>
<field name="arch" type="xml">
<data>
<tree position="attributes">
<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>
</tree>
<field name="virtual_available" position="after">
<field name="immediately_usable_qty" />
</field>
</data>
<tree position="attributes">
<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>
</tree>
<field name="virtual_available" position="after">
<field name="immediately_usable_qty" />
</field>
</field>
</record>
<record model="ir.ui.view" id="view_stock_available_kanban">
<field name="name">Quantity available to promise (kanban)</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="stock.product_template_kanban_stock_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='virtual_available']/.." position="replace">
<li t-if="record.type.raw_value != 'service'">Available to promise: <field name="immediately_usable_qty"/> <field name="uom_id"/></li>
</xpath>
<ul position="inside">
<li t-if="record.type.raw_value == 'product'">Available to Promise: <field name="immediately_usable_qty"/> <field name="uom_id"/></li>
</ul>
</field>
</record>
</data>
</openerp>
</openerp>

View File

@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- © 2014 Numérigraphe, Sodexis
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<openerp>
<data>
<record id="view_stock_configuration" model="ir.ui.view">
@@ -12,7 +15,8 @@
<label for="id" string="Stock available to promise" />
<div>
<div>
<field name="module_stock_available_immediately" class="oe_inline" />
<field name="module_stock_available_immediately"
class="oe_inline" />
<label for="module_stock_available_immediately" />
</div>
<!-- <div>