[10.0][MIG] stock_inventory_discrepancy

This commit is contained in:
lreficent
2017-08-23 11:54:21 +02:00
committed by Mateu Griful
parent 7219b32235
commit e009516fbe
17 changed files with 408 additions and 64 deletions

View File

@@ -8,10 +8,10 @@ Stock Inventory Discrepancy
Adds the capability to show the discrepancy of every line in an inventory and
to block the inventory validation (setting it as 'Pending to Approve') when the
discrepancy is greater than a user defined threshold.
discrepancy is greater than an user defined threshold.
Only new group "Validate All inventory Adjustments" will be able to force the
validation of those blocked inventories. By default Stock manager will belong
validation of those blocked inventories. By default, Stock manager will belong
to this group. In addition, Stock Users can validate inventories under the
threshold now.
@@ -24,7 +24,7 @@ You can configure the threshold as described below:
#. Go to "Inventory > Warehouse Management" > Warehouses" or to "Inventory >
Warehouse Management" > Locations".
#. Modify the "Maximum Discrepancy Rate Threshold" either in a Warehouse or
in a location. If set to 0.0 the threshold is disabled.
in a location. If set to 0.0 in both the threshold is disabled.
Usage
=====
@@ -42,7 +42,7 @@ If you configured a "Maximum Discrepancy Rate Threshold".
.. 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/9.0
:target: https://runbot.odoo-community.org/runbot/153/10.0
Bug Tracker

View File

@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import models

View File

@@ -7,7 +7,7 @@
"summary": "Adds the capability to show the discrepancy of every line in "
"an inventory and to block the inventory validation when the "
"discrepancy is over a user defined threshold.",
"version": "9.0.1.0.0",
"version": "10.0.1.0.0",
"author": "Eficent, "
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-warehouse",
@@ -17,7 +17,7 @@
'views/stock_inventory_view.xml',
'views/stock_warehouse_view.xml',
'views/stock_location_view.xml',
'security/stock_inventory_discrepancy_security.xml'
'security/stock_inventory_discrepancy_security.xml',
],
"license": "AGPL-3",
'installable': True,

View File

