diff --git a/odex-event/event_custom/models/test_errors.py b/odex-event/event_custom/models/test_errors.py new file mode 100644 index 000000000..32d50564a --- /dev/null +++ b/odex-event/event_custom/models/test_errors.py @@ -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)