diff --git a/product_create_stock_picking/models/product_template.py b/product_create_stock_picking/models/product_template.py index 1133671..10c570c 100644 --- a/product_create_stock_picking/models/product_template.py +++ b/product_create_stock_picking/models/product_template.py @@ -11,7 +11,7 @@ from odoo import tools, models, fields, api, _ class ProductTemplate(models.Model): _inherit = "product.template" - @api.multi + @api.multi def create_stock_picking(self): picking_vals = self.env['stock.picking'].default_get(self.env['stock.picking']._fields.keys()) picking_vals.update({ @@ -22,6 +22,7 @@ class ProductTemplate(models.Model): picking = self.env['stock.picking'].create(picking_vals) for p in self: + if p.qty_available > 0: move_vals = { 'name': p.name, 'product_id': p.id,