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

I use Odoo v8 and would like to know if it's possible disable auto-filling the fields "Invoice Adress" and "Delivery Adress" too.

These address types are automatically set on invoice when partner is selected, but I would like to not set automatically them, so I will force the user to search these values. Is it possible?

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

For documentation about my question, here is the solution:

Go through these steps:

  1. Locate Menu User Interface/Views [Setting->Technical->User Interface->Views]

  2. Search sale.order.form

  3. Edit this template 

  4. On current lines 27 until 32 there is a tag <group>:

  5.                             <field name="partner_id" on_change="onchange_partner_id(partner_id, context)" domain="[('customer','=',True)]" context="{'search_default_customer':1, 'show_address': 1}" options="{&quot;always_reload&quot;: True}"/>

    <field name="partner_invoice_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'invoice'}"/>

    <field name="partner_shipping_id" on_change="onchange_delivery_id(company_id, partner_id, partner_shipping_id, fiscal_position)" groups="sale.group_delivery_invoice_address" context="{'default_type':'delivery'}"/>

  6. I removed the two parameters above (on_change="onchange_partner_id(partner_id, context)" and on_change="onchange_delivery_id(company_id, partner_id, partner_shipping_id, fiscal_position)") and everithing is ok!

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

Yes it is possible, just override the onchange method "onchange_partner_id" , and unset the values for those 2 fields.

Ảnh đại diện
Huỷ bỏ
Tác giả

Hi Mr. Deep, thank you for your reply. I'm begginer, the method onchange_parther_id can be modified direct on configurations from interface web or I have to do it directly on pyhton code? Could you give me details?

You have to do it in Python code

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 2 25
2055
1
thg 12 24
2148
2
thg 3 24
2473
1
thg 2 24
2459
2
thg 3 24
2998