Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
486 Widoki

Using the code below, when I open the form view, it pulls the view from another xml file.  It's driving me crazy as I can't for the life of me find out what's causing the issue.  any ideas where I'm going wrong ?

<odoo>


      <!-- Action to Show User-Specific Jobs -->

    <record id="action_myags" model="ir.actions.act_window">

        <field name="name">My Jobs</field>

        <field name="type">ir.actions.act_window</field>

        <field name="res_model">garden.service</field>

        <field name="view_mode">tree,form</field>

        <field name="domain">[('user_id', '=', uid), ('job_status', '=', 'active'), ('next_scheduled', '&lt;=', 'today')] </field>

        <field name="view_id" ref="view_myjobs_tree"/>

    </record>

    <!-- Tree View for User-Specific Jobs -->

    <record id="view_myjobs_tree" model="ir.ui.view">

        <field name="name">myjobs.tree</field>

        <field name="model">garden.service</field>

        <field name="arch" type="xml">

            <tree string="My Jobs" default_order="next_scheduled asc">

                <field name="partner_id"/>

                <field name="suburb"/>

                <field name="address" string="Customer Address"/>

                <field name="job_type"/>

                <field name="next_scheduled"/>

                <button name="action_complete_job" type="object" string="Complete" class="btn-primary"/>

            </tree>

        </field>

    </record>


    <!-- Define the form view for the Garden Service model -->

    <record id="view_myjobs_form" model="ir.ui.view">

        <field name="name">myjobs.form</field>

        <field name="model">garden.service</field>

        <field name="arch" type="xml">

            <form string="My Jobs">

                <sheet>

                    <field name="partner_id"/>

                    <field name="address" readonly="1"/>

                    <field name="job_type"/>

                               

                </sheet>

            </form>

        </field>

    </record>


    <!-- Menu Item to Access User-Specific Jobs -->    

    <menuitem name="My Jobs"

        id="garden_service_user_submenu"

        parent="garden_service_menu_root"

        action="action_myags"

        sequence="2"/>


</odoo>

Awatar
Odrzuć
Autor Najlepsza odpowiedź

adding this to my action fixed the problem

<field name="view_ids" eval="[(5, 0, 0),

            (0, 0, {'view_mode': 'tree', 'view_id': ref('view_myjobs_tree')}),

            (0, 0, {'view_mode': 'form', 'view_id': ref('view_myjobs_form')})]"/>

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
lut 21
25982
2
lut 25
1007
2
gru 24
1141
2
maj 24
1290
1
wrz 23
4167