This question has been flagged
2 Replies
3974 Views

Hello gang!

I have added a new menuitems : Sales->Sales->Sales invoices - PT 

If I click on my new menuitem, I get list view of all the invoices. Good!

If I click on the button « create », it creates a new draft SUPPLIER invoice. Not for a CUSTOMER :

 

Would you know how I could correct this? A tip?

Please and thanks!

Avatar
Discard
Best Answer

See the original view definition, bold for you:      

<record id="action_invoice_tree1" model="ir.actions.act_window">
            <field name="name">Customer Invoices</field>
            <field name="res_model">account.invoice</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form,calendar,graph</field>
            <field eval="False" name="view_id"/>
            <field name="domain">[('type','=','out_invoice')]</field>
            <field name="context">{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale'}</field>

            <field name="search_view_id" ref="view_account_invoice_filter"/>
            <field name="help" type="html">
              <p class="oe_view_nocontent_create">
                Click to create a customer invoice.
              </p><p>
                Odoo's electronic invoicing allows to ease and fasten the
                collection of customer payments. Your customer receives the
                invoice by email and he can pay online and/or import it
                in his own system.
              </p><p>
                The discussions with your customer are automatically displayed at
                the bottom of each invoice.
              </p>
            </field>
        </record>

 

Avatar
Discard
Author Best Answer

zbik was right. Once again! Thanks.

Here is all the needed code to create my new  « Sales->Sales->Sales invoices - PT » menuitems :

<menuitem id="report_lapagept.menu_action_invoice_tree1_pt" name="Sales invoices - PT" parent="base.menu_sales" sequence="300" action="report_lapagept.action_invoice_tree1_pt" />

        <record id="report_lapagept.action_invoice_tree1_pt" model="ir.actions.act_window">
            <field name="name">Sale invoices - PT action</field>
            <field name="res_model">account.invoice</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form,calendar,graph</field>
            <field eval="False" name="view_id"/>
            <field name="domain">[('type','=','out_invoice')]</field>
            <field name="context">{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale'}</field>
            <field name="search_view_id" ref="account.view_account_invoice_filter"/>
            <field name="help" type="html">
              <p class="oe_view_nocontent_create">
                Click to create a customer invoice.
              </p><p>
                Odoo's electronic invoicing allows to ease and fasten the
                collection of customer payments. Your customer receives the
                invoice by email and he can pay online and/or import it
                in his own system.
              </p><p>
                The discussions with your customer are automatically displayed at
                the bottom of each invoice.
              </p>
            </field>
        </record>

<record id="report_lapagept.action_invoice_tree1_view1" model="ir.actions.act_window.view">
            <field eval="1" name="sequence"/>
            <field name="view_mode">tree</field>
            <field name="act_window_id" ref="report_lapagept.action_invoice_tree1_pt"/>
        </record>

        <record id="report_lapagept.action_invoice_tree1_view2" model="ir.actions.act_window.view">
            <field eval="2" name="sequence"/>
            <field name="view_mode">form</field>
            <field name="view_id" ref="invoice_form"/>
            <field name="act_window_id" ref="report_lapagept.action_invoice_tree1_pt"/>
        </record>

THANKS ALL!

Avatar
Discard