[MIG] stock_available: Migration to 13.0

This commit is contained in:
ps-tubtim
2020-06-16 13:37:06 +07:00
committed by Florian da Costa
parent dd90188d8a
commit b546d23d27
9 changed files with 144 additions and 77 deletions

View File

@@ -14,13 +14,13 @@ Stock available to promise
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3 :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github .. |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 :target: https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_available
:alt: OCA/stock-logistics-warehouse :alt: OCA/stock-logistics-warehouse
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |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 :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_available
:alt: Translate me on Weblate :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/153/12.0 :target: https://runbot.odoo-community.org/runbot/153/13.0
:alt: Try me on Runbot :alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@@ -63,7 +63,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/issues>`_. Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/issues>`_.
In case of trouble, please check there if your issue has already been reported. 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 If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_available%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. `feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_available%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues. Do not contact contributors directly about support or help with technical issues.
@@ -95,6 +95,10 @@ Contributors
* Sergio Teruel <sergio.teruel@tecnativa.com> * Sergio Teruel <sergio.teruel@tecnativa.com>
* `Ecosoft <http://ecosoft.co.th/>`_:
* Pimolnat Suntian <pimolnats@ecosoft.co.th>
Maintainers Maintainers
~~~~~~~~~~~ ~~~~~~~~~~~
@@ -108,6 +112,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_available>`_ project on GitHub. This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_available>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -4,7 +4,6 @@
from odoo import api, fields, models from odoo import api, fields, models
from odoo.addons import decimal_precision as dp
from odoo.addons.stock.models.product import OPERATORS from odoo.addons.stock.models.product import OPERATORS
@@ -17,7 +16,6 @@ class ProductProduct(models.Model):
_inherit = "product.product" _inherit = "product.product"
@api.multi
def _compute_available_quantities_dict(self): def _compute_available_quantities_dict(self):
stock_dict = self._compute_quantities_dict( stock_dict = self._compute_quantities_dict(
self._context.get("lot_id"), self._context.get("lot_id"),
@@ -34,7 +32,6 @@ class ProductProduct(models.Model):
} }
return res, stock_dict return res, stock_dict
@api.multi
@api.depends("virtual_available") @api.depends("virtual_available")
def _compute_available_quantities(self): def _compute_available_quantities(self):
res, _ = self._compute_available_quantities_dict() res, _ = self._compute_available_quantities_dict()
@@ -44,7 +41,7 @@ class ProductProduct(models.Model):
product[key] = value product[key] = value
immediately_usable_qty = fields.Float( immediately_usable_qty = fields.Float(
digits=dp.get_precision("Product Unit of Measure"), digits="Product Unit of Measure",
compute="_compute_available_quantities", compute="_compute_available_quantities",
search="_search_immediately_usable_qty", search="_search_immediately_usable_qty",
string="Available to promise", string="Available to promise",
@@ -55,7 +52,7 @@ class ProductProduct(models.Model):
) )
potential_qty = fields.Float( potential_qty = fields.Float(
compute="_compute_available_quantities", compute="_compute_available_quantities",
digits=dp.get_precision("Product Unit of Measure"), digits="Product Unit of Measure",
string="Potential", string="Potential",
help="Quantity of this Product that could be produced using " help="Quantity of this Product that could be produced using "
"the materials already at hand.", "the materials already at hand.",

View File

@@ -4,14 +4,12 @@
from odoo import api, fields, models from odoo import api, fields, models
from odoo.addons import decimal_precision as dp
from odoo.addons.stock.models.product import OPERATORS from odoo.addons.stock.models.product import OPERATORS
class ProductTemplate(models.Model): class ProductTemplate(models.Model):
_inherit = "product.template" _inherit = "product.template"
@api.multi
@api.depends( @api.depends(
"product_variant_ids.immediately_usable_qty", "product_variant_ids.immediately_usable_qty",
"product_variant_ids.potential_qty", "product_variant_ids.potential_qty",
@@ -23,7 +21,6 @@ class ProductTemplate(models.Model):
if key in product._fields: if key in product._fields:
product[key] = value product[key] = value
@api.multi
def _compute_available_quantities_dict(self): def _compute_available_quantities_dict(self):
variants_dict, _ = self.mapped( variants_dict, _ = self.mapped(
"product_variant_ids" "product_variant_ids"
@@ -51,7 +48,7 @@ class ProductTemplate(models.Model):
return res return res
immediately_usable_qty = fields.Float( immediately_usable_qty = fields.Float(
digits=dp.get_precision("Product Unit of Measure"), digits="Product Unit of Measure",
compute="_compute_available_quantities", compute="_compute_available_quantities",
search="_search_immediately_usable_qty", search="_search_immediately_usable_qty",
string="Available to promise", string="Available to promise",
@@ -62,7 +59,7 @@ class ProductTemplate(models.Model):
) )
potential_qty = fields.Float( potential_qty = fields.Float(
compute="_compute_available_quantities", compute="_compute_available_quantities",
digits=dp.get_precision("Product Unit of Measure"), digits="Product Unit of Measure",
string="Potential", string="Potential",
help="Quantity of this Product that could be produced using " help="Quantity of this Product that could be produced using "
"the materials already at hand. " "the materials already at hand. "

View File

@@ -66,7 +66,6 @@ class ResConfigSettings(models.TransientModel):
) )
return res return res
@api.multi
def set_values(self): def set_values(self):
super(ResConfigSettings, self).set_values() super(ResConfigSettings, self).set_values()
self.env["ir.config_parameter"].sudo().set_param( self.env["ir.config_parameter"].sudo().set_param(

View File

@@ -13,3 +13,7 @@
* `Tecnativa <https://www.tecnativa.com>`_: * `Tecnativa <https://www.tecnativa.com>`_:
* Sergio Teruel <sergio.teruel@tecnativa.com> * Sergio Teruel <sergio.teruel@tecnativa.com>
* `Ecosoft <http://ecosoft.co.th/>`_:
* Pimolnat Suntian <pimolnats@ecosoft.co.th>

