Skip to Content
Menu
This question has been flagged
1 Reply
5197 Views

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');"""



Avatar
Discard
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

Avatar
Discard
Author

Hello Hilar, Problem in not fixed yet.

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


Author

Hello Hilar

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

Related Posts Replies Views Activity
1
Mar 22
13949
13
Jul 24
14057
1
Oct 20
4834
1
Feb 18
4190
2
May 24
1238