Skip to content

[FW][IMP] hr_personal_equipment_stock: Enhance PPE view - #1643

Open
anusriNPS wants to merge 3 commits into
OCA:18.0from
PyTech-SRL:18-port-from-16-hr_personal_equipment_stock
Open

anusriNPS wants to merge 3 commits into
OCA:18.0from
PyTech-SRL:18-port-from-16-hr_personal_equipment_stock

Conversation

@anusriNPS

@anusriNPS anusriNPS commented Oct 30, 2026 •

Copy link
Copy Markdown

FW from 16.0 - #1497

Display serial number under "Personal Equipment" Tab in Personal Equipment request form view when Personal Equipment Request is in "Accepted" state.

  1. Introduced lot_ids as computed field which helps to update serial number even when pickings are duplicated.
  2. Corrected qty_delivered field to be uptodate based on stock availability in PPE location which helps to avoid wrong field updation when an allocation is returned from pickings or pickings are duplicated.

Introduced improvements based on comments in a seperate commit such as usage of common method for filtering moves and using quantity conversion while computing qty_delivered. Same has been backported in 16.0 as part of PR #1668

@OCA-git-bot OCA-git-bot added series:18.0 mod:hr_personal_equipment_stock Module hr_personal_equipment_stock labels Oct 30, 2026
@anusriNPS
anusriNPS marked this pull request as draft October 30, 2026 14:05
@anusriNPS anusriNPS changed the title [FW][IMP] hr_personal_equipment_stock: Port PR from 16.0 [FW][IMP] hr_personal_equipment_stock: Enhance PPE view Nov 4, 2026
@anusriNPS
anusriNPS force-pushed the 18-port-from-16-hr_personal_equipment_stock branch from a8dde6c to 2342555 Compare November 10, 2026 14:12
@anusriNPS
anusriNPS marked this pull request as ready for review November 10, 2026 14:28
@anusriNPS
anusriNPS force-pushed the 18-port-from-16-hr_personal_equipment_stock branch from 2342555 to 36f1dbc Compare November 10, 2026 14:40

@SirPyTech SirPyTech left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for porting this change, some of the comments are related to the porting itself, but others are new things I didn't notice in #1497: please create new commits for those so they can be easily backported if needed.

@anusriNPS
anusriNPS force-pushed the 18-port-from-16-hr_personal_equipment_stock branch 2 times, most recently from 28ce3ab to e970876 Compare November 12, 2026 14:53

@SirPyTech SirPyTech left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the changes 🙏
I think a few more edits are needed, and then we'll be good to go 🚀

@anusriNPS
anusriNPS force-pushed the 18-port-from-16-hr_personal_equipment_stock branch from e970876 to efe4ea6 Compare November 17, 2026 10:17

@SirPyTech SirPyTech left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The latest changes still need a little tweak in the depends, otherwise this looks good 👏🏻️

@anusriNPS
anusriNPS force-pushed the 18-port-from-16-hr_personal_equipment_stock branch from efe4ea6 to 93d5e8f Compare November 23, 2026 09:34

@SirPyTech SirPyTech left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Only code review, this looks good now, thanks!
Please resolve all the threads because I can't

@SirPyTech SirPyTech left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

While cross-checking this with #1497 I noticed we have missed a UoM conversion, please check

lot = move_line.lot_id
if lot not in qty_by_lot:
qty_by_lot[lot] = 0
moved_qty = move_line.quantity

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue: Please convert the quantity as mentioned in #1643 (comment).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, it was missed to use quantity conversion in lot_ids computation

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍🏻️

   Display serial number under "Personal Equipment" Tab
in Personal Equipment request form view when Personal
Equipment Request is in "Accepted" state.
   Using proper values for qty_delivered based on stock availability
when a picking associated with allocation is validated/returned/scrapped.
quantity conversion is also taken care while computing qty_delivered.
   Refactored computation method of qty_delivered and
lot_ids to use common methods for same logic.
@anusriNPS
anusriNPS force-pushed the 18-port-from-16-hr_personal_equipment_stock branch 2 times, most recently from df2d288 to 59f492f Compare November 24, 2026 16:59
@OCA-git-bot OCA-git-bot added mod:hr_employee_ppe Module hr_employee_ppe and removed mod:hr_personal_equipment_stock Module hr_personal_equipment_stock labels Nov 24, 2026
@anusriNPS
anusriNPS force-pushed the 18-port-from-16-hr_personal_equipment_stock branch from 59f492f to df2d288 Compare November 24, 2026 17:00
@OCA-git-bot OCA-git-bot added mod:hr_personal_equipment_stock Module hr_personal_equipment_stock and removed mod:hr_employee_ppe Module hr_employee_ppe labels Nov 24, 2026

@SirPyTech SirPyTech left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please fix the REF commit's title and description, if you want you can also add the test but it isn't required for approval on my side.
Also remember to resolve the older threads to cleanup the PR's comments because I can't.

lot = move_line.lot_id
if lot not in qty_by_lot:
qty_by_lot[lot] = 0
moved_qty = move_line.quantity

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍🏻️

Comment on lines +47 to +57
# Move lots needs to be verified
# for use case such as two
# allocations of same product used
# in same PPE request. If not, qty_delivered
# results in negative value when any one
# of the move is scrapped
and (
[lot for lot in move.lot_ids if lot in self.move_ids.lot_ids]
if self.move_ids.lot_ids
else True
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bonus: For a bonus point 🏆️ I know we already talked about this check and you explained it well in the added comment, but I just tried executing the tests without this piece of code and they are still passing.
Can you consider adding a test for this use case that fails without this piece of code?

for record in self:
record.skip_procurement = record._skip_procurement()

def _filter_allocation_moves(self):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

chore: The commit that extracts this method should be a [IMP] because we are changing the logic: we are no more using move_ids, please also adjust the commit's title and description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:hr_personal_equipment_stock Module hr_personal_equipment_stock series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants