Hi,
To add additional statuses, inherit the repair.order model and use selection_add to add new statuses:
# -- coding: utf-8 --
from odoo import fields, models
class RepairOrder(models.Model):
_inherit = 'repair.order'
state = fields.Selection(selection_add=[
('status1', 'Status 1'),
('status2', 'Status 2'),
])
You can replace status1 and status2 with the desired names.
Also, in the XML, modify the statusbar_visible attribute correctly to include the new statuses:
XML
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_repair_order_form" model="ir.ui.view">
<field name="name">repair.order.form.inherit</field>
<field name="model">repair.order</field>
<field name="inherit_id" ref="repair.view_repair_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='state']" position="attributes">
<attribute name="statusbar_visible">draft,confirmed,status1,status2,under_repair,done</attribute>
</xpath>
</field>
</record>
</odoo>
Ensure these files are in the correct directory structure within your custom module. Update the __manifest__.py file to include the XML file path in the data list and add repair in the depends list.