- Add blank lines at end of python files (pep8) - Easier uncomment (entire blocks, and no remaining whitespaces in empty lines) - Add `_description` to model to avoid the warning telling it's missing - Correct compute field, `self.value` raised an `ensure_one` issue - Change access so the user can add/edit/delete records in the web interface by default - Correct the server action, `self` is not in the server action context. closes odoo/odoo#40659 X-original-commit: 622615771d0a6f8544f6810f30df46aea0e0fb9c Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
20 lines
511 B
Plaintext
20 lines
511 B
Plaintext
# -*- coding: utf-8 -*-
|
|
|
|
# from odoo import models, fields, api
|
|
|
|
|
|
# class {{ name|snake }}(models.Model):
|
|
# _name = '{{ name|snake }}.{{ name|snake }}'
|
|
# _description = '{{ name|snake }}.{{ name|snake }}'
|
|
|
|
# name = fields.Char()
|
|
# value = fields.Integer()
|
|
# value2 = fields.Float(compute="_value_pc", store=True)
|
|
# description = fields.Text()
|
|
#
|
|
# @api.depends('value')
|
|
# def _value_pc(self):
|
|
# for record in self:
|
|
# record.value2 = float(record.value) / 100
|
|
|