Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
1116 Widoki

Hi I was trying to  replenish stock and would like to check how many sold last month. But I found no list showing both existing inventory and qty sold so that I can make decision quickly. 

For example, the list shows: 

Item A sold 20pcs last month and only 2pcs left in stock now. Then I can quickly decide to restock 18pcs for next month.

Item B...

Item C...etc

May I add a field which show the qty sold last month on the Product Variant list? Or any other solutions?

Thanks




Awatar
Odrzuć

Did you ever figure this out?

Autor

Thanks! (In the Action field, add a Python code snippet to calculate the quantity sold last month for each product). May I know the code or do you have any charge service? not familiar with Python...

Najlepsza odpowiedź

It seems that creating replenishment rules based on sales history is what you're looking for. There's no fully automated solution, but Odoo's MPS could be a great tool.

Awatar
Odrzuć
Najlepsza odpowiedź

In Odoo, you can create a custom field to display the quantity sold last month on the Product Variant list. To achieve this, you'll need to follow these general steps:

1. Create a Custom Field:

  1. Go to the "Inventory" app.
  2. Navigate to "Configuration" > "Settings."
  3. Enable the "Developer mode" from the settings.
  4. Go to "Technical" > "Database Structure" > "Fields."
  5. Create a new field with the following details:
    • Model: product.product
    • Name: Choose a name for your field (e.g., qty_sold_last_month).
    • Field Label: Display name for the field.
    • Field Type: Integer or Float (depending on your preference).

2. Calculate Quantity Sold Last Month:

  1. Go to "Technical" > "Automation" > "Scheduled Actions."
  2. Create a new scheduled action that runs monthly.
  3. In the Action field, add a Python code snippet to calculate the quantity sold last month for each product and update the custom fieldGo to "Inventory" > "Configuration" > "Settings."
  4. Enable the "Developer mode."
  5. Go to "Technical" > "User Interface" > "Views."
  6. Find and edit the view for the Product Variant list.
  7. Add the newly created custom field to the view.

3. Display the Custom Field on the Product Variant List:

  1. Go to "Inventory" > "Configuration" > "Settings."
  2. Enable the "Developer mode."
  3. Go to "Technical" > "User Interface" > "Views."
  4. Find and edit the view for the Product Variant list.
  5. Add the newly created custom field to the view.

4. Update and Upgrade:

After making these changes, update the module and upgrade the database to apply the changes. Then, you should see the quantity sold last month on the Product Variant list.


Awatar
Odrzuć