Where develop in axelor?

Hello,

I want to develop in Axelor module.

I need to create a new package? Or just develop directly in the Axelor class.

What is the best method and how do I do it?

Thank you

create new module as said in docs

I would like to create a new method for HR module, without modifying standard module.
I need to create a new module ? How i can use my new methode in the standard HR module ?

yes, you have to provide your classes methods to override base functionality
adding docs link

if you still feel issue in starting feel free to let us know

Thank’s

I can override methods now.

If I want to create a new method who doesn’t exist in base module, how I can proceed?

In my Timesheet.xml I have created a copy button. Where redirect my action-method? In my TimesheetController or in my new module with TimesheetControllerImpl copy()?

And also, I need to redefine my Timesheet.xml in my new module ?

Welcome, it is exciting news

new methods can be written in same service or however you want to proceed

you don’t need to redefine the Timesheet.xml even if you want to add few more columns in it, you just need to extend it

it can redirect wherever you need it

it is so beautiful once we know ins and outs of it

So now, all my methods are in my new module, it’s okay.

Just my copyBtn is in Timesheet.xml in HR Axelor module. I wouldn’t like modify the Axelor files.

If I create a new TimesheetWithCopyBtn.xml in my new module, I need to redefine all methods where Timesheet.xml is call and replace by my new TimesheetWithCopyBtn? Or there is a better solution ?

you have to extend rather duplicate

you can extend views and domain both see docs

So i see the docs, but i don’t really understand.

In my new module, i create a new view with the same name and this code :

<form name="timesheet-form" title="Timesheet" model="com.axelor.apps.hr.db.Timesheet" id="timesheet-test" extension="true">
    <extend target="panel[@name= 'actionsPanel']">
        <insert position="inside">
           
            <panel name="actionPanelCopy" sidebar="true" showIf="statusSelect == 3">
                <field name="companySelected" ... />
                <field name="$projectCopy" ... />
            </panel>
        </insert>
    </extend>

I have this message when i reload views:

extend target not found: panel[@name='actionsPanel']

you have this in original view?

Of course

In my original view :

panel name="actionsPanel" colSpan="3" itemSpan="12">
			<button name="confirmBtn" onClick="action-timesheet-group-confirm" title="Confirm" hideIf="statusSelect &gt; 1" icon="fa-check-square-o"/>
			...
		</panel>

Okey, i need to write the ‹ complete › path in the target. Not just the name of my element.

It’s working !

Thank you

Ce sujet a été automatiquement fermé après 30 jours. Aucune réponse n’est permise dorénavant.