Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

[v8.0] Ecommerce Grid is 4 columns by default. Where is this value set and how can we change it?

By
grayson
on 7/30/14, 3:30 PM 1,258 views

Wondering if it is possible to increase the number of columns to show more products per row.

1
Paul Catinean
On 9/18/15, 9:30 AM

Those constants are meant to be overridden by a module

Simply import the main controller with:

from openerp.addons.website_sale.controllers import main

then change the values

main.PPR = your_nr

main.PPG = your_nr

Regards,

Paul

0
grayson
On 8/1/14, 4:28 PM

Found it hardcoded at line 11 of /website_sale/controllers/main.py

PPR = 4  # Products Per Row

Probably want to make sure it's divisible by the amount set on line 10

PPG = 20 # Products Per Page

Still not sure how to override this without changing the core file...

It looks like changing this value is not having any effect though...

grayson
on 8/1/14, 4:42 PM

@grayson, I'm also trying to figure this out. I think you may need to override it in your theme's layout.xml. I'll post back here once I figure it out. Are you using a custom theme module, or the built-in bootswatch templates?

Luke Branch
on 8/1/14, 10:05 PM

@grayson, changing the value in /website_sale/controllers/main.py definitely has an affect, but i've found it only works after a server reboot (eg. change PPR = 5, save and reboot machine). I'll write back with an answer once I figure out how to override the default controller within a custom theme module.

Luke Branch
on 8/2/14, 7:36 AM

@Luke, thanks for pitching in. I'll try rebooting and see what happens...

grayson
on 8/6/14, 1:07 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/30/14, 3:30 PM
Seen: 1258 times
Last updated: 9/18/15, 11:44 PM