Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
On Odoo 10
I am trying to create a custom filter for the sales>customers overview, which should only show customers who have actually bought something at least once. I am trying with
[[u'customer', u'=', 1], [u'parent_id', u'=', False], [u'is_company', u'=', 1], [u'sale_order_count', u'>', 0]]
|Also tried using the field "total_invoiced > 0", but every attempt gives back all customers. What am I doing wrong here?|
This is my code and try like this,in my code only filtered last 30 days customers.get some idea from this.
<filter string="Last 30 Days" name="prev_month" domain="[('date_order','>=',(context_today()-relativedelta(months=1)).strftime('%Y-%m-01')),('date_order','<',time.strftime('%Y-%m-01'))]"/>
Thanks, Niyas. But it does not really do what I would expect. In your filter "customers" is also active, which means that only customers without a parent company are visible (so no contacts linked to the customer company). When the sales orders are directed to a contact rather than its company, the filter "sales_order_ids != 0 does not work anymore because sales order count is apparently not transferred from contact to parent company.
Because all our sales orders are addressed to contacts, your proposed filter gives zero results with me. When I remove the filter "customers" however, it works and list all the contacts (but not the parent companies to which the contacts belong). When I group by company then, it gives the results I was looking for.
Strange though that sales order count is not transferred to the actual customer (company), but is only linked to the contact.
Over deze community
This platform 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Gevraagd: 03-01-18 11:38|
|Gezien: 262 tijden|
|Laatst bijgewerkt: 04-01-18 08:10|