Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
5204 Представления

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



Аватар
Отменить
Лучший ответ

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

Аватар
Отменить
Автор

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


Автор

Hello Hilar

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

Related Posts Ответы Просмотры Активность
1
мар. 22
13964
13
июл. 24
14074
1
окт. 20
4843
1
февр. 18
4197
2
мая 24
1248