From f2ee60c41271d3535e71912c6c5fb638b78ff387 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Tue, 30 Jul 2019 12:09:43 -0500 Subject: [PATCH 01/25] [ADD] stock_request_direction --- stock_request_direction/README.rst | 109 +++++ stock_request_direction/__init__.py | 4 + stock_request_direction/__manifest__.py | 24 + .../i18n/stock_request_direction.pot | 43 ++ stock_request_direction/models/__init__.py | 5 + .../models/stock_request.py | 23 + .../models/stock_request_order.py | 31 ++ .../readme/CONTRIBUTORS.rst | 4 + .../readme/DESCRIPTION.rst | 3 + stock_request_direction/readme/USAGE.rst | 19 + .../static/description/icon.png | Bin 0 -> 7510 bytes .../static/description/index.html | 453 ++++++++++++++++++ .../views/res_config_settings.xml | 15 + .../views/stock_request_order_views.xml | 43 ++ .../views/stock_request_views.xml | 28 ++ 15 files changed, 804 insertions(+) create mode 100644 stock_request_direction/README.rst create mode 100644 stock_request_direction/__init__.py create mode 100644 stock_request_direction/__manifest__.py create mode 100644 stock_request_direction/i18n/stock_request_direction.pot create mode 100644 stock_request_direction/models/__init__.py create mode 100644 stock_request_direction/models/stock_request.py create mode 100644 stock_request_direction/models/stock_request_order.py create mode 100644 stock_request_direction/readme/CONTRIBUTORS.rst create mode 100644 stock_request_direction/readme/DESCRIPTION.rst create mode 100644 stock_request_direction/readme/USAGE.rst create mode 100644 stock_request_direction/static/description/icon.png create mode 100644 stock_request_direction/static/description/index.html create mode 100644 stock_request_direction/views/res_config_settings.xml create mode 100644 stock_request_direction/views/stock_request_order_views.xml create mode 100644 stock_request_direction/views/stock_request_views.xml diff --git a/stock_request_direction/README.rst b/stock_request_direction/README.rst new file mode 100644 index 000000000..695dbca8b --- /dev/null +++ b/stock_request_direction/README.rst @@ -0,0 +1,109 @@ +======================== +Stock Requests Direction +======================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-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/12.0/stock_request_direction + :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-12-0/stock-logistics-warehouse-12-0-stock_request_direction + :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/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module was written to allow users to request products to be transferred +from or to your warehouses. They can specify the direction and don't have to +bother selecting the inventory location. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Creation +~~~~~~~~ + +* Go to Stock Requests > Stock Requests +* Create or select a stock request +* Provide a product, quantity, direction and expected date +* Click Confirm + +Upon confirmation, the request will be reviewed by the warehouse team who can +define the appropriate route. + +In case that transfers are created, the user will be able to access to them +from the button 'Transfers' available in the Stock Request. + +Cancel +~~~~~~ + +When the user cancels a Stock Request, the related pending stock moves will be +also cancelled. + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Open Source Integrators + +Contributors +~~~~~~~~~~~~ + +* `Open Source Integrators `_ + + * Maxime Chambreuil + * Steve Campbell + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +.. |maintainer-max3903| image:: https://github.com/max3903.png?size=40px + :target: https://github.com/max3903 + :alt: max3903 + +Current `maintainer `__: + +|maintainer-max3903| + +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_request_direction/__init__.py b/stock_request_direction/__init__.py new file mode 100644 index 000000000..fcd348d59 --- /dev/null +++ b/stock_request_direction/__init__.py @@ -0,0 +1,4 @@ +# Copyright (c) 2019 Open Source Integrators +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from . import models diff --git a/stock_request_direction/__manifest__.py b/stock_request_direction/__manifest__.py new file mode 100644 index 000000000..6c22c8a12 --- /dev/null +++ b/stock_request_direction/__manifest__.py @@ -0,0 +1,24 @@ +# Copyright (c) 2019 Open Source Integrators +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +{ + "name": "Stock Requests Direction", + "summary": "From or to your warehouse?", + "version": "12.0.1.0.0", + "license": "LGPL-3", + "website": "https://github.com/OCA/stock-logistics-warehouse", + "author": "Open Source Integrators, " + "Odoo Community Association (OCA)", + "category": "Warehouse Management", + "depends": [ + "stock_request", + ], + "data": [ + "views/res_config_settings.xml", + "views/stock_request_views.xml", + "views/stock_request_order_views.xml", + ], + "application": False, + "development_status": "Beta", + "maintainers": ["max3903"], +} diff --git a/stock_request_direction/i18n/stock_request_direction.pot b/stock_request_direction/i18n/stock_request_direction.pot new file mode 100644 index 000000000..6ca5002cf --- /dev/null +++ b/stock_request_direction/i18n/stock_request_direction.pot @@ -0,0 +1,43 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_request_direction +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.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_request_direction +#: model:ir.model.fields,field_description:stock_request_direction.field_stock_request__direction +#: model:ir.model.fields,field_description:stock_request_direction.field_stock_request_order__direction +msgid "Direction" +msgstr "" + +#. module: stock_request_direction +#: selection:stock.request,direction:0 +#: selection:stock.request.order,direction:0 +msgid "Inbound" +msgstr "" + +#. module: stock_request_direction +#: selection:stock.request,direction:0 +#: selection:stock.request.order,direction:0 +msgid "Outbound" +msgstr "" + +#. module: stock_request_direction +#: model:ir.model,name:stock_request_direction.model_stock_request +msgid "Stock Request" +msgstr "" + +#. module: stock_request_direction +#: model:ir.model,name:stock_request_direction.model_stock_request_order +msgid "Stock Request Order" +msgstr "" + diff --git a/stock_request_direction/models/__init__.py b/stock_request_direction/models/__init__.py new file mode 100644 index 000000000..010f84b16 --- /dev/null +++ b/stock_request_direction/models/__init__.py @@ -0,0 +1,5 @@ +# Copyright (c) 2019 Open Source Integrators +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from . import stock_request +from . import stock_request_order diff --git a/stock_request_direction/models/stock_request.py b/stock_request_direction/models/stock_request.py new file mode 100644 index 000000000..732621286 --- /dev/null +++ b/stock_request_direction/models/stock_request.py @@ -0,0 +1,23 @@ +# Copyright (c) 2019 Open Source Integrators +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from odoo import api, fields, models + + +class StockRequest(models.Model): + _inherit = "stock.request" + + direction = fields.Selection([('outbound', 'Outbound'), + ('inbound', 'Inbound')], + string='Direction', + states={'draft': [('readonly', False)]}, + readonly=True) + + @api.onchange('direction') + def _onchange_location_id(self): + if self.direction == 'outbound': + # Partner Locations/Customers + self.location_id = self.env.ref('stock.stock_location_customers') + else: + # Otherwise the Stock Location of the Warehouse + self.location_id = self.warehouse_id.lot_stock_id.id diff --git a/stock_request_direction/models/stock_request_order.py b/stock_request_direction/models/stock_request_order.py new file mode 100644 index 000000000..6ffbec931 --- /dev/null +++ b/stock_request_direction/models/stock_request_order.py @@ -0,0 +1,31 @@ +# Copyright (c) 2019 Open Source Integrators +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from odoo import api, fields, models + + +class StockRequestOrder(models.Model): + _inherit = 'stock.request.order' + + direction = fields.Selection([('outbound', 'Outbound'), + ('inbound', 'Inbound')], + string='Direction', + states={'draft': [('readonly', False)]}, + readonly=True) + + @api.onchange('direction') + def _onchange_direction(self): + if self.direction == 'outbound': + # Stock Location set to Partner Locations/Customers + self.location_id = \ + self.company_id.partner_id.property_stock_customer.id + else: + # Otherwise the Stock Location of the Warehouse + self.location_id = \ + self.warehouse_id.lot_stock_id.id + + def change_childs(self): + super().change_childs() + if not self._context.get('no_change_childs', False): + for line in self.stock_request_ids: + line.direction = self.direction diff --git a/stock_request_direction/readme/CONTRIBUTORS.rst b/stock_request_direction/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..353b9c62d --- /dev/null +++ b/stock_request_direction/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* `Open Source Integrators `_ + + * Maxime Chambreuil + * Steve Campbell diff --git a/stock_request_direction/readme/DESCRIPTION.rst b/stock_request_direction/readme/DESCRIPTION.rst new file mode 100644 index 000000000..8620293b1 --- /dev/null +++ b/stock_request_direction/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module was written to allow users to request products to be transferred +from or to your warehouses. They can specify the direction and don't have to +bother selecting the inventory location. diff --git a/stock_request_direction/readme/USAGE.rst b/stock_request_direction/readme/USAGE.rst new file mode 100644 index 000000000..22156f016 --- /dev/null +++ b/stock_request_direction/readme/USAGE.rst @@ -0,0 +1,19 @@ +Creation +~~~~~~~~ + +* Go to Stock Requests > Stock Requests +* Create or select a stock request +* Provide a product, quantity, direction and expected date +* Click Confirm + +Upon confirmation, the request will be reviewed by the warehouse team who can +define the appropriate route. + +In case that transfers are created, the user will be able to access to them +from the button 'Transfers' available in the Stock Request. + +Cancel +~~~~~~ + +When the user cancels a Stock Request, the related pending stock moves will be +also cancelled. diff --git a/stock_request_direction/static/description/icon.png b/stock_request_direction/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c31ecfd9f58e3ab7e0ede0f1d56185d51074099c GIT binary patch literal 7510 zcmc(EWmJ@1^e>%52uPRGih$(MgCO0ggp`5|B{d@mNQ_8#3k>ywA}tIxq)OKSQUU@3 z!VD!6gEaTS_r2?X@2C6mu359rv(DaU$8Yab`$QWXYSB=!QxOml(CBDum=X{WI$!-M z$bg=J)hClcL-tfpOM~F@>Q~TKk_z-tdTCq22neVdul|Gt*+^EPlN_#NaG!jcgpyi} zmv2ke3Fu;j-?xCPdp>{u%mYrK?(^&k{Fx)Kp9|cXS4+ph*c?I2LO{UTuA`y$;N|T0 zyuW+S`V;Ifk4}HFV}C~FXSS;QnwW1d08q*cV{GO35dZ|j=C z?n|9uRmeqOsBAP=pdHnevOu*RxgZe)rfU*BW{eLR>PyPRY1(3Yk_7nt4rb>d{ttn4? z-Wp}=@u!AEh(G0R=$ucQi{sK`BSE_X`t^(H`j084LzP&5O^>yiY*&fPjK*4F%GE!y zONT~wp^c~($CB04XHhL*AmT$B1%y8XkvqD(Nwho_V;Of|jR}qtfUaZD18={ux4Z6e zuYk}|1#|vqMO26U@Zsi<3)dcju%ll@5Gp$DLPMRU)5~?BZyQQx05D2od_^X1i0oZ< zSmo#|zzeLLr0i+|Q--2Ix`nURGMD5E@oVP5s8@2TN#H(!QsDQ>kjR!Yj5 zcX64MEB!SM&+*6EY)LK^i_}rOnczT+!5XG2>c_W=|1sZl4dW-G`Duf6Fr5$}t*$;E z?e$IH?C(tGo2))Tb0T*&2`PVjxfA@wVm8d_Bz&@X}_OmP^sJV{K*D zL!K$R*m?gZ4E^BD%C3o7UPul!6(Rz+Gj4s~MKtrV9V3KV&!~rZr!l(K!?x zqW#<;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@;IN%lWTjPNT8+t}KVBxse z!c(q|8^Pm^aIOxCSKA4GHjF(_{#KSAn=w(myKxOl<3+vV1M?R3l7yY{rLg*2VhcW( z7&Q8f0Jxs8xi-Cf;qR8*c zH60^e1`*NFLmi1Tz@c$HSu#+GFftH37S_c!R6wX+^FX%&h14Y{qG7#_d6=>d@&;;B zao4e~{fA2beX{ra#(={h#62;vN=HSJtj4>{yrZGs%hp1ciHuNs=T8>iRhbndx*6MX zq!iNjNF(#Mx>d`5(;f?Z^(JFdUJUOjB<~~r73W*;28OHF-n)tqqkSuwpCp9=o1Jd9 z4t@-rdkBlVkNLgHr2a~@YI~IvYYe=Z5O1mK86>Cc-?fEh2n zt5V!Y{a7V??1@=BG zQEy(Y#hKM|pzL`C3uI@5%XEyoi_J1ofcB?75*^74l)uRW(L4XNMV3cN{jT=nmIg6k z&48ql2#Wv!Q9}|E(X6zc4w%cT+{AoRujxX7y8R;^6$g8?2&9~Wb0(16pFr$@-&sH; z&XI&pqY_gs&rdg$NumMaPYV2IWlM4QuXF&+EYVUQ4J*|6y1f@LLu|aG61K=e3m6%N zbQ}wI(ro?8oF~QLoiulGue_`83UH=ggH+cQCzIYgN9ExKb^^qeU4X+3P~I#%Z8jo) zallVHz+A+#^>D5+@TRxYjn=GH5wi4^WQI_E?E32k-dY?22sFp2g| qJBnmc1b^FaQP%UBXsGmY2o3DoX1di35AfVcpmX0)qw1dh>;DBm+(G~V literal 0 HcmV?d00001 diff --git a/stock_request_direction/static/description/index.html b/stock_request_direction/static/description/index.html new file mode 100644 index 000000000..28811a507 --- /dev/null +++ b/stock_request_direction/static/description/index.html @@ -0,0 +1,453 @@ + + + + + + +Stock Requests Direction + + + +
+

Stock Requests Direction

+ + +

Beta License: LGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runbot

+

This module was written to allow users to request products to be transferred +from or to your warehouses. They can specify the direction and don’t have to +bother selecting the inventory location.

+

Table of contents

+ +
+

Usage

+
+

Creation

+
    +
  • Go to Stock Requests > Stock Requests
  • +
  • Create or select a stock request
  • +
  • Provide a product, quantity, direction and expected date
  • +
  • Click Confirm
  • +
+

Upon confirmation, the request will be reviewed by the warehouse team who can +define the appropriate route.

+

In case that transfers are created, the user will be able to access to them +from the button ‘Transfers’ available in the Stock Request.

+
+
+

Cancel

+

When the user cancels a Stock Request, the related pending stock moves will be +also cancelled.

+
+
+
+

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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Open Source Integrators
  • +
+
+ +
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

Current maintainer:

+

max3903

+

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_request_direction/views/res_config_settings.xml b/stock_request_direction/views/res_config_settings.xml new file mode 100644 index 000000000..419bc78a3 --- /dev/null +++ b/stock_request_direction/views/res_config_settings.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + diff --git a/stock_request_direction/views/stock_request_order_views.xml b/stock_request_direction/views/stock_request_order_views.xml new file mode 100644 index 000000000..0c472e6e1 --- /dev/null +++ b/stock_request_direction/views/stock_request_order_views.xml @@ -0,0 +1,43 @@ + + + + + + stock.request.order.tree + stock.request.order + + + + + + + + + + stock.request.order.form + stock.request.order + + + + + + + { + 'default_expected_date': expected_date, + 'default_picking_policy': picking_policy, + 'default_warehouse_id': warehouse_id, + 'default_direction': direction, + 'default_location_id': location_id, + 'default_procurement_group_id': procurement_group_id, + 'default_company_id': company_id, + 'default_state': state, + } + + + + + + + + diff --git a/stock_request_direction/views/stock_request_views.xml b/stock_request_direction/views/stock_request_views.xml new file mode 100644 index 000000000..ed3e586c6 --- /dev/null +++ b/stock_request_direction/views/stock_request_views.xml @@ -0,0 +1,28 @@ + + + + + + stock.request.tree + stock.request + + + + + + + + + + stock.request.form + stock.request + + + + + + + + + From 74da018690933742eefe9d71695f5aa5a996176d Mon Sep 17 00:00:00 2001 From: scampbell Date: Tue, 6 Aug 2019 11:32:57 -0700 Subject: [PATCH 02/25] [FIX] Method Name --- stock_request_direction/models/stock_request_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_request_direction/models/stock_request_order.py b/stock_request_direction/models/stock_request_order.py index 6ffbec931..309261ea0 100644 --- a/stock_request_direction/models/stock_request_order.py +++ b/stock_request_direction/models/stock_request_order.py @@ -14,7 +14,7 @@ class StockRequestOrder(models.Model): readonly=True) @api.onchange('direction') - def _onchange_direction(self): + def _onchange_location_id(self): if self.direction == 'outbound': # Stock Location set to Partner Locations/Customers self.location_id = \ From 8fb2355e119e95e05e223f1abdf079515c909ea8 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sat, 10 Aug 2019 20:06:44 +0000 Subject: [PATCH 03/25] stock_request_direction 12.0.1.0.1 --- stock_request_direction/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_request_direction/__manifest__.py b/stock_request_direction/__manifest__.py index 6c22c8a12..1dcb93d29 100644 --- a/stock_request_direction/__manifest__.py +++ b/stock_request_direction/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Stock Requests Direction", "summary": "From or to your warehouse?", - "version": "12.0.1.0.0", + "version": "12.0.1.0.1", "license": "LGPL-3", "website": "https://github.com/OCA/stock-logistics-warehouse", "author": "Open Source Integrators, " From 90fb29aca09f7a63e88e4eae16d9750c541d5e86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Wed, 16 Oct 2019 14:54:56 +0000 Subject: [PATCH 04/25] Added translation using Weblate (Chinese (Simplified)) --- stock_request_direction/i18n/zh_CN.po | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 stock_request_direction/i18n/zh_CN.po diff --git a/stock_request_direction/i18n/zh_CN.po b/stock_request_direction/i18n/zh_CN.po new file mode 100644 index 000000000..58712b5dc --- /dev/null +++ b/stock_request_direction/i18n/zh_CN.po @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_request_direction +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-10-16 15:58+0000\n" +"Last-Translator: 黎伟杰 <674416404@qq.com>\n" +"Language-Team: none\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 3.8\n" + +#. module: stock_request_direction +#: model:ir.model.fields,field_description:stock_request_direction.field_stock_request__direction +#: model:ir.model.fields,field_description:stock_request_direction.field_stock_request_order__direction +msgid "Direction" +msgstr "方向" + +#. module: stock_request_direction +#: selection:stock.request,direction:0 +#: selection:stock.request.order,direction:0 +msgid "Inbound" +msgstr "入库" + +#. module: stock_request_direction +#: selection:stock.request,direction:0 +#: selection:stock.request.order,direction:0 +msgid "Outbound" +msgstr "出库" + +#. module: stock_request_direction +#: model:ir.model,name:stock_request_direction.model_stock_request +msgid "Stock Request" +msgstr "库存请求" + +#. module: stock_request_direction +#: model:ir.model,name:stock_request_direction.model_stock_request_order +msgid "Stock Request Order" +msgstr "库存请求单" From 10f2da345facf1ac83ef43e84420165633c3755e Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Fri, 1 Nov 2019 22:54:19 +0000 Subject: [PATCH 05/25] Added translation using Weblate (Spanish) --- stock_request_direction/i18n/es.po | 45 ++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 stock_request_direction/i18n/es.po diff --git a/stock_request_direction/i18n/es.po b/stock_request_direction/i18n/es.po new file mode 100644 index 000000000..d57892825 --- /dev/null +++ b/stock_request_direction/i18n/es.po @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_request_direction +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-01-17 05:13+0000\n" +"Last-Translator: Nelson Ramírez Sánchez \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.10\n" + +#. module: stock_request_direction +#: model:ir.model.fields,field_description:stock_request_direction.field_stock_request__direction +#: model:ir.model.fields,field_description:stock_request_direction.field_stock_request_order__direction +msgid "Direction" +msgstr "Sentido" + +#. module: stock_request_direction +#: selection:stock.request,direction:0 +#: selection:stock.request.order,direction:0 +msgid "Inbound" +msgstr "Entrante" + +#. module: stock_request_direction +#: selection:stock.request,direction:0 +#: selection:stock.request.order,direction:0 +msgid "Outbound" +msgstr "Saliente" + +#. module: stock_request_direction +#: model:ir.model,name:stock_request_direction.model_stock_request +msgid "Stock Request" +msgstr "Solicitud de Existencias" + +#. module: stock_request_direction +#: model:ir.model,name:stock_request_direction.model_stock_request_order +msgid "Stock Request Order" +msgstr "Pedido de Existencia" From a4b02c5b471c2a40babfe830e60fe3314ed3fe3d Mon Sep 17 00:00:00 2001 From: ps-tubtim Date: Fri, 13 Mar 2020 14:19:14 +0700 Subject: [PATCH 06/25] [IMP] stock_request_direction: black, isort --- stock_request_direction/__manifest__.py | 9 +++---- .../models/stock_request.py | 17 +++++++------ .../models/stock_request_order.py | 25 +++++++++---------- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/stock_request_direction/__manifest__.py b/stock_request_direction/__manifest__.py index 1dcb93d29..9731896e9 100644 --- a/stock_request_direction/__manifest__.py +++ b/stock_request_direction/__manifest__.py @@ -4,15 +4,12 @@ { "name": "Stock Requests Direction", "summary": "From or to your warehouse?", - "version": "12.0.1.0.1", + "version": "13.0.1.0.0", "license": "LGPL-3", "website": "https://github.com/OCA/stock-logistics-warehouse", - "author": "Open Source Integrators, " - "Odoo Community Association (OCA)", + "author": "Open Source Integrators, " "Odoo Community Association (OCA)", "category": "Warehouse Management", - "depends": [ - "stock_request", - ], + "depends": ["stock_request"], "data": [ "views/res_config_settings.xml", "views/stock_request_views.xml", diff --git a/stock_request_direction/models/stock_request.py b/stock_request_direction/models/stock_request.py index 732621286..03a0611ed 100644 --- a/stock_request_direction/models/stock_request.py +++ b/stock_request_direction/models/stock_request.py @@ -7,17 +7,18 @@ class StockRequest(models.Model): _inherit = "stock.request" - direction = fields.Selection([('outbound', 'Outbound'), - ('inbound', 'Inbound')], - string='Direction', - states={'draft': [('readonly', False)]}, - readonly=True) + direction = fields.Selection( + [("outbound", "Outbound"), ("inbound", "Inbound")], + string="Direction", + states={"draft": [("readonly", False)]}, + readonly=True, + ) - @api.onchange('direction') + @api.onchange("direction") def _onchange_location_id(self): - if self.direction == 'outbound': + if self.direction == "outbound": # Partner Locations/Customers - self.location_id = self.env.ref('stock.stock_location_customers') + self.location_id = self.env.ref("stock.stock_location_customers") else: # Otherwise the Stock Location of the Warehouse self.location_id = self.warehouse_id.lot_stock_id.id diff --git a/stock_request_direction/models/stock_request_order.py b/stock_request_direction/models/stock_request_order.py index 309261ea0..29e719c76 100644 --- a/stock_request_direction/models/stock_request_order.py +++ b/stock_request_direction/models/stock_request_order.py @@ -5,27 +5,26 @@ class StockRequestOrder(models.Model): - _inherit = 'stock.request.order' + _inherit = "stock.request.order" - direction = fields.Selection([('outbound', 'Outbound'), - ('inbound', 'Inbound')], - string='Direction', - states={'draft': [('readonly', False)]}, - readonly=True) + direction = fields.Selection( + [("outbound", "Outbound"), ("inbound", "Inbound")], + string="Direction", + states={"draft": [("readonly", False)]}, + readonly=True, + ) - @api.onchange('direction') + @api.onchange("direction") def _onchange_location_id(self): - if self.direction == 'outbound': + if self.direction == "outbound": # Stock Location set to Partner Locations/Customers - self.location_id = \ - self.company_id.partner_id.property_stock_customer.id + self.location_id = self.company_id.partner_id.property_stock_customer.id else: # Otherwise the Stock Location of the Warehouse - self.location_id = \ - self.warehouse_id.lot_stock_id.id + self.location_id = self.warehouse_id.lot_stock_id.id def change_childs(self): super().change_childs() - if not self._context.get('no_change_childs', False): + if not self._context.get("no_change_childs", False): for line in self.stock_request_ids: line.direction = self.direction From 1a491e6d20867f9b20b373442da8daf4692c857e Mon Sep 17 00:00:00 2001 From: ps-tubtim Date: Fri, 16 Oct 2020 18:13:23 +0700 Subject: [PATCH 07/25] [MIG] stock_request_direction: Migration to 13.0 --- stock_request_direction/README.rst | 14 +++++++++----- stock_request_direction/__manifest__.py | 2 +- .../i18n/stock_request_direction.pot | 15 +++++++-------- stock_request_direction/readme/CONTRIBUTORS.rst | 4 ++++ .../static/description/index.html | 10 +++++++--- .../views/res_config_settings.xml | 12 +++++------- .../views/stock_request_order_views.xml | 16 ++++++---------- .../views/stock_request_views.xml | 12 ++++-------- 8 files changed, 43 insertions(+), 42 deletions(-) diff --git a/stock_request_direction/README.rst b/stock_request_direction/README.rst index 695dbca8b..d67384896 100644 --- a/stock_request_direction/README.rst +++ b/stock_request_direction/README.rst @@ -14,13 +14,13 @@ Stock Requests Direction :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-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/12.0/stock_request_direction + :target: https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_request_direction :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-12-0/stock-logistics-warehouse-12-0-stock_request_direction + :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_request_direction :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/12.0 + :target: https://runbot.odoo-community.org/runbot/153/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -63,7 +63,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. @@ -83,6 +83,10 @@ Contributors * Maxime Chambreuil * Steve Campbell +* `Ecosoft `__: + + * Pimolnat Suntian + Maintainers ~~~~~~~~~~~ @@ -104,6 +108,6 @@ Current `maintainer `__: |maintainer-max3903| -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_request_direction/__manifest__.py b/stock_request_direction/__manifest__.py index 9731896e9..0b6c8acb6 100644 --- a/stock_request_direction/__manifest__.py +++ b/stock_request_direction/__manifest__.py @@ -7,7 +7,7 @@ "version": "13.0.1.0.0", "license": "LGPL-3", "website": "https://github.com/OCA/stock-logistics-warehouse", - "author": "Open Source Integrators, " "Odoo Community Association (OCA)", + "author": "Open Source Integrators, Odoo Community Association (OCA)", "category": "Warehouse Management", "depends": ["stock_request"], "data": [ diff --git a/stock_request_direction/i18n/stock_request_direction.pot b/stock_request_direction/i18n/stock_request_direction.pot index 6ca5002cf..ac0241116 100644 --- a/stock_request_direction/i18n/stock_request_direction.pot +++ b/stock_request_direction/i18n/stock_request_direction.pot @@ -1,12 +1,12 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * stock_request_direction +# * stock_request_direction # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: <>\n" +"Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -20,14 +20,14 @@ msgid "Direction" msgstr "" #. module: stock_request_direction -#: selection:stock.request,direction:0 -#: selection:stock.request.order,direction:0 +#: model:ir.model.fields.selection,name:stock_request_direction.selection__stock_request__direction__inbound +#: model:ir.model.fields.selection,name:stock_request_direction.selection__stock_request_order__direction__inbound msgid "Inbound" msgstr "" #. module: stock_request_direction -#: selection:stock.request,direction:0 -#: selection:stock.request.order,direction:0 +#: model:ir.model.fields.selection,name:stock_request_direction.selection__stock_request__direction__outbound +#: model:ir.model.fields.selection,name:stock_request_direction.selection__stock_request_order__direction__outbound msgid "Outbound" msgstr "" @@ -40,4 +40,3 @@ msgstr "" #: model:ir.model,name:stock_request_direction.model_stock_request_order msgid "Stock Request Order" msgstr "" - diff --git a/stock_request_direction/readme/CONTRIBUTORS.rst b/stock_request_direction/readme/CONTRIBUTORS.rst index 353b9c62d..d4f610216 100644 --- a/stock_request_direction/readme/CONTRIBUTORS.rst +++ b/stock_request_direction/readme/CONTRIBUTORS.rst @@ -2,3 +2,7 @@ * Maxime Chambreuil * Steve Campbell + +* `Ecosoft `__: + + * Pimolnat Suntian diff --git a/stock_request_direction/static/description/index.html b/stock_request_direction/static/description/index.html index 28811a507..7844d1b60 100644 --- a/stock_request_direction/static/description/index.html +++ b/stock_request_direction/static/description/index.html @@ -367,7 +367,7 @@

Stock Requests Direction

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: LGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runbot

+

Beta License: LGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runbot

This module was written to allow users to request products to be transferred from or to your warehouses. They can specify the direction and don’t have to bother selecting the inventory location.

@@ -414,7 +414,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.

@@ -433,6 +433,10 @@

Contributors

  • Steve Campbell <scampbell@opensourceintegrators.com>
  • +
  • Ecosoft: +
  • @@ -444,7 +448,7 @@

    Maintainers

    promote its widespread use.

    Current maintainer:

    max3903

    -

    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_request_direction/views/res_config_settings.xml b/stock_request_direction/views/res_config_settings.xml index 419bc78a3..c9d9148fd 100644 --- a/stock_request_direction/views/res_config_settings.xml +++ b/stock_request_direction/views/res_config_settings.xml @@ -1,15 +1,13 @@ - - - + - - - + - diff --git a/stock_request_direction/views/stock_request_order_views.xml b/stock_request_direction/views/stock_request_order_views.xml index 0c472e6e1..40b611d5d 100644 --- a/stock_request_direction/views/stock_request_order_views.xml +++ b/stock_request_direction/views/stock_request_order_views.xml @@ -1,26 +1,23 @@ - - stock.request.order.tree stock.request.order - + - + - - + stock.request.order.form stock.request.order - + - + { @@ -35,9 +32,8 @@ } - + - diff --git a/stock_request_direction/views/stock_request_views.xml b/stock_request_direction/views/stock_request_views.xml index ed3e586c6..5dd26be9b 100644 --- a/stock_request_direction/views/stock_request_views.xml +++ b/stock_request_direction/views/stock_request_views.xml @@ -1,28 +1,24 @@ - - stock.request.tree stock.request - + - + - stock.request.form stock.request - + - + - From 4846ca0ed2b67f5ce271790e7b55735d65cb477e Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Tue, 20 Oct 2020 14:49:01 +0000 Subject: [PATCH 08/25] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: stock-logistics-warehouse-13.0/stock-logistics-warehouse-13.0-stock_request_direction Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_request_direction/ --- stock_request_direction/i18n/es.po | 10 +++++----- stock_request_direction/i18n/zh_CN.po | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/stock_request_direction/i18n/es.po b/stock_request_direction/i18n/es.po index d57892825..63741a1f8 100644 --- a/stock_request_direction/i18n/es.po +++ b/stock_request_direction/i18n/es.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * stock_request_direction +# * stock_request_direction # msgid "" msgstr "" @@ -23,14 +23,14 @@ msgid "Direction" msgstr "Sentido" #. module: stock_request_direction -#: selection:stock.request,direction:0 -#: selection:stock.request.order,direction:0 +#: model:ir.model.fields.selection,name:stock_request_direction.selection__stock_request__direction__inbound +#: model:ir.model.fields.selection,name:stock_request_direction.selection__stock_request_order__direction__inbound msgid "Inbound" msgstr "Entrante" #. module: stock_request_direction -#: selection:stock.request,direction:0 -#: selection:stock.request.order,direction:0 +#: model:ir.model.fields.selection,name:stock_request_direction.selection__stock_request__direction__outbound +#: model:ir.model.fields.selection,name:stock_request_direction.selection__stock_request_order__direction__outbound msgid "Outbound" msgstr "Saliente" diff --git a/stock_request_direction/i18n/zh_CN.po b/stock_request_direction/i18n/zh_CN.po index 58712b5dc..ae463bfcc 100644 --- a/stock_request_direction/i18n/zh_CN.po +++ b/stock_request_direction/i18n/zh_CN.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * stock_request_direction +# * stock_request_direction # msgid "" msgstr "" @@ -23,14 +23,14 @@ msgid "Direction" msgstr "方向" #. module: stock_request_direction -#: selection:stock.request,direction:0 -#: selection:stock.request.order,direction:0 +#: model:ir.model.fields.selection,name:stock_request_direction.selection__stock_request__direction__inbound +#: model:ir.model.fields.selection,name:stock_request_direction.selection__stock_request_order__direction__inbound msgid "Inbound" msgstr "入库" #. module: stock_request_direction -#: selection:stock.request,direction:0 -#: selection:stock.request.order,direction:0 +#: model:ir.model.fields.selection,name:stock_request_direction.selection__stock_request__direction__outbound +#: model:ir.model.fields.selection,name:stock_request_direction.selection__stock_request_order__direction__outbound msgid "Outbound" msgstr "出库" From d6547cf7df47fa56accc549e5235624df6c3661c Mon Sep 17 00:00:00 2001 From: Patrick Wilson <36892066+patrickrwilson@users.noreply.github.com> Date: Mon, 23 Mar 2020 11:01:45 -0500 Subject: [PATCH 09/25] [IMP] Warehouse On Change Since the location and routes depend on the warehouse that is selected on the stock request order, if the warehouse changes then so will the route options. This adds an on change event so if the warehouse changes, then the direction gets cleared and so do the routes on the product lines. This forces the user to properly reset the items using the correct routes for the newly selected warehouse. --- stock_request_direction/models/stock_request_order.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stock_request_direction/models/stock_request_order.py b/stock_request_direction/models/stock_request_order.py index 29e719c76..f1b970180 100644 --- a/stock_request_direction/models/stock_request_order.py +++ b/stock_request_direction/models/stock_request_order.py @@ -23,6 +23,14 @@ def _onchange_location_id(self): # Otherwise the Stock Location of the Warehouse self.location_id = self.warehouse_id.lot_stock_id.id + @api.onchange('warehouse_id') + def _onchange_warehouse_id(self): + if self.direction: + self.direction = False + for stock_request in self.stock_request_ids: + if stock_request.route_id: + stock_request.route_id = False + def change_childs(self): super().change_childs() if not self._context.get("no_change_childs", False): From 48599ad628b4533ea342294506481104bb37597b Mon Sep 17 00:00:00 2001 From: Patrick Wilson <36892066+patrickrwilson@users.noreply.github.com> Date: Wed, 1 Apr 2020 16:43:24 -0500 Subject: [PATCH 10/25] [IMP] Add warehouse_id to existing onchange. --- stock_request_direction/models/stock_request_order.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/stock_request_direction/models/stock_request_order.py b/stock_request_direction/models/stock_request_order.py index f1b970180..3e5cd274b 100644 --- a/stock_request_direction/models/stock_request_order.py +++ b/stock_request_direction/models/stock_request_order.py @@ -14,7 +14,7 @@ class StockRequestOrder(models.Model): readonly=True, ) - @api.onchange("direction") + @api.onchange("warehouse_id", "direction") def _onchange_location_id(self): if self.direction == "outbound": # Stock Location set to Partner Locations/Customers @@ -22,11 +22,6 @@ def _onchange_location_id(self): else: # Otherwise the Stock Location of the Warehouse self.location_id = self.warehouse_id.lot_stock_id.id - - @api.onchange('warehouse_id') - def _onchange_warehouse_id(self): - if self.direction: - self.direction = False for stock_request in self.stock_request_ids: if stock_request.route_id: stock_request.route_id = False From d2e108396d526a156e7573ee37a11ead7f1e9a4b Mon Sep 17 00:00:00 2001 From: Patrick Wilson <36892066+patrickrwilson@users.noreply.github.com> Date: Thu, 16 Apr 2020 16:00:51 -0500 Subject: [PATCH 11/25] [FIX] Conflict with stock_request onchange method The onchange method in the stock_request module is no longer needed so this overrides that to do nothing. --- stock_request_direction/models/stock_request_order.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stock_request_direction/models/stock_request_order.py b/stock_request_direction/models/stock_request_order.py index 3e5cd274b..10e545451 100644 --- a/stock_request_direction/models/stock_request_order.py +++ b/stock_request_direction/models/stock_request_order.py @@ -26,6 +26,11 @@ def _onchange_location_id(self): if stock_request.route_id: stock_request.route_id = False + @api.onchange('warehouse_id') + def onchange_warehouse_id(self): + # Onchange no longer needed + pass + def change_childs(self): super().change_childs() if not self._context.get("no_change_childs", False): From 6ea58969c4cc367552dc737b91cdb868eec792ce Mon Sep 17 00:00:00 2001 From: Kitti U Date: Thu, 15 Apr 2021 22:46:23 +0700 Subject: [PATCH 12/25] [FIX] stock.request's location_id conflict with stock.request.order's --- stock_request_direction/models/stock_request.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stock_request_direction/models/stock_request.py b/stock_request_direction/models/stock_request.py index 03a0611ed..8c150edb5 100644 --- a/stock_request_direction/models/stock_request.py +++ b/stock_request_direction/models/stock_request.py @@ -17,8 +17,8 @@ class StockRequest(models.Model): @api.onchange("direction") def _onchange_location_id(self): if self.direction == "outbound": - # Partner Locations/Customers - self.location_id = self.env.ref("stock.stock_location_customers") + # Stock Location set to Partner Locations/Customers + self.location_id = self.company_id.partner_id.property_stock_customer.id else: # Otherwise the Stock Location of the Warehouse self.location_id = self.warehouse_id.lot_stock_id.id From 219ddf46bb912ab47b24ad226c0fa6d95d893c17 Mon Sep 17 00:00:00 2001 From: Kitti U Date: Thu, 15 Apr 2021 22:52:27 +0700 Subject: [PATCH 13/25] pre-commit fix --- stock_request_direction/models/stock_request_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_request_direction/models/stock_request_order.py b/stock_request_direction/models/stock_request_order.py index 10e545451..e794e6058 100644 --- a/stock_request_direction/models/stock_request_order.py +++ b/stock_request_direction/models/stock_request_order.py @@ -26,7 +26,7 @@ def _onchange_location_id(self): if stock_request.route_id: stock_request.route_id = False - @api.onchange('warehouse_id') + @api.onchange("warehouse_id") def onchange_warehouse_id(self): # Onchange no longer needed pass From bb641cf69d8f5d5e9a746f5c7f03872f2fccd7ac Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 19 Apr 2021 04:40:24 +0000 Subject: [PATCH 14/25] stock_request_direction 13.0.1.0.1 --- stock_request_direction/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_request_direction/__manifest__.py b/stock_request_direction/__manifest__.py index 0b6c8acb6..c8d76cec4 100644 --- a/stock_request_direction/__manifest__.py +++ b/stock_request_direction/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Stock Requests Direction", "summary": "From or to your warehouse?", - "version": "13.0.1.0.0", + "version": "13.0.1.0.1", "license": "LGPL-3", "website": "https://github.com/OCA/stock-logistics-warehouse", "author": "Open Source Integrators, Odoo Community Association (OCA)", From 90e255d37ed24c5f0bbe5ac3273ea046ee36001f Mon Sep 17 00:00:00 2001 From: Kitti U Date: Mon, 19 Apr 2021 15:34:00 +0700 Subject: [PATCH 15/25] [MIG] stock_request_direction --- stock_request_direction/README.rst | 12 +- stock_request_direction/__manifest__.py | 2 +- .../readme/CONTRIBUTORS.rst | 2 + .../static/description/index.html | 10 +- stock_request_direction/tests/__init__.py | 1 + .../tests/test_stock_request_direction.py | 125 ++++++++++++++++++ 6 files changed, 142 insertions(+), 10 deletions(-) create mode 100644 stock_request_direction/tests/__init__.py create mode 100644 stock_request_direction/tests/test_stock_request_direction.py diff --git a/stock_request_direction/README.rst b/stock_request_direction/README.rst index d67384896..64a721b66 100644 --- a/stock_request_direction/README.rst +++ b/stock_request_direction/README.rst @@ -14,13 +14,13 @@ Stock Requests Direction :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-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/13.0/stock_request_direction + :target: https://github.com/OCA/stock-logistics-warehouse/tree/14.0/stock_request_direction :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-13-0/stock-logistics-warehouse-13-0-stock_request_direction + :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-14-0/stock-logistics-warehouse-14-0-stock_request_direction :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/13.0 + :target: https://runbot.odoo-community.org/runbot/153/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -63,7 +63,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. @@ -82,10 +82,12 @@ Contributors * Maxime Chambreuil * Steve Campbell + * Freni Patel * `Ecosoft `__: * Pimolnat Suntian + * Kitti U. Maintainers ~~~~~~~~~~~ @@ -108,6 +110,6 @@ Current `maintainer `__: |maintainer-max3903| -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_request_direction/__manifest__.py b/stock_request_direction/__manifest__.py index c8d76cec4..a6688a1f9 100644 --- a/stock_request_direction/__manifest__.py +++ b/stock_request_direction/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Stock Requests Direction", "summary": "From or to your warehouse?", - "version": "13.0.1.0.1", + "version": "14.0.1.0.0", "license": "LGPL-3", "website": "https://github.com/OCA/stock-logistics-warehouse", "author": "Open Source Integrators, Odoo Community Association (OCA)", diff --git a/stock_request_direction/readme/CONTRIBUTORS.rst b/stock_request_direction/readme/CONTRIBUTORS.rst index d4f610216..d4744da00 100644 --- a/stock_request_direction/readme/CONTRIBUTORS.rst +++ b/stock_request_direction/readme/CONTRIBUTORS.rst @@ -2,7 +2,9 @@ * Maxime Chambreuil * Steve Campbell + * Freni Patel * `Ecosoft `__: * Pimolnat Suntian + * Kitti U. diff --git a/stock_request_direction/static/description/index.html b/stock_request_direction/static/description/index.html index 7844d1b60..89fcb1dc2 100644 --- a/stock_request_direction/static/description/index.html +++ b/stock_request_direction/static/description/index.html @@ -3,7 +3,7 @@ - + Stock Requests Direction