This question has been flagged

I have to develop a wizard that let manipulate the Selection field values for the final user, I all ready have the wizards and models, but the methods doesn't work, what can I do for success the objective?

This is my model code:

PROPERTY_TYPES = [("A", "Apartamento"), ("B", "Bodega"), ("C", "Casa"), ("S", "Consultorio"),
("F", "Finca"), ("L", "Local"), ("T", "Lote"), ("P", "Parqueadero"), ("O", "Oficina")]
class Property(models.Model):
    place_type = fields.Selection(PROPERTY_TYPES,"Tipo de sitio")

And this is my wizard code:

from ..models.models import *



class PropertyTypesWizard(models.TransientModel):

    _name = "product.property_types.wizard"

    type_ref = fields.Char(string="Property type internal ref")
    type_name = fields.Char(string="Property type name")
 
    @api.multi
    def add_property_type(self):
        PROPERTY_TYPES.append((self.type_ref, self.type_name))
        return {}
 
Avatar
Discard