Giter VIP home page Giter VIP logo

Comments (3)

lmignon avatar lmignon commented on August 28, 2024

@laetitia-gangloff

why company_id is not a related on company_ids ? (is it possible ?!)

It's not possible and has no sens. Which company can we use if the user has access to a lot of them?

And, why in the case there is many companies define on the product, company_id is set with the first value ?

IMO, the company_id should be empty and never used once this module is installed otherwise we will encounter bugs. (IMO it's a bug)

Last question, why record rules is set with in and not child_of ?

IMO to be consistent with others multi company record rules, we should use child_of

from multi-company.

pedrobaeza avatar pedrobaeza commented on August 28, 2024

company_id is an standard Odoo field, so we should keep a value in it for possible modules that tries to acces that field. I decided to use the first record of the allowed companies. I could put a related field, because Odoo makes the same behaviour when relating a many2many in a many2one field, but I preferred to use a computed method that can be inherited is someone has another need/requirement instead of using the first record. The same applies to be empty instead of this. Any of the behaviors seems good for me.

About the record rule, I say no. This is put this way intentionally, because we will lose functionality using child_of operator. What if we want to give permission to the parent company and only one of the child ones? As this is a many2many, you can select all the companies you want. If you want to mimic the child_of behavior, select the parent and all of the children companies in it.

from multi-company.

laetitia-gangloff avatar laetitia-gangloff commented on August 28, 2024

Thank you for your answers.

from multi-company.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.