0
votes

How add a stage "new" in OCA module wchich field :

stage_id = fields.Many2one(
        'mgmtsystem.action.stage',
        'Stage',
        track_visibility='onchange',
        index=True,
        copy=False,
        default=lambda self: self._default_stage(),
        group_expand='_stage_groups',
    )

Thanks.

1

1 Answers

2
votes

If you are extending it with your own module, then it goes something like that

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <!-- It mofifies the original starting stage to be second and to be nonstarting -->
    <record id="mgmtsystem_action.stage_draft" model="mgmtsystem.action.stage">
        <field name="sequence">1</field>
        <field name="is_starting" eval="False" />
    </record>
    
    <record id="stage_new" model="mgmtsystem.action.stage">
        <field name="name">New</field>
        <field name="sequence">0</field>
        <field name="is_starting" eval="True" />
        <field name="is_ending" eval="False" />
    </record>


</odoo>

if you can edit the original module then edit mgmtsystem_action_stage.xml file:

https://github.com/OCA/management-system/blob/13.0/mgmtsystem_action/data/mgmtsystem_action_stage.xml