No crea movimientos de productos con stock cero
This commit is contained in:
parent
136ff98559
commit
12deffe026
1 changed files with 2 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue