Skip to content

[10.0] [ADD] purchase_requisition_operating_unit - #81

Closed
serpentcs-dev1 wants to merge 7 commits into
OCA:10.0from
serpentcs-dev1:10.0-purchase_requisition_operating_unit
Closed

serpentcs-dev1 wants to merge 7 commits into
OCA:10.0from
serpentcs-dev1:10.0-purchase_requisition_operating_unit

Conversation

@serpentcs-dev1

Copy link
Copy Markdown
Member

Purchase Requisition with Operating Units

This module introduces the following features:

  • Security rules are defined to ensure that users can only see the Purchase Requisition of that Operating Units in which they are allowed access to.

  • Ensures that Purchase Requisition and the Warehouse in picking type belongs to the same Operating Unit (OU) .

  • When the user creates a Purchase Order (PO) from the purchase requisition the operating unit is passed to that PO.

  • Sets default Picking type whoes Operating Unit (OU) in Warehouse matches to that of the User.

@nikul-serpentcs

Copy link
Copy Markdown
Member

@aheficent Please review code.

@AaronHForgeFlow AaronHForgeFlow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only code review

and rec.operating_unit_id and\
picking_type.warehouse_id.operating_unit_id !=\
rec.operating_unit_id:
raise UserError(_('Configuration error!\nThe Operating \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\n is not need, just close the quotes and open those again in the next line

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aheficent Removed '\n' and quotes open next line.
Please review code.

('warehouse_id.operating_unit_id', '=',
self.operating_unit_id.id)])
if types:
self.picking_type_id = types[:1]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you use the first?

@nikul-serpentcs nikul-serpentcs Jul 7, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aheficent
[:1] in find first record

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aheficent
Python slicing in find first value.

