I need to add two selection fields in products: one for manufacturer (For example: LG, Samsung) and another selection field for the model that would depend from the selected manufacturer. For example, if we selected LG, then in models field we'll see only models for LG, and if Samsung is selected, then only models for samsung we can select in models field.
I'm trying to get value of selection field, but always get ony None instead:
from odoo import models, fields, api
_inherit = 'product.template'
manufactures = 
raw_data = self.env['product.manufacturer.model'].search()
for rec in raw_data:
return ('one', 'ONE')
product_manufacturers = fields.Selection(get_manufactures,
product_models = fields.Selection(get_selected_value)
My function get_selected_value for testing, also alarms there for testing too ;)
Can anybody tell how can I get the value from selection field?
I'll be grateful for any help.