Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] stock_manual_transfer: Migration to 18.0 T#88384 #1692

Open
wants to merge 16 commits into
base: 18.0
Choose a base branch
from

Conversation

rolandojduartem
Copy link
Contributor

@rolandojduartem rolandojduartem commented Feb 27, 2025

Changelog:

  • Bump version to 18.0.1.0.0
  • Use location_final_id instead of location_dest_id because are not
    getting the values from stock rules but operation type, and location
    in the rule are saved on location_final_id [1]
  • Add Internal Manual Transfer menu to respect the style of the current
    Operation menu of Inventory
  • Add path to action to show a meaningful url
    (/odoo/stock_manual_transfer)
  • General changes of this version (tree to list, chatter block, use
    self.env._, remove no needed invisible field)
  • Update translations and documentation

References:

Alejandro Garza and others added 15 commits February 26, 2025 23:40
- New module added in order to allow the user to create stock transfers
  manually.
Due to upstream updates adding support for @api.ondelete and
pre-commit-vauxoo detecting the override of .unlink() method as
a code smell, this transforms the old logic into more
idiomatic odoo code.
…inal commit

While the original fix (Vauxoo@cbd70ff)
did fix the immediate lint messages, we didn't actually stop it from
calling super().unlink(), thus it didn't actually fix what it intended
to fix. Here we remove that call to super().unlink() so the issue is
properly fixed.
Add domain to route_id field to show the only the routes that are
supplied_wh_id = warehouse_id. This is to avoid
inconsistencies between the rule and the warehouse.
To prevent any potential duplication, this fix introduces a
return-early pattern. Now, transfers are not created if the manual
transfer record has already been published.

Issue reported on helpdesk ticket #25879
- Changed name for deprecated models like stock.location.route to
  stock.route and stock move to Operations(stock.move.line) to Stock
  Moves.
- Added user to group uom to fix unit tests and avoid error for not
  null violation in product uom.
…ithout group

A validation error is raised when a user without the "Manage Multiple
Units of Measure" access tries to save or validate a manual transfer.

This fix allows any user to create manual transfers, but only users with
"Units of Measure" access can modify this attribute on the lines.
Renamed the model 'stock.manual_transfer_line' to
'stock.manual_transfer.line' for consistency with previous
versions of this model.
- Update use of quantity as part of [1].
- Simplify the way to define modifiers as states, required, readonly,
  invisible and column_invisible as part of [2].
- Fix tests.

[1] odoo/odoo#137864
[2] odoo/odoo#104741
…sfers

Set the default value of the 'warehouse_id' field on the
'stock.manual_transfer' model to the default warehouse of the company.
… group

By default, it is recommended that the admin and root users have
all permissions due to their roles and to facilitate functional testing.
The name shouldn't be present in the vals list when creating a record
and this commit fixes that by making it readonly instead of force_save
which lead to the same functional behaviour but without adding the field
to the vals list.
Rename group's external ID, from:
`group_stock_manual_transferp` → `group_user`
to follow usual naming conventions.

The reason for the old name is first implementation of this was not as
a standalone module.

In addition, IDs and names of model access rights are also modified to
follow conventions.
Since now only routes matching the selected warehouse are displayed [1],
the demo route should have the supplied warehouse set to be selectable.

[1]: 62ec4c4
The fields for `warehouses_selectable` and `manual_transfers_selectable`
were placed on a single line. There was no clarity on what they represented,
as they were just two checkboxes without the appropriate labels.

Therefore, `manual_transfers_selectable` was placed on its own line.
@rolandojduartem rolandojduartem changed the title [MIG] stock_manual_transfer: Migration to 18.0 T#88384 Draft: [MIG] stock_manual_transfer: Migration to 18.0 T#88384 Feb 27, 2025
Changelog:
- Bump version to 18.0.1.0.0
- Use location_final_id instead of location_dest_id because are not
  getting the values from stock rules but operation type, and location
  in the rule are saved on location_final_id [1]
- Add Internal Manual Transfer menu to respect the style of the current
  Operation menu of Inventory
- Add path to action to show a meaningful url
  (/odoo/stock_manual_transfer)
- General changes of this version (tree to list, chatter block, use
  self.env._, remove no needed invisible field)
- Update translations and documentation

References:
- [1] odoo/odoo@11e69870
@rolandojduartem rolandojduartem force-pushed the 18.0-stock_manual_transfer-mig-rolando branch from 79e7d51 to 5812c50 Compare February 27, 2025 20:55
@rolandojduartem rolandojduartem changed the title Draft: [MIG] stock_manual_transfer: Migration to 18.0 T#88384 [MIG] stock_manual_transfer: Migration to 18.0 T#88384 Feb 27, 2025
@rolandojduartem
Copy link
Contributor Author

@JulioSerna

@rolandojduartem
Copy link
Contributor Author

cc @desdelinux

@luisg123v luisg123v self-requested a review February 27, 2025 23:21
Copy link
Contributor

@luisg123v luisg123v left a comment

Choose a reason for hiding this comment

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

Please adjust references format. They should be:

[1]: https://...

So they're rendered correctly by markdown.

</field>
</record>

<record id="stock_manual_transfer_tree_view" model="ir.ui.view">
Copy link
Contributor

Choose a reason for hiding this comment

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

tree → list


<menuitem
id="menu_stock_manual_transfer"
name="Internal Manual Transfer"
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't it be in plural?

If so, please fix window action name. I think this is an issue comming from the previous version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not know, you tell me hahaha, so should it be fixed on the previous version?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes please, that was probably my bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants