Skip to Content
Menu
This question has been flagged
1 Reply
26620 Views

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
Discard
Best Answer

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
Discard