how to use many2one field for searching records from other linked model in odoo 10?How to browse or search One2many field in Odoo?domain filter for many2one fields in odoo?Odoo: Error404 when linking many2one to other model?Odoo Filter many2one field on loadodoo many2one as selection fieldOdoo - multiple many2one fields that point to the same modelodoo filter one2many listHow to emulate “self.env.ref” in the domain of a search view in Odoo 10?How to update One2many field from JS function in Odoo 10?odoo - explanation @api.multi - recordset

How important is weather sealing for a winter trip?

Should the pagination be reset when changing the order?

Three knights searching for a princess in a castle

Problem of Induction: Dissolved

Floating Point XOR

LaTeX matrix formatting

Are all article combinations valid patterns for "the" ɴᴏᴜɴ of "the" ɴᴏᴜɴ?

Output Distinct Factor Cuboids

MySQL - How to check for a value in all columns

Can I separate garlic into cloves for storage?

Why are there no programmes / playbills for movies?

Python web-scraper to download table of transistor counts from Wikipedia

What is the origin of the "being immortal sucks" trope?

What was the earliest microcomputer Logo language implementation?

Can we have a C++ function with multiple return types? ( C++11 and above)

Talk about Grandpa's weird talk: Who are these folks?

Cube around 2 points with correct perspective

How to convey to the people around me that I want to disengage myself from constant giving?

How to generate short fixed length cryptographic hashes?

What does the Free Recovery sign (UK) actually mean?

Should I inform my future product owner that there is a good chance that a team member will leave the company soon?

Where did Otto von Bismarck say "lying awake all night, hating"?

What's the word for a student who doesn't register but goes to a class anyway?

Bash attempts to write two shell prompts?



how to use many2one field for searching records from other linked model in odoo 10?


How to browse or search One2many field in Odoo?domain filter for many2one fields in odoo?Odoo: Error404 when linking many2one to other model?Odoo Filter many2one field on loadodoo many2one as selection fieldOdoo - multiple many2one fields that point to the same modelodoo filter one2many listHow to emulate “self.env.ref” in the domain of a search view in Odoo 10?How to update One2many field from JS function in Odoo 10?odoo - explanation @api.multi - recordset






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am setting a module with models:



  1. Department(department)

  2. Registered Business (reg.dept.business)

  3. Department Business Records (dept.business.records)

Current working model is dept.business.records.



I want to display business list against current department using business_types field via calling compute method.



I am unable to filter records based on Domain applying on search() in method get_dept_business_ids(). All business list are showing currently, if I apply domain there is not result.



dept_id = fields.Many2one('department', 'Department')
business_types = fields.Many2many('reg.dept.business', string='Business List', compute='get_firm_business_ids')

@api.multi
def get_dept_business_ids(self):
for record in self:
list_val = []
env_rec = self.env['reg.dept.business'].search([('reg_dept_id', '=', dept_id.id)])
for x in env_rec:
list_val.append(x.id)
record.update(
'business_types': [(6, False, list_val)]
)









share|improve this question


























  • are you not getting any errors? your search should be ('reg_dept_id', '=', record.dept_id.id). Also you defined compute='get_firm_business_ids' and the name of method you shown here is 'get_dept_business_ids'

    – Amal
    Mar 29 at 4:02











  • Could you show the model "reg.dept.business" please ?

    – jo541
    Mar 29 at 8:41

















0















I am setting a module with models:



  1. Department(department)

  2. Registered Business (reg.dept.business)

  3. Department Business Records (dept.business.records)

Current working model is dept.business.records.



I want to display business list against current department using business_types field via calling compute method.



I am unable to filter records based on Domain applying on search() in method get_dept_business_ids(). All business list are showing currently, if I apply domain there is not result.



dept_id = fields.Many2one('department', 'Department')
business_types = fields.Many2many('reg.dept.business', string='Business List', compute='get_firm_business_ids')

