From 030bccf6660dfe3148aa5b84f6763ed2cc038915 Mon Sep 17 00:00:00 2001 From: hveficent Date: Mon, 22 Oct 2018 17:05:38 +0200 Subject: [PATCH] [MIG] purchase_request_department: Migration to 11.0 --- oca_dependencies.txt | 2 + purchase_request_department/README.rst | 77 +++- purchase_request_department/__init__.py | 4 - purchase_request_department/__manifest__.py | 5 +- purchase_request_department/hooks.py | 3 +- .../models/__init__.py | 4 - .../models/purchase_request.py | 12 +- .../readme/CONTRIBUTORS.rst | 2 + .../readme/CREDITS.rst | 5 + .../readme/DESCRIPTION.rst | 2 + purchase_request_department/readme/USAGE.rst | 2 + .../static/description/index.html | 411 ++++++++++++++++++ purchase_request_department/tests/__init__.py | 4 - .../tests/test_purchase_request_department.py | 1 - 14 files changed, 488 insertions(+), 46 deletions(-) create mode 100644 purchase_request_department/readme/CONTRIBUTORS.rst create mode 100644 purchase_request_department/readme/CREDITS.rst create mode 100644 purchase_request_department/readme/DESCRIPTION.rst create mode 100644 purchase_request_department/readme/USAGE.rst create mode 100644 purchase_request_department/static/description/index.html diff --git a/oca_dependencies.txt b/oca_dependencies.txt index 9c8c9172cc9..c237ec14b13 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -1 +1,3 @@ server-tools +hr +purchase-workflow https://github.com/Eficent/purchase-workflow.git 11.0-mig-purchase_request diff --git a/purchase_request_department/README.rst b/purchase_request_department/README.rst index 37fce87c3c7..23e2c9282ec 100644 --- a/purchase_request_department/README.rst +++ b/purchase_request_department/README.rst @@ -1,53 +1,90 @@ -.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg - :alt: License LGPL-3 - =========================== Purchase Request Department =========================== +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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%2Fpurchase--workflow-lightgray.png?logo=github + :target: https://github.com/OCA/purchase-workflow/tree/11.0/purchase_request_department + :alt: OCA/purchase-workflow +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/purchase-workflow-11-0/purchase-workflow-11-0-purchase_request_department + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/142/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + This module adds the user department in a new field in the purchase request form and allows to group by department on the tree view. +**Table of contents** + +.. contents:: + :local: + Usage ===== When editing the 'purchase request' form and choosing the 'requested_by' field the requester's department will be automatically set. -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/142/10.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 smashing it by providing a 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. Credits ======= +Authors +~~~~~~~ + +* Eficent + Contributors ------------- +~~~~~~~~~~~~ * Gisela Mora Comas +* Héctor Villarreal -Maintainer ----------- +Other credits +~~~~~~~~~~~~~ -.. image:: http://odoo-community.org/logo.png - :alt: Odoo Community Association - :target: http://odoo-community.org +The development of this module has been financially supported by: + +.. image:: https://upload.wikimedia.org/wikipedia/en/3/3b/Aleph_Objects_Logo.png + :alt: Aleph Objects, Inc + :target: https://www.alephobjects.com + +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. -To contribute to this module, please visit http://odoo-community.org. +This module is part of the `OCA/purchase-workflow `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/purchase_request_department/__init__.py b/purchase_request_department/__init__.py index dfe6fd46a49..cc6b6354ad8 100644 --- a/purchase_request_department/__init__.py +++ b/purchase_request_department/__init__.py @@ -1,6 +1,2 @@ -# -*- coding: utf-8 -*- -# Copyright 2017 Eficent Business and IT Consulting Services S.L. -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0). - from . import models from .hooks import post_init_hook diff --git a/purchase_request_department/__manifest__.py b/purchase_request_department/__manifest__.py index 23b9af599de..da49165a698 100644 --- a/purchase_request_department/__manifest__.py +++ b/purchase_request_department/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0). @@ -6,7 +5,8 @@ "name": "Purchase Request Department", "author": "Eficent, " "Odoo Community Association (OCA)", - "version": "10.0.1.0.0", + "version": "11.0.1.0.0", + "website": "https://github.com/OCA/purchase-workflow", "category": "Purchase Management", "post_init_hook": "post_init_hook", "depends": [ @@ -16,7 +16,6 @@ "data": [ "views/purchase_request_department_view.xml" ], - 'demo': [], "license": 'LGPL-3', "installable": True } diff --git a/purchase_request_department/hooks.py b/purchase_request_department/hooks.py index 9092b806c13..43423fcde66 100644 --- a/purchase_request_department/hooks.py +++ b/purchase_request_department/hooks.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0). -from openerp import api, SUPERUSER_ID +from odoo import api, SUPERUSER_ID import logging _logger = logging.getLogger(__name__) diff --git a/purchase_request_department/models/__init__.py b/purchase_request_department/models/__init__.py index 1e8d7b4e7e4..91be581c56a 100644 --- a/purchase_request_department/models/__init__.py +++ b/purchase_request_department/models/__init__.py @@ -1,5 +1 @@ -# -*- coding: utf-8 -*- -# Copyright 2017 Eficent Business and IT Consulting Services S.L. -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0). - from . import purchase_request diff --git a/purchase_request_department/models/purchase_request.py b/purchase_request_department/models/purchase_request.py index 667450b8a69..561167c06a9 100644 --- a/purchase_request_department/models/purchase_request.py +++ b/purchase_request_department/models/purchase_request.py @@ -1,7 +1,5 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0). - from odoo import api, fields, models @@ -10,7 +8,6 @@ class PurchaseRequest(models.Model): def _get_my_department(self): employees = self.env.user.employee_ids - return (employees[0].department_id if employees else self.env['hr.department']) @@ -27,8 +24,7 @@ def onchange_requested_by(self): class PurchaseRequestLine(models.Model): _inherit = 'purchase.request.line' - department_id = fields.Many2one( - comodel_name='hr.department', - related='request_id.department_id', - store=True, - string='Department', readonly=True) + department_id = fields.Many2one(comodel_name='hr.department', + related='request_id.department_id', + store=True, + string='Department', readonly=True) diff --git a/purchase_request_department/readme/CONTRIBUTORS.rst b/purchase_request_department/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..b66a241db1d --- /dev/null +++ b/purchase_request_department/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Gisela Mora Comas +* Héctor Villarreal diff --git a/purchase_request_department/readme/CREDITS.rst b/purchase_request_department/readme/CREDITS.rst new file mode 100644 index 00000000000..f34fe3d80f0 --- /dev/null +++ b/purchase_request_department/readme/CREDITS.rst @@ -0,0 +1,5 @@ +The development of this module has been financially supported by: + +.. image:: https://upload.wikimedia.org/wikipedia/en/3/3b/Aleph_Objects_Logo.png + :alt: Aleph Objects, Inc + :target: https://www.alephobjects.com diff --git a/purchase_request_department/readme/DESCRIPTION.rst b/purchase_request_department/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..b29a1a9b8fc --- /dev/null +++ b/purchase_request_department/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module adds the user department in a new field in the purchase request +form and allows to group by department on the tree view. diff --git a/purchase_request_department/readme/USAGE.rst b/purchase_request_department/readme/USAGE.rst new file mode 100644 index 00000000000..bb336ab0593 --- /dev/null +++ b/purchase_request_department/readme/USAGE.rst @@ -0,0 +1,2 @@ +When editing the 'purchase request' form and choosing the 'requested_by' field +the requester's department will be automatically set. diff --git a/purchase_request_department/static/description/index.html b/purchase_request_department/static/description/index.html new file mode 100644 index 00000000000..2f7927ac774 --- /dev/null +++ b/purchase_request_department/static/description/index.html @@ -0,0 +1,411 @@ + + + + + + +Purchase Request Department + + + +
+