View File

@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_available"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_available"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/153/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_available"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_available"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/153/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module proposes several options to compute the quantity available to <p>This module proposes several options to compute the quantity available to
promise for each product. promise for each product.
This quantity is based on the projected stock and, depending on the This quantity is based on the projected stock and, depending on the
@@ -411,7 +411,7 @@ chose to base the computation on.</p>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues">GitHub Issues</a>. <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported. 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 If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_available%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_available%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
@@ -454,6 +454,13 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
</ul> </ul>
</blockquote> </blockquote>
</li> </li>
<li><p class="first"><a class="reference external" href="http://ecosoft.co.th/">Ecosoft</a>:</p>
<blockquote>
<ul class="simple">
<li>Pimolnat Suntian &lt;<a class="reference external" href="mailto:pimolnats&#64;ecosoft.co.th">pimolnats&#64;ecosoft.co.th</a>&gt;</li>
</ul>
</blockquote>
</li>
</ul> </ul>
</div> </div>
<div class="section" id="maintainers"> <div class="section" id="maintainers">
@@ -463,7 +470,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_available">OCA/stock-logistics-warehouse</a> project on GitHub.</p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_available">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div> </div>
</div> </div>

View File

@@ -1,37 +1,56 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2014 Numérigraphe <!-- Copyright 2014 Numérigraphe
Copyright 2016 Sodexis Copyright 2016 Sodexis
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<odoo> <odoo>
<record model="ir.ui.view" id="product_normal_form_view"> <record model="ir.ui.view" id="product_normal_form_view">
<field name="name">Quantity available to promise (variant tree)</field> <field name="name">Quantity available to promise (variant tree)</field>
<field name="model">product.product</field> <field name="model">product.product</field>
<field name="inherit_id" ref="stock.product_form_view_procurement_button" /> <field name="inherit_id" ref="stock.product_form_view_procurement_button" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//button[@name='%(stock.action_stock_level_forecast_report_product)d']" <xpath
position="after"> expr="//button[@name='action_product_forecast_report']"
<button type="action" name="%(stock.product_open_quants)d" position="after"
>
<button
type="object"
name="action_open_quants"
attrs="{'invisible':[('type', 'not in', ['product','consu'])]}" attrs="{'invisible':[('type', 'not in', ['product','consu'])]}"
class="oe_stat_button" icon="fa-building-o"> class="oe_stat_button"
<div class="o_field_widget o_stat_info"> icon="fa-building-o"
<span class="o_stat_value" widget="statinfo"> >
<field name="immediately_usable_qty" widget="statinfo" nolabel="1" class="mr4"/> <div class="o_field_widget o_stat_info">
<field name="uom_name"/> <span class="o_stat_value" widget="statinfo">
</span> <field
<span class="o_stat_text">Available</span> name="immediately_usable_qty"
</div> widget="statinfo"
nolabel="1"
class="mr4"
/>
<field name="uom_name" />
</span>
<span class="o_stat_text">Available</span>
</div>
</button> </button>
<button type="action" name="%(stock.product_open_quants)d" <button
type="object"
name="action_open_quants"
attrs="{'invisible':[('type', 'not in', ['product','consu'])]}" attrs="{'invisible':[('type', 'not in', ['product','consu'])]}"
class="oe_stat_button" icon="fa-building-o"> class="oe_stat_button"
<div class="o_field_widget o_stat_info"> icon="fa-building-o"
<span class="o_stat_value" widget="statinfo"> >
<field name="potential_qty" widget="statinfo" nolabel="1" class="mr4"/> <div class="o_field_widget o_stat_info">
<field name="uom_name"/> <span class="o_stat_value" widget="statinfo">
</span> <field
<span class="o_stat_text">Potential</span> name="potential_qty"
</div> widget="statinfo"
nolabel="1"
class="mr4"
/>
<field name="uom_name" />
</span>
<span class="o_stat_text">Potential</span>
</div>
</button> </button>
</xpath> </xpath>
</field> </field>
@@ -39,14 +58,18 @@
<record model="ir.ui.view" id="view_stock_available_product_tree"> <record model="ir.ui.view" id="view_stock_available_product_tree">
<field name="name">Quantity available to promise (variant tree)</field> <field name="name">Quantity available to promise (variant tree)</field>
<field name="model">product.product</field> <field name="model">product.product</field>
<field name="inherit_id" ref="stock.view_stock_product_tree"/> <field name="inherit_id" ref="stock.view_stock_product_tree" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree position="attributes"> <tree position="attributes">
<attribute name="decoration-danger">virtual_available&lt;0 or immediately_usable_qty&lt;0</attribute> <attribute
<attribute name="decoration-info">virtual_available&gt;=0 or immediately_usable_qty&gt;0</attribute> name="decoration-danger"
>virtual_available&lt;0 or immediately_usable_qty&lt;0</attribute>
<attribute
name="decoration-info"
>virtual_available&gt;=0 or immediately_usable_qty&gt;0</attribute>
</tree> </tree>
<field name="virtual_available" position="after"> <field name="virtual_available" position="after">
<field name="immediately_usable_qty" /> <field name="immediately_usable_qty" />
</field> </field>
</field> </field>
</record> </record>