@api.multi
def get_dept_business_ids(self):
for record in self:
list_val = []
env_rec = self.env['reg.dept.business'].search([('reg_dept_id', '=', dept_id.id)])
for x in env_rec:
list_val.append(x.id)
record.update(
'business_types': [(6, False, list_val)]
)









share|improve this question


























  • are you not getting any errors? your search should be ('reg_dept_id', '=', record.dept_id.id). Also you defined compute='get_firm_business_ids' and the name of method you shown here is 'get_dept_business_ids'

    – Amal
    Mar 29 at 4:02











  • Could you show the model "reg.dept.business" please ?

    – jo541
    Mar 29 at 8:41













0












0








0








I am setting a module with models:



  1. Department(department)

  2. Registered Business (reg.dept.business)

  3. Department Business Records (dept.business.records)

Current working model is dept.business.records.



I want to display business list against current department using business_types field via calling compute method.



I am unable to filter records based on Domain applying on search() in method get_dept_business_ids(). All business list are showing currently, if I apply domain there is not result.



dept_id = fields.Many2one('department', 'Department')
business_types = fields.Many2many('reg.dept.business', string='Business List', compute='get_firm_business_ids')

@api.multi
def get_dept_business_ids(self):
for record in self:
list_val = []
env_rec = self.env['reg.dept.business'].search([('reg_dept_id', '=', dept_id.id)])
for x in env_rec:
list_val.append(x.id)
record.update(
'business_types': [(6, False, list_val)]
)









share|improve this question
















I am setting a module with models:



  1. Department(department)

  2. Registered Business (reg.dept.business)

  3. Department Business Records (dept.business.records)

Current working model is dept.business.records.



I want to display business list against current department using business_types field via calling compute method.



I am unable to filter records based on Domain applying on search() in method get_dept_business_ids(). All business list are showing currently, if I apply domain there is not result.



dept_id = fields.Many2one('department', 'Department')
business_types = fields.Many2many('reg.dept.business', string='Business List', compute='get_firm_business_ids')

@api.multi
def get_dept_business_ids(self):
for record in self:
list_val = []
env_rec = self.env['reg.dept.business'].search([('reg_dept_id', '=', dept_id.id)])
for x in env_rec:
list_val.append(x.id)
record.update(
'business_types': [(6, False, list_val)]
)






python odoo






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 17:26









travisw

1,63110 silver badges22 bronze badges




1,63110 silver badges22 bronze badges










asked Mar 28 at 13:23









majidmajid

1181 silver badge14 bronze badges




1181 silver badge14 bronze badges















  • are you not getting any errors? your search should be ('reg_dept_id', '=', record.dept_id.id). Also you defined compute='get_firm_business_ids' and the name of method you shown here is 'get_dept_business_ids'

    – Amal
    Mar 29 at 4:02











  • Could you show the model "reg.dept.business" please ?

    – jo541
    Mar 29 at 8:41

















  • are you not getting any errors? your search should be ('reg_dept_id', '=', record.dept_id.id). Also you defined compute='get_firm_business_ids' and the name of method you shown here is 'get_dept_business_ids'

    – Amal
    Mar 29 at 4:02











  • Could you show the model "reg.dept.business" please ?

    – jo541
    Mar 29 at 8:41
















are you not getting any errors? your search should be ('reg_dept_id', '=', record.dept_id.id). Also you defined compute='get_firm_business_ids' and the name of method you shown here is 'get_dept_business_ids'

– Amal
Mar 29 at 4:02





are you not getting any errors? your search should be ('reg_dept_id', '=', record.dept_id.id). Also you defined compute='get_firm_business_ids' and the name of method you shown here is 'get_dept_business_ids'

– Amal
Mar 29 at 4:02













Could you show the model "reg.dept.business" please ?

– jo541
Mar 29 at 8:41





Could you show the model "reg.dept.business" please ?

– jo541
Mar 29 at 8:41












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55398747%2fhow-to-use-many2one-field-for-searching-records-from-other-linked-model-in-odoo%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.




















draft saved

draft discarded















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55398747%2fhow-to-use-many2one-field-for-searching-records-from-other-linked-model-in-odoo%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해