@@ -0,0 +1,117 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_inventory_discrepancy
#
# Translators:
# Lukáš Spurný <lukasspurny8@gmail.com>, 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ý <lukasspurny8@gmail.com>, 2018\n"
"Language-Team: Czech (Czech Republic) (https://www.transifex.com/oca/teams/23907/cs_CZ/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: cs_CZ\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_qty
msgid "Discrepancy"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_percent
msgid "Discrepancy percent (%)"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.ui.view,arch_db:stock_inventory_discrepancy.view_inventory_form
msgid "Force Validation"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model,name:stock_inventory_discrepancy.model_stock_inventory
msgid "Inventory"
msgstr "Inventář"
#. module: stock_inventory_discrepancy
#: model:ir.model,name:stock_inventory_discrepancy.model_stock_inventory_line
msgid "Inventory Line"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model,name:stock_inventory_discrepancy.model_stock_location
msgid "Inventory Locations"
msgstr "Umístění inventáře"
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_location_discrepancy_threshold
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_warehouse_discrepancy_threshold
#: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_threshold
msgid "Maximum Discrepancy Rate Threshold"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_warehouse_discrepancy_threshold
msgid ""
"Maximum Discrepancy Rate allowed for any product when doing an Inventory "
"Adjustment. Threshold defined in involved Location has preference."
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_location_discrepancy_threshold
msgid ""
"Maximum Discrepancy Rate allowed for any product when doing an Inventory "
"Adjustment. Thresholds defined in Locations have preference over Warehouse's"
" ones."
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_inventory_over_discrepancy_line_count
msgid "Number of Discrepancies Over Threshold"
msgstr ""
#. module: stock_inventory_discrepancy
#: code:addons/stock_inventory_discrepancy/models/stock_inventory.py:55
#, python-format
msgid ""
"The Qty Update is over the Discrepancy Threshold.\n"
" Please, contact a user with rights to perform this action."
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_qty
msgid ""
"The difference between the actual qty counted and the theoretical quantity "
"on hand."
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_percent
msgid ""
"The discrepancy expressed in percent with theoretical quantity as basis"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_threshold
msgid "Threshold (%)"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:res.groups,name:stock_inventory_discrepancy.group_stock_inventory_validation_always
msgid "Validate All inventory Adjustments"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:res.groups,name:stock_inventory_discrepancy.group_stock_inventory_validation
msgid "Validate Inventory Adjustments Under Threshold"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model,name:stock_inventory_discrepancy.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -4,14 +4,13 @@
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
# Rudolf Schnapka <rs@techno-flex.de>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-29 13:12+0000\n"
"PO-Revision-Date: 2017-06-29 13:12+0000\n"
"Last-Translator: Rudolf Schnapka <rs@techno-flex.de>, 2017\n"
"POT-Creation-Date: 2017-11-30 03:53+0000\n"
"PO-Revision-Date: 2017-11-30 03:53+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -22,17 +21,17 @@ msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_qty
msgid "Discrepancy"
msgstr "Abweichung"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_percent
msgid "Discrepancy percent (%)"
msgstr "Abweichung (%)"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.ui.view,arch_db:stock_inventory_discrepancy.view_inventory_form
msgid "Force Validation"
msgstr "Erzwinge Freigabe"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model,name:stock_inventory_discrepancy.model_stock_inventory
@@ -47,14 +46,14 @@ msgstr "Inventurposition"
#. module: stock_inventory_discrepancy
#: model:ir.model,name:stock_inventory_discrepancy.model_stock_location
msgid "Inventory Locations"
msgstr "Bestandslagerorte"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_location_discrepancy_threshold
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_warehouse_discrepancy_threshold
#: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_threshold
msgid "Maximum Discrepancy Rate Threshold"
msgstr "Obergrenze für hinnehmbare Abweichung"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_warehouse_discrepancy_threshold

View File

@@ -4,14 +4,13 @@
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
# Antonio Trueba <atgayol@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-18 04:05+0000\n"
"PO-Revision-Date: 2017-02-18 04:05+0000\n"
"Last-Translator: Antonio Trueba <atgayol@gmail.com>, 2017\n"
"POT-Creation-Date: 2017-11-30 03:53+0000\n"
"PO-Revision-Date: 2017-11-30 03:53+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -47,7 +46,7 @@ msgstr "Línea inventario"
#. module: stock_inventory_discrepancy
#: model:ir.model,name:stock_inventory_discrepancy.model_stock_location
msgid "Inventory Locations"
msgstr "Ubicaciones de inventario"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_location_discrepancy_threshold

View File

@@ -6,10 +6,10 @@
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-18 04:05+0000\n"
"PO-Revision-Date: 2017-02-18 04:05+0000\n"
"POT-Creation-Date: 2017-11-30 03:53+0000\n"
"PO-Revision-Date: 2017-11-30 03:53+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n"
"MIME-Version: 1.0\n"
@@ -46,7 +46,7 @@ msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model,name:stock_inventory_discrepancy.model_stock_location
msgid "Inventory Locations"
msgstr "Emplacements d'inventaire"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_location_discrepancy_threshold

View File

