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,6 +156,7 @@ class Dialyzer(Model):
raise Exception("Warehouse not found")
wh_loc_id=res[0]
if prod.type=='stock':
line_vals={
"product_id": prod.id,
"qty": 1,
@ -164,10 +165,6 @@ class Dialyzer(Model):
"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_id=picking_obj.create(pick_vals,context={"pick_type": "out"})
pick=picking_obj.browse(pick_id)