Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
28190 Vistas

Class pos_category(models.Model):
    _inherit = 'pos.category'

   @api.model
    def create(self, data):
        r = super(pos_category,self).with_context(is_pos=True).create(data)
Avatar
Descartar
Mejor respuesta

You may want to check the following doc page

https://www.odoo.com/documentation/9.0/reference/orm.html#openerp.models.Model.with_context

# current context is {'key1': True}
r2 = records.with_context({}, key2=True)
# -> r2._context is {'key2': True}
r2 = records.with_context(key2=True)
# -> r2._context is {'key1': True, 'key2': True}
Avatar
Descartar