Skip to Content
Odoo เมนู
  • ลงชื่อเข้าใช้
  • ทดลองใช้ฟรี
  • แอป
    การเงิน
    • ระบบบัญชี
    • ระบบการออกใบแจ้งหนี้
    • ระบบบัญชีรายจ่าย
    • ระบบการจัดการข้อมูลผ่านสเปรดชีต (BI)
    • เอกสาร
    • ระบบลงลายเซ็น
    การขาย
    • ลูกค้าสัมพันธ์
    • การขาย
    • POS ร้านค้า
    • POS ร้านอาหาร
    • ระบบสมัครสมาชิก
    • การเช่า
    การจัดการเว็บไซต์
    • เครื่องมือสร้างเว็บไซต์
    • ระบบการขายออนไลน์
    • บล็อก
    • ฟอรั่ม
    • ไลฟ์แชท
    • ระบบการอบรมออนไลน์
    ซัพพลายเชน
    • คลังสินค้า
    • ระบบการผลิต
    • PLM
    • ระบบการจัดซื้อ
    • การซ่อมบำรุง
    • ระบบจัดการคุณภาพ
    ทรัพยากรบุคคล
    • ข้อมูลพนักงาน
    • ระบบสรรหาบุคลากร
    • ระบบการลา
    • การประเมิน
    • ระบบการแนะนำพนักงาน
    • ระบบจัดการยานพาหนะ
    การตลาด
    • โซเชียลมาร์เก็ตติ้ง
    • การตลาดผ่านอีเมล
    • ระบบการตลาดผ่าน SMS
    • ระบบการจัดงานอีเวนต์
    • การตลาดแบบอัตโนมัติ
    • ระบบแบบสำรวจ
    การบริการ
    • โปรเจกต์
    • ระบบบันทึกเวลา
    • ระบบการจัดการบริการภาคสนาม
    • ระบบดูแลช่วยเหลือ
    • การวางแผน
    • การนัดหมาย
    ประสิทธิผล
    • ระบบแสดงความคิดเห็น
    • ระบบการอนุมัติ
    • ไอโอที
    • VoIP
    • คลังข้อมูล
    • WhatsApp
    แอปพลิเคชันของบุคคลที่สาม Odoo สตูดิโอ แพลตฟอร์มคลาวด์ของ Odoo
  • อุตสาหกรรม
    การค้าปลีก
    • ร้านขายหนังสือ
    • ร้านขายเสื้อผ้า
    • ร้านขายเฟอร์นิเจอร์
    • ร้านขายของชำ
    • ร้านขายฮาร์ดแวร์
    • ร้านขายของเล่น
    Food & Hospitality
    • บาร์และผับ
    • ร้านอาหาร
    • อาหารฟาสต์ฟู้ด
    • Guest House
    • ตัวแทนจำหน่ายเครื่องดื่ม
    • Hotel
    Real Estate
    • Real Estate Agency
    • บริษัทสถาปัตยกรรม
    • บริษัทรับเหมา
    • การจัดการอสังหาริมทรัพย์
    • การจัดสวน
    • สมาคมเจ้าของอสังหาริมทรัพย์
    Consulting
    • Accounting Firm
    • Odoo พาร์ทเนอร์
    • เอเจนซี่การตลาด
    • สำนักงานกฎหมาย
    • บริการสรรหาบุคลากร
    • การตรวจสอบและการรับรอง
    ระบบการผลิต
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • ของขวัญขององค์กร
    สุขภาพ & ฟิตเนส
    • ชมรมกีฬา
    • ร้านขายแว่นตา
    • ฟิตเนส
    • ผู้ประกอบวิชาชีพด้านสุขภาพ
    • ร้านขายยา
    • ร้านทำผม
    Trades
    • ช่างซ่อม
    • ฮาร์ดแวร์และการสนับสนุนด้านไอที
    • Solar Energy Systems
    • ช่างทำรองเท้า
    • บริการทำความสะอาด
    • HVAC Services
    Others
    • Nonprofit Organization
    • สำนักงานสิ่งแวดล้อม
    • ร้านเช่าป้ายโฆษณา
    • การถ่ายภาพ
    • ร้านเช่าจักรยาน
    • ตัวแทนจำหน่ายซอฟต์แวร์
    Browse all Industries
  • คอมมูนิตี้
    ศึกษา
    • บทเรียน
    • เอกสารกำกับโปรแกรม
    • การรับรอง
    • การฝึกอบรม
    • บล็อก
    • พอดแคสต์
    เพิ่มศักยภาพให้กับการศึกษา
    • โปรแกรมการศึกษา
    • Scale Up! Business Game
    • เยี่ยมชม Odoo
    รับซอฟต์แวร์
    • ดาวน์โหลด
    • เปรียบเทียบรุ่น
    • เผยแพร่
    ทำงานร่วมกัน
    • Github
    • ฟอรั่ม
    • ระบบการจัดงานอีเวนต์
    • การแปล
    • ร่วมเป็นพาร์ทเนอร์
    • Services for Partners
    • ลงทะเบียนเพื่อสร้างบัญชีบริษัทของคุณ
    รับบริการ
    • ค้นหาพาร์ทเนอร์
    • ค้นหานักบัญชี
    • พบกับที่ปรึกษา
    • บริการติดตั้งระบบเพื่อใช้งาน
    • ข้อมูลอ้างอิงลูกค้า
    • การสนับสนุน
    • อัปเกรด
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    รับการสาธิต
  • ราคา
  • ช่วยเหลือ

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • ลูกค้าสัมพันธ์
  • e-Commerce
  • ระบบบัญชี
  • สินค้าคงคลัง
  • PoS
  • โปรเจกต์
  • MRP
