-3

Im working with Odoo 10, i have a big a lot of articles classified by category, and i had installed website module, now i wante to show my articles and categories in one of pages of my website

BoutainaAS
  • 11
  • 1
  • 6
  • Hi and welcome to StackOverflow! Please consider taking [the tour](https://stackoverflow.com/help/how-to-ask) to improve your question - and therefore the probability of getting an answer! – Philipp Apr 12 '17 at 10:22

1 Answers1

2

To build a Website page, you can read the documentation here [https://www.odoo.com/documentation/10.0/howtos/website.html][1]

To resume what you must doing.

The first step is creations of a link with a controller. Like this

from odoo import http

class Product(http.Controller):
    @http.route('/products/', auth='public')
    def index(self, **kw):
        product_ids = self.env['product.product'].search([])
        return http.request.render('academy.index', {
            'products': product_ids,
        })

Seconde step is creations of your template view. Like this

<template id="index">
    <title>Products</title>
    <t t-foreach="products" t-as="product">
      <p><t t-esc="product.name"/></p>
    </t>
</template>

It's a simple example. If you want more information you can read the documentation and see example in the code of odoo .

jo541
  • 1,155
  • 6
  • 10