简体   繁体   中英

Add Column to sale order lines from product.template in Odoo 15

Products in odoo have informations like name,type,price,Internal Reference ect.. 在此处输入图像描述 I want to add Internal Reference of a product in sale order lines销售订单行

as you see in the picture we have in order lines product,description,qty,price ect.. i want to add Internal Reference to this infos.

how can i add Internal Reference from image 1 (product) to image 2 (Order lines)

inherit sale.order.line and add a field

default_code = fields.Char(string='Internal Reference ', related="product_id.default_code")

add this default_code field in xml by inheriting the the order_lines view.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM