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

Saas 18 stock scrap warn wizard pgu #19655

Merged
merged 4 commits into from
Sep 27, 2017

Conversation

pgu-odoo
Copy link
Contributor

Description of the issue/feature this PR addresses:
task id - https://www.odoo.com/web#id=36014&view_type=form&model=project.task&action=327&menu_id=
Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@pgu-odoo pgu-odoo force-pushed the saas-18-stock-scrap-warn-wizard-pgu branch from c8a0956 to 26274c9 Compare September 25, 2017 05:40
@C3POdoo C3POdoo added the RD research & development, internal work label Sep 26, 2017
@api.constrains('lot_id', 'product_id')
def constrain_lot_id(self):
for line in self.filtered(lambda x: x.product_id.tracking != 'none' and not x.lot_id):
raise ValueError(_("Serial number is required for operation line with product '%s'") % (line.product_id.name))
Copy link
Contributor

Choose a reason for hiding this comment

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

ValidationError

@sle-odoo sle-odoo force-pushed the saas-18-stock-scrap-warn-wizard-pgu branch from 4e0b470 to 487adf2 Compare September 26, 2017 14:53
package_id = self.package_id or None
owner_id = self.owner_id or None
available_qty = self.env['stock.quant']._get_available_quantity(self.product_id, self.location_id, lot_id, package_id, owner_id, strict=True)
if float_compare(available_qty, self.scrap_qty, 2) >= 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

why forcing precision_digits?

@jorenvo jorenvo force-pushed the saas-18-stock-scrap-warn-wizard-pgu branch 7 times, most recently from e5ef0af to 0d2db8f Compare September 27, 2017 02:40
@jorenvo jorenvo self-assigned this Sep 27, 2017
Instead of only checking when actually confirming the repair.
This implements a warning when the user tries to do any of the
following operations on a product that is not in stock:

- Scrapping
- Unbuilding
- Repairing

The warning displays the current stock of the product in question per
location which can be helpful in case the user selected the wrong
location.
@jorenvo jorenvo force-pushed the saas-18-stock-scrap-warn-wizard-pgu branch from 0d2db8f to 55c0221 Compare September 27, 2017 04:36
@jorenvo jorenvo merged commit 55c0221 into odoo:saas-18 Sep 27, 2017
@sle-odoo sle-odoo deleted the saas-18-stock-scrap-warn-wizard-pgu branch October 25, 2017 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants