-
Notifications
You must be signed in to change notification settings - Fork 247
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
[8.0] Several improvements on stock_quant_packages_moving_wizard #1345
base: 8.0
Are you sure you want to change the base?
Conversation
Use reserved_quant_ids in stock.move instead of quant_ids Add prepare method for stock move creation and add origin field by default Use 'fields_list' instead of 'fields' argument in default_get to avoid confusion with "fields" from "from openerp import fields" Add visible button on form view of stock.quant and stock.quant.package Block selection of destination location = source location in wizard Rename 'Source Location' to 'Current Location' in wizard (and other string improvements) Use related field for source location instead of onchange Give access to button "move quant" on stock.quant even if not in group stock.group_tracking_lot (but keep it for the button on stock.quant.package) Display moved quants after execution of the stock.quants.move wizard
FYI, I still have to fix some access rights issue (works fine as admin, but not as regular user). I'm working on it. |
Fix missing source_loc field when the line of the wizard is generated by default_get()
The access right issue is fixed now (and another one, which was a late change...). So it should be really ready for review now. |
…hat booked the quant
|
||
@api.model | ||
def quants_get_prefered_domain( | ||
self, location, product, qty, domain=None, | ||
prefered_domain_list=None, restrict_lot_id=False, | ||
prefered_domain_list=[], restrict_lot_id=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexis-via I think this change is not allowed by pylint check
https://travis-ci.org/odoomrp/odoomrp-wip/jobs/198061670#L511
I don't remember but I think I did it that way because of that.
We are just patching an error on stock_quant_packages_moving_wizard. Here is the PR So I think we should also include @alexis-via test on module, ir order to see it doesn't fail now. |
vals = self._prepare_move_to(dest_location) | ||
new_move = self.env['stock.move'].create(vals) | ||
# No group has write access on stock.quant -> we need sudo() | ||
self.sudo().reservation_id = new_move |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line will do almost the same thing that is done in #1358
@alexis-via The fix has been merged, so please fetch and rebase in order to merge also the test. Thank you!! |
Add a test to show that the stock.quant.package.move wizard doesn't work ! => I don't know how to make it work, but at least this test is a demo that it fails !
Use reserved_quant_ids in stock.move instead of quant_ids (I think it's the right thing to do, but I'm not an expert)
Add prepare method for stock move creation and add origin field by default
Use 'fields_list' instead of 'fields' argument in default_get to avoid confusion with "fields" from "from openerp import fields"
Add visible button on form view of stock.quant and stock.quant.package
Block selection of destination location = source location in wizard
Rename 'Source Location' to 'Current Location' in wizard (and other string improvements)
Use related field for source location instead of onchange
Give access to button "move quant" on stock.quant even if not in group stock.group_tracking_lot (but keep it for the button on stock.quant.package)
Display moved quants after execution of the stock.quants.move wizard