Hi, I want to create a custom module and I need to remove the mandatory fields on the checkout address page. I just want to use [name, email]. How can I remove the mandatory ["street", "city", "country_id"]?
def _get_mandatory_fields_billing(self, country_id=False):
req = ["name", "email", "street", "city", "country_id"]
if country_id:
country = request.env['res.country'].browse(country_id)
if country.state_required:
req += ['state_id']
if country.zip_required:
req += ['zip']
return req
def _get_mandatory_fields_shipping(self, country_id=False):
req = ["name", "street", "city", "country_id"]
if country_id:
country = request.env['res.country'].browse(country_id)
if country.state_required:
req += ['state_id']
if country.zip_required:
req += ['zip']
return req
It worked! Thank you so much :D