Purchase Request Department

+ + +

Beta License: LGPL-3 OCA/purchase-workflow Translate me on Weblate Try me on Runbot

+

This module adds the user department in a new field in the purchase request +form and allows to group by department on the tree view.

+

Table of contents

+ +
+

Usage

+

When editing the ‘purchase request’ form and choosing the ‘requested_by’ field +the requester’s department will be automatically set.

+
+
+

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

+
    +
  • Eficent
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The development of this module has been financially supported by:

+Aleph Objects, Inc +
+
+

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/purchase-workflow project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/purchase_request_department/tests/__init__.py b/purchase_request_department/tests/__init__.py index 20281d7c955..5a1f0d6204b 100644 --- a/purchase_request_department/tests/__init__.py +++ b/purchase_request_department/tests/__init__.py @@ -1,5 +1 @@ -# -*- coding: utf-8 -*- -# Copyright 2017 Eficent Business and IT Consulting Services S.L. -# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0). - from . import test_purchase_request_department diff --git a/purchase_request_department/tests/test_purchase_request_department.py b/purchase_request_department/tests/test_purchase_request_department.py index ad6fe156499..c7958af0dd4 100644 --- a/purchase_request_department/tests/test_purchase_request_department.py +++ b/purchase_request_department/tests/test_purchase_request_department.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0).