diff --git a/stock_user_default_warehouse_mrp/README.rst b/stock_user_default_warehouse_mrp/README.rst new file mode 100644 index 0000000..d9ade5f --- /dev/null +++ b/stock_user_default_warehouse_mrp/README.rst @@ -0,0 +1,58 @@ +=============================== +Default Warehouse on User (MRP) +=============================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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-akretion%2Fodoo--usability-lightgray.png?logo=github + :target: https://github.com/akretion/odoo-usability/tree/12.0/stock_user_default_warehouse_mrp + :alt: akretion/odoo-usability + +|badge1| |badge2| |badge3| + +The default warehouse configured in the preferences of the user will be used by default on manufacturing orders. + +**Table of contents** + +.. 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Akretion + +Contributors +~~~~~~~~~~~~ + +* Alexis de Lattre +* Daniel Luque + +Maintainers +~~~~~~~~~~~ + +This module is part of the `akretion/odoo-usability `_ project on GitHub. + +You are welcome to contribute. diff --git a/stock_user_default_warehouse_mrp/__init__.py b/stock_user_default_warehouse_mrp/__init__.py new file mode 100644 index 0000000..20e273f --- /dev/null +++ b/stock_user_default_warehouse_mrp/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2018 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/stock_user_default_warehouse_mrp/__manifest__.py b/stock_user_default_warehouse_mrp/__manifest__.py new file mode 100644 index 0000000..8365631 --- /dev/null +++ b/stock_user_default_warehouse_mrp/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2018 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Default Warehouse on User (MRP)', + 'version': '12.0.1.0.0', + 'category': 'Manufacturing', + 'license': 'AGPL-3', + 'summary': "Use the users's default warehouse on manufacturing orders", + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'depends': ['mrp', 'stock_user_default_warehouse_base'], + 'installable': True, +} diff --git a/stock_user_default_warehouse_mrp/models/__init__.py b/stock_user_default_warehouse_mrp/models/__init__.py new file mode 100644 index 0000000..bc81ecf --- /dev/null +++ b/stock_user_default_warehouse_mrp/models/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2018 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import mrp diff --git a/stock_user_default_warehouse_mrp/models/mrp.py b/stock_user_default_warehouse_mrp/models/mrp.py new file mode 100644 index 0000000..0c859bf --- /dev/null +++ b/stock_user_default_warehouse_mrp/models/mrp.py @@ -0,0 +1,19 @@ +# Copyright 2018 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, fields, api + + +class MrpProduction(models.Model): + _inherit = 'mrp.production' + + @api.model + def _default_pref_picking_type(self): + manu_type = self.env.user.context_default_warehouse_id.manu_type_id + return manu_type.id if manu_type else self._get_default_picking_type() + + # No need to inherit the default value of location_src_id and + # location_dest_id because it is immediately over-ridden + # by the onchange of picking_type_id + picking_type_id = fields.Many2one(default=_default_pref_picking_type) diff --git a/stock_user_default_warehouse_mrp/readme/CONTRIBUTORS.rst b/stock_user_default_warehouse_mrp/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..aa552d7 --- /dev/null +++ b/stock_user_default_warehouse_mrp/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Alexis de Lattre +* Daniel Luque diff --git a/stock_user_default_warehouse_mrp/readme/DESCRIPTION.rst b/stock_user_default_warehouse_mrp/readme/DESCRIPTION.rst new file mode 100644 index 0000000..051d269 --- /dev/null +++ b/stock_user_default_warehouse_mrp/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +The default warehouse configured in the preferences of the user will be used by default on manufacturing orders. diff --git a/stock_user_default_warehouse_mrp/static/description/icon.png b/stock_user_default_warehouse_mrp/static/description/icon.png new file mode 100644 index 0000000..c91da79 Binary files /dev/null and b/stock_user_default_warehouse_mrp/static/description/icon.png differ diff --git a/stock_user_default_warehouse_mrp/static/description/index.html b/stock_user_default_warehouse_mrp/static/description/index.html new file mode 100644 index 0000000..01c8a9e --- /dev/null +++ b/stock_user_default_warehouse_mrp/static/description/index.html @@ -0,0 +1,415 @@ + + + + + + +Default Warehouse on User (MRP) + + + +
+

Default Warehouse on User (MRP)

+ + +

Beta License: AGPL-3 akretion/odoo-usability

+

The default warehouse configured in the preferences of the user will be used by default on manufacturing orders.

+

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

+
    +
  • Akretion
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the akretion/odoo-usability project on GitHub.

+

You are welcome to contribute.

+
+
+
+ +