Skip to content

[8.0] Several improvements on stock_quant_packages_moving_wizard#1345

Open
alexis-via wants to merge 3 commits intoodoomrp:8.0from
akretion:8.0-quant_moving_wiz-improve
Open

[8.0] Several improvements on stock_quant_packages_moving_wizard#1345
alexis-via wants to merge 3 commits intoodoomrp:8.0from
akretion:8.0-quant_moving_wiz-improve

Conversation

@alexis-via
Copy link
Copy Markdown

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

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
@alexis-via
Copy link
Copy Markdown
Author

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()
@alexis-via
Copy link
Copy Markdown
Author

The access right issue is fixed now (and another one, which was a late change...). So it should be really ready for review now.

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,
Copy link
Copy Markdown
Contributor

@oihane oihane Feb 6, 2017

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.

@anajuaristi
Copy link
Copy Markdown
Contributor

We are just patching an error on stock_quant_packages_moving_wizard. Here is the PR
#1358

So I think we should also include @alexis-via test on module, ir order to see it doesn't fail now.
@alfredoavanzosc @oihane opinion?

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
Copy link
Copy Markdown
Contributor

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

@anajuaristi
Copy link
Copy Markdown
Contributor

@alexis-via The fix has been merged, so please fetch and rebase in order to merge also the test.

Thank you!!
Ana
@oihane @alfredoavanzosc

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.

3 participants