Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
3768 Lượt xem

Hi,

The account details page has some required fields such as street, city, country.

We don't require these fields so we want to cancel or delete the property of required field.

These fields will be stored in the res.partner model. In this model these fields are not required fields. SO technically I think there is no must to make these fields required in the portal account details form.

Thank you for your help.

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Thanks for your quick reaction.

If I remove the class properties as by your example the fields remain required and I get a warning of missing fields.

I found the code below in portal.py

class CustomerPortal(Controller): 

   MANDATORY_BILLING_FIELDS = ["name", "phone", "email", "street", "city", "country_id"]/

How can this be overridden?

We are running V15 on .sh without access to the source code.

Thanks

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello Art

you can inherit portal_my_details view and remove dynamic class assign related code same as i did for city field in following screenshot.


Thanks & Regards,



CandidRoot Solutions Pvt. Ltd.

Mobile: (+91) 8849036209
Email: info@candidroot.com
Skype: live:candidroot
Web: https://www.candidroot.com
Address: 1229-1230, Iconic Shyamal, Near Shyamal Cross Road, Ahmedabad, Gujarat

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 1 23
2438
0
thg 2 25
1681
0
thg 9 24
1599
0
thg 12 23
1689
2
thg 3 22
4731