Skip to Content
Menu
This question has been flagged
1497 Views

Hi, before I create pivot I need to create temporary table 'plate.cost'.
All works fine but the "calculate_plate_price_table" related to "Report" menuitem. 
what I want to achive is:

# - Report (main) ->  action required: clean table and calculate plates costs again

# - - Plates Cost (submenu) -> create pivot (works OK)


    <record id="calculate_plate_price_table" model="ir.actions.server">

        <field name="name">Temporary Plate Price Table</field>

        <field name="model_id" ref="model_nutri_report_platescost"/>

        <field name="state">code</field>

        <field name="code">
                env['plate.cost'].search([]).unlink()

                env['plate.cost'].compute_plates_cost()

        </field>

    </record>

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

        <field name="name">Nutri Report</field>

        <field name="res_model">nutri.report.platescost</field>

        <field name="view_mode">pivot</field>

    </record>   


    <!--MENU-->

    <menuitem name="Report" id="report_menu" parent="nutrition.main_menu" action="calculate_plate_price_table" sequence="7"/>

    <menuitem name="Plates Cost" id="sub_report_menu" parent="report_menu" action="action_nutrition_report" sequence="1"/>

Avatar
Discard
Related Posts Replies Views Activity
2
Sep 21
4246
2
Dec 23
11994
0
Oct 23
33
3
Oct 23
787
1
Oct 23
6953