You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
363 B

  1. Fields that want to implement the language default should use the provided method,such as in the below example::
  2. class MyModel(models.Model):
  3. _name = 'my.model'
  4. time_uom_id = fields.Many2one(
  5. string='Time Units',
  6. comodel_name='product.uom',
  7. default=lambda s: s.env['res.lang'].default_uom_by_category('Time'),
  8. )