Giter Site home page Giter Site logo

One2Many Issue about framework HOT 10 CLOSED

odoo-mobile avatar odoo-mobile commented on September 7, 2024
One2Many Issue

from framework.

Comments (10)

salahzidi avatar salahzidi commented on September 7, 2024

You can get it by using the "ODataRow" function: yourDataRow.getO2MRecord(yourOneToManyItemId)

from framework.

maanu avatar maanu commented on September 7, 2024

I know that function.but it fails to work in case of using cursor Loader as you might know that it uses pure SQLITE database for fetching record.so it doesn't store value in table that has ONE side key..we can only use M2O relationship.It causes null pointer exception when I'm trying to fetch record as you suggest.

from framework.

dpr-odoo avatar dpr-odoo commented on September 7, 2024

Hello,

It is not possible to directly access one to many record using CursorLoader.

CursorLoader create cursor record set which are related to your table column. It not automatically handle relations such as One2Many or Many2Many.

For accessing one 2 many record when you are binding your view with record cursor you have to just fetch ODataRow using your database object by db.select(your cursor's _id row value as int) and than you can get your one 2 many record by datarow.getO2MRecord("column").browseEach().

E.g:

ODataRow row = db.select(cr.getInt(cr.getColumnIndex("_id"));

Also, you can specify your specific column to fetch record by ignoring other columns.

db.select(new String[]{"my_relation_column"}, cr.getInt(cr.getColumnIndex("_id"));

from framework.

maanu avatar maanu commented on September 7, 2024

Thank you so much for your reply.:)
Can you please help me to understand the whole process of this framework.
I mean to say how services running and when it calls??..Its same process as
the older one framework..?
I am getting some difficulties to understand work of services and syncing
data in new framework.can you please explain me briefly.??
It would be easier for me to understand if you help me.;)
Thanks in advance:

On Thu, Apr 9, 2015 at 10:48 AM, Dharmang Soni [email protected]
wrote:

Hello,

It is not possible to directly access one to many record using
CursorLoader.

CursorLoader create cursor record set which are related to your table
column. It not automatically handle relations such as One2Many or
Many2Many.

For accessing one 2 many record when you are binding your view with record
cursor you have to just fetch ODataRow using your database object by
db.select(your cursor's _id row value as int) and than you can get your one
2 many record by datarow.getO2MRecord("column").browseEach().

E.g:

ODataRow row = db.select(cr.getInt(cr.getColumnIndex("_id"));


Reply to this email directly or view it on GitHub
#68 (comment)
.

NICE DAY...

from framework.

SELKHOUFAIRI avatar SELKHOUFAIRI commented on September 7, 2024

Hi,
please tell me if odoo mobile framwork manage access rights based on groups?
Regards

from framework.

dpr-odoo avatar dpr-odoo commented on September 7, 2024

@maanu Refer Odoo Mobile documentation (v2) http://mobile.odoo.co.in/v2

from framework.

dpr-odoo avatar dpr-odoo commented on September 7, 2024

@SELKHOUFAIRI Odoo Mobile framework uses JSON-RPC for getting and submitting data on server. Odoo Server check access rights based on RPC calls. So on mobile, we don't need to check for access rights of user, it already checked by server on your request for data.

from framework.

SalouaELKHOUFAIRI avatar SalouaELKHOUFAIRI commented on September 7, 2024

Thank you @dharmang :)


Saloua ELKHOUFAIRI
Elève Ingénieur en Réseaux Informatiques et Systèmes d'Information
Faculté des Sciences et Techniques -Gueliz-Marrakech

2015-05-28 6:54 GMT+01:00 Dharmang Soni [email protected]:

@SELKHOUFAIRI https://github.com/SELKHOUFAIRI Odoo Mobile framework
uses JSON-RPC for getting and submitting data on server. Odoo Server check
access rights based on RPC calls. So on mobile, we don't need to check for
access rights of user, it already checked by server on your request for
data.


Reply to this email directly or view it on GitHub
#68 (comment)
.

from framework.

dpr-odoo avatar dpr-odoo commented on September 7, 2024

@SalouaELKHOUFAIRI Its @dpr-odoo 😉

from framework.

fabermandeke avatar fabermandeke commented on September 7, 2024

Hi, currently I am working on a mobile app with Odoo mobile framework which is supposed to use some features of the survey module (answer questions from the mobile app), at first I just try to fetch the questions.
Models are structured in this way:
Survey.survey has a relationship o2many with survey.page, and survey.page has another o2many relation with survey .question, I retrieve the pages well into the activity surveyDetail like this:

survey = new SurveySurvey(this, null);

int rowId = extras.getInt(OColumn.ROW_ID);
record = survey.browse(rowId);

List lines = record.getO2MRecord("page_ids").browseEach();

The problem is that I do not get the questions in PageDetail with this:

record = page.browse(rowId);

List lines = record.getO2MRecord("question_ids").browseEach();

I get null but there are questions in server.
And Whereas this: record.getO2MRecord("question_ids") I have this in log: odoo.core.orm.OO2Mrecord@41896e98
can I have your support?

from framework.

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.