@serpentcs-dev1
serpentcs-dev1 force-pushed the 10.0-purchase_requisition_operating_unit branch from b387fe5 to 1196e55 Compare July 7, 2017 05:38
@serpentcs-dev1 serpentcs-dev1 changed the title 10.0 purchase requisition operating unit [10.0] [ADD] purchase_requisition_operating_unit Jul 7, 2017
"license": "LGPL-3",
"website": "http://www.eficent.com",
"category": "Purchase Management",
"depends": ["purchase_requisition",

@serpentcs-dev1 serpentcs-dev1 Jul 7, 2017

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aheficent Waiting for #368 to get merged.

I guess then we need to add purchase-workflow to the oca_dependencies, right?

Don't know though why the travis is already green now?!

@AaronHForgeFlow AaronHForgeFlow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM Thanks. Can you please squash the commits before this is merged?

@serpentcs-dev1
serpentcs-dev1 force-pushed the 10.0-purchase_requisition_operating_unit branch from ff35807 to d75f0e6 Compare August 19, 2017 07:51
@nikul-serpentcs

Copy link
Copy Markdown
Member

@aheficent squashed commits, Please check it.

for rec in self:
if rec.company_id and rec.operating_unit_id and \
rec.company_id != rec.operating_unit_id.company_id:
raise UserError(_('The Company in the Purchase Requisition and'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll be great if you include and assertRaises in the test for this one 🏅

@nikul-serpentcs

Copy link
Copy Markdown
Member

@aheficent included assertRaises in the test case, Please check it.

@AaronHForgeFlow AaronHForgeFlow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikul-serpentcs codecov covers 100% of the lines don't know why it's red

@serpentcs-dev1
serpentcs-dev1 force-pushed the 10.0-purchase_requisition_operating_unit branch from 0edc0b0 to c5264af Compare September 6, 2017 09:35
@nikul-serpentcs

nikul-serpentcs commented Sep 6, 2017

Copy link
Copy Markdown
Member

@aheficent Rebased branch and codecov is Happy.

andhit-r pushed a commit to open-synergy/operating-unit that referenced this pull request Oct 30, 2017
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
andhit-r pushed a commit to open-synergy/operating-unit that referenced this pull request Oct 30, 2017
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
andhit-r pushed a commit to open-synergy/operating-unit that referenced this pull request Oct 30, 2017
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
andhit-r pushed a commit to open-synergy/operating-unit that referenced this pull request Oct 30, 2017
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
andhit-r pushed a commit to open-synergy/operating-unit that referenced this pull request Oct 30, 2017
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
andhit-r pushed a commit to open-synergy/operating-unit that referenced this pull request Oct 30, 2017
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
and rec.operating_unit_id and\
picking_type.warehouse_id.operating_unit_id !=\
rec.operating_unit_id:
raise UserError(_('Configuration error! The Operating '

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you avoid exclamation marks in the error messages? People may feel bad when getting a message like this

if types:
self.picking_type_id = types[:1]
else:
raise UserError(_("No Warehouse found with the "

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

and rec.operating_unit_id and\
picking_type.warehouse_id.operating_unit_id !=\
rec.operating_unit_id:
raise UserError(_('Configuration error, The Operating '

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but the , should be a . @aheficent

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done @mreficent thanks

@AaronHForgeFlow
AaronHForgeFlow force-pushed the 10.0-purchase_requisition_operating_unit branch from 40e101b to 477a462 Compare June 27, 2018 12:10
@AaronHForgeFlow
AaronHForgeFlow force-pushed the 10.0-purchase_requisition_operating_unit branch from 477a462 to 1d7674a Compare June 29, 2018 08:12
JordiBForgeFlow added a commit that referenced this pull request Jul 18, 2018
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (#81)

* [FIX] travis
BT-rmartin referenced this pull request in brain-tec/operating-unit Mar 27, 2019
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (#81)

* [FIX] travis
OCA-git-bot pushed a commit that referenced this pull request Nov 25, 2019
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (#81)

* [FIX] travis
meigallodixital pushed a commit to meigallodixital/operating-unit that referenced this pull request Nov 28, 2019
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
@max3903 max3903 added this to the 10.0 milestone Dec 27, 2019
Saran440 pushed a commit to ecosoft-odoo/operating-unit that referenced this pull request Dec 10, 2020
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
Saran440 pushed a commit to ecosoft-odoo/operating-unit that referenced this pull request Dec 10, 2020
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
Saran440 pushed a commit to ecosoft-odoo/operating-unit that referenced this pull request Jun 5, 2021
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
Saran440 pushed a commit to ecosoft-odoo/operating-unit that referenced this pull request Jun 5, 2021
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
kittiu pushed a commit to ecosoft-odoo/operating-unit that referenced this pull request Jun 14, 2021
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
kittiu pushed a commit to ecosoft-odoo/operating-unit that referenced this pull request Aug 8, 2021
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
@github-actions

Copy link
Copy Markdown

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Oct 31, 2021
@github-actions github-actions Bot closed this Dec 5, 2021
kittiu pushed a commit to ecosoft-odoo/operating-unit that referenced this pull request Apr 29, 2022
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
kittiu pushed a commit to ecosoft-odoo/operating-unit that referenced this pull request Jun 1, 2022
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
BT-pcavero pushed a commit to BT-pcavero/operating-unit that referenced this pull request Aug 2, 2022
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
Saran440 pushed a commit to ecosoft-odoo/operating-unit that referenced this pull request Oct 28, 2022
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
alan196 pushed a commit to Jarsa/operating-unit that referenced this pull request Jan 25, 2023
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
Saran440 pushed a commit to ecosoft-odoo/operating-unit that referenced this pull request Jan 31, 2023
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
alan196 pushed a commit to Jarsa/operating-unit that referenced this pull request Feb 1, 2023
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
Saran440 pushed a commit to ecosoft-odoo/operating-unit that referenced this pull request Mar 16, 2023
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
Saran440 pushed a commit to ecosoft-odoo/operating-unit that referenced this pull request Sep 25, 2023
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
Borruso pushed a commit to Borruso/operating-unit that referenced this pull request Nov 9, 2023
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
ps-tubtim pushed a commit to ecosoft-odoo/operating-unit that referenced this pull request Jan 18, 2024
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
Borruso pushed a commit to Borruso/operating-unit that referenced this pull request Jan 31, 2024
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
Borruso pushed a commit to Borruso/operating-unit that referenced this pull request Jul 26, 2024
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
thewarat-tao pushed a commit to trinityroots/operating-unit that referenced this pull request May 28, 2025
[FIX] remove reference to warehouse

[ENH] purchase_request_operating_unit,
purchase_rquest_procurement_operating_unit

9.0 purchase request operating unit - fixed travis (OCA#81)

* [FIX] travis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants