From 0510ce80d26d065b2cc993c3a79764615322ba96 Mon Sep 17 00:00:00 2001
From: mreficent
Date: Fri, 19 May 2017 17:59:50 +0200
Subject: [PATCH 01/20] Stock Removal Location by Priority
---
stock_removal_location_by_priority/README.rst | 60 ++++++++
.../__init__.py | 6 +
.../__openerp__.py | 19 +++
.../models/__init__.py | 7 +
.../models/stock_location.py | 15 ++
.../models/stock_quant.py | 34 +++++
.../static/description/icon.png | Bin 0 -> 9455 bytes
.../tests/__init__.py | 6 +
...test_stock_removal_location_by_priority.py | 140 ++++++++++++++++++
.../views/stock_location_view.xml | 18 +++
10 files changed, 305 insertions(+)
create mode 100644 stock_removal_location_by_priority/README.rst
create mode 100644 stock_removal_location_by_priority/__init__.py
create mode 100644 stock_removal_location_by_priority/__openerp__.py
create mode 100644 stock_removal_location_by_priority/models/__init__.py
create mode 100644 stock_removal_location_by_priority/models/stock_location.py
create mode 100644 stock_removal_location_by_priority/models/stock_quant.py
create mode 100644 stock_removal_location_by_priority/static/description/icon.png
create mode 100644 stock_removal_location_by_priority/tests/__init__.py
create mode 100644 stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py
create mode 100644 stock_removal_location_by_priority/views/stock_location_view.xml
diff --git a/stock_removal_location_by_priority/README.rst b/stock_removal_location_by_priority/README.rst
new file mode 100644
index 000000000..9d50c17bb
--- /dev/null
+++ b/stock_removal_location_by_priority/README.rst
@@ -0,0 +1,60 @@
+.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
+ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ :alt: License: AGPL-3
+
+==================================
+Stock Removal Location by Priority
+==================================
+
+This module adds a removal priority field on stock locations.
+This priority applies when removing a product from different stock locations
+and the incoming dates are equal in both locations.
+
+Configuration
+=============
+
+You can configure the removal priority as follows:
+
+#. Go to "Inventory > Configuration > Warehouse Management > Locations"
+#. In each Location form, put a Removal Priority.
+
+
+.. 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
+
+
+Bug Tracker
+===========
+
+Bugs are tracked on `GitHub Issues
+`_. In case of
+trouble, please check there if your issue has already been reported. If you
+spotted it first, help us smash it by providing detailed and welcomed feedback.
+
+
+Images
+------
+
+* Odoo Community Association: `Icon `_.
+
+Contributors
+------------
+
+* Miquel Raïch
+
+
+Maintainer
+----------
+
+.. image:: https://odoo-community.org/logo.png
+ :alt: Odoo Community Association
+ :target: https://odoo-community.org
+
+This module is maintained by the OCA.
+
+OCA, or the Odoo Community Association, is a nonprofit organization whose
+mission is to support the collaborative development of Odoo features and
+promote its widespread use.
+
+To contribute to this module, please visit https://odoo-community.org.
diff --git a/stock_removal_location_by_priority/__init__.py b/stock_removal_location_by_priority/__init__.py
new file mode 100644
index 000000000..08f93b3a4
--- /dev/null
+++ b/stock_removal_location_by_priority/__init__.py
@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+# Copyright 2016 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
diff --git a/stock_removal_location_by_priority/__openerp__.py b/stock_removal_location_by_priority/__openerp__.py
new file mode 100644
index 000000000..87bddda80
--- /dev/null
+++ b/stock_removal_location_by_priority/__openerp__.py
@@ -0,0 +1,19 @@
+# -*- 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).
+{
+ "name": "Stock Removal Location by Priority",
+ "summary": "Establish a removal priority on stock locations.",
+ "version": "9.0.1.0.0",
+ "author": "Eficent, "
+ "Odoo Community Association (OCA)",
+ "website": "https://github.com/OCA/stock-logistics-warehouse",
+ "category": "Warehouse Management",
+ "depends": ["stock"],
+ "data": [
+ 'views/stock_location_view.xml'],
+ "license": "AGPL-3",
+ 'installable': True,
+ 'application': False,
+}
diff --git a/stock_removal_location_by_priority/models/__init__.py b/stock_removal_location_by_priority/models/__init__.py
new file mode 100644
index 000000000..89a4028f3
--- /dev/null
+++ b/stock_removal_location_by_priority/models/__init__.py
@@ -0,0 +1,7 @@
+# -*- 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_location
+from . import stock_quant
diff --git a/stock_removal_location_by_priority/models/stock_location.py b/stock_removal_location_by_priority/models/stock_location.py
new file mode 100644
index 000000000..2c0a3c308
--- /dev/null
+++ b/stock_removal_location_by_priority/models/stock_location.py
@@ -0,0 +1,15 @@
+# -*- 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 openerp import fields, models
+
+
+class StockLocation(models.Model):
+ _inherit = 'stock.location'
+
+ removal_priority = fields.Integer(help="This priority applies when "
+ "removing stock and incoming dates "
+ "are equal.",
+ string="Removal Priority", default=10)
diff --git a/stock_removal_location_by_priority/models/stock_quant.py b/stock_removal_location_by_priority/models/stock_quant.py
new file mode 100644
index 000000000..72c6da995
--- /dev/null
+++ b/stock_removal_location_by_priority/models/stock_quant.py
@@ -0,0 +1,34 @@
+# -*- 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 openerp import api, fields, models
+from openerp.tools.translate import _
+from openerp.exceptions import UserError
+
+
+class StockQuant(models.Model):
+ _inherit = 'stock.quant'
+
+ removal_priority = fields.Integer(
+ related='location_id.removal_priority', readonly=True, store=True)
+
+ @api.model
+ def apply_removal_strategy(self, quantity, move, ops=False,
+ domain=None, removal_strategy='fifo'):
+ if any(move.mapped('location_id.removal_priority')):
+ if removal_strategy == 'fifo':
+ order = 'in_date, removal_priority, id'
+ return self._quants_get_order(
+ quantity, move, ops=ops, domain=domain, orderby=order)
+ elif removal_strategy == 'lifo':
+ order = 'in_date desc, removal_priority asc, id desc'
+ return self._quants_get_order(
+ quantity, move, ops=ops, domain=domain, orderby=order)
+ raise UserError(_('Removal strategy %s not implemented.') % (
+ removal_strategy,))
+ else:
+ return super(StockQuant, self).apply_removal_strategy(
+ self, quantity, move, ops=ops, domain=domain,
+ removal_strategy=removal_strategy)
diff --git a/stock_removal_location_by_priority/static/description/icon.png b/stock_removal_location_by_priority/static/description/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d
GIT binary patch
literal 9455
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
z
z?n?eq1XP>p-IM$Z^C;2L3itnbJZAip*Zo0aw2bs8@(s^~*8T9go!%dHcAz2lM;`yp
zD=7&xjFV$S&5uDaiScyD?B-i1ze`+CoRtz`Wn+Zls4&}MO{@N!ufrzjG$B79)Y2d3tBk&)TxUTw@QS0TEL_?njX|@vq?Uz(nBFK5Pq7*xj#u*R&i|?7+6#
z+|r_n#SW&LXhtheZdah{ZVoqwyT{D>MC3nkFF#N)xLi{p7J1jXlmVeb;cP5?e(=f#
zuT7fvjSbjS781v?7{)-X3*?>tq?)Yd)~|1{BDS(pqC
zC}~H#WXlkUW*H5CDOo<)#x7%RY)A;ShGhI5s*#cRDA8YgqG(HeKDx+#(ZQ?386dv!
zlXCO)w91~Vw4AmOcATuV653fa9R$fyK8ul%rG
z-wfS
zihugoZyr38Im?Zuh6@RcF~t1anQu7>#lPpb#}4cOA!EM11`%f*07RqOVkmX{p~KJ9
z^zP;K#|)$`^Rb{rnHGH{~>1(fawV0*Z#)}M`m8-?ZJV<+e}s9wE#
z)l&az?w^5{)`S(%MRzxdNqrs1n*-=jS^_jqE*5XDrA0+VE`5^*p3CuM<&dZEeCjoz
zR;uu_H9ZPZV|fQq`Cyw4nscrVwi!fE6ciMmX$!_hN7uF;jjKG)d2@aC4ropY)8etW=xJvni)8eHi`H$%#zn^WJ5NLc-rqk|u&&4Z6fD_m&JfSI1Bvb?b<*n&sfl0^t
z=HnmRl`XrFvMKB%9}>PaA`m-fK6a0(8=qPkWS5bb4=v?XcWi&hRY?O5HdulRi4?fN
zlsJ*N-0Qw+Yic@s0(2uy%F@ib;GjXt01Fmx5XbRo6+n|pP(&nodMoap^z{~q
ziEeaUT@Mxe3vJSfI6?uLND(CNr=#^W<1b}jzW58bIfyWTDle$mmS(|x-0|2UlX+9k
zQ^EX7Nw}?EzVoBfT(-LT|=9N@^hcn-_p&sqG
z&*oVs2JSU+N4ZD`FhCAWaS;>|wH2G*Id|?pa#@>tyxX`+4HyIArWDvVrX)2WAOQff
z0qyHu&-S@i^MS-+j--!pr4fPBj~_8({~e1bfcl0wI1kaoN>mJL6KUPQm5N7lB(ui1
zE-o%kq)&djzWJ}ob<-GfDlkB;F31j-VHKvQUGQ3sp`CwyGJk_i!y^sD0fqC@$9|jO
zOqN!r!8-p==F@ZVP=U$qSpY(gQ0)59P1&t@y?5rvg<}E+GB}26NYPp4f2YFQrQtot5mn3wu_qprZ=>Ig-$
zbW26Ws~IgY>}^5w`vTB(G`PTZaDiGBo5o(tp)qli|NeV(
z@H_=R8V39rt5J5YB2Ky?4eJJ#b`_iBe2ot~6%7mLt5t8Vwi^Jy7|jWXqa3amOIoRb
zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4
z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{
zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx}
z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov
zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22
zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq
zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t<
z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k
z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp
z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{}
zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N
Xviia!U7SGha1wx#SCgwmn*{w2TRX*I
literal 0
HcmV?d00001
diff --git a/stock_removal_location_by_priority/tests/__init__.py b/stock_removal_location_by_priority/tests/__init__.py
new file mode 100644
index 000000000..574b5131a
--- /dev/null
+++ b/stock_removal_location_by_priority/tests/__init__.py
@@ -0,0 +1,6 @@
+# -*- 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_stock_removal_location_by_priority
diff --git a/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py b/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py
new file mode 100644
index 000000000..1c2a4f460
--- /dev/null
+++ b/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py
@@ -0,0 +1,140 @@
+# -*- 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 openerp.tests.common import TransactionCase
+
+
+class TestStockRemovalLocationByPriority(TransactionCase):
+
+ def setUp(self):
+ super(TestStockRemovalLocationByPriority, self).setUp()
+ self.res_users_model = self.env['res.users']
+ self.stock_location_model = self.env['stock.location']
+ self.stock_warehouse_model = self.env['stock.warehouse']
+ self.stock_picking_model = self.env['stock.picking']
+ self.stock_change_model = self.env['stock.change.product.qty']
+ self.product_template_model = self.env['product.template']
+ self.quant_model = self.env['stock.quant']
+
+ self.picking_internal = self.env.ref('stock.picking_type_internal')
+ self.picking_out = self.env.ref('stock.picking_type_out')
+ self.location_supplier = self.env.ref('stock.stock_location_suppliers')
+
+ self.company = self.env.ref('base.main_company')
+ self.partner = self.env.ref('base.res_partner_1')
+ self.g_stock_user = self.env.ref('stock.group_stock_user')
+
+ self.user = self._create_user(
+ 'user_1', [self.g_stock_user], self.company).id
+
+ self.wh1 = self.stock_warehouse_model.create({
+ 'name': 'WH1',
+ 'code': 'WH1',
+ })
+
+ # Create a locations:
+ self.stock = self.stock_location_model.create({
+ 'name': 'Stock Base',
+ 'usage': 'internal',
+ })
+ self.shelf_A = self.stock_location_model.create({
+ 'name': 'Shelf_A',
+ 'usage': 'internal',
+ 'location_id': self.stock.id,
+ })
+ self.shelf_B = self.stock_location_model.create({
+ 'name': 'Shelf_B',
+ 'usage': 'internal',
+ 'location_id': self.stock.id,
+ 'removal_priority': 5,
+ })
+
+ # Create a product:
+ self.product_templ_1 = self.product_template_model.create({
+ 'name': 'Test Product Template 1',
+ 'type': 'product',
+ 'default_code': 'PROD_1',
+ })
+
+ def _create_user(self, login, groups, company):
+ group_ids = [group.id for group in groups]
+ user = self.res_users_model.create({
+ 'name': login,
+ 'login': login,
+ 'password': 'demo',
+ 'email': 'example@yourcompany.com',
+ 'company_id': company.id,
+ 'company_ids': [(4, company.id)],
+ 'groups_id': [(6, 0, group_ids)]
+ })
+ return user
+
+ def _create_picking(self, picking_type, location, location_dest, qty):
+
+ picking = self.stock_picking_model.sudo(self.user).create({
+ 'picking_type_id': picking_type.id,
+ 'location_id': location.id,
+ 'location_dest_id': location_dest.id,
+ 'move_lines': [
+ (0, 0, {
+ 'name': 'Test move',
+ 'product_id': self.product1.id,
+ 'product_uom': self.product1.uom_id.id,
+ 'product_uom_qty': qty,
+ 'location_id': location.id,
+ 'location_dest_id': location_dest.id,
+ 'price_unit': 2
+ })]
+ })
+ return picking
+
+ def test_stock_removal_location_by_priority(self):
+ """Tests removal priority."""
+ wiz1 = self.stock_change_model.with_context(
+ active_id=self.product_templ_1.id,
+ active_model='product.template'
+ ).create({'new_quantity': 20,
+ 'location_id': self.stock.id,
+ 'product_tmpl_id': self.product_templ_1.id,
+ })
+ wiz1.change_product_qty()
+ self.product1 = wiz1.product_id
+
+ picking_1 = self._create_picking(
+ self.picking_internal, self.stock, self.shelf_A, 5)
+ picking_1.action_confirm()
+ picking_1.action_assign()
+
+ picking_2 = self._create_picking(
+ self.picking_internal, self.stock, self.shelf_B, 10)
+ picking_2.action_confirm()
+ picking_2.action_assign()
+
+ self.assertEqual(picking_1.pack_operation_ids.
+ linked_move_operation_ids.reserved_quant_id.in_date,
+ picking_2.pack_operation_ids.
+ linked_move_operation_ids.reserved_quant_id.in_date,
+ 'Testing data not generated properly.')
+
+ wiz_act = picking_1.do_new_transfer()
+ wiz2 = self.env[wiz_act['res_model']].browse(wiz_act['res_id'])
+ wiz2.process()
+
+ wiz_act = picking_2.do_new_transfer()
+ wiz3 = self.env[wiz_act['res_model']].browse(wiz_act['res_id'])
+ wiz3.process()
+
+ picking_3 = self._create_picking(
+ self.picking_out, self.stock, self.location_supplier, 5)
+ picking_3.action_confirm()
+ picking_3.action_assign()
+ wiz_act = picking_3.do_new_transfer()
+ wiz4 = self.env[wiz_act['res_model']].browse(wiz_act['res_id'])
+ wiz4.process()
+
+ records = self.quant_model.search(
+ [('product_id', '=', self.product1.id)])
+ for record in records:
+ self.assertEqual(record.qty, 5,
+ 'Removal_priority did\'nt work properly.')
diff --git a/stock_removal_location_by_priority/views/stock_location_view.xml b/stock_removal_location_by_priority/views/stock_location_view.xml
new file mode 100644
index 000000000..5a287231b
--- /dev/null
+++ b/stock_removal_location_by_priority/views/stock_location_view.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ Location form - removal priority extension
+ stock.location
+
+
+
+
+
+
+
+
+
From 1f7f50846052160682a17ebe20df51a9c7fe8162 Mon Sep 17 00:00:00 2001
From: lreficent
Date: Wed, 24 May 2017 14:06:45 +0200
Subject: [PATCH 02/20] stock_removal_location_by_priority: Add init_hook to
speed up installation
---
.../__init__.py | 1 +
.../__openerp__.py | 1 +
.../init_hook.py | 37 +++++++++++++++++++
3 files changed, 39 insertions(+)
create mode 100644 stock_removal_location_by_priority/init_hook.py
diff --git a/stock_removal_location_by_priority/__init__.py b/stock_removal_location_by_priority/__init__.py
index 08f93b3a4..2e7485cc7 100644
--- a/stock_removal_location_by_priority/__init__.py
+++ b/stock_removal_location_by_priority/__init__.py
@@ -4,3 +4,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import models
+from .init_hook import pre_init_hook
diff --git a/stock_removal_location_by_priority/__openerp__.py b/stock_removal_location_by_priority/__openerp__.py
index 87bddda80..91dd2d686 100644
--- a/stock_removal_location_by_priority/__openerp__.py
+++ b/stock_removal_location_by_priority/__openerp__.py
@@ -16,4 +16,5 @@
"license": "AGPL-3",
'installable': True,
'application': False,
+ 'pre_init_hook': 'pre_init_hook',
}
diff --git a/stock_removal_location_by_priority/init_hook.py b/stock_removal_location_by_priority/init_hook.py
new file mode 100644
index 000000000..a3055b980
--- /dev/null
+++ b/stock_removal_location_by_priority/init_hook.py
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+# Copyright 2017 Eficent Business and IT Consulting Services, S.L.
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
+
+import logging
+
+logger = logging.getLogger(__name__)
+
+
+def pre_init_hook(cr):
+ """
+ The objective of this hook is to speed up the installation
+ of the module on an existing Odoo instance.
+
+ Without this script, big databases can take a long time to install this
+ module.
+ """
+ set_stock_location_removal_priority_default(cr)
+ set_stock_quant_removal_priority_default(cr)
+
+
+def set_stock_location_removal_priority_default(cr):
+ cr.execute(
+ """
+ ALTER TABLE stock_location
+ ADD COLUMN removal_priority integer
+ DEFAULT 10;
+ """)
+
+
+def set_stock_quant_removal_priority_default(cr):
+ cr.execute(
+ """
+ ALTER TABLE stock_quant
+ ADD COLUMN removal_priority integer
+ DEFAULT 10;
+ """)
From 453764f4529fea4a173dd5fa2fbcf8cbf58de457 Mon Sep 17 00:00:00 2001
From: OCA Transbot
Date: Sat, 3 Jun 2017 11:53:09 +0200
Subject: [PATCH 03/20] OCA Transbot updated translations from Transifex
---
stock_removal_location_by_priority/i18n/de.po | 49 +++++++++++++++++++
stock_removal_location_by_priority/i18n/es.po | 49 +++++++++++++++++++
stock_removal_location_by_priority/i18n/fi.po | 48 ++++++++++++++++++
stock_removal_location_by_priority/i18n/fr.po | 48 ++++++++++++++++++
stock_removal_location_by_priority/i18n/it.po | 48 ++++++++++++++++++
.../i18n/pt_BR.po | 48 ++++++++++++++++++
stock_removal_location_by_priority/i18n/ro.po | 48 ++++++++++++++++++
stock_removal_location_by_priority/i18n/sl.po | 49 +++++++++++++++++++
.../i18n/zh_CN.po | 48 ++++++++++++++++++
9 files changed, 435 insertions(+)
create mode 100644 stock_removal_location_by_priority/i18n/de.po
create mode 100644 stock_removal_location_by_priority/i18n/es.po
create mode 100644 stock_removal_location_by_priority/i18n/fi.po
create mode 100644 stock_removal_location_by_priority/i18n/fr.po
create mode 100644 stock_removal_location_by_priority/i18n/it.po
create mode 100644 stock_removal_location_by_priority/i18n/pt_BR.po
create mode 100644 stock_removal_location_by_priority/i18n/ro.po
create mode 100644 stock_removal_location_by_priority/i18n/sl.po
create mode 100644 stock_removal_location_by_priority/i18n/zh_CN.po
diff --git a/stock_removal_location_by_priority/i18n/de.po b/stock_removal_location_by_priority/i18n/de.po
new file mode 100644
index 000000000..aefd5832f
--- /dev/null
+++ b/stock_removal_location_by_priority/i18n/de.po
@@ -0,0 +1,49 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_removal_location_by_priority
+#
+# Translators:
+# OCA Transbot , 2017
+# Rudolf Schnapka , 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 9.0c\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-05-31 02:38+0000\n"
+"PO-Revision-Date: 2017-05-31 02:38+0000\n"
+"Last-Translator: Rudolf Schnapka , 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"
+"Content-Transfer-Encoding: \n"
+"Language: de\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
+msgid "Inventory Locations"
+msgstr "Bestandslagerorte"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
+msgid "Quants"
+msgstr "Quants"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid "Removal Priority"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#, python-format
+msgid "Removal strategy %s not implemented."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid ""
+"This priority applies when removing stock and incoming dates are equal."
+msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/es.po b/stock_removal_location_by_priority/i18n/es.po
new file mode 100644
index 000000000..3be93015f
--- /dev/null
+++ b/stock_removal_location_by_priority/i18n/es.po
@@ -0,0 +1,49 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_removal_location_by_priority
+#
+# Translators:
+# OCA Transbot , 2017
+# Antonio Trueba , 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 9.0c\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-05-31 02:38+0000\n"
+"PO-Revision-Date: 2017-05-31 02:38+0000\n"
+"Last-Translator: Antonio Trueba , 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"
+"Content-Transfer-Encoding: \n"
+"Language: es\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
+msgid "Inventory Locations"
+msgstr "Ubicaciones de inventario"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
+msgid "Quants"
+msgstr "Quants"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid "Removal Priority"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#, python-format
+msgid "Removal strategy %s not implemented."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid ""
+"This priority applies when removing stock and incoming dates are equal."
+msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/fi.po b/stock_removal_location_by_priority/i18n/fi.po
new file mode 100644
index 000000000..0151669b5
--- /dev/null
+++ b/stock_removal_location_by_priority/i18n/fi.po
@@ -0,0 +1,48 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_removal_location_by_priority
+#
+# Translators:
+# OCA Transbot , 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 9.0c\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-05-31 02:38+0000\n"
+"PO-Revision-Date: 2017-05-31 02:38+0000\n"
+"Last-Translator: OCA Transbot , 2017\n"
+"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: fi\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
+msgid "Inventory Locations"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
+msgid "Quants"
+msgstr "Määrät"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid "Removal Priority"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#, python-format
+msgid "Removal strategy %s not implemented."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid ""
+"This priority applies when removing stock and incoming dates are equal."
+msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/fr.po b/stock_removal_location_by_priority/i18n/fr.po
new file mode 100644
index 000000000..b6c87bd70
--- /dev/null
+++ b/stock_removal_location_by_priority/i18n/fr.po
@@ -0,0 +1,48 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_removal_location_by_priority
+#
+# Translators:
+# OCA Transbot , 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 9.0c\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-05-31 02:38+0000\n"
+"PO-Revision-Date: 2017-05-31 02:38+0000\n"
+"Last-Translator: OCA Transbot , 2017\n"
+"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: fr\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
+msgid "Inventory Locations"
+msgstr "Emplacements de stock"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
+msgid "Quants"
+msgstr "Quants"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid "Removal Priority"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#, python-format
+msgid "Removal strategy %s not implemented."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid ""
+"This priority applies when removing stock and incoming dates are equal."
+msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/it.po b/stock_removal_location_by_priority/i18n/it.po
new file mode 100644
index 000000000..1417cb2ea
--- /dev/null
+++ b/stock_removal_location_by_priority/i18n/it.po
@@ -0,0 +1,48 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_removal_location_by_priority
+#
+# Translators:
+# Paolo Valier , 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 9.0c\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-05-31 02:38+0000\n"
+"PO-Revision-Date: 2017-05-31 02:38+0000\n"
+"Last-Translator: Paolo Valier , 2017\n"
+"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: it\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
+msgid "Inventory Locations"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
+msgid "Quants"
+msgstr "Quantità"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid "Removal Priority"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#, python-format
+msgid "Removal strategy %s not implemented."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid ""
+"This priority applies when removing stock and incoming dates are equal."
+msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/pt_BR.po b/stock_removal_location_by_priority/i18n/pt_BR.po
new file mode 100644
index 000000000..b9a299281
--- /dev/null
+++ b/stock_removal_location_by_priority/i18n/pt_BR.po
@@ -0,0 +1,48 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_removal_location_by_priority
+#
+# Translators:
+# OCA Transbot , 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 9.0c\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-05-31 02:38+0000\n"
+"PO-Revision-Date: 2017-05-31 02:38+0000\n"
+"Last-Translator: OCA Transbot , 2017\n"
+"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: pt_BR\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
+msgid "Inventory Locations"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
+msgid "Quants"
+msgstr "Quants"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid "Removal Priority"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#, python-format
+msgid "Removal strategy %s not implemented."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid ""
+"This priority applies when removing stock and incoming dates are equal."
+msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/ro.po b/stock_removal_location_by_priority/i18n/ro.po
new file mode 100644
index 000000000..23d944e28
--- /dev/null
+++ b/stock_removal_location_by_priority/i18n/ro.po
@@ -0,0 +1,48 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_removal_location_by_priority
+#
+# Translators:
+# Dorin Hongu , 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 9.0c\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-05-31 02:38+0000\n"
+"PO-Revision-Date: 2017-05-31 02:38+0000\n"
+"Last-Translator: Dorin Hongu , 2017\n"
+"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: ro\n"
+"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
+msgid "Inventory Locations"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
+msgid "Quants"
+msgstr "Poziții de stoc"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid "Removal Priority"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#, python-format
+msgid "Removal strategy %s not implemented."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid ""
+"This priority applies when removing stock and incoming dates are equal."
+msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/sl.po b/stock_removal_location_by_priority/i18n/sl.po
new file mode 100644
index 000000000..57f96382c
--- /dev/null
+++ b/stock_removal_location_by_priority/i18n/sl.po
@@ -0,0 +1,49 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_removal_location_by_priority
+#
+# Translators:
+# OCA Transbot , 2017
+# Matjaž Mozetič , 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 9.0c\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-05-31 02:38+0000\n"
+"PO-Revision-Date: 2017-05-31 02:38+0000\n"
+"Last-Translator: Matjaž Mozetič , 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"
+"Content-Transfer-Encoding: \n"
+"Language: sl\n"
+"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
+msgid "Inventory Locations"
+msgstr "Lokacije inventarja"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
+msgid "Quants"
+msgstr "Kvant"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid "Removal Priority"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#, python-format
+msgid "Removal strategy %s not implemented."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid ""
+"This priority applies when removing stock and incoming dates are equal."
+msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/zh_CN.po b/stock_removal_location_by_priority/i18n/zh_CN.po
new file mode 100644
index 000000000..297a72ba4
--- /dev/null
+++ b/stock_removal_location_by_priority/i18n/zh_CN.po
@@ -0,0 +1,48 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_removal_location_by_priority
+#
+# Translators:
+# liAnGjiA , 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 9.0c\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-05-31 02:38+0000\n"
+"PO-Revision-Date: 2017-05-31 02:38+0000\n"
+"Last-Translator: liAnGjiA , 2017\n"
+"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/zh_CN/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: zh_CN\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
+msgid "Inventory Locations"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
+msgid "Quants"
+msgstr "源"
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid "Removal Priority"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#, python-format
+msgid "Removal strategy %s not implemented."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid ""
+"This priority applies when removing stock and incoming dates are equal."
+msgstr ""
From 83fa5752d17e82a93f95502c0a59ce4c3d3b083d Mon Sep 17 00:00:00 2001
From: mreficent
Date: Wed, 21 Jun 2017 14:47:43 +0200
Subject: [PATCH 04/20] [MIG] stock_removal_location_by_priority: Migration to
10.0
---
stock_removal_location_by_priority/README.rst | 11 +++-
.../{__openerp__.py => __manifest__.py} | 3 +-
.../models/__init__.py | 2 +
.../models/res_company.py | 16 +++++
.../models/stock_config_settings.py | 13 ++++
.../models/stock_location.py | 2 +-
.../models/stock_quant.py | 24 +++----
...test_stock_removal_location_by_priority.py | 63 ++++++++++++++++++-
.../views/res_config_settings_views.xml | 27 ++++++++
.../views/stock_location_view.xml | 2 +-
10 files changed, 140 insertions(+), 23 deletions(-)
rename stock_removal_location_by_priority/{__openerp__.py => __manifest__.py} (90%)
create mode 100644 stock_removal_location_by_priority/models/res_company.py
create mode 100644 stock_removal_location_by_priority/models/stock_config_settings.py
create mode 100644 stock_removal_location_by_priority/views/res_config_settings_views.xml
diff --git a/stock_removal_location_by_priority/README.rst b/stock_removal_location_by_priority/README.rst
index 9d50c17bb..c9a8fd763 100644
--- a/stock_removal_location_by_priority/README.rst
+++ b/stock_removal_location_by_priority/README.rst
@@ -15,13 +15,20 @@ Configuration
You can configure the removal priority as follows:
+#. Go to "Inventory > Configuration > Settings"
+#. In 'Location & Warehouse' section, mark "Use 'Removal Priority' in Locations *"
+
+Usage
+=====
+
+To use this module, you need to:
+
#. Go to "Inventory > Configuration > Warehouse Management > Locations"
#. In each Location form, put a Removal Priority.
-
.. 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
diff --git a/stock_removal_location_by_priority/__openerp__.py b/stock_removal_location_by_priority/__manifest__.py
similarity index 90%
rename from stock_removal_location_by_priority/__openerp__.py
rename to stock_removal_location_by_priority/__manifest__.py
index 91dd2d686..95870c0a7 100644
--- a/stock_removal_location_by_priority/__openerp__.py
+++ b/stock_removal_location_by_priority/__manifest__.py
@@ -5,13 +5,14 @@
{
"name": "Stock Removal Location by Priority",
"summary": "Establish a removal priority on stock locations.",
- "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",
"category": "Warehouse Management",
"depends": ["stock"],
"data": [
+ 'views/res_config_settings_views.xml',
'views/stock_location_view.xml'],
"license": "AGPL-3",
'installable': True,
diff --git a/stock_removal_location_by_priority/models/__init__.py b/stock_removal_location_by_priority/models/__init__.py
index 89a4028f3..76a62a061 100644
--- a/stock_removal_location_by_priority/models/__init__.py
+++ b/stock_removal_location_by_priority/models/__init__.py
@@ -3,5 +3,7 @@
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+from . import res_company
+from . import stock_config_settings
from . import stock_location
from . import stock_quant
diff --git a/stock_removal_location_by_priority/models/res_company.py b/stock_removal_location_by_priority/models/res_company.py
new file mode 100644
index 000000000..a920ba57f
--- /dev/null
+++ b/stock_removal_location_by_priority/models/res_company.py
@@ -0,0 +1,16 @@
+# -*- coding: utf-8 -*-
+# Copyright 2017 Eficent Business and IT Consulting Services S.L.
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
+
+from odoo import fields, models
+
+
+class ResCompany(models.Model):
+ _inherit = "res.company"
+
+ removal_priority_active = fields.Boolean(
+ string="Use 'Removal Priority' in Locations",
+ help="Adds an extra field in Locations named 'Removal Priority'."
+ "When removing stock from Locations, this priority will apply"
+ "whenever the incoming dates of the same stock in several "
+ "locations are the same.")
diff --git a/stock_removal_location_by_priority/models/stock_config_settings.py b/stock_removal_location_by_priority/models/stock_config_settings.py
new file mode 100644
index 000000000..6b7e3b835
--- /dev/null
+++ b/stock_removal_location_by_priority/models/stock_config_settings.py
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import fields, models
+
+
+class StockConfigSettings(models.TransientModel):
+ _inherit = 'stock.config.settings'
+
+ removal_priority_active = fields.Boolean(
+ related='company_id.removal_priority_active',
+ string="Use 'Removal Priority' in Locations (*)",
+ help="This configuration is related to the company you're logged into")
diff --git a/stock_removal_location_by_priority/models/stock_location.py b/stock_removal_location_by_priority/models/stock_location.py
index 2c0a3c308..08d948fd2 100644
--- a/stock_removal_location_by_priority/models/stock_location.py
+++ b/stock_removal_location_by_priority/models/stock_location.py
@@ -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):
diff --git a/stock_removal_location_by_priority/models/stock_quant.py b/stock_removal_location_by_priority/models/stock_quant.py
index 72c6da995..febc26e1c 100644
--- a/stock_removal_location_by_priority/models/stock_quant.py
+++ b/stock_removal_location_by_priority/models/stock_quant.py
@@ -3,32 +3,26 @@
# (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.tools.translate import _
-from openerp.exceptions import UserError
+from odoo import api, fields, models
+from odoo.tools.translate import _
+from odoo.exceptions import UserError
-class StockQuant(models.Model):
+class Quant(models.Model):
_inherit = 'stock.quant'
removal_priority = fields.Integer(
related='location_id.removal_priority', readonly=True, store=True)
@api.model
- def apply_removal_strategy(self, quantity, move, ops=False,
- domain=None, removal_strategy='fifo'):
- if any(move.mapped('location_id.removal_priority')):
+ def _quants_removal_get_order(self, removal_strategy=None):
+ if self.env.user.company_id.removal_priority_active:
if removal_strategy == 'fifo':
- order = 'in_date, removal_priority, id'
- return self._quants_get_order(
- quantity, move, ops=ops, domain=domain, orderby=order)
+ return 'in_date, removal_priority, id'
elif removal_strategy == 'lifo':
- order = 'in_date desc, removal_priority asc, id desc'
- return self._quants_get_order(
- quantity, move, ops=ops, domain=domain, orderby=order)
+ return 'in_date desc, removal_priority asc, id desc'
raise UserError(_('Removal strategy %s not implemented.') % (
removal_strategy,))
else:
- return super(StockQuant, self).apply_removal_strategy(
- self, quantity, move, ops=ops, domain=domain,
+ return super(Quant, self)._quants_removal_get_order(
removal_strategy=removal_strategy)
diff --git a/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py b/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py
index 1c2a4f460..c93bef685 100644
--- a/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py
+++ b/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py
@@ -2,7 +2,7 @@
# 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 openerp.tests.common import TransactionCase
+from odoo.tests.common import TransactionCase
class TestStockRemovalLocationByPriority(TransactionCase):
@@ -22,7 +22,8 @@ class TestStockRemovalLocationByPriority(TransactionCase):
self.location_supplier = self.env.ref('stock.stock_location_suppliers')
self.company = self.env.ref('base.main_company')
- self.partner = self.env.ref('base.res_partner_1')
+ self.company.removal_priority_active = True
+
self.g_stock_user = self.env.ref('stock.group_stock_user')
self.user = self._create_user(
@@ -89,7 +90,7 @@ class TestStockRemovalLocationByPriority(TransactionCase):
})
return picking
- def test_stock_removal_location_by_priority(self):
+ def test_stock_removal_location_by_priority_fifo(self):
"""Tests removal priority."""
wiz1 = self.stock_change_model.with_context(
active_id=self.product_templ_1.id,
@@ -138,3 +139,59 @@ class TestStockRemovalLocationByPriority(TransactionCase):
for record in records:
self.assertEqual(record.qty, 5,
'Removal_priority did\'nt work properly.')
+
+ def test_stock_removal_location_by_priority_lifo(self):
+ """Tests removal priority."""
+ removal_method_id = self.env['product.removal'].search(
+ [('name', '=', 'lifo')]).id
+ self.stock.removal_strategy_id = removal_method_id
+ self.shelf_A.removal_strategy_id = removal_method_id
+ self.shelf_B.removal_strategy_id = removal_method_id
+ self.location_supplier.removal_strategy_id = removal_method_id
+ wiz1 = self.stock_change_model.with_context(
+ active_id=self.product_templ_1.id,
+ active_model='product.template'
+ ).create({'new_quantity': 20,
+ 'location_id': self.stock.id,
+ 'product_tmpl_id': self.product_templ_1.id,
+ })
+ wiz1.change_product_qty()
+ self.product1 = wiz1.product_id
+
+ picking_1 = self._create_picking(
+ self.picking_internal, self.stock, self.shelf_A, 5)
+ picking_1.action_confirm()
+ picking_1.action_assign()
+
+ picking_2 = self._create_picking(
+ self.picking_internal, self.stock, self.shelf_B, 10)
+ picking_2.action_confirm()
+ picking_2.action_assign()
+
+ self.assertEqual(picking_1.pack_operation_ids.
+ linked_move_operation_ids.reserved_quant_id.in_date,
+ picking_2.pack_operation_ids.
+ linked_move_operation_ids.reserved_quant_id.in_date,
+ 'Testing data not generated properly.')
+
+ wiz_act = picking_1.do_new_transfer()
+ wiz2 = self.env[wiz_act['res_model']].browse(wiz_act['res_id'])
+ wiz2.process()
+
+ wiz_act = picking_2.do_new_transfer()
+ wiz3 = self.env[wiz_act['res_model']].browse(wiz_act['res_id'])
+ wiz3.process()
+
+ picking_3 = self._create_picking(
+ self.picking_out, self.stock, self.location_supplier, 5)
+ picking_3.action_confirm()
+ picking_3.action_assign()
+ wiz_act = picking_3.do_new_transfer()
+ wiz4 = self.env[wiz_act['res_model']].browse(wiz_act['res_id'])
+ wiz4.process()
+
+ records = self.quant_model.search(
+ [('product_id', '=', self.product1.id)])
+ for record in records:
+ self.assertEqual(record.qty, 5,
+ 'Removal_priority did\'nt work properly.')
diff --git a/stock_removal_location_by_priority/views/res_config_settings_views.xml b/stock_removal_location_by_priority/views/res_config_settings_views.xml
new file mode 100644
index 000000000..28b6e25a4
--- /dev/null
+++ b/stock_removal_location_by_priority/views/res_config_settings_views.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+ stock.config.view - removal_priority
+ stock.config.settings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/stock_removal_location_by_priority/views/stock_location_view.xml b/stock_removal_location_by_priority/views/stock_location_view.xml
index 5a287231b..db4fd46ac 100644
--- a/stock_removal_location_by_priority/views/stock_location_view.xml
+++ b/stock_removal_location_by_priority/views/stock_location_view.xml
@@ -10,7 +10,7 @@
-
+
From 9f218109e6f98a271f73c4066488589c03afbbc6 Mon Sep 17 00:00:00 2001
From: mreficent
Date: Mon, 30 Oct 2017 18:45:42 +0100
Subject: [PATCH 05/20] [IMP/FIX] Removal priority should be independent of
company
---
stock_removal_location_by_priority/README.rst | 9 +++++++--
.../__manifest__.py | 4 +++-
.../models/__init__.py | 1 -
.../models/res_company.py | 16 ----------------
.../models/stock_config_settings.py | 12 ++++++++----
.../models/stock_quant.py | 3 ++-
.../security/stock_security.xml | 8 ++++++++
.../test_stock_removal_location_by_priority.py | 6 ++++--
.../views/res_config_settings_views.xml | 12 +-----------
.../views/stock_location_view.xml | 4 ++--
10 files changed, 35 insertions(+), 40 deletions(-)
delete mode 100644 stock_removal_location_by_priority/models/res_company.py
create mode 100644 stock_removal_location_by_priority/security/stock_security.xml
diff --git a/stock_removal_location_by_priority/README.rst b/stock_removal_location_by_priority/README.rst
index c9a8fd763..3077dbd0a 100644
--- a/stock_removal_location_by_priority/README.rst
+++ b/stock_removal_location_by_priority/README.rst
@@ -16,7 +16,12 @@ Configuration
You can configure the removal priority as follows:
#. Go to "Inventory > Configuration > Settings"
-#. In 'Location & Warehouse' section, mark "Use 'Removal Priority' in Locations *"
+#. In 'Location & Warehouse' section, mark the "Removal Priority" option.
+
+NOTE: To be able to view this option you need to have already marked:
+
+#. Manage several locations in "Warehouses and Locations usage level" option.
+#. Advanced routing of products using rules in "Routing" option.
Usage
=====
@@ -24,7 +29,7 @@ Usage
To use this module, you need to:
#. Go to "Inventory > Configuration > Warehouse Management > Locations"
-#. In each Location form, put a Removal Priority.
+#. In each Location form, in the Logistics section, put a Removal Priority.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
diff --git a/stock_removal_location_by_priority/__manifest__.py b/stock_removal_location_by_priority/__manifest__.py
index 95870c0a7..9aa7cce4f 100644
--- a/stock_removal_location_by_priority/__manifest__.py
+++ b/stock_removal_location_by_priority/__manifest__.py
@@ -12,8 +12,10 @@
"category": "Warehouse Management",
"depends": ["stock"],
"data": [
+ 'security/stock_security.xml',
'views/res_config_settings_views.xml',
- 'views/stock_location_view.xml'],
+ 'views/stock_location_view.xml',
+ ],
"license": "AGPL-3",
'installable': True,
'application': False,
diff --git a/stock_removal_location_by_priority/models/__init__.py b/stock_removal_location_by_priority/models/__init__.py
index 76a62a061..629e8d9a6 100644
--- a/stock_removal_location_by_priority/models/__init__.py
+++ b/stock_removal_location_by_priority/models/__init__.py
@@ -3,7 +3,6 @@
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
-from . import res_company
from . import stock_config_settings
from . import stock_location
from . import stock_quant
diff --git a/stock_removal_location_by_priority/models/res_company.py b/stock_removal_location_by_priority/models/res_company.py
deleted file mode 100644
index a920ba57f..000000000
--- a/stock_removal_location_by_priority/models/res_company.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright 2017 Eficent Business and IT Consulting Services S.L.
-# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-
-from odoo import fields, models
-
-
-class ResCompany(models.Model):
- _inherit = "res.company"
-
- removal_priority_active = fields.Boolean(
- string="Use 'Removal Priority' in Locations",
- help="Adds an extra field in Locations named 'Removal Priority'."
- "When removing stock from Locations, this priority will apply"
- "whenever the incoming dates of the same stock in several "
- "locations are the same.")
diff --git a/stock_removal_location_by_priority/models/stock_config_settings.py b/stock_removal_location_by_priority/models/stock_config_settings.py
index 6b7e3b835..5da3aa22a 100644
--- a/stock_removal_location_by_priority/models/stock_config_settings.py
+++ b/stock_removal_location_by_priority/models/stock_config_settings.py
@@ -7,7 +7,11 @@ from odoo import fields, models
class StockConfigSettings(models.TransientModel):
_inherit = 'stock.config.settings'
- removal_priority_active = fields.Boolean(
- related='company_id.removal_priority_active',
- string="Use 'Removal Priority' in Locations (*)",
- help="This configuration is related to the company you're logged into")
+ group_removal_priority = fields.Selection([
+ (0, 'Don\'t use \'Removal Priority\' in Locations'),
+ (1, 'Use \'Removal Priority\' in Locations'),
+ ], "Removal Priority",
+ implied_group='stock_removal_location_by_priority.'
+ 'group_removal_priority',
+ help="Removal priority that applies when the incoming dates "
+ "are equal in both locations.")
diff --git a/stock_removal_location_by_priority/models/stock_quant.py b/stock_removal_location_by_priority/models/stock_quant.py
index febc26e1c..93cbb9294 100644
--- a/stock_removal_location_by_priority/models/stock_quant.py
+++ b/stock_removal_location_by_priority/models/stock_quant.py
@@ -16,7 +16,8 @@ class Quant(models.Model):
@api.model
def _quants_removal_get_order(self, removal_strategy=None):
- if self.env.user.company_id.removal_priority_active:
+ if self.user_has_groups(
+ 'stock_removal_location_by_priority.group_removal_priority'):
if removal_strategy == 'fifo':
return 'in_date, removal_priority, id'
elif removal_strategy == 'lifo':
diff --git a/stock_removal_location_by_priority/security/stock_security.xml b/stock_removal_location_by_priority/security/stock_security.xml
new file mode 100644
index 000000000..da6b1aaa2
--- /dev/null
+++ b/stock_removal_location_by_priority/security/stock_security.xml
@@ -0,0 +1,8 @@
+
+
+
+ Removal Priority
+
+
+
+
diff --git a/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py b/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py
index c93bef685..a53e88fdc 100644
--- a/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py
+++ b/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py
@@ -22,12 +22,14 @@ class TestStockRemovalLocationByPriority(TransactionCase):
self.location_supplier = self.env.ref('stock.stock_location_suppliers')
self.company = self.env.ref('base.main_company')
- self.company.removal_priority_active = True
+ self.grp_rem_priority = self.env.ref(
+ 'stock_removal_location_by_priority.group_removal_priority')
self.g_stock_user = self.env.ref('stock.group_stock_user')
self.user = self._create_user(
- 'user_1', [self.g_stock_user], self.company).id
+ 'user_1', [self.g_stock_user, self.grp_rem_priority],
+ self.company).id
self.wh1 = self.stock_warehouse_model.create({
'name': 'WH1',
diff --git a/stock_removal_location_by_priority/views/res_config_settings_views.xml b/stock_removal_location_by_priority/views/res_config_settings_views.xml
index 28b6e25a4..7ee9c871f 100644
--- a/stock_removal_location_by_priority/views/res_config_settings_views.xml
+++ b/stock_removal_location_by_priority/views/res_config_settings_views.xml
@@ -9,18 +9,8 @@
-
+
-
-
-
-
-
-
diff --git a/stock_removal_location_by_priority/views/stock_location_view.xml b/stock_removal_location_by_priority/views/stock_location_view.xml
index db4fd46ac..deef32a81 100644
--- a/stock_removal_location_by_priority/views/stock_location_view.xml
+++ b/stock_removal_location_by_priority/views/stock_location_view.xml
@@ -9,8 +9,8 @@
stock.location
-
-
+
+
From 2d818079aa94c8de1d4236465c2e5a9dd2aa012b Mon Sep 17 00:00:00 2001
From: oca-travis
Date: Mon, 18 Jun 2018 09:54:48 +0000
Subject: [PATCH 06/20] [UPD] Update stock_removal_location_by_priority.pot
---
stock_removal_location_by_priority/i18n/de.po | 33 ++++++++--
stock_removal_location_by_priority/i18n/es.po | 33 ++++++++--
stock_removal_location_by_priority/i18n/fi.po | 33 ++++++++--
stock_removal_location_by_priority/i18n/fr.po | 33 ++++++++--
stock_removal_location_by_priority/i18n/it.po | 33 ++++++++--
.../i18n/pt_BR.po | 36 ++++++++--
stock_removal_location_by_priority/i18n/ro.po | 36 ++++++++--
stock_removal_location_by_priority/i18n/sl.po | 36 ++++++++--
.../stock_removal_location_by_priority.pot | 65 +++++++++++++++++++
.../i18n/zh_CN.po | 36 ++++++++--
10 files changed, 325 insertions(+), 49 deletions(-)
create mode 100644 stock_removal_location_by_priority/i18n/stock_removal_location_by_priority.pot
diff --git a/stock_removal_location_by_priority/i18n/de.po b/stock_removal_location_by_priority/i18n/de.po
index aefd5832f..bab721b34 100644
--- a/stock_removal_location_by_priority/i18n/de.po
+++ b/stock_removal_location_by_priority/i18n/de.po
@@ -1,7 +1,7 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_removal_location_by_priority
-#
+#
# Translators:
# OCA Transbot , 2017
# Rudolf Schnapka , 2017
@@ -13,12 +13,17 @@ msgstr ""
"PO-Revision-Date: 2017-05-31 02:38+0000\n"
"Last-Translator: Rudolf Schnapka , 2017\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
+"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
-"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Don't use 'Removal Priority' in Locations"
+msgstr ""
+
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
msgid "Inventory Locations"
@@ -30,13 +35,22 @@ msgid "Quants"
msgstr "Quants"
#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+msgid ""
+"Removal priority that applies when the incoming dates are equal in both "
+"locations."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
#, python-format
msgid "Removal strategy %s not implemented."
msgstr ""
@@ -44,6 +58,15 @@ msgstr ""
#. module: stock_removal_location_by_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
-msgid ""
-"This priority applies when removing stock and incoming dates are equal."
+msgid "This priority applies when removing stock and incoming dates are equal."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Use 'Removal Priority' in Locations"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
+msgid "stock.config.settings"
msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/es.po b/stock_removal_location_by_priority/i18n/es.po
index 3be93015f..bc01ac73d 100644
--- a/stock_removal_location_by_priority/i18n/es.po
+++ b/stock_removal_location_by_priority/i18n/es.po
@@ -1,7 +1,7 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_removal_location_by_priority
-#
+#
# Translators:
# OCA Transbot , 2017
# Antonio Trueba , 2017
@@ -13,12 +13,17 @@ msgstr ""
"PO-Revision-Date: 2017-05-31 02:38+0000\n"
"Last-Translator: Antonio Trueba , 2017\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
+"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
-"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Don't use 'Removal Priority' in Locations"
+msgstr ""
+
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
msgid "Inventory Locations"
@@ -30,13 +35,22 @@ msgid "Quants"
msgstr "Quants"
#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+msgid ""
+"Removal priority that applies when the incoming dates are equal in both "
+"locations."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
#, python-format
msgid "Removal strategy %s not implemented."
msgstr ""
@@ -44,6 +58,15 @@ msgstr ""
#. module: stock_removal_location_by_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
-msgid ""
-"This priority applies when removing stock and incoming dates are equal."
+msgid "This priority applies when removing stock and incoming dates are equal."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Use 'Removal Priority' in Locations"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
+msgid "stock.config.settings"
msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/fi.po b/stock_removal_location_by_priority/i18n/fi.po
index 0151669b5..1d8a5cb64 100644
--- a/stock_removal_location_by_priority/i18n/fi.po
+++ b/stock_removal_location_by_priority/i18n/fi.po
@@ -1,7 +1,7 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_removal_location_by_priority
-#
+#
# Translators:
# OCA Transbot , 2017
msgid ""
@@ -12,12 +12,17 @@ msgstr ""
"PO-Revision-Date: 2017-05-31 02:38+0000\n"
"Last-Translator: OCA Transbot , 2017\n"
"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n"
+"Language: fi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
-"Language: fi\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Don't use 'Removal Priority' in Locations"
+msgstr ""
+
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
msgid "Inventory Locations"
@@ -29,13 +34,22 @@ msgid "Quants"
msgstr "Määrät"
#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+msgid ""
+"Removal priority that applies when the incoming dates are equal in both "
+"locations."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
#, python-format
msgid "Removal strategy %s not implemented."
msgstr ""
@@ -43,6 +57,15 @@ msgstr ""
#. module: stock_removal_location_by_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
-msgid ""
-"This priority applies when removing stock and incoming dates are equal."
+msgid "This priority applies when removing stock and incoming dates are equal."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Use 'Removal Priority' in Locations"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
+msgid "stock.config.settings"
msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/fr.po b/stock_removal_location_by_priority/i18n/fr.po
index b6c87bd70..2400bb9db 100644
--- a/stock_removal_location_by_priority/i18n/fr.po
+++ b/stock_removal_location_by_priority/i18n/fr.po
@@ -1,7 +1,7 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_removal_location_by_priority
-#
+#
# Translators:
# OCA Transbot , 2017
msgid ""
@@ -12,12 +12,17 @@ msgstr ""
"PO-Revision-Date: 2017-05-31 02:38+0000\n"
"Last-Translator: OCA Transbot , 2017\n"
"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n"
+"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
-"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Don't use 'Removal Priority' in Locations"
+msgstr ""
+
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
msgid "Inventory Locations"
@@ -29,13 +34,22 @@ msgid "Quants"
msgstr "Quants"
#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+msgid ""
+"Removal priority that applies when the incoming dates are equal in both "
+"locations."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
#, python-format
msgid "Removal strategy %s not implemented."
msgstr ""
@@ -43,6 +57,15 @@ msgstr ""
#. module: stock_removal_location_by_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
-msgid ""
-"This priority applies when removing stock and incoming dates are equal."
+msgid "This priority applies when removing stock and incoming dates are equal."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Use 'Removal Priority' in Locations"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
+msgid "stock.config.settings"
msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/it.po b/stock_removal_location_by_priority/i18n/it.po
index 1417cb2ea..d15b18b6d 100644
--- a/stock_removal_location_by_priority/i18n/it.po
+++ b/stock_removal_location_by_priority/i18n/it.po
@@ -1,7 +1,7 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_removal_location_by_priority
-#
+#
# Translators:
# Paolo Valier , 2017
msgid ""
@@ -12,12 +12,17 @@ msgstr ""
"PO-Revision-Date: 2017-05-31 02:38+0000\n"
"Last-Translator: Paolo Valier , 2017\n"
"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n"
+"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
-"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Don't use 'Removal Priority' in Locations"
+msgstr ""
+
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
msgid "Inventory Locations"
@@ -29,13 +34,22 @@ msgid "Quants"
msgstr "Quantità"
#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+msgid ""
+"Removal priority that applies when the incoming dates are equal in both "
+"locations."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
#, python-format
msgid "Removal strategy %s not implemented."
msgstr ""
@@ -43,6 +57,15 @@ msgstr ""
#. module: stock_removal_location_by_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
-msgid ""
-"This priority applies when removing stock and incoming dates are equal."
+msgid "This priority applies when removing stock and incoming dates are equal."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Use 'Removal Priority' in Locations"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
+msgid "stock.config.settings"
msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/pt_BR.po b/stock_removal_location_by_priority/i18n/pt_BR.po
index b9a299281..3f042c197 100644
--- a/stock_removal_location_by_priority/i18n/pt_BR.po
+++ b/stock_removal_location_by_priority/i18n/pt_BR.po
@@ -1,7 +1,7 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_removal_location_by_priority
-#
+#
# Translators:
# OCA Transbot , 2017
msgid ""
@@ -11,13 +11,19 @@ msgstr ""
"POT-Creation-Date: 2017-05-31 02:38+0000\n"
"PO-Revision-Date: 2017-05-31 02:38+0000\n"
"Last-Translator: OCA Transbot , 2017\n"
-"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n"
+"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/"
+"teams/23907/pt_BR/)\n"
+"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
-"Language: pt_BR\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Don't use 'Removal Priority' in Locations"
+msgstr ""
+
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
msgid "Inventory Locations"
@@ -29,13 +35,22 @@ msgid "Quants"
msgstr "Quants"
#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+msgid ""
+"Removal priority that applies when the incoming dates are equal in both "
+"locations."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
#, python-format
msgid "Removal strategy %s not implemented."
msgstr ""
@@ -43,6 +58,15 @@ msgstr ""
#. module: stock_removal_location_by_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
-msgid ""
-"This priority applies when removing stock and incoming dates are equal."
+msgid "This priority applies when removing stock and incoming dates are equal."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Use 'Removal Priority' in Locations"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
+msgid "stock.config.settings"
msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/ro.po b/stock_removal_location_by_priority/i18n/ro.po
index 23d944e28..654e5791e 100644
--- a/stock_removal_location_by_priority/i18n/ro.po
+++ b/stock_removal_location_by_priority/i18n/ro.po
@@ -1,7 +1,7 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_removal_location_by_priority
-#
+#
# Translators:
# Dorin Hongu , 2017
msgid ""
@@ -12,11 +12,17 @@ msgstr ""
"PO-Revision-Date: 2017-05-31 02:38+0000\n"
"Last-Translator: Dorin Hongu , 2017\n"
"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n"
+"Language: ro\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
-"Language: ro\n"
-"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
+"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?"
+"2:1));\n"
+
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Don't use 'Removal Priority' in Locations"
+msgstr ""
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
@@ -29,13 +35,22 @@ msgid "Quants"
msgstr "Poziții de stoc"
#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+msgid ""
+"Removal priority that applies when the incoming dates are equal in both "
+"locations."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
#, python-format
msgid "Removal strategy %s not implemented."
msgstr ""
@@ -43,6 +58,15 @@ msgstr ""
#. module: stock_removal_location_by_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
-msgid ""
-"This priority applies when removing stock and incoming dates are equal."
+msgid "This priority applies when removing stock and incoming dates are equal."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Use 'Removal Priority' in Locations"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
+msgid "stock.config.settings"
msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/sl.po b/stock_removal_location_by_priority/i18n/sl.po
index 57f96382c..b3053dec5 100644
--- a/stock_removal_location_by_priority/i18n/sl.po
+++ b/stock_removal_location_by_priority/i18n/sl.po
@@ -1,7 +1,7 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_removal_location_by_priority
-#
+#
# Translators:
# OCA Transbot , 2017
# Matjaž Mozetič , 2017
@@ -13,11 +13,17 @@ msgstr ""
"PO-Revision-Date: 2017-05-31 02:38+0000\n"
"Last-Translator: Matjaž Mozetič , 2017\n"
"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n"
+"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
-"Language: sl\n"
-"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
+"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
+"%100==4 ? 2 : 3);\n"
+
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Don't use 'Removal Priority' in Locations"
+msgstr ""
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
@@ -30,13 +36,22 @@ msgid "Quants"
msgstr "Kvant"
#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+msgid ""
+"Removal priority that applies when the incoming dates are equal in both "
+"locations."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
#, python-format
msgid "Removal strategy %s not implemented."
msgstr ""
@@ -44,6 +59,15 @@ msgstr ""
#. module: stock_removal_location_by_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
-msgid ""
-"This priority applies when removing stock and incoming dates are equal."
+msgid "This priority applies when removing stock and incoming dates are equal."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Use 'Removal Priority' in Locations"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
+msgid "stock.config.settings"
msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/stock_removal_location_by_priority.pot b/stock_removal_location_by_priority/i18n/stock_removal_location_by_priority.pot
new file mode 100644
index 000000000..446cd3b97
--- /dev/null
+++ b/stock_removal_location_by_priority/i18n/stock_removal_location_by_priority.pot
@@ -0,0 +1,65 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_removal_location_by_priority
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 10.0\n"
+"Report-Msgid-Bugs-To: \n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Don't use 'Removal Priority' in Locations"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
+msgid "Inventory Locations"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_quant
+msgid "Quants"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
+msgid "Removal Priority"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+msgid "Removal priority that applies when the incoming dates are equal in both locations."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
+#, python-format
+msgid "Removal strategy %s not implemented."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
+msgid "This priority applies when removing stock and incoming dates are equal."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Use 'Removal Priority' in Locations"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
+msgid "stock.config.settings"
+msgstr ""
+
diff --git a/stock_removal_location_by_priority/i18n/zh_CN.po b/stock_removal_location_by_priority/i18n/zh_CN.po
index 297a72ba4..675168c00 100644
--- a/stock_removal_location_by_priority/i18n/zh_CN.po
+++ b/stock_removal_location_by_priority/i18n/zh_CN.po
@@ -1,7 +1,7 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_removal_location_by_priority
-#
+#
# Translators:
# liAnGjiA , 2017
msgid ""
@@ -11,13 +11,19 @@ msgstr ""
"POT-Creation-Date: 2017-05-31 02:38+0000\n"
"PO-Revision-Date: 2017-05-31 02:38+0000\n"
"Last-Translator: liAnGjiA , 2017\n"
-"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/zh_CN/)\n"
+"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/"
+"zh_CN/)\n"
+"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
-"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Don't use 'Removal Priority' in Locations"
+msgstr ""
+
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
msgid "Inventory Locations"
@@ -29,13 +35,22 @@ msgid "Quants"
msgstr "源"
#. module: stock_removal_location_by_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
+#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:29
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+msgid ""
+"Removal priority that applies when the incoming dates are equal in both "
+"locations."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: code:addons/stock_removal_location_by_priority/models/stock_quant.py:25
#, python-format
msgid "Removal strategy %s not implemented."
msgstr ""
@@ -43,6 +58,15 @@ msgstr ""
#. module: stock_removal_location_by_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_quant_removal_priority
-msgid ""
-"This priority applies when removing stock and incoming dates are equal."
+msgid "This priority applies when removing stock and incoming dates are equal."
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: selection:stock.config.settings,group_removal_priority:0
+msgid "Use 'Removal Priority' in Locations"
+msgstr ""
+
+#. module: stock_removal_location_by_priority
+#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
+msgid "stock.config.settings"
msgstr ""
From 5e08e3eedfc99c7fd5f74ede3e832425a047559c Mon Sep 17 00:00:00 2001
From: Lois Rilo
Date: Tue, 18 Sep 2018 17:02:10 +0200
Subject: [PATCH 07/20] [11.0][MIG] stock_removal_location_by_priority
---
stock_removal_location_by_priority/README.rst | 85 +++++---
.../__init__.py | 5 -
.../__manifest__.py | 3 +-
.../init_hook.py | 1 -
.../models/__init__.py | 7 +-
.../models/res_config_settings.py | 17 ++
.../models/stock_config_settings.py | 17 --
.../models/stock_location.py | 10 +-
.../models/stock_quant.py | 20 +-
.../readme/CONFIGURE.rst | 14 ++
.../readme/CONTRIBUTORS.rst | 2 +
.../readme/DESCRIPTION.rst | 3 +
.../readme/USAGE.rst | 3 +
.../security/stock_security.xml | 14 +-
.../tests/__init__.py | 5 -
...test_stock_removal_location_by_priority.py | 201 +++++++-----------
.../views/res_config_settings_views.xml | 24 ++-
17 files changed, 211 insertions(+), 220 deletions(-)
create mode 100644 stock_removal_location_by_priority/models/res_config_settings.py
delete mode 100644 stock_removal_location_by_priority/models/stock_config_settings.py
create mode 100644 stock_removal_location_by_priority/readme/CONFIGURE.rst
create mode 100644 stock_removal_location_by_priority/readme/CONTRIBUTORS.rst
create mode 100644 stock_removal_location_by_priority/readme/DESCRIPTION.rst
create mode 100644 stock_removal_location_by_priority/readme/USAGE.rst
diff --git a/stock_removal_location_by_priority/README.rst b/stock_removal_location_by_priority/README.rst
index 3077dbd0a..316c910af 100644
--- a/stock_removal_location_by_priority/README.rst
+++ b/stock_removal_location_by_priority/README.rst
@@ -1,72 +1,97 @@
-.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
- :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
- :alt: License: AGPL-3
-
==================================
Stock Removal Location by Priority
==================================
+.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! This file is generated by oca-gen-addon-readme !!
+ !! changes will be overwritten. !!
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
+ :target: https://odoo-community.org/page/development-status
+ :alt: Beta
+.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
+ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ :alt: License: AGPL-3
+.. |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/11.0/stock_removal_location_by_priority
+ :alt: OCA/stock-logistics-warehouse
+.. |badge4| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
+ :target: https://runbot.odoo-community.org/runbot/153/11.0
+ :alt: Try me on Runbot
+
+|badge1| |badge2| |badge3| |badge4|
+
This module adds a removal priority field on stock locations.
This priority applies when removing a product from different stock locations
and the incoming dates are equal in both locations.
+**Table of contents**
+
+.. contents::
+ :local:
+
Configuration
=============
-You can configure the removal priority as follows:
+You can activate the removal priority as follows:
#. Go to "Inventory > Configuration > Settings"
-#. In 'Location & Warehouse' section, mark the "Removal Priority" option.
+#. In 'Operations' section, mark the "Removal Priority" option.
+#. You also need to activate the following settings in the section *Warehouse* if they are not yet:
-NOTE: To be able to view this option you need to have already marked:
+ #. Manage several locations using *Storage Locations* option.
+ #. Advanced routing using "Multi-Step Routes" option.
-#. Manage several locations in "Warehouses and Locations usage level" option.
-#. Advanced routing of products using rules in "Routing" option.
-
-Usage
-=====
-
-To use this module, you need to:
+Then, set the *Removal Priority* in the desired locations. Remember that a
+lower number means more priority:
#. Go to "Inventory > Configuration > Warehouse Management > Locations"
#. In each Location form, in the Logistics section, put a Removal Priority.
-.. 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/10.0
+Usage
+=====
+After configure your locations properly, the system will select the quant
+at the location with more priority in case of equal date, no matter if you
+use FIFO or LIFO removal strategy.
Bug Tracker
===========
-Bugs are tracked on `GitHub Issues
-`_. In case of
-trouble, please check there if your issue has already been reported. If you
-spotted it first, help us smash it by providing detailed and welcomed feedback.
+Bugs are tracked on `GitHub Issues `_.
+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 feedback.
+Do not contact contributors directly about support or help with technical issues.
-Images
-------
+Credits
+=======
-* Odoo Community Association: `Icon `_.
+Authors
+~~~~~~~
+
+* Eficent
Contributors
-------------
+~~~~~~~~~~~~
* Miquel Raïch
+* Lois Rilo
+Maintainers
+~~~~~~~~~~~
-Maintainer
-----------
+This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
-This module is maintained by the OCA.
-
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-To contribute to this module, please visit https://odoo-community.org.
+This module is part of the `OCA/stock-logistics-warehouse `_ project on GitHub.
+
+You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/stock_removal_location_by_priority/__init__.py b/stock_removal_location_by_priority/__init__.py
index 2e7485cc7..cd4bd41dd 100644
--- a/stock_removal_location_by_priority/__init__.py
+++ b/stock_removal_location_by_priority/__init__.py
@@ -1,7 +1,2 @@
-# -*- coding: utf-8 -*-
-# Copyright 2016 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
from .init_hook import pre_init_hook
diff --git a/stock_removal_location_by_priority/__manifest__.py b/stock_removal_location_by_priority/__manifest__.py
index 9aa7cce4f..6eab05cee 100644
--- a/stock_removal_location_by_priority/__manifest__.py
+++ b/stock_removal_location_by_priority/__manifest__.py
@@ -1,11 +1,10 @@
-# -*- 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).
{
"name": "Stock Removal Location by Priority",
"summary": "Establish a removal priority on stock locations.",
- "version": "10.0.1.0.0",
+ "version": "11.0.1.0.0",
"author": "Eficent, "
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-warehouse",
diff --git a/stock_removal_location_by_priority/init_hook.py b/stock_removal_location_by_priority/init_hook.py
index a3055b980..5b2be5faf 100644
--- a/stock_removal_location_by_priority/init_hook.py
+++ b/stock_removal_location_by_priority/init_hook.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services, S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
diff --git a/stock_removal_location_by_priority/models/__init__.py b/stock_removal_location_by_priority/models/__init__.py
index 629e8d9a6..81e02630a 100644
--- a/stock_removal_location_by_priority/models/__init__.py
+++ b/stock_removal_location_by_priority/models/__init__.py
@@ -1,8 +1,3 @@
-# -*- 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_config_settings
+from . import res_config_settings
from . import stock_location
from . import stock_quant
diff --git a/stock_removal_location_by_priority/models/res_config_settings.py b/stock_removal_location_by_priority/models/res_config_settings.py
new file mode 100644
index 000000000..99ef62790
--- /dev/null
+++ b/stock_removal_location_by_priority/models/res_config_settings.py
@@ -0,0 +1,17 @@
+# Copyright 2017-18 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 odoo import fields, models
+
+
+class ResConfigSettings(models.TransientModel):
+ _inherit = 'res.config.settings'
+
+ group_removal_priority = fields.Boolean(
+ string="Removal Priority",
+ implied_group='stock_removal_location_by_priority.'
+ 'group_removal_priority',
+ help="Removal priority that applies when the incoming dates "
+ "are equal in both locations.",
+ )
diff --git a/stock_removal_location_by_priority/models/stock_config_settings.py b/stock_removal_location_by_priority/models/stock_config_settings.py
deleted file mode 100644
index 5da3aa22a..000000000
--- a/stock_removal_location_by_priority/models/stock_config_settings.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# -*- coding: utf-8 -*-
-# Part of Odoo. See LICENSE file for full copyright and licensing details.
-
-from odoo import fields, models
-
-
-class StockConfigSettings(models.TransientModel):
- _inherit = 'stock.config.settings'
-
- group_removal_priority = fields.Selection([
- (0, 'Don\'t use \'Removal Priority\' in Locations'),
- (1, 'Use \'Removal Priority\' in Locations'),
- ], "Removal Priority",
- implied_group='stock_removal_location_by_priority.'
- 'group_removal_priority',
- help="Removal priority that applies when the incoming dates "
- "are equal in both locations.")
diff --git a/stock_removal_location_by_priority/models/stock_location.py b/stock_removal_location_by_priority/models/stock_location.py
index 08d948fd2..c067823cf 100644
--- a/stock_removal_location_by_priority/models/stock_location.py
+++ b/stock_removal_location_by_priority/models/stock_location.py
@@ -1,4 +1,3 @@
-# -*- 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).
@@ -9,7 +8,8 @@ from odoo import fields, models
class StockLocation(models.Model):
_inherit = 'stock.location'
- removal_priority = fields.Integer(help="This priority applies when "
- "removing stock and incoming dates "
- "are equal.",
- string="Removal Priority", default=10)
+ removal_priority = fields.Integer(
+ string="Removal Priority", default=10,
+ help="This priority applies when removing stock and incoming dates "
+ "are equal.",
+ )
diff --git a/stock_removal_location_by_priority/models/stock_quant.py b/stock_removal_location_by_priority/models/stock_quant.py
index 93cbb9294..6eb768821 100644
--- a/stock_removal_location_by_priority/models/stock_quant.py
+++ b/stock_removal_location_by_priority/models/stock_quant.py
@@ -1,29 +1,29 @@
-# -*- coding: utf-8 -*-
-# Copyright 2017 Eficent Business and IT Consulting Services S.L.
+# Copyright 2017-18 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 odoo import api, fields, models
-from odoo.tools.translate import _
+from odoo import api, fields, models, _
from odoo.exceptions import UserError
-class Quant(models.Model):
+class StockQuant(models.Model):
_inherit = 'stock.quant'
removal_priority = fields.Integer(
- related='location_id.removal_priority', readonly=True, store=True)
+ related='location_id.removal_priority',
+ readonly=True, store=True,
+ )
@api.model
- def _quants_removal_get_order(self, removal_strategy=None):
+ def _get_removal_strategy_order(self, removal_strategy=None):
if self.user_has_groups(
'stock_removal_location_by_priority.group_removal_priority'):
if removal_strategy == 'fifo':
- return 'in_date, removal_priority, id'
+ return 'in_date ASC NULLS FIRST, removal_priority ASC, id'
elif removal_strategy == 'lifo':
- return 'in_date desc, removal_priority asc, id desc'
+ return 'in_date DESC NULLS LAST, removal_priority ASC, id desc'
raise UserError(_('Removal strategy %s not implemented.') % (
removal_strategy,))
else:
- return super(Quant, self)._quants_removal_get_order(
+ return super()._get_removal_strategy_order(
removal_strategy=removal_strategy)
diff --git a/stock_removal_location_by_priority/readme/CONFIGURE.rst b/stock_removal_location_by_priority/readme/CONFIGURE.rst
new file mode 100644
index 000000000..c160586be
--- /dev/null
+++ b/stock_removal_location_by_priority/readme/CONFIGURE.rst
@@ -0,0 +1,14 @@
+You can activate the removal priority as follows:
+
+#. Go to "Inventory > Configuration > Settings"
+#. In 'Operations' section, mark the "Removal Priority" option.
+#. You also need to activate the following settings in the section *Warehouse* if they are not yet:
+
+ #. Manage several locations using *Storage Locations* option.
+ #. Advanced routing using "Multi-Step Routes" option.
+
+Then, set the *Removal Priority* in the desired locations. Remember that a
+lower number means more priority:
+
+#. Go to "Inventory > Configuration > Warehouse Management > Locations"
+#. In each Location form, in the Logistics section, put a Removal Priority.
diff --git a/stock_removal_location_by_priority/readme/CONTRIBUTORS.rst b/stock_removal_location_by_priority/readme/CONTRIBUTORS.rst
new file mode 100644
index 000000000..9843f5f12
--- /dev/null
+++ b/stock_removal_location_by_priority/readme/CONTRIBUTORS.rst
@@ -0,0 +1,2 @@
+* Miquel Raïch
+* Lois Rilo
diff --git a/stock_removal_location_by_priority/readme/DESCRIPTION.rst b/stock_removal_location_by_priority/readme/DESCRIPTION.rst
new file mode 100644
index 000000000..11aa2cb8b
--- /dev/null
+++ b/stock_removal_location_by_priority/readme/DESCRIPTION.rst
@@ -0,0 +1,3 @@
+This module adds a removal priority field on stock locations.
+This priority applies when removing a product from different stock locations
+and the incoming dates are equal in both locations.
diff --git a/stock_removal_location_by_priority/readme/USAGE.rst b/stock_removal_location_by_priority/readme/USAGE.rst
new file mode 100644
index 000000000..94c9ee303
--- /dev/null
+++ b/stock_removal_location_by_priority/readme/USAGE.rst
@@ -0,0 +1,3 @@
+After configure your locations properly, the system will select the quant
+at the location with more priority in case of equal date, no matter if you
+use FIFO or LIFO removal strategy.
diff --git a/stock_removal_location_by_priority/security/stock_security.xml b/stock_removal_location_by_priority/security/stock_security.xml
index da6b1aaa2..230cc962b 100644
--- a/stock_removal_location_by_priority/security/stock_security.xml
+++ b/stock_removal_location_by_priority/security/stock_security.xml
@@ -1,8 +1,8 @@
-
-
-
- Removal Priority
-
-
-
+
+
+
+ Removal Priority
+
+
+
diff --git a/stock_removal_location_by_priority/tests/__init__.py b/stock_removal_location_by_priority/tests/__init__.py
index 574b5131a..57ed6d147 100644
--- a/stock_removal_location_by_priority/tests/__init__.py
+++ b/stock_removal_location_by_priority/tests/__init__.py
@@ -1,6 +1 @@
-# -*- 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_stock_removal_location_by_priority
diff --git a/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py b/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py
index a53e88fdc..037efd0be 100644
--- a/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py
+++ b/stock_removal_location_by_priority/tests/test_stock_removal_location_by_priority.py
@@ -1,7 +1,9 @@
-# -*- coding: utf-8 -*-
-# Copyright 2017 Eficent Business and IT Consulting Services S.L.
+# Copyright 2017-18 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 datetime import date
+
from odoo.tests.common import TransactionCase
@@ -14,7 +16,7 @@ class TestStockRemovalLocationByPriority(TransactionCase):
self.stock_warehouse_model = self.env['stock.warehouse']
self.stock_picking_model = self.env['stock.picking']
self.stock_change_model = self.env['stock.change.product.qty']
- self.product_template_model = self.env['product.template']
+ self.product_model = self.env['product.product']
self.quant_model = self.env['stock.quant']
self.picking_internal = self.env.ref('stock.picking_type_internal')
@@ -22,21 +24,24 @@ class TestStockRemovalLocationByPriority(TransactionCase):
self.location_supplier = self.env.ref('stock.stock_location_suppliers')
self.company = self.env.ref('base.main_company')
- self.grp_rem_priority = self.env.ref(
+ grp_rem_priority = self.env.ref(
'stock_removal_location_by_priority.group_removal_priority')
- self.g_stock_user = self.env.ref('stock.group_stock_user')
-
- self.user = self._create_user(
- 'user_1', [self.g_stock_user, self.grp_rem_priority],
- self.company).id
+ # We assign the group to admin, as the _get_removal_strategy_order
+ # method is going to be always executed as sudo.
+ user_admin = self.env.ref('base.user_root')
+ user_admin.groups_id = [(4, grp_rem_priority.id, 0)]
self.wh1 = self.stock_warehouse_model.create({
'name': 'WH1',
'code': 'WH1',
})
- # Create a locations:
+ # Removal strategies:
+ self.fifo = self.env.ref('stock.removal_fifo')
+ self.lifo = self.env.ref('stock.removal_lifo')
+
+ # Create locations:
self.stock = self.stock_location_model.create({
'name': 'Stock Base',
'usage': 'internal',
@@ -45,6 +50,7 @@ class TestStockRemovalLocationByPriority(TransactionCase):
'name': 'Shelf_A',
'usage': 'internal',
'location_id': self.stock.id,
+ 'removal_priority': 10,
})
self.shelf_B = self.stock_location_model.create({
'name': 'Shelf_B',
@@ -52,148 +58,93 @@ class TestStockRemovalLocationByPriority(TransactionCase):
'location_id': self.stock.id,
'removal_priority': 5,
})
+ self.stock_2 = self.stock_location_model.create({
+ 'name': 'Another Stock Location',
+ 'usage': 'internal',
+ })
# Create a product:
- self.product_templ_1 = self.product_template_model.create({
- 'name': 'Test Product Template 1',
+ self.product_1 = self.product_model.create({
+ 'name': 'Test Product 1',
'type': 'product',
- 'default_code': 'PROD_1',
})
- def _create_user(self, login, groups, company):
- group_ids = [group.id for group in groups]
- user = self.res_users_model.create({
- 'name': login,
- 'login': login,
- 'password': 'demo',
- 'email': 'example@yourcompany.com',
- 'company_id': company.id,
- 'company_ids': [(4, company.id)],
- 'groups_id': [(6, 0, group_ids)]
+ # Create quants:
+ today = date.today()
+ q1 = self.quant_model.create({
+ 'product_id': self.product_1.id,
+ 'location_id': self.shelf_A.id,
+ 'quantity': 5.0,
+ 'in_date': today,
})
- return user
+ q2 = self.quant_model.create({
+ 'product_id': self.product_1.id,
+ 'location_id': self.shelf_B.id,
+ 'quantity': 5.0,
+ 'in_date': today,
+ })
+ self.quants = q1 + q2
def _create_picking(self, picking_type, location, location_dest, qty):
-
- picking = self.stock_picking_model.sudo(self.user).create({
+ picking = self.stock_picking_model.create({
'picking_type_id': picking_type.id,
'location_id': location.id,
'location_dest_id': location_dest.id,
'move_lines': [
(0, 0, {
'name': 'Test move',
- 'product_id': self.product1.id,
- 'product_uom': self.product1.uom_id.id,
+ 'product_id': self.product_1.id,
+ 'product_uom': self.product_1.uom_id.id,
'product_uom_qty': qty,
'location_id': location.id,
'location_dest_id': location_dest.id,
- 'price_unit': 2
+ 'price_unit': 2,
})]
})
return picking
- def test_stock_removal_location_by_priority_fifo(self):
- """Tests removal priority."""
- wiz1 = self.stock_change_model.with_context(
- active_id=self.product_templ_1.id,
- active_model='product.template'
- ).create({'new_quantity': 20,
- 'location_id': self.stock.id,
- 'product_tmpl_id': self.product_templ_1.id,
- })
- wiz1.change_product_qty()
- self.product1 = wiz1.product_id
-
+ def test_01_stock_removal_location_by_priority_fifo(self):
+ """Tests removal priority with FIFO strategy."""
+ self.stock.removal_strategy_id = self.fifo
+ # quants must start unreserved
+ for q in self.quants:
+ self.assertEqual(q.reserved_quantity, 0.0)
+ if q.location_id == self.shelf_A:
+ self.assertEqual(q.removal_priority, 10)
+ if q.location_id == self.shelf_B:
+ self.assertEqual(q.removal_priority, 5)
+ self.assertEqual(self.quants[0].in_date, self.quants[1].in_date)
picking_1 = self._create_picking(
- self.picking_internal, self.stock, self.shelf_A, 5)
+ self.picking_internal, self.stock, self.stock_2, 5)
picking_1.action_confirm()
picking_1.action_assign()
- picking_2 = self._create_picking(
- self.picking_internal, self.stock, self.shelf_B, 10)
- picking_2.action_confirm()
- picking_2.action_assign()
-
- self.assertEqual(picking_1.pack_operation_ids.
- linked_move_operation_ids.reserved_quant_id.in_date,
- picking_2.pack_operation_ids.
- linked_move_operation_ids.reserved_quant_id.in_date,
- 'Testing data not generated properly.')
-
- wiz_act = picking_1.do_new_transfer()
- wiz2 = self.env[wiz_act['res_model']].browse(wiz_act['res_id'])
- wiz2.process()
-
- wiz_act = picking_2.do_new_transfer()
- wiz3 = self.env[wiz_act['res_model']].browse(wiz_act['res_id'])
- wiz3.process()
-
- picking_3 = self._create_picking(
- self.picking_out, self.stock, self.location_supplier, 5)
- picking_3.action_confirm()
- picking_3.action_assign()
- wiz_act = picking_3.do_new_transfer()
- wiz4 = self.env[wiz_act['res_model']].browse(wiz_act['res_id'])
- wiz4.process()
-
- records = self.quant_model.search(
- [('product_id', '=', self.product1.id)])
- for record in records:
- self.assertEqual(record.qty, 5,
- 'Removal_priority did\'nt work properly.')
-
- def test_stock_removal_location_by_priority_lifo(self):
- """Tests removal priority."""
- removal_method_id = self.env['product.removal'].search(
- [('name', '=', 'lifo')]).id
- self.stock.removal_strategy_id = removal_method_id
- self.shelf_A.removal_strategy_id = removal_method_id
- self.shelf_B.removal_strategy_id = removal_method_id
- self.location_supplier.removal_strategy_id = removal_method_id
- wiz1 = self.stock_change_model.with_context(
- active_id=self.product_templ_1.id,
- active_model='product.template'
- ).create({'new_quantity': 20,
- 'location_id': self.stock.id,
- 'product_tmpl_id': self.product_templ_1.id,
- })
- wiz1.change_product_qty()
- self.product1 = wiz1.product_id
+ # quants must be reserved in Shelf B (lower removal_priority value).
+ for q in self.quants:
+ if q.location_id == self.shelf_A:
+ self.assertEqual(q.reserved_quantity, 0.0)
+ if q.location_id == self.shelf_B:
+ self.assertEqual(q.reserved_quantity, 5.0)
+ def test_02_stock_removal_location_by_priority_lifo(self):
+ """Tests removal priority with LIFO strategy."""
+ self.stock.removal_strategy_id = self.lifo
+ # quants must start unreserved
+ for q in self.quants:
+ self.assertEqual(q.reserved_quantity, 0.0)
+ if q.location_id == self.shelf_A:
+ self.assertEqual(q.removal_priority, 10)
+ if q.location_id == self.shelf_B:
+ self.assertEqual(q.removal_priority, 5)
+ self.assertEqual(self.quants[0].in_date, self.quants[1].in_date)
picking_1 = self._create_picking(
- self.picking_internal, self.stock, self.shelf_A, 5)
+ self.picking_internal, self.stock, self.stock_2, 5)
picking_1.action_confirm()
picking_1.action_assign()
- picking_2 = self._create_picking(
- self.picking_internal, self.stock, self.shelf_B, 10)
- picking_2.action_confirm()
- picking_2.action_assign()
-
- self.assertEqual(picking_1.pack_operation_ids.
- linked_move_operation_ids.reserved_quant_id.in_date,
- picking_2.pack_operation_ids.
- linked_move_operation_ids.reserved_quant_id.in_date,
- 'Testing data not generated properly.')
-
- wiz_act = picking_1.do_new_transfer()
- wiz2 = self.env[wiz_act['res_model']].browse(wiz_act['res_id'])
- wiz2.process()
-
- wiz_act = picking_2.do_new_transfer()
- wiz3 = self.env[wiz_act['res_model']].browse(wiz_act['res_id'])
- wiz3.process()
-
- picking_3 = self._create_picking(
- self.picking_out, self.stock, self.location_supplier, 5)
- picking_3.action_confirm()
- picking_3.action_assign()
- wiz_act = picking_3.do_new_transfer()
- wiz4 = self.env[wiz_act['res_model']].browse(wiz_act['res_id'])
- wiz4.process()
-
- records = self.quant_model.search(
- [('product_id', '=', self.product1.id)])
- for record in records:
- self.assertEqual(record.qty, 5,
- 'Removal_priority did\'nt work properly.')
+ # quants must be reserved in Shelf B (lower removal_priority value).
+ for q in self.quants:
+ if q.location_id == self.shelf_A:
+ self.assertEqual(q.reserved_quantity, 0.0)
+ if q.location_id == self.shelf_B:
+ self.assertEqual(q.reserved_quantity, 5.0)
diff --git a/stock_removal_location_by_priority/views/res_config_settings_views.xml b/stock_removal_location_by_priority/views/res_config_settings_views.xml
index 7ee9c871f..d40cd25e0 100644
--- a/stock_removal_location_by_priority/views/res_config_settings_views.xml
+++ b/stock_removal_location_by_priority/views/res_config_settings_views.xml
@@ -1,16 +1,26 @@
-
- stock.config.view - removal_priority
- stock.config.settings
-
+ res.config.settings - removal_priority
+ res.config.settings
+
-
-
-
+
+
+
+
+
+
+
+
+ Use Removal Priority in Locations
+
+
+
+
From 13e1a725ab5bb433ecb2c07c592dd41581ed89ea Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Tue, 9 Oct 2018 14:50:28 +0000
Subject: [PATCH 08/20] [UPD] README.rst
---
stock_removal_location_by_priority/README.rst | 10 +-
.../static/description/index.html | 449 ++++++++++++++++++
2 files changed, 456 insertions(+), 3 deletions(-)
create mode 100644 stock_removal_location_by_priority/static/description/index.html
diff --git a/stock_removal_location_by_priority/README.rst b/stock_removal_location_by_priority/README.rst
index 316c910af..eec6b6b8f 100644
--- a/stock_removal_location_by_priority/README.rst
+++ b/stock_removal_location_by_priority/README.rst
@@ -16,11 +16,14 @@ Stock Removal Location by Priority
.. |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/11.0/stock_removal_location_by_priority
:alt: OCA/stock-logistics-warehouse
-.. |badge4| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
+.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
+ :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-11-0/stock-logistics-warehouse-11-0-stock_removal_location_by_priority
+ :alt: Translate me on Weblate
+.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/153/11.0
:alt: Try me on Runbot
-|badge1| |badge2| |badge3| |badge4|
+|badge1| |badge2| |badge3| |badge4| |badge5|
This module adds a removal priority field on stock locations.
This priority applies when removing a product from different stock locations
@@ -61,7 +64,8 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
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 feedback.
+If you spotted it first, help us smashing it by providing a detailed and welcomed
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
diff --git a/stock_removal_location_by_priority/static/description/index.html b/stock_removal_location_by_priority/static/description/index.html
new file mode 100644
index 000000000..0b750ba04
--- /dev/null
+++ b/stock_removal_location_by_priority/static/description/index.html
@@ -0,0 +1,449 @@
+
+
+
+
+
+
+Stock Removal Location by Priority
+
+
+
+
+
Stock Removal Location by Priority
+
+
+
+
This module adds a removal priority field on stock locations.
+This priority applies when removing a product from different stock locations
+and the incoming dates are equal in both locations.
After configure your locations properly, the system will select the quant
+at the location with more priority in case of equal date, no matter if you
+use FIFO or LIFO removal strategy.
Bugs are tracked on GitHub Issues.
+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
+feedback.
+
Do not contact contributors directly about support or help with technical issues.
OCA, or the Odoo Community Association, is a nonprofit organization whose
+mission is to support the collaborative development of Odoo features and
+promote its widespread use.
+
+
From f0cf92754c1deb7aa64f4d21fb94ec0bb85dc77c Mon Sep 17 00:00:00 2001
From: oca-travis
Date: Tue, 9 Oct 2018 15:36:49 +0000
Subject: [PATCH 09/20] [UPD] Update stock_removal_location_by_priority.pot
---
.../stock_removal_location_by_priority.pot | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/stock_removal_location_by_priority/i18n/stock_removal_location_by_priority.pot b/stock_removal_location_by_priority/i18n/stock_removal_location_by_priority.pot
index 446cd3b97..ae904e4a4 100644
--- a/stock_removal_location_by_priority/i18n/stock_removal_location_by_priority.pot
+++ b/stock_removal_location_by_priority/i18n/stock_removal_location_by_priority.pot
@@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 10.0\n"
+"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
@@ -13,11 +13,6 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
-#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Don't use 'Removal Priority' in Locations"
-msgstr ""
-
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
msgid "Inventory Locations"
@@ -29,7 +24,7 @@ msgid "Quants"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
@@ -37,7 +32,7 @@ msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
msgid "Removal priority that applies when the incoming dates are equal in both locations."
msgstr ""
@@ -54,12 +49,12 @@ msgid "This priority applies when removing stock and incoming dates are equal."
msgstr ""
#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Use 'Removal Priority' in Locations"
+#: model:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
+msgid "Use Removal Priority in Locations"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
-msgid "stock.config.settings"
+#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
+msgid "res.config.settings"
msgstr ""
From bdb3a9ca776b1131d9a3175d510de98dc28dc392 Mon Sep 17 00:00:00 2001
From: mreficent
Date: Fri, 9 Nov 2018 17:27:01 +0100
Subject: [PATCH 10/20] [FIX] stock_removal_by_priority: avoid pre-init-hook if
reinstalled
---
.../init_hook.py | 36 ++++++++++++-------
1 file changed, 24 insertions(+), 12 deletions(-)
diff --git a/stock_removal_location_by_priority/init_hook.py b/stock_removal_location_by_priority/init_hook.py
index 5b2be5faf..3774c1680 100644
--- a/stock_removal_location_by_priority/init_hook.py
+++ b/stock_removal_location_by_priority/init_hook.py
@@ -19,18 +19,30 @@ def pre_init_hook(cr):
def set_stock_location_removal_priority_default(cr):
- cr.execute(
- """
- ALTER TABLE stock_location
- ADD COLUMN removal_priority integer
- DEFAULT 10;
- """)
+ cr.execute("""SELECT column_name
+ FROM information_schema.columns
+ WHERE table_name='stock_location' AND
+ column_name='removal_priority'""")
+ if not cr.fetchone():
+ logger.info('Creating field removal_priority on stock_location')
+ cr.execute(
+ """
+ ALTER TABLE stock_location
+ ADD COLUMN removal_priority integer
+ DEFAULT 10;
+ """)
def set_stock_quant_removal_priority_default(cr):
- cr.execute(
- """
- ALTER TABLE stock_quant
- ADD COLUMN removal_priority integer
- DEFAULT 10;
- """)
+ cr.execute("""SELECT column_name
+ FROM information_schema.columns
+ WHERE table_name='stock_quant' AND
+ column_name='removal_priority'""")
+ if not cr.fetchone():
+ logger.info('Creating field removal_priority on stock_quant')
+ cr.execute(
+ """
+ ALTER TABLE stock_quant
+ ADD COLUMN removal_priority integer
+ DEFAULT 10;
+ """)
From 0864acd8adb6847e7fe02f979949a4d778c48ad3 Mon Sep 17 00:00:00 2001
From: OCA Transbot
Date: Fri, 30 Nov 2018 13:12:47 +0000
Subject: [PATCH 11/20] Update translation files
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
---
stock_removal_location_by_priority/i18n/de.po | 17 ++++++-----------
stock_removal_location_by_priority/i18n/es.po | 17 ++++++-----------
stock_removal_location_by_priority/i18n/fi.po | 17 ++++++-----------
stock_removal_location_by_priority/i18n/fr.po | 17 ++++++-----------
stock_removal_location_by_priority/i18n/it.po | 17 ++++++-----------
.../i18n/pt_BR.po | 17 ++++++-----------
stock_removal_location_by_priority/i18n/ro.po | 17 ++++++-----------
stock_removal_location_by_priority/i18n/sl.po | 17 ++++++-----------
.../i18n/zh_CN.po | 17 ++++++-----------
9 files changed, 54 insertions(+), 99 deletions(-)
diff --git a/stock_removal_location_by_priority/i18n/de.po b/stock_removal_location_by_priority/i18n/de.po
index bab721b34..42f0c67f0 100644
--- a/stock_removal_location_by_priority/i18n/de.po
+++ b/stock_removal_location_by_priority/i18n/de.po
@@ -19,11 +19,6 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Don't use 'Removal Priority' in Locations"
-msgstr ""
-
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
msgid "Inventory Locations"
@@ -35,7 +30,7 @@ msgid "Quants"
msgstr "Quants"
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
@@ -43,7 +38,7 @@ msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
msgid ""
"Removal priority that applies when the incoming dates are equal in both "
"locations."
@@ -62,11 +57,11 @@ msgid "This priority applies when removing stock and incoming dates are equal."
msgstr ""
#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Use 'Removal Priority' in Locations"
+#: model:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
+msgid "Use Removal Priority in Locations"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
-msgid "stock.config.settings"
+#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
+msgid "res.config.settings"
msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/es.po b/stock_removal_location_by_priority/i18n/es.po
index bc01ac73d..05cb05a61 100644
--- a/stock_removal_location_by_priority/i18n/es.po
+++ b/stock_removal_location_by_priority/i18n/es.po
@@ -19,11 +19,6 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Don't use 'Removal Priority' in Locations"
-msgstr ""
-
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
msgid "Inventory Locations"
@@ -35,7 +30,7 @@ msgid "Quants"
msgstr "Quants"
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
@@ -43,7 +38,7 @@ msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
msgid ""
"Removal priority that applies when the incoming dates are equal in both "
"locations."
@@ -62,11 +57,11 @@ msgid "This priority applies when removing stock and incoming dates are equal."
msgstr ""
#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Use 'Removal Priority' in Locations"
+#: model:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
+msgid "Use Removal Priority in Locations"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
-msgid "stock.config.settings"
+#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
+msgid "res.config.settings"
msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/fi.po b/stock_removal_location_by_priority/i18n/fi.po
index 1d8a5cb64..44816978c 100644
--- a/stock_removal_location_by_priority/i18n/fi.po
+++ b/stock_removal_location_by_priority/i18n/fi.po
@@ -18,11 +18,6 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Don't use 'Removal Priority' in Locations"
-msgstr ""
-
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
msgid "Inventory Locations"
@@ -34,7 +29,7 @@ msgid "Quants"
msgstr "Määrät"
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
@@ -42,7 +37,7 @@ msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
msgid ""
"Removal priority that applies when the incoming dates are equal in both "
"locations."
@@ -61,11 +56,11 @@ msgid "This priority applies when removing stock and incoming dates are equal."
msgstr ""
#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Use 'Removal Priority' in Locations"
+#: model:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
+msgid "Use Removal Priority in Locations"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
-msgid "stock.config.settings"
+#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
+msgid "res.config.settings"
msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/fr.po b/stock_removal_location_by_priority/i18n/fr.po
index 2400bb9db..34d1d40ef 100644
--- a/stock_removal_location_by_priority/i18n/fr.po
+++ b/stock_removal_location_by_priority/i18n/fr.po
@@ -18,11 +18,6 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Don't use 'Removal Priority' in Locations"
-msgstr ""
-
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
msgid "Inventory Locations"
@@ -34,7 +29,7 @@ msgid "Quants"
msgstr "Quants"
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
@@ -42,7 +37,7 @@ msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
msgid ""
"Removal priority that applies when the incoming dates are equal in both "
"locations."
@@ -61,11 +56,11 @@ msgid "This priority applies when removing stock and incoming dates are equal."
msgstr ""
#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Use 'Removal Priority' in Locations"
+#: model:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
+msgid "Use Removal Priority in Locations"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
-msgid "stock.config.settings"
+#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
+msgid "res.config.settings"
msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/it.po b/stock_removal_location_by_priority/i18n/it.po
index d15b18b6d..913e452a4 100644
--- a/stock_removal_location_by_priority/i18n/it.po
+++ b/stock_removal_location_by_priority/i18n/it.po
@@ -18,11 +18,6 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Don't use 'Removal Priority' in Locations"
-msgstr ""
-
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
msgid "Inventory Locations"
@@ -34,7 +29,7 @@ msgid "Quants"
msgstr "Quantità"
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
@@ -42,7 +37,7 @@ msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
msgid ""
"Removal priority that applies when the incoming dates are equal in both "
"locations."
@@ -61,11 +56,11 @@ msgid "This priority applies when removing stock and incoming dates are equal."
msgstr ""
#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Use 'Removal Priority' in Locations"
+#: model:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
+msgid "Use Removal Priority in Locations"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
-msgid "stock.config.settings"
+#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
+msgid "res.config.settings"
msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/pt_BR.po b/stock_removal_location_by_priority/i18n/pt_BR.po
index 3f042c197..677594fd4 100644
--- a/stock_removal_location_by_priority/i18n/pt_BR.po
+++ b/stock_removal_location_by_priority/i18n/pt_BR.po
@@ -19,11 +19,6 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Don't use 'Removal Priority' in Locations"
-msgstr ""
-
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
msgid "Inventory Locations"
@@ -35,7 +30,7 @@ msgid "Quants"
msgstr "Quants"
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
@@ -43,7 +38,7 @@ msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
msgid ""
"Removal priority that applies when the incoming dates are equal in both "
"locations."
@@ -62,11 +57,11 @@ msgid "This priority applies when removing stock and incoming dates are equal."
msgstr ""
#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Use 'Removal Priority' in Locations"
+#: model:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
+msgid "Use Removal Priority in Locations"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
-msgid "stock.config.settings"
+#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
+msgid "res.config.settings"
msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/ro.po b/stock_removal_location_by_priority/i18n/ro.po
index 654e5791e..1ea4579a8 100644
--- a/stock_removal_location_by_priority/i18n/ro.po
+++ b/stock_removal_location_by_priority/i18n/ro.po
@@ -19,11 +19,6 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?"
"2:1));\n"
-#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Don't use 'Removal Priority' in Locations"
-msgstr ""
-
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
msgid "Inventory Locations"
@@ -35,7 +30,7 @@ msgid "Quants"
msgstr "Poziții de stoc"
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
@@ -43,7 +38,7 @@ msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
msgid ""
"Removal priority that applies when the incoming dates are equal in both "
"locations."
@@ -62,11 +57,11 @@ msgid "This priority applies when removing stock and incoming dates are equal."
msgstr ""
#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Use 'Removal Priority' in Locations"
+#: model:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
+msgid "Use Removal Priority in Locations"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
-msgid "stock.config.settings"
+#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
+msgid "res.config.settings"
msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/sl.po b/stock_removal_location_by_priority/i18n/sl.po
index b3053dec5..c703a2b3d 100644
--- a/stock_removal_location_by_priority/i18n/sl.po
+++ b/stock_removal_location_by_priority/i18n/sl.po
@@ -20,11 +20,6 @@ msgstr ""
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3);\n"
-#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Don't use 'Removal Priority' in Locations"
-msgstr ""
-
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
msgid "Inventory Locations"
@@ -36,7 +31,7 @@ msgid "Quants"
msgstr "Kvant"
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
@@ -44,7 +39,7 @@ msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
msgid ""
"Removal priority that applies when the incoming dates are equal in both "
"locations."
@@ -63,11 +58,11 @@ msgid "This priority applies when removing stock and incoming dates are equal."
msgstr ""
#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Use 'Removal Priority' in Locations"
+#: model:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
+msgid "Use Removal Priority in Locations"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
-msgid "stock.config.settings"
+#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
+msgid "res.config.settings"
msgstr ""
diff --git a/stock_removal_location_by_priority/i18n/zh_CN.po b/stock_removal_location_by_priority/i18n/zh_CN.po
index 675168c00..be06fbfa6 100644
--- a/stock_removal_location_by_priority/i18n/zh_CN.po
+++ b/stock_removal_location_by_priority/i18n/zh_CN.po
@@ -19,11 +19,6 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
-#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Don't use 'Removal Priority' in Locations"
-msgstr ""
-
#. module: stock_removal_location_by_priority
#: model:ir.model,name:stock_removal_location_by_priority.model_stock_location
msgid "Inventory Locations"
@@ -35,7 +30,7 @@ msgid "Quants"
msgstr "源"
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_location_removal_priority
#: model:ir.model.fields,field_description:stock_removal_location_by_priority.field_stock_quant_removal_priority
#: model:res.groups,name:stock_removal_location_by_priority.group_removal_priority
@@ -43,7 +38,7 @@ msgid "Removal Priority"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model.fields,help:stock_removal_location_by_priority.field_stock_config_settings_group_removal_priority
+#: model:ir.model.fields,help:stock_removal_location_by_priority.field_res_config_settings_group_removal_priority
msgid ""
"Removal priority that applies when the incoming dates are equal in both "
"locations."
@@ -62,11 +57,11 @@ msgid "This priority applies when removing stock and incoming dates are equal."
msgstr ""
#. module: stock_removal_location_by_priority
-#: selection:stock.config.settings,group_removal_priority:0
-msgid "Use 'Removal Priority' in Locations"
+#: model:ir.ui.view,arch_db:stock_removal_location_by_priority.view_stock_config_settings
+msgid "Use Removal Priority in Locations"
msgstr ""
#. module: stock_removal_location_by_priority
-#: model:ir.model,name:stock_removal_location_by_priority.model_stock_config_settings
-msgid "stock.config.settings"
+#: model:ir.model,name:stock_removal_location_by_priority.model_res_config_settings
+msgid "res.config.settings"
msgstr ""
From b4e6de472149f34e6c95d190813a44058656e584 Mon Sep 17 00:00:00 2001
From: mreficent
Date: Thu, 27 Jun 2019 14:11:17 +0200
Subject: [PATCH 12/20] [MIG] stock_removal_location_by_priority: Migration to
12.0
---
stock_removal_location_by_priority/README.rst | 10 +++++-----
stock_removal_location_by_priority/__init__.py | 2 ++
stock_removal_location_by_priority/__manifest__.py | 4 ++--
stock_removal_location_by_priority/models/__init__.py | 2 ++
.../models/stock_quant.py | 2 +-
.../security/stock_security.xml | 6 +++++-
.../static/description/index.html | 6 +++---
stock_removal_location_by_priority/tests/__init__.py | 2 ++
.../tests/test_stock_removal_location_by_priority.py | 1 -
.../views/res_config_settings_views.xml | 2 +-
10 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/stock_removal_location_by_priority/README.rst b/stock_removal_location_by_priority/README.rst
index eec6b6b8f..ad12e3b1e 100644
--- a/stock_removal_location_by_priority/README.rst
+++ b/stock_removal_location_by_priority/README.rst
@@ -14,13 +14,13 @@ Stock Removal Location by Priority
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |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/11.0/stock_removal_location_by_priority
+ :target: https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_removal_location_by_priority
:alt: OCA/stock-logistics-warehouse
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-11-0/stock-logistics-warehouse-11-0-stock_removal_location_by_priority
+ :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_removal_location_by_priority
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/153/11.0
+ :target: https://runbot.odoo-community.org/runbot/153/12.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -65,7 +65,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
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
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -96,6 +96,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-This module is part of the `OCA/stock-logistics-warehouse `_ project on GitHub.
+This module is part of the `OCA/stock-logistics-warehouse `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/stock_removal_location_by_priority/__init__.py b/stock_removal_location_by_priority/__init__.py
index cd4bd41dd..a2aff3e43 100644
--- a/stock_removal_location_by_priority/__init__.py
+++ b/stock_removal_location_by_priority/__init__.py
@@ -1,2 +1,4 @@
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+
from . import models
from .init_hook import pre_init_hook
diff --git a/stock_removal_location_by_priority/__manifest__.py b/stock_removal_location_by_priority/__manifest__.py
index 6eab05cee..2b296c48e 100644
--- a/stock_removal_location_by_priority/__manifest__.py
+++ b/stock_removal_location_by_priority/__manifest__.py
@@ -4,11 +4,11 @@
{
"name": "Stock Removal Location by Priority",
"summary": "Establish a removal priority on stock locations.",
- "version": "11.0.1.0.0",
+ "version": "12.0.1.0.0",
"author": "Eficent, "
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-warehouse",
- "category": "Warehouse Management",
+ "category": "Warehouse",
"depends": ["stock"],
"data": [
'security/stock_security.xml',
diff --git a/stock_removal_location_by_priority/models/__init__.py b/stock_removal_location_by_priority/models/__init__.py
index 81e02630a..fad922206 100644
--- a/stock_removal_location_by_priority/models/__init__.py
+++ b/stock_removal_location_by_priority/models/__init__.py
@@ -1,3 +1,5 @@
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
+
from . import res_config_settings
from . import stock_location
from . import stock_quant
diff --git a/stock_removal_location_by_priority/models/stock_quant.py b/stock_removal_location_by_priority/models/stock_quant.py
index 6eb768821..a0b50e5dc 100644
--- a/stock_removal_location_by_priority/models/stock_quant.py
+++ b/stock_removal_location_by_priority/models/stock_quant.py
@@ -11,7 +11,7 @@ class StockQuant(models.Model):
removal_priority = fields.Integer(
related='location_id.removal_priority',
- readonly=True, store=True,
+ store=True,
)
@api.model
diff --git a/stock_removal_location_by_priority/security/stock_security.xml b/stock_removal_location_by_priority/security/stock_security.xml
index 230cc962b..7a49c05e5 100644
--- a/stock_removal_location_by_priority/security/stock_security.xml
+++ b/stock_removal_location_by_priority/security/stock_security.xml
@@ -1,4 +1,8 @@
-
+
+
+
+Removal Priority
diff --git a/stock_removal_location_by_priority/static/description/index.html b/stock_removal_location_by_priority/static/description/index.html
index 0b750ba04..038b6fbec 100644
--- a/stock_removal_location_by_priority/static/description/index.html
+++ b/stock_removal_location_by_priority/static/description/index.html
@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
This module adds a removal priority field on stock locations.
This priority applies when removing a product from different stock locations
and the incoming dates are equal in both locations.
@@ -415,7 +415,7 @@ use FIFO or LIFO removal strategy.
Bugs are tracked on GitHub Issues.
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
-feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -440,7 +440,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.