Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

module over-riding core model?

Bret Watson   ( User )

Commented 4 years ago

I'm writing a module to add in taxes for payments - here in Aust all incomes and expenses record sales tax, not just ones with formal invoices..


However I seem to only be able to add the tax fields if I edit the core app, if I drop it into the module Models folder it doesn't over-ride the core payments model


Am I right? or am I missing something? nWidart's doco doesn't suggest I can over-ride core models..

Denis Dulici   ( Admin )

Commented 4 years ago

Hello Bret,


I would suggest overriding the invoice page and your own model.


Regards

Bret Watson   ( User )

Commented 4 years ago

umm this is for payments, not invoices..


So I'm adding tax_amount and tax_name to the payments table - it works fine if I modify the core model, but there appear to be no way to over-ride teh model from teh module..


 


Actually it looks like all these should be in modules, that way it would be possible to replace out core functions without forking :)

Michael Pemberton   ( User )

Commented 3 years ago

Did you ever find a way of doing this without changing core files?

Bret Watson   ( User )

Commented 3 years ago

nope.. for invoice printing its easy since you are simply taking variables (though not awesome) https://github.com/baradhili/Akaunting-Module_example is the invoice example.. for actually over-riding core variables.. no I've decided I'll fork the core and stay with the 1.x branch

Please login or register to leave a response.

Showing 1 to 5 of 5 discussions