Poppy Cooke

Poppy Cooke

1548235464

Odoo10 xpath inherit field on purchase order line

I'm trying to code on module.

but i'm stuck. it doesn't work.

Python code

class PurchaseCurrency(models.Model):
    _inherit = "purchase.order.line"
new_currency = fields.Float(string="Test")

my xml

<record id=“new_currency_line” model=“ir.ui.view”>
<field name=“name”>purchase.order.form</field>
<field name=“model”>purchase.order</field>
<field name=“inherit_id” ref=“purchase.purchase_order_form”/>
<field name=“arch” type=“xml”>
<xpath expr=“//field[@name=‘order_line’]/tree/field[@name=‘product_qty’]” position=“after”>
<field name=“new_currency”/>
</xpath>
</field>
</record>

and error warning

ParseError: "Error while validating constraint

Field new_currency does not exist

Error context:

anyone can help me?

#python #xml

What is GEEK

Buddha Community

Add your python model file to init.py from . import model

Make sure your python model directory is imported in modules root init.py from . import models

Restart your odoo instance and update the module from web backend or using -u module_name from command line.

You can simplify xpath expression by using field tag

<record id="new_currency_line" model="ir.ui.view">
    <field name="name">purchase.order.form.new</field>
    <field name="model">purchase.order</field>
    <field name="inherit_id" ref="purchase.purchase_order_form" />
    <field name="arch" type="xml">
    <field name="product_qty" position="after">
        <field name="new_currency" />
    </field>
</record>

Origin Scale

Origin Scale

1621581772

Purchasing & Replenishment Software

Manage your purchases in a single window across multiple suppliers or manufacturers. Originscale works seamlessly with the entire value chain and helps you navigate through the end-to-end process from planning to manufacturing, shipment, arrival, receipt, and closure across channels & locations. Originscale makes purchases quickly and confidently with best-in-class Purchasing & Replenishment Software, so you can rather focus on boosting sales. TRY FOR FREE

#purchase order #purchasing #replenishment #purchase requisition #purchase order software #purchase order management software

Origin Scale

Origin Scale

1615535784

Purchasing & Replacement Software Solutions | Originscale

With Originscale, you’ve got reliable software providing dynamic inventory insights at your fingertips including raw materials and finished products that help you prevent missed production timelines, sales, avoid stockouts, and free up cash by optimizing operations so you can reinvest in your business.
Read more: https://www.originscale.io/purchasingreplenishment

#purchasing software solutions #purchase order software #purchasing software #free purchasing software #purchase order management software #purchasing software for manufacturing

Origin Scale

Origin Scale

1616572311

Originscale Order Management System

Originscale order management software helps to manage all your orders across channels in a single place. Originscale collects orders across multiple channels in real-time - online, offline, D2C, B2B, and more. View all your orders in one single window and process them with a simple click.

#order management system #ordering management system #order management software #free order management software #purchase order management software #best order management software

Types of Inheritance in Python | Python Inheritance [With Example] | upGrad blog

Introduction

The struggle for a clean code is a battle joined by all the programmers. And that battle can be conquered with a proper armour of object-oriented programming concepts. And proper utilization of OOP concepts helps us to improve code reusability, readability, optimal time and space complexity.

Coding in Python is super fun. It has a whopping number of library support, object-oriented, GUI programmability makes it a hot cake among all the programming languages.

Inheritance is one of the most utilized object-oriented features and implementing it in python is an enthusiastic task. So, let’s start now!

First things first let’s understand the definition of inheritance.

#data science #inheritance #inheritance in python #python #types of inheritance #types of inheritance in python

Poppy Cooke

Poppy Cooke

1548235464

Odoo10 xpath inherit field on purchase order line

I'm trying to code on module.

but i'm stuck. it doesn't work.

Python code

class PurchaseCurrency(models.Model):
    _inherit = "purchase.order.line"
new_currency = fields.Float(string="Test")

my xml

<record id=“new_currency_line” model=“ir.ui.view”>
<field name=“name”>purchase.order.form</field>
<field name=“model”>purchase.order</field>
<field name=“inherit_id” ref=“purchase.purchase_order_form”/>
<field name=“arch” type=“xml”>
<xpath expr=“//field[@name=‘order_line’]/tree/field[@name=‘product_qty’]” position=“after”>
<field name=“new_currency”/>
</xpath>
</field>
</record>

and error warning

ParseError: "Error while validating constraint

Field new_currency does not exist

Error context:

anyone can help me?

#python #xml