How can I add custom fields?


I am new to CRMs and ERPs. Axelor seems very easy to someone like me, but there are technical things I can’t understand.

One of these are related to the customing. How can I add more fields?
For example, I’d like to add more fields for Customers and Leads. How can I add them? And does it is possible to add calculated fields too?

Hello @bebop75
You need to add new fields inside the model and view as well as change for calculation of calculated fields.

Hello , where are the case to use json attr and case you could add fields on model ?

I never used json, only changed XML view and models accordingly and refresh all views at application startup.
For example, I needed to add new fields for the employee entity.

custom fields can be added easily and are handled by axelor
they get saved in attrs column in json

2 « J'aime »

So how do you do ? I use the details of this page Custom Fields :: Axelor Documentation to add field in Domain/PurchaseOrderLine.xml but after building the application with success, running server does not work. I get a one-to-many error.

can you share how you did it so we can see what went wrong

1 « J'aime »
<?xml version="1.0" encoding="UTF-8"?>

<many-to-one name="base" ref="com.axelor.apps.base.db"
<many-to-one name="commissionReceipt"
  ref="com.axelor.apps.base.db.Region" title="Commission Receipt"/>
    <decimal name="lat" title="Latitude"/>
    <decimal name="lon" title="Longitude"/>
    <one-to-many name="city" ref="com.axelor.apps.base.db.City"/>

you can add new fileds like this using .xml files.