View File

@@ -1,37 +1,59 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2014 Numérigraphe <!-- Copyright 2014 Numérigraphe
Copyright 2016 Sodexis Copyright 2016 Sodexis
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<odoo> <odoo>
<record model="ir.ui.view" id="view_stock_available_form"> <record model="ir.ui.view" id="view_stock_available_form">
<field name="name">Quantity available to promise (form)</field> <field name="name">Quantity available to promise (form)</field>
<field name="model">product.template</field> <field name="model">product.template</field>
<field name="inherit_id" ref="stock.product_template_form_view_procurement_button" /> <field
name="inherit_id"
ref="stock.product_template_form_view_procurement_button"
/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//button[@name='%(stock.action_stock_level_forecast_report_template)d']" <xpath
position="after"> expr="//button[@name='action_product_tmpl_forecast_report']"
<button type="object" name="action_open_quants" position="after"
>
<button
type="object"
name="action_open_quants"
attrs="{'invisible':[('type', 'not in', ['product','consu'])]}" attrs="{'invisible':[('type', 'not in', ['product','consu'])]}"
class="oe_stat_button" icon="fa-building-o"> class="oe_stat_button"
icon="fa-building-o"
>
<div class="o_field_widget o_stat_info"> <div class="o_field_widget o_stat_info">
<span class="o_stat_value" widget="statinfo"> <span class="o_stat_value" widget="statinfo">
<field name="immediately_usable_qty" widget="statinfo" nolabel="1" class="mr4"/> <field
<field name="uom_name"/> name="immediately_usable_qty"
widget="statinfo"
nolabel="1"
class="mr4"
/>
<field name="uom_name" />
</span> </span>
<span class="o_stat_text">Available</span> <span class="o_stat_text">Available</span>
</div> </div>
</button> </button>
<button type="action" name="%(stock.product_open_quants)d" <button
type="object"
name="action_open_quants"
attrs="{'invisible':[('type', 'not in', ['product','consu'])]}" attrs="{'invisible':[('type', 'not in', ['product','consu'])]}"
class="oe_stat_button" icon="fa-building-o"> class="oe_stat_button"
<div class="o_field_widget o_stat_info"> icon="fa-building-o"
<span class="o_stat_value" widget="statinfo"> >
<field name="potential_qty" widget="statinfo" nolabel="1" class="mr4"/> <div class="o_field_widget o_stat_info">
<field name="uom_name"/> <span class="o_stat_value" widget="statinfo">
</span> <field
<span class="o_stat_text">Potential</span> name="potential_qty"
</div> widget="statinfo"
nolabel="1"
class="mr4"
/>
<field name="uom_name" />
</span>
<span class="o_stat_text">Potential</span>
</div>
</button> </button>
</xpath> </xpath>
</field> </field>
@@ -39,24 +61,32 @@
<record model="ir.ui.view" id="view_stock_available_product_template_tree"> <record model="ir.ui.view" id="view_stock_available_product_template_tree">
<field name="name">Quantity available to promise (tree)</field> <field name="name">Quantity available to promise (tree)</field>
<field name="model">product.template</field> <field name="model">product.template</field>
<field name="inherit_id" ref="stock.view_stock_product_template_tree"/> <field name="inherit_id" ref="stock.view_stock_product_template_tree" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree position="attributes"> <tree position="attributes">
<attribute name="decoration-danger">virtual_available&lt;0 or immediately_usable_qty&lt;0</attribute> <attribute
<attribute name="decoration-info">virtual_available&gt;=0 or immediately_usable_qty&gt;0</attribute> name="decoration-danger"
>virtual_available&lt;0 or immediately_usable_qty&lt;0</attribute>
<attribute
name="decoration-info"
>virtual_available&gt;=0 or immediately_usable_qty&gt;0</attribute>
</tree> </tree>
<field name="virtual_available" position="after"> <field name="virtual_available" position="after">
<field name="immediately_usable_qty" /> <field name="immediately_usable_qty" />
</field> </field>
</field> </field>
</record> </record>
<record model="ir.ui.view" id="view_stock_available_kanban"> <record model="ir.ui.view" id="view_stock_available_kanban">
<field name="name">Quantity available to promise (kanban)</field> <field name="name">Quantity available to promise (kanban)</field>
<field name="model">product.template</field> <field name="model">product.template</field>
<field name="inherit_id" ref="stock.product_template_kanban_stock_view"/> <field name="inherit_id" ref="stock.product_template_kanban_stock_view" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<ul position="inside"> <ul position="inside">
<li t-if="record.type.raw_value == 'product'">Available to Promise: <field name="immediately_usable_qty"/> <field name="uom_id"/></li> <li
t-if="record.type.raw_value == 'product'"
>Available to Promise: <field name="immediately_usable_qty" /> <field
name="uom_id"
/></li>
</ul> </ul>
</field> </field>
</record> </record>

