Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2785 มุมมอง

I want to add a "designation" field in the "stock.quant.tree" view that displays the description of each product in stock. I have already added the field in the tree but I am stuck how I get the value of the description of the model "purchase.order". Any idea for help please?

stock_quant_tree_designation.xml 

<?xml version="1.0" encoding="utf-8"?>

<openerp>

    <data>

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

            <field name="name">stock.quant.tree.designation</field>

            <field name="model">stock.quant</field>

            <field name="inherit_id" ref="stock.view_stock_quant_tree"/>

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

                <xpath expr="//field[@name='qty']" position="after">

                            <field name="designation2"/>

                </xpath>

            </field>

        </record>

    </data>

</openerp>


stock.py
from openerp.osv import fields, osv 
from openerp import tools , api
import openerp.addons.decimal_precision as dp
from openerp.tools.translate import _
class StockQuantTreeDesignation(osv.osv):
    _inherit = 'stock.quant'
    _columns = {
'designation2': fields.char(string="Désignation", required=True, select=True),
 }
    
อวตาร
ละทิ้ง
ผู้เขียน

https://ibb.co/ezkuhJ this is a photo to explain what i want

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
เม.ย. 25
3819
3
ธ.ค. 22
11767
How to get current url from bowser? แก้ไขแล้ว
5
เม.ย. 24
42337
Add users to group through python code แก้ไขแล้ว
6
เม.ย. 24
39260
how to compute Len() of list python แก้ไขแล้ว
3
มี.ค. 24
10771