removed innecessary data

This commit is contained in:
oihane
2015-03-04 12:17:34 +01:00
committed by Jordi Ballester Alomar
parent 06cfca106b
commit 6c1d63e290
5 changed files with 68 additions and 136 deletions

View File

@@ -1,6 +1,13 @@
Reordering Rules stock info
===========================
This modules allows to know the product availability directly in the reordering
rules.
Credits
=======
Contributors
------------
* Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>

View File

@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-17 08:55+0000\n"
"PO-Revision-Date: 2015-02-17 08:55+0000\n"
"POT-Creation-Date: 2015-03-04 11:41+0000\n"
"PO-Revision-Date: 2015-03-04 11:41+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -15,6 +15,21 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: stock_warehouse_orderpoint_stock_info
#: view:stock.warehouse.orderpoint:stock_warehouse_orderpoint_stock_info.stock_warehouse_orderpoint_search_view
msgid "Availability under minimum"
msgstr "Disponibilidad por debajo del mínimo"
#. module: stock_warehouse_orderpoint_stock_info
#: view:stock.warehouse.orderpoint:stock_warehouse_orderpoint_stock_info.stock_warehouse_orderpoint_search_view
msgid "Group By"
msgstr "Agrupar por"
#. module: stock_warehouse_orderpoint_stock_info
#: field:stock.warehouse.orderpoint,available:0
msgid "Is enough product available?"
msgstr "Hay producto suficiente?"
#. module: stock_warehouse_orderpoint_stock_info
#: model:ir.model,name:stock_warehouse_orderpoint_stock_info.model_stock_warehouse_orderpoint
msgid "Minimum Inventory Rule"
@@ -28,59 +43,5 @@ msgstr "Reglas"
#. module: stock_warehouse_orderpoint_stock_info
#: view:stock.warehouse.orderpoint:stock_warehouse_orderpoint_stock_info.stock_warehouse_orderpoint_form_view
msgid "Stock Info"
msgstr "Info. Stock"
msgstr "Info. de Stock"
#. module: stock_warehouse_orderpoint_stock_info
#: help:stock.warehouse.orderpoint,product_qty_available:0
msgid ""
"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"
"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 with 'internal' "
"type."
msgstr ""
"Cantidad actual de los productos.\n"
"En un contexto de una sola ubicación de existencias, esto incluye los bienes "
"almacenados en esta ubicación, o cualquiera de sus hijas.\n"
"En un contexto de un solo almacén, esto incluye los bienes almacenados en la "
"ubicación de existencias de ese almacén, o cualquiera de sus hijas.\n"
"En cualquier otro caso, esto incluye los bienes almacenados en cualquier "
"ubicación de existencias de tipo 'Interna'."
#. module: stock_warehouse_orderpoint_stock_info
#: field:stock.warehouse.orderpoint,product_qty_available:0
msgid "Quantity On Hand"
msgstr "Cantidad disponible"
#. module: stock_warehouse_orderpoint_stock_info
#: help:stock.warehouse.orderpoint,product_virtual_available:0
msgid ""
"Forecast quantity (computed as Quantity On Hand - Outgoing + Incoming)\n"
"In a context with a single Stock Location, this includes goods stored in "
"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"
"Otherwise, this includes goods stored in any Stock Location with 'internal' "
"type."
msgstr ""
"Cantidad prevista (calculada como cantidad a mano - saliente + entrante)\n"
"En un contexto de una sola ubicación de existencias, esto incluye los bienes "
"almacenados en esta ubicación, o cualquiera de sus hijas.\n"
"En un contexto de un solo almacén, esto incluye los bienes almacenados en la "
"ubicación de existencias de ese almacén, o cualquiera de sus hijas.\n"
"En cualquier otro caso, esto incluye los bienes almacenados en cualquier "
"ubicación de existencias de tipo 'Interna'."
#. module: stock_warehouse_orderpoint_stock_info
#: field:stock.warehouse.orderpoint,product_virtual_available:0
msgid "Forecast Quantity"
msgstr "Cantidad prevista"
#. module: stock_warehouse_orderpoint_stock_info
#: field:stock.warehouse.orderpoint,product_location_qty:0
msgid "Quantity On Location"
msgstr "Cantidad en la ubicación"

View File

