diff --git a/stock_change_qty_reason/README.rst b/stock_change_qty_reason/README.rst index 604e892a0..0c4321864 100644 --- a/stock_change_qty_reason/README.rst +++ b/stock_change_qty_reason/README.rst @@ -1,59 +1,76 @@ -.. 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 Change Quantity Reason ============================ +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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_change_qty_reason + :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_change_qty_reason + :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| |badge5| + This module extends the product stock management and allows to set a reason in the wizard when changing the product quantity. -Installation -============ +**Table of contents** -To install this module, simply click on the installation button - -Usage -===== - -.. 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 +.. contents:: + :local: 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 -`here `_. +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 ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* ACSONE SA/NV Contributors ------------- +~~~~~~~~~~~~ * Denis Roussel * Meyomesse Gilles +* Andreas Dian S.P -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +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_change_qty_reason/__init__.py b/stock_change_qty_reason/__init__.py index 2eb723313..4d7a49b5e 100644 --- a/stock_change_qty_reason/__init__.py +++ b/stock_change_qty_reason/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models diff --git a/stock_change_qty_reason/__manifest__.py b/stock_change_qty_reason/__manifest__.py index fb13405d0..0d7b9370b 100644 --- a/stock_change_qty_reason/__manifest__.py +++ b/stock_change_qty_reason/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2017 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { @@ -8,7 +7,7 @@ 'author': 'ACSONE SA/NV, Odoo Community Association (OCA)', 'website': "http://acsone.eu", 'category': 'Warehouse Management', - 'version': '10.0.1.0.0', + 'version': '11.0.1.0.0', 'license': 'AGPL-3', 'depends': [ 'stock', diff --git a/stock_change_qty_reason/models/__init__.py b/stock_change_qty_reason/models/__init__.py index 351afa051..da871d39e 100644 --- a/stock_change_qty_reason/models/__init__.py +++ b/stock_change_qty_reason/models/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import stock_inventory_line diff --git a/stock_change_qty_reason/models/stock_inventory_line.py b/stock_change_qty_reason/models/stock_inventory_line.py index 2d996412f..1e88c69f5 100644 --- a/stock_change_qty_reason/models/stock_inventory_line.py +++ b/stock_change_qty_reason/models/stock_inventory_line.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2017 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -6,11 +5,13 @@ from odoo import models class StockInventoryLine(models.Model): + """Class to inherit model stock.inventory.line""" _inherit = "stock.inventory.line" - def _get_move_values(self, qty, location_id, location_dest_id): + def _get_move_values(self, qty, location_id, location_dest_id, out): + """Function to super _get_move_value""" res = super(StockInventoryLine, self)._get_move_values( - qty, location_id, location_dest_id) + qty, location_id, location_dest_id, out) if res.get('origin'): res['origin'] = ' ,'.join( [res.get('origin'), diff --git a/stock_change_qty_reason/readme/CONTRIBUTORS.rst b/stock_change_qty_reason/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..264e42ade --- /dev/null +++ b/stock_change_qty_reason/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Denis Roussel +* Meyomesse Gilles +* Andreas Dian S.P diff --git a/stock_change_qty_reason/readme/DESCRIPTION.rst b/stock_change_qty_reason/readme/DESCRIPTION.rst new file mode 100644 index 000000000..bcaa884ca --- /dev/null +++ b/stock_change_qty_reason/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module extends the product stock management and allows to set a reason +in the wizard when changing the product quantity. diff --git a/stock_change_qty_reason/static/description/index.html b/stock_change_qty_reason/static/description/index.html new file mode 100644 index 000000000..e8f958847 --- /dev/null +++ b/stock_change_qty_reason/static/description/index.html @@ -0,0 +1,422 @@ + + + + + + +Stock Change Quantity Reason + + + +
+

Stock Change Quantity Reason

+ + +

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

+

This module extends the product stock management and allows to set a reason +in the wizard when changing the product quantity.

+

Table of contents

+ +
+

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

+
    +
  • ACSONE SA/NV
  • +
+
+
+

Contributors

+ +
+
+

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.

+

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_change_qty_reason/tests/__init__.py b/stock_change_qty_reason/tests/__init__.py index 955016f34..89d40acc0 100644 --- a/stock_change_qty_reason/tests/__init__.py +++ b/stock_change_qty_reason/tests/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/license from . import test_stock_change_qty_reason diff --git a/stock_change_qty_reason/tests/test_stock_change_qty_reason.py b/stock_change_qty_reason/tests/test_stock_change_qty_reason.py index 2b3ffc036..b434c527c 100644 --- a/stock_change_qty_reason/tests/test_stock_change_qty_reason.py +++ b/stock_change_qty_reason/tests/test_stock_change_qty_reason.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# pylint: disable=import-error,protected-access,too-few-public-methods # Copyright 2016-2017 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -23,7 +23,8 @@ class TestStockQuantityChangeReason(SavepointCase): def _create_product(self, name): return self.product_product_model.create({ 'name': name, - 'categ_id': self.category.id}) + 'categ_id': self.category.id, + 'type': 'product'}) def _product_change_qty(self, product, new_qty, reason): wizard = self.wizard_model.create({'product_id': product.id, diff --git a/stock_change_qty_reason/wizard/__init__.py b/stock_change_qty_reason/wizard/__init__.py index d641ab993..4462a6cc7 100644 --- a/stock_change_qty_reason/wizard/__init__.py +++ b/stock_change_qty_reason/wizard/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/license from . import stock_change_product_qty diff --git a/stock_change_qty_reason/wizard/stock_change_product_qty.py b/stock_change_qty_reason/wizard/stock_change_product_qty.py index 01ce26c7b..bc1aa21d5 100644 --- a/stock_change_qty_reason/wizard/stock_change_product_qty.py +++ b/stock_change_qty_reason/wizard/stock_change_product_qty.py @@ -1,11 +1,13 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2017 ACSONE SA/NV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +"""stock_change_product_qty""" + from odoo import models, fields, api class StockChangeProductQty(models.TransientModel): + """Class to inherit model stock.change.product.qty""" _inherit = 'stock.change.product.qty' reason = fields.Char('Reason', @@ -14,6 +16,7 @@ class StockChangeProductQty(models.TransientModel): @api.multi def change_product_qty(self): + """Function to super change_product_qty""" if self.reason: this = self.with_context(change_quantity_reason=self.reason) return super(StockChangeProductQty, this).change_product_qty() diff --git a/stock_change_qty_reason/wizard/stock_product_change_qty.xml b/stock_change_qty_reason/wizard/stock_product_change_qty.xml index 4ba0ddd1a..b5160715d 100644 --- a/stock_change_qty_reason/wizard/stock_product_change_qty.xml +++ b/stock_change_qty_reason/wizard/stock_product_change_qty.xml @@ -1,4 +1,3 @@ -