View File

@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2014 Numérigraphe <!-- Copyright 2014 Numérigraphe
Copyright 2016 Sodexis Copyright 2016 Sodexis
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<odoo> <odoo>
<record id="view_stock_configuration" model="ir.ui.view"> <record id="view_stock_configuration" model="ir.ui.view">
<field name="name">Stock settings: quantity available to promise</field> <field name="name">Stock settings: quantity available to promise</field>
@@ -14,21 +13,28 @@
<div class="row mt16 o_settings_container"> <div class="row mt16 o_settings_container">
<div class="col-xs-12 col-md-6 o_setting_box"> <div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane"> <div class="o_setting_left_pane">
<field name="module_stock_available_immediately"/> <field name="module_stock_available_immediately" />
</div> </div>
<div class="o_setting_right_pane"> <div class="o_setting_right_pane">
<label for="module_stock_available_immediately"/> <label for="module_stock_available_immediately" />
</div> </div>
</div> </div>
<div class="col-xs-12 col-md-6 o_setting_box"> <div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane"> <div class="o_setting_left_pane">
<field name="module_stock_available_mrp"/> <field name="module_stock_available_mrp" />
</div> </div>
<div class="o_setting_right_pane"> <div class="o_setting_right_pane">
<label for="module_stock_available_mrp"/> <label for="module_stock_available_mrp" />
<div class="content-group"> <div class="content-group">
<div class="mt16" attrs="{'invisible': [('module_stock_available_mrp', '=', False)]}"> <div
<field name="stock_available_mrp_based_on" class="oe_inline" attrs="{'required':[('module_stock_available_mrp','=',True)]}"/> class="mt16"
attrs="{'invisible': [('module_stock_available_mrp', '=', False)]}"
>
<field
name="stock_available_mrp_based_on"
class="oe_inline"
attrs="{'required':[('module_stock_available_mrp','=',True)]}"
/>
</div> </div>
</div> </div>
</div> </div>