Hello, currently the order of the adres of our customers are displayed in the wrong order. On the invoice and in the contactlist. How do I change this? Example: currently we have House number, Street, City, Postal code. But in the netherlands we have the order Street, house number, postal code and city.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
You install contacts module. Go to settings in this module. Find menu Country, select Netherlands and change order in field Layout in Reports.
I am editing the Netherlands now, but can not find the Layout in reports? Do you perhaps have a screenshot?
You activate the developer mode.
In res.partner object , there is an method which create the string of the address of partner . Override below method in your res.partner object as per your expected format.
@api.model
def _get_default_address_format(self):
return "%(street)s\n%(street2)s\n%(state_code)s\t%(zip)s\t%(city)s\n%(country_name)s"
Were can I find res.partner object ?
Well, It is base module : base/res/res_partner.py file.
To override the method you have inherit the object res.partner in your custom module and override above method.
e.g
#create file
custome_res_partner.py
#Insert following code :
# -*- coding: utf-8 -*-
from odoo import api, fields, models, tools, SUPERUSER_ID, _
class ResPartner(models.Model):
_description = 'Contact'
_inherit = 'res.partner'
@api.model
def _get_default_address_format(self):
return "%(street)s\n%(street2)s\n%(state_code)s\t%(zip)s\t%(city)s\n%(country_name)s"
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up