[18.0][FIX] rma_sale_lot: Add domain to the lot_id field so that only the appropriate lots can be selected#554
Conversation
pedrobaeza
left a comment
There was a problem hiding this comment.
Not sure if the goal is to restrict it so much. @sbejaoui do you see any problem?
170118a to
5e7a027
Compare
| smls = rec.move_id.move_line_ids.filtered( | ||
| lambda x: x.state == "done" and x.lot_id | ||
| ) | ||
| domain = [("id", "in", smls.lot_id.ids)] | ||
| rec.lot_id_domain = domain |
There was a problem hiding this comment.
I agree with adding a domain, because before this commit, any lot could be selected, even lots that belong to other products, which is an error.
But I also think this domain can be too restrictive; I’m not sure, so I’ll wait for more opinions in this case.
There was a problem hiding this comment.
In the context of the RMA creation wizard from a sales order, in my opinion, you should only be able to select the lots that have been used and not others, don't you think?
5e7a027 to
0ceca50
Compare
|
When opening the wizard, the return lines are automatically populated based on the delivery information, so the lot is already preselected In our case, users rely on this mechanism to manage customer returns and rarely modify the proposed values But, if a user does change the suggested lot, it is likely for a good reason, and he knows what he is doing, in this context, applying a restrictive domain could be counterproductive A domain would be more relevant if the lot were not prefilled by the system, but that is not the case here If there is still a need to control this field for specific users, a better approach would be to make it read-only for a particular user group so they only change the returned qty by lot |
|
In my opinion, even though it doesn't happen often because it's self-selecting, allowing users to select a lot that hasn't been used is a mistake (right now, lots aren't even filtered by product). |
…ppropriate lots can be selected TT61559
0ceca50 to
f17649e
Compare
Add domain to the
lot_idfield so that only the appropriate lots can be selectedPlease @pedrobaeza and @carlos-lopez-tecnativa can you review it?
@Tecnativa TT61559