Hello,
On an order/invoice, i select a customer and at the shipping address it displays all of the contacts on record. I want to display only the contacts and addresses of the customer I've selected.
Thank you.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello,
On an order/invoice, i select a customer and at the shipping address it displays all of the contacts on record. I want to display only the contacts and addresses of the customer I've selected.
Thank you.
Hi,
You can achieve this by adding domain for the contact field of sale order.If you want to set whether a contact need to be shown in the shipping address in the contact form, add a boolean field inside contact form and show only those contact for which this boolean is enabled.For example if the boolean field is
test_boolean = fields.Boolean()
Then the domain will be [('test_boolean', '=', True)]
Regards
This will show all the delivery addresses for all the companies. i have tried to filter it out with ["parent_id","=","partner_id"] but then doesnt populate anything
Inherit the field and add ('parent_id','=',partner_id) to the domain:
class SaleOrder(models.Model):
_inherit = 'sale.order'
partner_shipping_id = fields.Many2one(
comodel_name='res.partner',
string="Delivery Address",
compute='_compute_partner_shipping_id',
store=True, readonly=False, required=True, precompute=True,
states=LOCKED_FIELD_STATES,
domain="['|','&',('company_id', '=', False), ('company_id', '=', company_id), ('parent_id','=',partner_id)]")
Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.
Inscribirse