跳至内容
菜单
此问题已终结
1 回复
4790 查看

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

相关帖文 回复 查看 活动
1
3月 22
13438
13
7月 24
13433
1
10月 20
4201
1
2月 18
3899
2
5月 24
776