@@ -0,0 +1,117 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_inventory_discrepancy
#
# Translators:
# Bole <bole@dajmi5.com>, 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: Bole <bole@dajmi5.com>, 2018\n"
"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: 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_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_qty
msgid "Discrepancy"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_percent
msgid "Discrepancy percent (%)"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.ui.view,arch_db:stock_inventory_discrepancy.view_inventory_form
msgid "Force Validation"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model,name:stock_inventory_discrepancy.model_stock_inventory
msgid "Inventory"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model,name:stock_inventory_discrepancy.model_stock_inventory_line
msgid "Inventory Line"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model,name:stock_inventory_discrepancy.model_stock_location
msgid "Inventory Locations"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_location_discrepancy_threshold
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_warehouse_discrepancy_threshold
#: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_threshold
msgid "Maximum Discrepancy Rate Threshold"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_warehouse_discrepancy_threshold
msgid ""
"Maximum Discrepancy Rate allowed for any product when doing an Inventory "
"Adjustment. Threshold defined in involved Location has preference."
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_location_discrepancy_threshold
msgid ""
"Maximum Discrepancy Rate allowed for any product when doing an Inventory "
"Adjustment. Thresholds defined in Locations have preference over Warehouse's"
" ones."
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_inventory_over_discrepancy_line_count
msgid "Number of Discrepancies Over Threshold"
msgstr ""
#. module: stock_inventory_discrepancy
#: code:addons/stock_inventory_discrepancy/models/stock_inventory.py:55
#, python-format
msgid ""
"The Qty Update is over the Discrepancy Threshold.\n"
" Please, contact a user with rights to perform this action."
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_qty
msgid ""
"The difference between the actual qty counted and the theoretical quantity "
"on hand."
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_percent
msgid ""
"The discrepancy expressed in percent with theoretical quantity as basis"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_threshold
msgid "Threshold (%)"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:res.groups,name:stock_inventory_discrepancy.group_stock_inventory_validation_always
msgid "Validate All inventory Adjustments"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:res.groups,name:stock_inventory_discrepancy.group_stock_inventory_validation
msgid "Validate Inventory Adjustments Under Threshold"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model,name:stock_inventory_discrepancy.model_stock_warehouse
msgid "Warehouse"
msgstr "Skladište"

View File

@@ -0,0 +1,117 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_inventory_discrepancy
#
# Translators:
# Peter Hageman <hageman.p@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-30 03:53+0000\n"
"PO-Revision-Date: 2017-11-30 03:53+0000\n"
"Last-Translator: Peter Hageman <hageman.p@gmail.com>, 2017\n"
"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: nl_NL\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_qty
msgid "Discrepancy"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_percent
msgid "Discrepancy percent (%)"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.ui.view,arch_db:stock_inventory_discrepancy.view_inventory_form
msgid "Force Validation"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model,name:stock_inventory_discrepancy.model_stock_inventory
msgid "Inventory"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model,name:stock_inventory_discrepancy.model_stock_inventory_line
msgid "Inventory Line"
msgstr "Voorraadregel"
#. module: stock_inventory_discrepancy
#: model:ir.model,name:stock_inventory_discrepancy.model_stock_location
msgid "Inventory Locations"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_location_discrepancy_threshold
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_warehouse_discrepancy_threshold
#: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_threshold
msgid "Maximum Discrepancy Rate Threshold"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_warehouse_discrepancy_threshold
msgid ""
"Maximum Discrepancy Rate allowed for any product when doing an Inventory "
"Adjustment. Threshold defined in involved Location has preference."
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_location_discrepancy_threshold
msgid ""
"Maximum Discrepancy Rate allowed for any product when doing an Inventory "
"Adjustment. Thresholds defined in Locations have preference over Warehouse's"
" ones."
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_inventory_over_discrepancy_line_count
msgid "Number of Discrepancies Over Threshold"
msgstr ""
#. module: stock_inventory_discrepancy
#: code:addons/stock_inventory_discrepancy/models/stock_inventory.py:55
#, python-format
msgid ""
"The Qty Update is over the Discrepancy Threshold.\n"
" Please, contact a user with rights to perform this action."
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_qty
msgid ""
"The difference between the actual qty counted and the theoretical quantity "
"on hand."
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,help:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_percent
msgid ""
"The discrepancy expressed in percent with theoretical quantity as basis"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_inventory_line_discrepancy_threshold
msgid "Threshold (%)"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:res.groups,name:stock_inventory_discrepancy.group_stock_inventory_validation_always
msgid "Validate All inventory Adjustments"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:res.groups,name:stock_inventory_discrepancy.group_stock_inventory_validation
msgid "Validate Inventory Adjustments Under Threshold"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model,name:stock_inventory_discrepancy.model_stock_warehouse
msgid "Warehouse"
msgstr "Magazijn"

