To set an existing contact as the default invoice or delivery address for a company in Odoo Online (using Odoo Studio), follow these steps:
1. Understand Address Fields in Odoo
- Odoo’s Sales module allows you to associate specific invoice and delivery addresses with a customer.
- These addresses are typically linked to the Parent Company and stored as child contacts (e.g., type='invoice' or type='delivery').
2. Use Odoo Studio to Set Defaults
Since you are using Odoo Online, Odoo Studio can help configure these defaults.
Steps:
-
Activate Odoo Studio:
- Go to your Sales > Customers menu.
- Open Odoo Studio by clicking the Studio icon in the top-right corner.
-
Open the Customer Form View:
- In Studio, navigate to the form view of the customer.
- Ensure the Contact & Addresses section is visible.
-
Add Fields for Default Invoice and Delivery Contacts:
- Drag and drop Many2one fields onto the form.
- Configure these fields:
- Field for Default Invoice Contact:
- Related Model: res.partner.
- Field Name: x_default_invoice_contact.
- Label: "Default Invoice Contact".
- Field for Default Delivery Contact:
- Related Model: res.partner.
- Field Name: x_default_delivery_contact.
- Label: "Default Delivery Contact".
-
Set Default Values:
- Once the fields are added, edit the customer record for Company X.
- Select the existing contact (e.g., Cool Dude) as the default invoice and delivery contact.
3. Automatically Populate Sales Orders
You need to use Studio's automation features to automatically populate the invoice and delivery address fields on Sales Orders.
Steps:
-
Add an Automated Action in Studio:
- In Studio, create an Automated Action for the Sales Order model (sale.order).
- Configure the action:
-
Save and Test:
- Save the action.
- Create a new Sales Order for Company X, and verify that the default invoice and delivery addresses are automatically populated.
4. Optional: Adjust the Customer Form View
To avoid confusion when managing customer records, you can hide or disable the system-generated "Invoice Address" and "Delivery Address" fields in the form view. Use Studio to ensure your custom fields are prominent.
5. Benefits of This Approach
- Reuses Existing Contacts: Avoids creating duplicate contacts for the same person.
- Saves Time: Automatically sets invoice and delivery addresses without manual selection for each Sales Order.
- Uses Studio: Fully compliant with Odoo Online’s no-code/low-code approach.
6. Troubleshooting
- If the automation doesn’t work as expected:
- Verify that the x_default_invoice_contact and x_default_delivery_contact fields are properly populated in the customer record.
- Check for errors in the automated action configuration.
By implementing these changes, you can efficiently manage default addresses for your customers in Odoo Online without creating redundant contact records. Let me know if you need further assistance!
Ping! I'd like to see an answer to your question as well.