Odoo Help

1

0
2 Answers
4
Avatar

Ankit H Gandhi(AHG)

--Ankit H Gandhi(AHG)--

1367
| 6 5 8
Baroda, India
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG)
11/18/15, 9:39 AM

Dear Dr Obx,

You need to create a wizard and you will select all record from wizard

and also create button inside wizard form view

when press the button at that time state will be change of order which are selected

Using below code you will create action in 'More' menu.

Syntax:

<record model="ir.values" id="any_name">
<field name="model_id" ref="module_name_model_model_name" />
<field name="name">Any String</field>
<field name="key2">client_action_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('your_action_name'))" />
<field name="key">action</field>
<field name="model">model.name</field>
</record>


Example:

<record model="ir.values" id="wiz_hospital_values">
<field name="model_id" ref="hospital_management.model_patient_patient" />
<field name="name">Wiz Hospital</field>
<field name="key2">client_action_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_wiz_hospital'))" />
<field name="key">action</field>
<field name="model">patient.patient</field>
</record>

Please let me know, if you have any problem.

Thanks & Regards

Ankit H Gandhi.

2 Comments
Dr Obx
11/18/15, 10:49 AM

Thank you Ankit

Ankit H Gandhi(AHG)
11/19/15, 12:09 AM

Your Welcome !!!

2
Avatar

Pawan

--Pawan--

1542
| 4 4 8
Hyderabad, India
--Pawan--


Pawan
11/18/15, 9:29 AM

Rob,

On clicking on menu under more, you have to get a form opened as a default functionality of odoo, but u can customize it in your way as:

in the new opened window(of new object) you can use it as a message box and prompt the user to change state by giving some message like;

"You are about to change the state of the selected [your object], Are you sure to continue?"

and then on click of button, you can do your functionality of changing the state  of the recordsw of  your object...

You can get the selected records ids in 'context' of current object(object of which your popped up form is related to) as "active_ids"

There might be some other direct method too, but its one of the way to customize wat you have according to your need.

Regards,    

Pawan

2 Comments
Dr Obx
12/17/15, 6:59 AM

Are you there Pawan ? I need your advice, URGENT!

Pawan
12/17/15, 10:22 AM

Yes ROB,...

Ask a Question
Writer
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now