|
@@ -15,7 +15,7 @@
|
|
# GNU Affero General Public License for more details.
|
|
# GNU Affero General Public License for more details.
|
|
#
|
|
#
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
+# along with this program. If not, see <http://www.gnu.org/licenses/>. and pv.price_grid= True
|
|
#
|
|
#
|
|
##############################################################################
|
|
##############################################################################
|
|
|
|
|
|
@@ -31,32 +31,29 @@ class report_productlist(osv.osv):
|
|
_rec_name = 'product_id'
|
|
_rec_name = 'product_id'
|
|
|
|
|
|
_columns = {
|
|
_columns = {
|
|
- 'product_id': fields.many2one('product.product', 'Producto', readonly=True),
|
|
|
|
- 'name_template': fields.char('Descripción', readonly=True),
|
|
|
|
|
|
+ 'product_id': fields.many2one('product.template', 'Producto', readonly=True),
|
|
'list_price': fields.char('Lista de Precio', readonly=True),
|
|
'list_price': fields.char('Lista de Precio', readonly=True),
|
|
'price_surcharge': fields.float('Precio', readonly=True),
|
|
'price_surcharge': fields.float('Precio', readonly=True),
|
|
'company_id': fields.many2one('res.company', 'Compañia', readonly=True),
|
|
'company_id': fields.many2one('res.company', 'Compañia', readonly=True),
|
|
}
|
|
}
|
|
- _order = 'id desc'
|
|
|
|
|
|
+ _order = 'product_id asc'
|
|
|
|
|
|
def init(self, cr):
|
|
def init(self, cr):
|
|
tools.drop_view_if_exists(cr, 'report_productlist')
|
|
tools.drop_view_if_exists(cr, 'report_productlist')
|
|
cr.execute("""
|
|
cr.execute("""
|
|
create or replace view report_productlist as (
|
|
create or replace view report_productlist as (
|
|
- SELECT row_number() over (ORDER BY pl.id) as id,
|
|
|
|
- po.id AS product_id,
|
|
|
|
- po.name_template AS name_template,
|
|
|
|
|
|
+ SELECT row_number() over (ORDER BY pl.id) as id,
|
|
|
|
+ pt.id AS product_id,
|
|
pv.name as list_price,
|
|
pv.name as list_price,
|
|
pl.price_surcharge as price_surcharge,
|
|
pl.price_surcharge as price_surcharge,
|
|
pt.company_id
|
|
pt.company_id
|
|
from product_pricelist_item pl
|
|
from product_pricelist_item pl
|
|
- LEFT JOIN product_product po ON po.id = pl.product_tmpl_id
|
|
|
|
- LEFT JOIN product_template pt ON pt.id = po.product_tmpl_id
|
|
|
|
|
|
+ LEFT JOIN product_template pt ON pt.id = pl.product_tmpl_id
|
|
|
|
+ LEFT JOIN product_product po ON po.product_tmpl_id = pt.id
|
|
LEFT JOIN product_pricelist_version pv ON pv.id = pl.price_version_id
|
|
LEFT JOIN product_pricelist_version pv ON pv.id = pl.price_version_id
|
|
- where pv.price_grid = True and pl.price_surcharge>0 and po.name_template <> ''
|
|
|
|
|
|
+ where po.name_template <> ''
|
|
GROUP BY pl.id,
|
|
GROUP BY pl.id,
|
|
- po.id,
|
|
|
|
- po.name_template,
|
|
|
|
|
|
+ pt.id,
|
|
pv.name,
|
|
pv.name,
|
|
pl.price_surcharge,
|
|
pl.price_surcharge,
|
|
pt.company_id)
|
|
pt.company_id)
|