Help

3

How to get value manual ORDER BY from Query

Avatar
Pawan Kumar Sharma

Hello All

I applied query in code for getting values and I received values, but these values came randomly not 'ORDER BY'. So, How to get these values as i defined?

Below is my query and it's o/p:

"""select distinct src, field_description, value from ir_translation, ir_model_fields where module='P2N_Sales' and ir_translation.src = ir_model_fields.field_description and model='sale.mail.wizard' and ir_model_fields.name in ('status','order','customer','pet_name','services', 'amount','msg');"""



الصورة الرمزية
تجاهل
1 إجابة
1
Avatar
Hilar Andikkadavath
Best Answer

you can just add order by in your query.

eg:

select distinct src, field_description, value from ir_translation, ir_model_fields where module='P2N_Sales' and ir_translation.src = ir_model_fields.field_description and model='sale.mail.wizard' and ir_model_fields.name in ('status','order','customer','pet_name','services', 'amount','msg') order by fields_name asc/desc

3 التعليقات
الصورة الرمزية
تجاهل
Avatar
Pawan Kumar Sharma
-

Hello Hilar, Problem in not fixed yet.

Avatar
Hilar Andikkadavath
-
What is your problem, I just the use of ORDER BY. If you cant fetch in order then update the question with the code that you have tried.

On Wed, Jun 6, 2018 at 4:52 PM, Pawan Sharma <pawan.sharma@sunarctechnologies.com> wrote:

Hello Hilar, Problem in not fixed yet.

--
Pawan Sharma

Sent by Odoo S.A. using Odoo.




--
Hilar AK  Python / Odoo Developer

m: +917736617619
e: hilarak@gmail.com
Follow me:
twitteryoutubegithubstack-overflow


Avatar
Pawan Kumar Sharma
-

Hello Hilar

I want record according to i assign in query ('status','order','customer','pet_name','services', 'amount','msg')