Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
1842 Lượt xem

Helo All


I need total quantity field on odoo Sales Quotation page

SO its calculate order quantity at the end of the quotation page 


I am using odoo 18 and I dont know how to add Total Quantity filed from odoo Studio?


any other way to add total quantity field on odoo 18?


please help


 


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

This is easy to do in Odoo Studio:

  1. Enable Studio and click on the Order Lines:

2. Click on the Quantity field and change the aggregate to "Sum"

Looks like this:

Or you can use cart quantity


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

There is already Field for this 

Activate developer Mode

Edit Sales view

Add Existing Field > Cart Quantity

You can Label that as you like

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

After enabling the developer model, go to sale on clicking the debug choose fields -> New

create new field with name x_total_qty, field type = Integer, In Base Properties enable Readonly

Advanced Properties -> compute section add code

for rec in self:

    rec.write({'x_total_qty': sum(rec.order_line.mapped('product_uom_qty'))})

after that click debug from sale order form view , click debug and choose View:Form, Inherited views notebook click add a line , give name to it and in the Architecture add code

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

    <field name="x_total_qty"/>

  </xpath>

save and reload form view you can see the newly added field showing the total sale order quantity after the Payment terms or you can adjust the view.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 11 24
1540
1
thg 5 23
2310
0
thg 10 22
2220
2
thg 3 25
2051
1
thg 7 23
3048