Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Is there a form view for purchase order lines?

By
Carmen
on 12/12/13, 5:00 AM 2,068 views

Is there a form view for purchase order lines? how can I write notes in the pruchase_order_line?

0
Achref Mhadhbi
On 1/28/16, 4:17 AM

hi you can replace existing page with your own code

<xpath expr="/form/sheet/notebook/page[1]" position="replace">

<page name="Products" string="Products">

<field nolabel="1" collaspan="2" name="order_line"

context="{'form_view_ref':'purchase.purchase_order_line_form','tree_view_ref':'purchase.purchase_order_line_tree'}">

</field>

</page>

</xpath>


and you must replace create="false" with create ="true" so you can add and replace the fields as you want

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

<field name="name">purchase.order.line.tree.inherit</field>

<field name="model">purchase.order.line</field>

<field name="inherit_id" ref="purchase.purchase_order_line_tree" />

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

<tree string="Purchase Order Lines" create="false" position="replace">

<tree string="Purchase Order Lines" create="true">

<field name="name" /> 

<field name="price_unit" />

<field name="product_qty" />

<field name="product_uom" groups="product.group_uom" />

<field name="price_subtotal" />

<field name="date_planned" widget="date" width="135" />

</tree>

</tree>

</field>

</record>



0
Julio Serna
On 12/12/13, 1:38 PM

You can see purchase order line in:

Purchase / Invoice Control / On Purchase Order Line

Best Regards

0
Ashif Abdulrahman
On 12/12/13, 6:15 AM

yes..this is the form view...located in purchase module in th file purchase_view.xml

<record id="purchase_order_line_form" model="ir.ui.view">
            <field name="name">purchase.order.line.form</field>
            <field name="model">purchase.order.line</field>
            <field name="arch" type="xml">
                <form string="Purchase Order Line" version="7.0">
                    <sheet>
                        <group>
                            <group>
                                <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,0,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,context)"/>
                                <label for="product_qty"/>
                                <div>
                                    <field name="product_qty" on_change="onchange_product_id(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id,parent.date_order,parent.fiscal_position,date_planned,name,price_unit,context)" class="oe_inline"/>
                                    <field name="product_uom" groups="product.group_uom" on_change="onchange_product_uom(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,context)" class="oe_inline"/>
                                </div>
                                <field name="price_unit"/>
                            </group>
                            <group>
                                <field name="taxes_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
                                <field name="date_planned" widget="date"/>
                                <field name="account_analytic_id" colspan="2" groups="purchase.group_analytic_accounting"/>
                                <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                            </group>
                        </group>
                        <notebook>
                        <page string="Notes">
                            <field name="name"/>
                        </page><page string="Invoices and Receptions">
                            <field name="invoice_lines"/>
                            <field name="move_ids"/>
                        </page>
                        </notebook>
                    </sheet>
                </form>
            </field>
        </record>

Thanks Ashif! But, how can I get it to open? The only way I have to write a new line or modify an existing one is in the purchase order window. I don't know what to do to open the purchase order line view form you indicate.

Thanks again!

Carmen

Carmen
on 12/12/13, 7:59 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 12/12/13, 5:00 AM
Seen: 2068 times
Last updated: 6/24/16, 11:50 AM