every product in odoo should have quantity minimum
i have created product and i set the quantity min to it in reordering rule
what i want to do is get the product name and it's quantity min in python
this is my python file
from odoo import fields,models,api
class Qty_Min_Alert(models.Model):
_inherit='product.template'
product_name = # here i want to set the product name from product.template
product_qty_min = # here i want to set the product quantity minimum from product.template
i added 'product' in depends on __manifest__.py
can you help me please
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
This question has been flagged
1
Reply
1016
Views
Hi,
You can refer to this code.
from odoo import fields, models
class ProductTemplate(models.Model):
_inherit = 'product.template'
product_name = fields.Many2one('product.template', string='Prooooooo')
product_qty_min = fields.Float(related='product_name.reordering_min_qty')
Regards
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up