Odoo Help

Welcome!

This community 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.

0

How can I Clear/Reset the list of orders that "Need Action"?

By
Travis Waelbroeck
on 1/15/16, 12:35 PM 566 views

We imported many orders from our old system (thousands) and they are marked as needing action. This means we don't get any useful information because it is overrun with useless data.


How can I clear this queue?


The only way I have found is to manually view each order, which is impossible for 2,000+ orders for each user.


Screenshot: http://prntscr.com/9qhnb8

Hello Are they imported from Magento?

Swapnesh
on 1/15/16, 3:46 PM

Yes, imported from Magento 1.9

Htm-Mbs, Travis Waelbroeck
on 1/15/16, 4:11 PM
2

Denis Ledoux (dle)

--Denis Ledoux (dle)--
1045
| 5 5 7
Ramillies, Belgium
--Denis Ledoux (dle)--


Denis Ledoux (dle)
On 1/18/16, 5:50 AM

If you want it to be done with a SQL request:

```
UPDATE mail_notification SET is_read = 't' where partner_id in (select partner_id from res_users WHERE login in ('admin', 'demo')) and is_read = 'f';
```

Where you replace `('admin', 'demo')` by the list of logins for which you want the notifications to be read.


If you want it to be done from a server action, using the ORM:

```
logins = ['admin', 'demo']
partner_ids = [user['partner_id'][0] for user in pool['res.users'].search_read(cr, uid, [('login', 'in', logins)], ['partner_id'], context=context)]
notifications_ids = pool['mail.notification'].search(cr, uid, [('partner_id', 'in', partner_ids), ('is_read', '=', False)], context=context)
pool['mail.notification'].write(cr, uid, notification_ids, {'is_read': True}, context=context)
```

Where you replace ['admin', 'demo'] by the list of logins for who you want the notifications to be read.

Yep, this did it! I was able to simplify your SQL slightly to just do all users at once: UPDATE mail_notification SET is_read = 't' WHERE is_read = 'f';

Htm-Mbs, Travis Waelbroeck
on 1/18/16, 8:24 AM
0
Swapnesh
On 1/16/16, 12:42 AM

Hello,

You can select all records from tree view and after that go to More ==> you will find Review Checkpoint 


This option will be available if You are using Default Connector available of OCA 

Thanks

I don't think we are using the OCA connector. The only options under More are Export or Make Invoices. Is there a way I can do this programmatically from the command line?

Htm-Mbs, Travis Waelbroeck
on 1/16/16, 9:29 AM

It is Possible but for that you need to Create Function For that you can call method of that button (Review) for all available Pending Orders if you need further help so give Code so that i can customize that code Thanks

Swapnesh
on 1/16/16, 3:12 PM

I'm not sure how to call the method as you describe. Do you have code in mind that can be used?

Htm-Mbs, Travis Waelbroeck
on 1/16/16, 7:16 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/15/16, 12:35 PM
Seen: 566 times
Last updated: 1/18/16, 8:16 AM