Browse Source

Ajuste de sql

deisy 5 years ago
parent
commit
c3dce40bc0
2 changed files with 1 additions and 1 deletions
  1. 1 1
      models/initial_inventory.py
  2. BIN
      models/initial_inventory.pyc

+ 1 - 1
models/initial_inventory.py

@@ -33,7 +33,7 @@ class StockInventory(models.Model):
             product_obj = self.env['product.product']
             categ_obj = self.env['product.category']
             categories = categ_obj.search([('id', 'child_of', [inventory.category_id.id])])
-            sql =  "SELECT pp.id as product_id, pc.id as category_id FROM product_product as pp INNER JOIN product_template as pt ON pp.product_tmpl_id = pt.id INNER JOIN product_category as pc ON pt.categ_id = pc.id WHERE pt.type = 'product' and pc.id IN %s"
+            sql =  "SELECT pp.id as product_id, pc.id as category_id FROM product_product as pp INNER JOIN product_template as pt ON pp.product_tmpl_id = pt.id INNER JOIN product_category as pc ON pt.categ_id = pc.id WHERE pp.active = true and pt.type = 'product' and pc.id IN %s"
 
             self.env.cr.execute(sql, (tuple(categories.ids),))
             vals = []

BIN
models/initial_inventory.pyc