All apps
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
ช่วยเหลือ

How to add a column to Sales Order Lines?

ติดตาม

รับการแจ้งเตือนเมื่อมีกิจกรรมในโพสต์นี้

คำถามนี้ถูกตั้งค่าสถานะ
salesviewinheritancev7quotation
2 ตอบกลับ
14117 มุมมอง
อวตาร
Anabela Damas

Hi, First of all I had a new parameter to the product. Then I need that new parameter in Sales Order Lines for each product in the sales order.

I've tried to add but I had some problems regarding to being inheriting a view from sales.order and adding a parameter from products.

I've done this:

<record id="view_order_form_inherit" model="ir.ui.view">
  <field name="name">sale.order.form.inherit</field>
  <field name="model">sale.order</field>
  <field name="inherit_id" ref="sale.view_order_form"/>
  <field name="arch" type="xml">
     <xpath expr="/form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='price_unit']" position="before">
         <field name="new_field_from_product"/> 
     </xpath>
  </field>
</record>

Thanks, sorry my English.

1
อวตาร
ละทิ้ง
อวตาร
AJ Schrafel Paper Corp
คำตอบที่ดีที่สุด

First, The code you posted is trying to insert your new field into the view_ORDER_form, you need to insert it on the view_ORDER_LINE_form.

Second, the python code must also inherit and add the new field, if you are not doing that, there is no way your XML will work right.

Third, when you ask for help, please include the error message. Without the error message those trying to help you are flying blind.

0
อวตาร
ละทิ้ง
Anabela Damas
ผู้เขียน

I've changed the code to: <record id="view_order_line_form_inherit" model="ir.ui.view"> <field name="name">sale.order.line.form.inherit</field> <field name="model">sale.order.line</field> <field name="inherit_id" ref="sale.view_order_line_form2"/> <field name="arch" type="xml"> <xpath expr="/form/sheet/group/group/field[@name='price_unit']" position="before"> <field name="vi_adr"/> </xpath> </field> </record>

Anabela Damas
ผู้เขียน

In the second point you said that I've to inherit and and the new field, class product_product(osv.osv): _inherit = "product.product" _name = "product.product" _columns = { 'vi_adr': fields.boolean('ADR', help="Check this box if the product needs ADR (Accord europeen relatif au transport international des marchandises Dangereuses par Route)"), } product_product() Is this that you mean or is to add the new field in the sale.order.line?

Anabela Damas
ผู้เขียน

And the error that I've with the new code is: Can't find field 'vi_adr' in the following view parts composing the view of object model 'sale.order.line': * sale.order.line.form.inherit Either you wrongly customized this view, or some modules bringing those views are not compatible with your current data model openerp.addons.base.ir.ir_ui_view: Can't render view mutante.view_order_line_form_inherit for model: sale.order.line

AJ Schrafel Paper Corp

you must upload your code, then stop and start your server to get openERP to recognize the new fields you added in your python file.

Anabela Damas
ผู้เขียน

I'm stoping and starting the server by doing this : ./openerp-server -c install/openerp-server.conf --update=mynewmodule, but the error that I've mentioned is always there..

AJ Schrafel Paper Corp

that is wrong, you must FIRST stop the server. ./openerp-server stop SECOND run the command to confirm the server has stopped - ps aux | grep openerp THIRD kill any other running processes FINALLY start the server again ./openerp-server start capitals are for readability because you cannot put new lines in the comments.

Anabela Damas
ผู้เขียน