View File

@@ -3,14 +3,14 @@
# * stock_inventory_discrepancy
#
# Translators:
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2017
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-18 04:05+0000\n"
"PO-Revision-Date: 2017-02-18 04:05+0000\n"
"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>, 2017\n"
"POT-Creation-Date: 2017-11-30 03:53+0000\n"
"PO-Revision-Date: 2017-11-30 03:53+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -46,7 +46,7 @@ msgstr "Postavka inventarja"
#. module: stock_inventory_discrepancy
#: model:ir.model,name:stock_inventory_discrepancy.model_stock_location
msgid "Inventory Locations"
msgstr "Lokacije inventarja"
msgstr ""
#. module: stock_inventory_discrepancy
#: model:ir.model.fields,field_description:stock_inventory_discrepancy.field_stock_location_discrepancy_threshold

View File

@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import stock_inventory

View File

@@ -3,8 +3,8 @@
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from openerp import _, api, fields, models
from openerp.exceptions import UserError
from odoo import _, api, fields, models
from odoo.exceptions import UserError
class StockInventory(models.Model):

View File

@@ -3,32 +3,33 @@
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from openerp import api, fields, models
from odoo import api, fields, models
class StockInventoryLine(models.Model):
_inherit = 'stock.inventory.line'
@api.one
@api.multi
def _compute_discrepancy(self):
self.discrepancy_qty = self.product_qty - self.theoretical_qty
if self.theoretical_qty:
self.discrepancy_percent = 100 * abs(
(self.product_qty - self.theoretical_qty) /
self.theoretical_qty)
elif not self.theoretical_qty and self.product_qty:
self.discrepancy_percent = 100.0
for l in self:
l.discrepancy_qty = l.product_qty - l.theoretical_qty
if l.theoretical_qty:
l.discrepancy_percent = 100 * abs(
(l.product_qty - l.theoretical_qty) /
l.theoretical_qty)
elif not l.theoretical_qty and l.product_qty:
l.discrepancy_percent = 100.0
@api.one
def _get_discrepancy_threshold(self):
wh_id = self.location_id.get_warehouse(self.location_id)
wh = self.env['stock.warehouse'].browse(wh_id)
if self.location_id.discrepancy_threshold > 0.0:
self.discrepancy_threshold = self.location_id.discrepancy_threshold
elif wh.discrepancy_threshold > 0.0:
self.discrepancy_threshold = wh.discrepancy_threshold
else:
self.discrepancy_threshold = False
@api.multi
def _compute_discrepancy_threshold(self):
for l in self:
wh = l.location_id.get_warehouse()
if l.location_id.discrepancy_threshold > 0.0:
l.discrepancy_threshold = l.location_id.discrepancy_threshold
elif wh.discrepancy_threshold > 0.0:
l.discrepancy_threshold = wh.discrepancy_threshold
else:
l.discrepancy_threshold = False
discrepancy_qty = fields.Float(
string='Discrepancy',
@@ -45,4 +46,4 @@ class StockInventoryLine(models.Model):
string='Threshold (%)',
digits=(3, 2),
help="Maximum Discrepancy Rate Threshold",
compute=_get_discrepancy_threshold)
compute=_compute_discrepancy_threshold)

View File

@@ -3,7 +3,7 @@
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from openerp import fields, models
from odoo import fields, models
class StockLocation(models.Model):

View File

@@ -3,7 +3,7 @@
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from openerp import fields, models
from odoo import fields, models
class StockWarehouse(models.Model):

View File

@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import test_inventory_discrepancy

View File

@@ -3,8 +3,8 @@
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import TransactionCase
from openerp.exceptions import UserError
from odoo.tests.common import TransactionCase
from odoo.exceptions import UserError
class TestInventoryDiscrepancy(TransactionCase):