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

What is the the easiest way to change view according to company?

By
Pascal Tremblay
on 2/16/15, 7:59 AM 651 views

Hello there,

Example :

in my custom module, I inherit sale.report_saleorder_document to create a new mycustom.report_saleorder_document.

This mycustom.report_saleorder_document is used for each company in my multi-company setup of Odoo 8.

Question :

What would be the easiest approach to have different view or different report for each company in our multi-company setup? Each company should have his own mycustom.report_saleorder_document (for example).

 

Idea?

1

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 2/16/15, 9:19 AM

You inherit this xml code, and add t-if="user.company_id.id == XXX":

<template id="report_saleorder">
    <t t-call="report.html_container">
        <t t-foreach="doc_ids" t-as="doc_id">

<HERE T-IF>
            <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'sale.report_saleorder_document')"/>

</HERE T>
        </t>
    </t>
</template>

Oh! You are my best zbik!

Pascal Tremblay
on 2/16/15, 9:20 AM

In my multi-company setup, I want different pos receipt/ticket for each company. Should it work also in a file like /Volumes/odoo/addons/report_lapagept/static/src/xml/pos.xml ???

Pascal Tremblay
on 2/17/15, 6:10 AM

I think you have found a solution?

zbik
on 2/17/15, 8:54 AM

It worked! First shot! Thanks a lot zbik.

Pascal Tremblay
on 2/23/15, 4:01 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: 2/16/15, 7:59 AM
Seen: 651 times
Last updated: 3/16/15, 8:10 AM