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
- Boekhouding
- Voorraad
- PoS
- Project
- MRP
Deze vraag is gerapporteerd
1
Beantwoorden
1379
Weergaven
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
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
Aanmelden