This question has been flagged
3 Replies
3977 Views

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?

Avatar
Discard
Author Best Answer

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!

Avatar
Discard
Best Answer

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

Avatar
Discard
Author

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