skip create picking if product type is service

conv_bal
watcha.h 2015-03-03 10:59:24 +07:00
parent 843f7c1d2f
commit 98ec00abb5
1 changed files with 12 additions and 15 deletions

View File

@ -156,22 +156,19 @@ class Dialyzer(Model):
raise Exception("Warehouse not found") raise Exception("Warehouse not found")
wh_loc_id=res[0] wh_loc_id=res[0]
line_vals={ if prod.type=='stock':
"product_id": prod.id, line_vals={
"qty": 1, "product_id": prod.id,
"uom_id": prod.uom_id.id, "qty": 1,
"location_from_id": wh_loc_id, "uom_id": prod.uom_id.id,
"location_to_id": cust_loc_id, "location_from_id": wh_loc_id,
} "location_to_id": cust_loc_id,
pick_vals["lines"].append(("create",line_vals))
if not pick_vals["lines"]:
return {
"flash": "Nothing left to deliver",
} }
picking_obj=get_model("stock.picking") pick_vals["lines"].append(("create",line_vals))
pick_id=picking_obj.create(pick_vals,context={"pick_type": "out"}) picking_obj=get_model("stock.picking")
pick=picking_obj.browse(pick_id) pick_id=picking_obj.create(pick_vals,context={"pick_type": "out"})
pick.set_done([pick_id]) pick=picking_obj.browse(pick_id)
pick.set_done([pick_id])
number=obj.number.replace("/","") number=obj.number.replace("/","")
if not number: if not number:
number=self._get_number(context) number=self._get_number(context)