just wanna find out all products which got no sales, so that we could re -consider the strategy about them.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Apskaita
- Atsarga
- PoS
- Project
- MRP
This question has been flagged
Hi Sigma,
without any customization, I propose to use a scheduled action with python code. The code will give you a nice error message listing all products which were not sold during a specific period, which you can adjust in the code. Below is an example for getting these values. Of course if you want to only see which products are not delivered in a period or not invoiced in a period, you could use the same strategy but different models in odoo.
This is the code:
def get_unsold_products_in_january(self):
# Step 1: Find all products that were sold in the given period
env.cr.execute("""
SELECT DISTINCT(product_id)
FROM sale_order_line
WHERE order_id IN (
SELECT id FROM sale_order
WHERE date_order >= '2024-01-01' AND date_order
)
""")
sold_product_ids = [row[0] for row in env.cr.fetchall()]
# Step 2: Find all products that were not sold in January 2024
unsold_products = self.env['product.product'].search([
('id', 'not in', sold_product_ids)
])
# Step 3: Prepare the message with product internal reference and name
if unsold_products:
message = "\n".join([f"{prod.default_code} - {prod.name}" for prod in unsold_products])
raise UserError(f"The following products were not sold:\n\n{message}")
else:
raise UserError("All products were sold.")
Can I help you with this? Contact me at hi (at) latus . ch / thanks! Cheers, Joep
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
RegistracijaRelated Posts | Replies | Rodiniai | Veikla | |
---|---|---|---|---|
|
2
geg. 25
|
3217 | ||
|
0
lapkr. 24
|
866 | ||
|
1
rugp. 24
|
2626 | ||
|
2
geg. 23
|
1806 | ||
|
2
geg. 20
|
36 |
It looks like this module - https://apps.odoo.com/apps/modules/17.0/low_sales_report - serve exactly for the goal.