@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-17 08:54+0000\n"
"PO-Revision-Date: 2015-02-17 08:54+0000\n"
"POT-Creation-Date: 2015-03-04 11:39+0000\n"
"PO-Revision-Date: 2015-03-04 11:39+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -15,6 +15,21 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: stock_warehouse_orderpoint_stock_info
#: view:stock.warehouse.orderpoint:stock_warehouse_orderpoint_stock_info.stock_warehouse_orderpoint_search_view
msgid "Availability under minimum"
msgstr ""
#. module: stock_warehouse_orderpoint_stock_info
#: view:stock.warehouse.orderpoint:stock_warehouse_orderpoint_stock_info.stock_warehouse_orderpoint_search_view
msgid "Group By"
msgstr ""
#. module: stock_warehouse_orderpoint_stock_info
#: field:stock.warehouse.orderpoint,available:0
msgid "Is enough product available?"
msgstr ""
#. module: stock_warehouse_orderpoint_stock_info
#: model:ir.model,name:stock_warehouse_orderpoint_stock_info.model_stock_warehouse_orderpoint
msgid "Minimum Inventory Rule"
@@ -30,43 +45,3 @@ msgstr ""
msgid "Stock Info"
msgstr ""
#. module: stock_warehouse_orderpoint_stock_info
#: help:stock.warehouse.orderpoint,product_qty_available:0
msgid ""
"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"
"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 with 'internal' "
"type."
msgstr ""
#. module: stock_warehouse_orderpoint_stock_info
#: field:stock.warehouse.orderpoint,product_qty_available:0
msgid "Quantity On Hand"
msgstr ""
#. module: stock_warehouse_orderpoint_stock_info
#: help:stock.warehouse.orderpoint,product_virtual_available:0
msgid ""
"Forecast quantity (computed as Quantity On Hand - Outgoing + Incoming)\n"
"In a context with a single Stock Location, this includes goods stored in "
"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"
"Otherwise, this includes goods stored in any Stock Location with 'internal' "
"type."
msgstr ""
#. module: stock_warehouse_orderpoint_stock_info
#: field:stock.warehouse.orderpoint,product_virtual_available:0
msgid "Forecast Quantity"
msgstr ""
#. module: stock_warehouse_orderpoint_stock_info
#: field:stock.warehouse.orderpoint,product_location_qty:0
msgid "Quantity On Location"
msgstr ""

View File

@@ -4,45 +4,24 @@
##############################################################################
from openerp import models, fields, api
from openerp.tools.float_utils import float_round
class StockWarehouseOrderpoint(models.Model):
_inherit = 'stock.warehouse.orderpoint'
@api.one
def _product_available_qty(self):
self.product_location_qty = self.product_id.with_context(
location=self.location_id.id
)._product_available()[self.product_id.id]['qty_available']
@api.one
@api.depends('product_location_qty', 'product_min_qty')
def _product_available(self):
domain_quant = [('location_id', '=', self.location_id.id),
('product_id', '=', self.product_id.id)]
quants = self.env['stock.quant'].read_group(
domain_quant, ['product_id', 'qty'], ['product_id'])
quants = dict(map(lambda x: (x['product_id'][0], x['qty']), quants))
self.product_location_qty = float_round(
quants.get(self.product_id.id, 0.0),
precision_rounding=self.product_uom.rounding)
self.available = self.product_location_qty > self.product_min_qty
product_location_qty = fields.Float(
string='Quantity On Location', compute='_product_available')
product_qty_available = fields.Float(
string='Quantity On Hand', related='product_id.qty_available',
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"
"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 "
"with 'internal' type.")
product_virtual_available = fields.Float(
string='Forecast Quantity', related='product_id.virtual_available',
help="Forecast quantity (computed as Quantity On Hand "
"- Outgoing + Incoming)\n"
"In a context with a single Stock Location, this includes "
"goods stored in 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"
"Otherwise, this includes goods stored in any Stock Location "
"with 'internal' type.")
string='Quantity On Location', compute='_product_available_qty')
available = fields.Boolean(
string='Is enough product available?', compute='_product_available',
store=True)

View File

@@ -8,8 +8,7 @@
<field name="arch" type="xml">
<field name="product_max_qty" position="after">
<field name="product_location_qty" />
<field name="product_qty_available" />
<field name="product_virtual_available" />
<field name="available" invisible="1" />
</field>
</field>
</record>
@@ -22,12 +21,23 @@
<group string="Rules" position="after">
<group string="Stock Info">
<field name="product_location_qty" />
<field name="product_qty_available" />
<field name="product_virtual_available" />
</group>
</group>
</field>
</record>
<record model="ir.ui.view" id="stock_warehouse_orderpoint_search_view">
<field name="name">stock.warehouser.orderpoint.search</field>
<field name="model">stock.warehouse.orderpoint</field>
<field name="inherit_id" ref="stock.warehouse_orderpoint_search" />
<field name="arch" type="xml">
<group string="Group By" position="before">
<filter string="Availability under minimum"
domain="[('available', '!=', False)]"
context="{}" />
</group>
</field>
</record>
</data>
</openerp>