Skip to Content
Menu
This question has been flagged
1 Reply
3425 Views

Hi all,

I'm trying to port an addon v8 to odoo 11. I faced a problem in that case.  

<record id="wizard_account_partner_balance_letter_form" model="ir.ui.view">
            <field name="name">wizard.account.partner.balance.letter.form</field>
            <field name="model">account.partner.balance.letter</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Account Partner Balance Letter">
                    <group colspan="2">
                        <field name="date_start" invisible="1"/>
                        <field name="date_end"/>
                    </group>
                    <footer>
                        <button name="print_report" string="Print" type="object" class="oe_highlight"
                                context="{'date_from':date_start, 'date_to':date_end}"/>
                        or
                        <button string="Cancel" special="cancel" class="oe_link"/>
                    </footer>
                </form>
            </field>
        </record>
        <record id="account_partner_balance_letter_action_window" model="ir.actions.act_window">
            <field name="name">Account Partner Balance Letter</field>
            <field name="res_model">account.partner.balance.letter</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="view_id" ref="wizard_account_partner_balance_letter_form"/>
            <field name="target">new</field>
        </record>
        <record model="ir.values" id="ir_values_account_partner_balance_letter">
            <field name="key2" eval="'client_print_multi'"/>
            <field name="model" eval="'res.partner'"/>
            <field name="name">Account Partner Balance Letter</field>
            <field name="value" eval="'ir.actions.act_window,%d'%account_partner_balance_letter_action_window"/>
        </record>

i'm taking this error: odoo.tools.convert.ParseError: "ir.values" while parsing


After that, I changed ir.values with ir.actions.server. 

This time it gives that error:

odoo.tools.convert.ParseError: "null value in column "model_id" violates not-null constraint

DETAIL:  Failing row contains (276, Account Partner Balance Letter, ir.actions.server, null, null, action, 1, 2018-12-20 19:21:52.083847, 1, 2018-12-20 19:21:52.083847, ir_actions_server, object_write, 5, null, null, # Available variables:

#  - env: Odoo Environment on which the a..., null, null, null).

" while parsing


How can I open form before I print report in Odoo 11. Please help me

Avatar
Discard
Author Best Answer

I solved this. 


Solution is:

I replaced this:

<record model="ir.values" id="ir_values_account_partner_balance_letter">
            <field name="key2" eval="'client_print_multi'"/>
            <field name="model" eval="'res.partner'"/>
            <field name="name">Account Partner Balance Letter</field>
            <field name="value" eval="'ir.actions.act_window,%d'%account_partner_balance_letter_action_window"/>
        </record>
with this:

<act_window id="action_account_partner_balance_letter"
name="Account Partner Balance Letter"
src_model="res.partner"
res_model="account.partner.balance.letter"
view_type="form" view_mode="form"
key2="client_print_multi" target="new"
/>
Avatar
Discard
Related Posts Replies Views Activity
0
Nov 17
2880
0
Apr 24
559
5
Dec 22
25057
0
Jan 22
2683
0
Jun 20
1630