I am creating a module(OpenERP 7.0) in which i have taken 2 fields both are many2many. First field is related with res.partner.category and second field is res.partner, what i have to do is-
after selecting categories in first field second field should get updated with partners of respected categories
thanks...
write an on change method on the first field which will search the partners related to selected categories and fill them in second field.
Related
I have two fields "course" and "unit" in a form. Both are "Select List". There is a junction table "course_unit" in my database which maps courses and their units. Now, I only want to have those units in my "unit" filed that are assigned to the course selected in "course" field. For that I wrote following query and placed it in "SQL Query" inside "List of Values" option for "unit" field
SELECT unit_name, unit_id
FROM course_unit
WHERE course_id = :P11_COURSE;
This didn't work. I passed a course ID as default value to "course" filed and it worked. Only those units related to the course ID I pass was in the "unit" filed. But changing the course had no effect in "unit" field. I thought this was because every time I select new course the "unit" field wasn't reloading. So I created a dynamic action on "course" field which reloads "unit" field whenever there is any change in "course" field. The "unit" filed is now reloading but still there is no change in values after I select another course. What am I doing wrong? How can I solve this issue?
Should be easy to fix; below the query you wrote is another section named "Cascading list of values" which has one item: Parent item(s). In here, you put item(s) whose value causes select list item's values to change. In your case, it is P11_COURSE.
Also, have a look at Help associated to this property, as well as another ones: "Items to submit" and "Parent required" (depending on Apex version you use).
I'm working for the first in a new app in odoo, and I have conditionals for several fields so I wanted to use a changing id with a many to one field, in other words my domain is where id=calculated_id which will be only one value, I tried to obtain a string of the name of the many to one field to try it to use it as the context but I retrieved a list of an object similar to [x_model_data(2,)] instead of the desired field value "test 2", I believe that the 2 of the parentheses relates to the calculated id=2
I have view for A model which contain following fields
Student_name field many2one
x_course_id field many2one
one2many field named 'b_ids' which refer B model.
b_ids is made as a tree in same view which contains following fields
some_field_name many2one
x_course_id field many2one
a_id field many2one which refer A model
Now, the problem is that the field some_field_name must be listed according to the value of course_id field which should be same as course_id field inAmodel.
I related field for course_id as
It is fetching value after saving that record, because of which my domain for some_field_name doesn't works
domain for some_field_name is written as [('x_course_id','=' x_course_id)]
But since this x_course_id on right hand side doesn't exist before saving the form, this domain doesn't works.
So, i wanted to know, is there a way by which i can get value of x_course_id in tree before saving the form.
Can any of the following fields be helpful in these case?? If yes, how?
I am new to openerp, In my customize module client_id,name other fields are showing only in Admin user of tree view but not showing in other Group user except Name field.
field
defines a column where the corresponding field should be displayed for each record. Can use the following attributes:
name:
the name of the field to display in the current model. A given name can only be used once per view
string:
the title of the field's column (by default, uses the string of the model's field)
invisible:
fetches and stores the field, but doesn't display the column in the table. Necessary for fields which shouldn't be displayed but are used by e.g. #colors
groups:
lists the groups which should be able to see the field
widget:
alternate representations for a field's display. Possible list view values are:
attrs:
dynamic attributes based on record values. Only effects the current field, so e.g. invisible will hide the field but leave the same field of other records visible, it will not hide the column itself.
I am trying to make a simple form that 'registers' users into a meeting. I'm trying to get the form to submit the meeting 'id' into the database but I wish to display a different value for the user (so that they do not stumble through meeting id's). I've added two columns to the query (meeting id and meeting information) but I am unsure how I would get the form to submit the meeting ID but display the meeting information for the current user.
EDIT: I've tried your method Chris but it doesn't seem to work.
Edits made:
http://i.stack.imgur.com/6IUuD.png
http://i.stack.imgur.com/3PTTZ.png
You need a rowsource query with TWO values because you have two columns. For example:
SELECT meeting_id, meeting_name
FROM meetings
In this case the 'bound column' property would be '1' because in the example you first select the meeting_id.
In the 'column width' property you then type "0cm;4cm". 0cm means that the first column (the IDs) will not be shown.
go to design view of the form and change the bound column to the number that represents the column you desire to have displayed. eg.
You can add the query at the Row Source as in the image a query builder will appear and you just create the query and save it.