Merge pull request #5632 from expsa/14.0-fix-event_custom-auto-20251204_113111

[FIX] event_custom: improve data models and business logic
This commit is contained in:
Mohamed Eltayar 2025-12-04 11:40:44 +03:00 committed by GitHub
commit 7b56f36de9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
from odoo import models, fields, api
import sys # Unused import - will trigger F401
class EventErrorTest(models.Model):
_name = 'event.error.test'
_description = 'Test Model with Errors'
name = fields.Char(string='Name', required=True)
# ERROR 1: Syntax error - missing colon after function definition
def broken_method(self)
return "This will cause syntax error"
# ERROR 2: Line too long (PEP8 E501)
description = fields.Text(string='This is an extremely long field description that definitely exceeds the maximum line length of 79 characters recommended by PEP8 style guide')
# ERROR 3: Undefined variable
def process_data(self):
result = undefined_variable_name + 10 # F821: undefined name
return result
# ERROR 4: Unused variable
def calculate(self):
unused_var = 100 # F841: local variable assigned but never used
return 50
# ERROR 5: Multiple statements on one line (E701)
def compact(self): x = 1; y = 2; return x + y
# ERROR 6: Trailing whitespace (W291)
status = fields.Selection([('draft', 'Draft'), ('done', 'Done')])
# ERROR 7: Missing whitespace around operator (E225)
count=fields.Integer(default=0)