Skip to content

Commit

Permalink
[MIG] purchase_request_department: Migration to 11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HviorForgeFlow committed Nov 8, 2018
1 parent 5a69763 commit 030bccf
Show file tree
Hide file tree
Showing 14 changed files with 488 additions and 46 deletions.
2 changes: 2 additions & 0 deletions oca_dependencies.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
server-tools
hr
purchase-workflow https://github.com/Eficent/purchase-workflow.git 11.0-mig-purchase_request
77 changes: 57 additions & 20 deletions purchase_request_department/README.rst
Original file line number Diff line number Diff line change
@@ -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
<https://github.com/OCA/purchase-workflow/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 <https://github.com/OCA/purchase-workflow/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 <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_request_department%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* Eficent

Contributors
------------
~~~~~~~~~~~~

* Gisela Mora Comas <[email protected]>
* Héctor Villarreal <[email protected]>

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 <https://github.com/OCA/purchase-workflow/tree/11.0/purchase_request_department>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 0 additions & 4 deletions purchase_request_department/__init__.py
Original file line number Diff line number Diff line change
@@ -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
5 changes: 2 additions & 3 deletions purchase_request_department/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# -*- 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).

{
"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": [
Expand All @@ -16,7 +16,6 @@
"data": [
"views/purchase_request_department_view.xml"
],
'demo': [],
"license": 'LGPL-3',
"installable": True
}
3 changes: 1 addition & 2 deletions purchase_request_department/hooks.py
Original file line number Diff line number Diff line change
@@ -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__)
Expand Down
4 changes: 0 additions & 4 deletions purchase_request_department/models/__init__.py
Original file line number Diff line number Diff line change
@@ -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
12 changes: 4 additions & 8 deletions purchase_request_department/models/purchase_request.py
Original file line number Diff line number Diff line change
@@ -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


Expand All @@ -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'])

Expand All @@ -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)
2 changes: 2 additions & 0 deletions purchase_request_department/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Gisela Mora Comas <[email protected]>
* Héctor Villarreal <[email protected]>
5 changes: 5 additions & 0 deletions purchase_request_department/readme/CREDITS.rst
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions purchase_request_department/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions purchase_request_department/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
When editing the 'purchase request' form and choosing the 'requested_by' field
the requester's department will be automatically set.
Loading

0 comments on commit 030bccf

Please sign in to comment.