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
- Financeiro
- Inventário
- PoS
- Project
- MRP
Esta pergunta foi sinalizada
1
Responder
1384
Visualizações
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
Está gostando da discussão? Não fique apenas lendo, participe!
Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!
Inscreva-se