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

[MIG] stock_quant_manual_assign: Migration to 11.0 #508

Merged
merged 32 commits into from
Nov 21, 2018
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f1467c0
[mod] added qty control
Nov 13, 2014
482478e
[mod]
Nov 13, 2014
2f15f4f
[mod] _rec_name
Nov 14, 2014
37e50e4
[mod] new_api
Nov 20, 2014
fa7ec8b
[fix] null lines error and remaining qty assign
Dec 16, 2014
d1f9d9f
[MOD] Fixed some problems when there are quants with diferente histories
oihane Mar 3, 2015
30d7186
[IMP] Expand AUTHORS
pedrobaeza Mar 25, 2015
a917b2b
[IMP] stock_quant_manual_assign: Delete picking operations to confirm…
Jun 24, 2015
e5bdb81
OCA Transbot updated translations from Transifex
pedrobaeza Oct 9, 2015
3e0aea7
[IMP] stock_quant_manual_assign: added tests
oihane Oct 14, 2015
00a224f
[IMP] stock_quant_manual_assign: Tests for missing cases
oihane Oct 21, 2015
1534cd7
[IMP] stock_quant_manual_assign:
oihane Oct 21, 2015
6124df4
OCA Transbot updated translations from Transifex
oca-transbot Oct 26, 2015
12e450f
[IMP] stock_quant_manual_assign: Add lot and package to selection view
pedrobaeza Nov 6, 2015
08549cb
[FIX] stock_quant_manual_assign: lot_id and package_id not populated …
pedrobaeza Nov 10, 2015
2409b73
Update READMEs
Nov 25, 2015
dec5de7
OCA Transbot updated translations from Transifex
oca-transbot Jan 31, 2016
3701107
OCA Transbot updated translations from Transifex
oca-transbot Feb 14, 2016
edeb8fd
[FIX] stock_quant_manual_assign: Search in all child locations
pedrobaeza Feb 25, 2016
9b603b2
OCA Transbot updated translations from Transifex
oca-transbot Mar 13, 2016
23b259a
[MOV] stock_quant_manual_assign: make module uninstallable
Mar 21, 2016
532f63f
[FIX] remove en.po that was erroneously created by transbot
sbidoul Aug 15, 2016
4a1e039
[MIG] Rename manifest files
pedrobaeza Oct 6, 2016
52c1a97
[9.0][MIG] stock_manual_assign: Migration to 9.0
lbelorgey Jul 2, 2016
73a5104
[FIX] computation of remaining qty
JordiBForgeFlow Sep 27, 2016
d25469b
Fix: avoid remove assigned lots on manual assignement
cubells Mar 21, 2017
443783a
[FIX] stock_quant_manual_assign: computed field is not the same
Mar 27, 2017
b1ae830
[CHG] stock_quant_manual_assign: Update copyright and author
pedrobaeza Apr 2, 2017
1cbcf59
[10.0][MIG] stock_quant_manual_assign: Migration to 10.0
fanha99 Jul 26, 2017
3334b4c
11.0-mig-stock_quant_manual_assign
fanha99 Dec 28, 2017
2234a2e
[MIG] stock_quant_manual_assign: Migration to 11.0
cubells Nov 12, 2018
ec5025d
[IMP] stock_quant_manual_assign:
pedrobaeza Nov 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[fix] null lines error and remaining qty assign
  • Loading branch information
avanzosc1 authored and cubells committed Nov 16, 2018
commit fa7ec8b6a86ca0a906e858c02af1119940dd1d7a
22 changes: 14 additions & 8 deletions stock_quant_manual_assign/wizard/assign_manual_quants.py
Original file line number Diff line number Diff line change
@@ -33,12 +33,13 @@ def lines_qty(self):
@api.one
@api.constrains('quants_lines')
def check_qty(self):
total_qty = self.lines_qty()
move = self.env['stock.move'].browse(self.env.context['active_id'])
if total_qty > move.product_uom_qty:
raise exceptions.Warning(_('Error'),
_('Quantity is higher'
' than the needed one'))
if self.quants_lines:
total_qty = self.lines_qty()
move = self.env['stock.move'].browse(self.env.context['active_id'])
if total_qty > move.product_uom_qty:
raise exceptions.Warning(_('Error'),
_('Quantity is higher'
' than the needed one'))

@api.depends('quants_lines')
def get_move_qty(self):
@@ -90,10 +91,15 @@ def onchange_selected(self):
if not self.selected:
self.qty = False
if self.selected and self.qty == 0:
self.qty = self.quant.qty
quant_qty = self.quant.qty
remaining_qty = self.assign_wizard.move_qty
if quant_qty < remaining_qty:
self.qty = quant_qty
else:
self.qty = remaining_qty

assign_wizard = fields.Many2one('assign.manual.quants', string='Move',
required=True)
required=True, ondelete="cascade")
quant = fields.Many2one('stock.quant', string="Quant", required=True)
qty = fields.Float(string='QTY')
selected = fields.Boolean(string="Select")