[FIX] stock_quant_manual_assign: Search in all child locations

This commit is contained in:
Pedro M. Baeza
2016-02-25 13:38:46 +01:00
committed by Tony Gu
parent 3162d76f2f
commit b49fca756e
2 changed files with 11 additions and 10 deletions

View File

@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: stock-logistics-warehouse (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-10-24 09:07+0000\n"
"POT-Creation-Date: 2016-03-04 07:59+0000\n"
"PO-Revision-Date: 2015-10-24 09:08+0000\n"
"Last-Translator: <>\n"
"Language-Team: Finnish (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/fi/)\n"
@@ -102,7 +102,7 @@ msgstr ""
#. module: stock_quant_manual_assign
#: field:assign.manual.quants,quants_lines:0
msgid "Quants"
msgstr ""
msgstr "Määrät"
#. module: stock_quant_manual_assign
#: field:assign.manual.quants.lines,selected:0
@@ -122,7 +122,7 @@ msgstr ""
#. module: stock_quant_manual_assign
#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view
msgid "or"
msgstr ""
msgstr "tai"
#. module: stock_quant_manual_assign
#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view

View File

@@ -55,13 +55,14 @@ class AssignManualQuants(models.TransientModel):
def default_get(self, var_fields):
super(AssignManualQuants, self).default_get(var_fields)
move = self.env['stock.move'].browse(self.env.context['active_id'])
available_quants = self.env['stock.quant'].search(
['|', ('location_id', '=', move.location_id.id),
('location_id', 'in', move.location_id.child_ids.ids),
('product_id', '=', move.product_id.id),
('qty', '>', 0),
'|', ('reservation_id', '=', False),
('reservation_id', '=', move.id)])
available_quants = self.env['stock.quant'].search([
('location_id', 'child_of', move.location_id.id),
('product_id', '=', move.product_id.id),
('qty', '>', 0),
'|',
('reservation_id', '=', False),
('reservation_id', '=', move.id)
])
quants_lines = [{
'quant': x.id,
'lot_id': x.lot_id.id,