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;
I am setting a module with models:
- Department(department)
- Registered Business (reg.dept.business)
- 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
add a comment
|
I am setting a module with models:
- Department(department)
- Registered Business (reg.dept.business)
- 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
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
add a comment
|
I am setting a module with models:
- Department(department)
- Registered Business (reg.dept.business)
- 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
I am setting a module with models:
- Department(department)
- Registered Business (reg.dept.business)
- 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
python odoo
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
add a comment
|
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
add a comment
|
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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