server-ux/base_tier_validation_server_action/tests/tier_validation_tester.py

29 lines
849 B
Python
Raw Normal View History

2021-03-23 19:15:27 +00:00
# Copyright 2020 Ecosoft (http://ecosoft.co.th)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from flectra import fields, models
class TierValidationTester(models.Model):
_name = "tier.validation.tester"
_description = "Tier Validation Tester"
_inherit = ["tier.validation"]
state = fields.Selection(
selection=[
("draft", "Draft"),
("confirmed", "Confirmed"),
("cancel", "Cancel"),
],
default="draft",
)
test_field = fields.Float()
user_id = fields.Many2one(string="Assigned to:", comodel_name="res.users")
test_bool = fields.Boolean()
def action_confirm(self):
self.write({"state": "confirmed"})
def _get_under_validation_exceptions(self):
return super()._get_under_validation_exceptions() + ["test_bool"]