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

[16.0][MIG] fleet vehicle purchase : Migration to 16.0 #155

Open
wants to merge 14 commits into
base: 16.0
Choose a base branch
from

Conversation

lmarion-source
Copy link

No description provided.

fleet_vehicle_purchase/models/fleet_vehicle.py Outdated Show resolved Hide resolved
fleet_vehicle_purchase/models/purchase_order.py Outdated Show resolved Hide resolved
@api.depends("fleet_vehicle_from_po")
def _compute_fleet_vehicle_id(self):
for rec in self:
if rec.fleet_vehicle_from_po:

Choose a reason for hiding this comment

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

I don't understand this boolean field. It sets to True when the order is related to a fleet vehicle. So this if section will always be True in this case.
So when the order is not related to a fleet vehicle, it'll fill the fleet_vehicle_id is an empty recordset (and that's also the expected behavior).

Copy link
Author

Choose a reason for hiding this comment

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

This is to cover a practical case where we want to order pieces for several fleet vehicle in one PO:

  • If we put the vehicle on the PO, it will be propagate on all purchase order lines and the vehicle will be readonly in the view. In this case the PO is for one vehicle.
  • If we don't put the vehicle on the PO, we can order pieces for different vehicles in one PO, changing the vehicle on each line. This allows a big customer to order pieces for more than one vehicle in one PO.

@lmarion-source lmarion-source force-pushed the 16.0-mig-fleet_vehicle_purchase branch 2 times, most recently from ad097ce to ed9dae2 Compare October 16, 2024 05:38
   Initially, there was only one vehicle for one PO.
   Now, if the vehicle is set on the PO, all the PO lines are related to this vehicle
   But if the vehicle is not set on the PO, the user can decide to have different vehicles on every line.
   Use case is a grouped purchase of several items for several vehicles.
@ivantodorovich
Copy link

/ocabot migration fleet_vehicle_purchase

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Oct 28, 2024
@OCA-git-bot OCA-git-bot mentioned this pull request Oct 28, 2024
12 tasks
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.

8 participants