I've this error doing like you told me to: ./openerp-server start No handlers could be found for logger "openerp.addons.google_docs.google_docs" Traceback (most recent call last): File "./openerp-server", line 5, in <module> openerp.cli.main() File "/opt/openerp-7.0/openerp/cli/__init__.py", line 51, in main __import__(m) File "/opt/openerp-7.0/openerp/modules/module.py", line 133, in load_module mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)

Anabela Damas
ผู้เขียน

File "/opt/openerp-7.0/openerp/addons/base_action_rule/__init__.py", line 23, in <module> import test_models File "/opt/openerp-7.0/openerp/addons/base_action_rule/test_models.py", line 1, in <module> from osv import osv, fields

Anabela Damas
ผู้เขียน

I've put this working but the error is still here: " Can't find field 'vi_adr' ..."

AJ Schrafel Paper Corp

you must add the attribute to class sale_order_line(osv.osv): if you want to record that information in an order line. If you have a product that is or is not ADR it would be much easier for you to just create 2 different products. I do not know what ADR is, so i cannot adivse you.

Anabela Damas
ผู้เขียน

So if I had a field to products and if I want that field to appear in the sale_order_line I have to add this field to the class sale_order_line(osv.osv)? ADR - "Accord europeen relatif au transport international des marchandises Dangereuses par Route" Thanks

AJ Schrafel Paper Corp

Yes, but it would probably be easier for you to create a product ADR, and add that to orders that require ADR. Or create 2 product entries - one with ADR and one without, for each of your products. That would remove the need for you to do any custom coding.

Jhon Felipe Urrego Mejia

Hi, please share all module, tnks

อวตาร
Abdullah
คำตอบที่ดีที่สุด

Here is .py

class SaleOrderLine(models.Model):
_inherit = "sale.order.line"

secondary_uom_qty = fields.Float(
string="Secondary Qty", digits="Product Unit of Measure"
)

Here is your XML


Sale Order Secondary Unit
sale.order



expr="//field[@name='order_line']/form//field[@name='price_subtotal']"
position="after"
>
name="secondary_uom_qty"
class="oe_inline oe_no_button"
attrs="{'readonly': [('state', 'in', ('done', 'cancel'))]}"
/>

I hope this will give you a good idea about how to do it. Just inherit sale.order.line in py and specify your field and in xml while specifying model you will write sale.order as both views are linked together.

Thanks

0
อวตาร
ละทิ้ง
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!

สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!

ลงชื่อ
Related Posts ตอบกลับ มุมมอง กิจกรรม
Sales quotation in V10 แก้ไขแล้ว
sales view quotation
อวตาร
อวตาร
1
มิ.ย. 19
2763
odoo16 sale order inheritance
sales view inheritance saas odoo16features
อวตาร
อวตาร
อวตาร
2
มี.ค. 23
3048
Sales quotation แก้ไขแล้ว
sales quotation
อวตาร
อวตาร
2
มี.ค. 24
8530
View inheritance แก้ไขแล้ว
view inheritance
อวตาร
อวตาร
1
มี.ค. 20
4300
How to auto refresh view? แก้ไขแล้ว
view v7
อวตาร
อวตาร
อวตาร
อวตาร
อวตาร
12
ธ.ค. 23
45315
คอมมูนิตี้
  • บทเรียน
  • เอกสารกำกับโปรแกรม
  • ฟอรั่ม
โอเพนซอร์ส
  • ดาวน์โหลด
  • Github
  • Runbot
  • การแปล
บริการ
  • โฮสติ้ง odoo.sh เซิร์ฟเวอร์
  • การสนับสนุน
  • อัปเกรด
  • การพัฒนาที่กำหนดเอง
  • การศึกษา
  • ค้นหานักบัญชี
  • ค้นหาพาร์ทเนอร์
  • ร่วมเป็นพาร์ทเนอร์
เกี่ยวกับเรา
  • บริษัทของเรา
  • ทรัพย์สินในรูปของเครื่องหมายการค้า
  • ติดต่อเรา
  • งาน
  • ระบบการจัดงานอีเวนต์
  • พอดแคสต์
  • บล็อก
  • ลูกค้า
  • กฎหมาย • ความเป็นส่วนตัว
  • ความปลอดภัย
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo เป็นชุดแอปธุรกิจแบบเปิดที่ครอบคลุมทุกความต้องการของบริษัทของคุณ อาธิ CRM eCommerce ระบบบัญชี ระบบสินค้าคงคลัง ระบบการขายหน้าร้าน โปรเจกต์ และ อีกมากมาย

ความเหนือกว่าอันเป็นเอกลักษณ์ของ Odoo คือการใช้งานที่ง่ายดายและผสานการทำงานอย่างสมบูรณ์แบบในเวลาเดียวกัน

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now