Ilyes Ferchiou
Ilyes Ferchiou

Reputation: 583

OpenERP: modify core module

I'm new to OpenERP and Python too. I have OpenERP 6.0.4

I have modified the invoice.py file in the account folder using python 2.7 (I just edited and saved the file, I didn't compile anything).

The change I made is how the total amount is calculated, I needed the total amount to always add 0.3 EUR to the total.

I then restarted OpenERP server, I also went to admnisitration>modules> set the account module to upgrade and then applied the upgrades.

I then started a new invoice and the changes were not reflected.

For testing purposes, since I'm new to Python and thought maybe I didn't code correctly, I have modified the help message that appears when you hover the mouse over "Residual" in the invoice interface by modifying a line in invoice.py from help="Remaining amount due." to help="This is just for testing."

I restarted the server and upgraded the modules and even this change isn't reflected.

I even created a new database and the modifications are still not showing.

Am I missing something? Is it even possible to edit the core modules ? Is there any workaround to this?

FINAL SOLUTION : Uninstalling and reinstalling the server solved the problem.

Upvotes: 0

Views: 2290

Answers (3)

TimoSolo
TimoSolo

Reputation: 7325

From your comments, it seems you want to add a set tax amount to your invoice. Have a look at http://doc.openerp.com/v6.1/book/3/3_7/invoicing.html#tax-management - openerp already caters for that need and then you dont need to hack the source code which should be your last resort :)

Upvotes: 0

gurney alex
gurney alex

Reputation: 13645

Slightly off topic, but important: you should not be modifying the core modules directly in the source. The correct way is to extend the core class in your own module which will depend on the core module.

Upvotes: 3

Daniel Reis
Daniel Reis

Reputation: 13342

The most probable cause is the the addons directory being used is not the same you are editing. You can be sure if you change the name of the addons directory and can restart the server without problems. You can also try to set the --addons-path parameter to the server start command.

If/when you confirm to be working on the right files, try instead to make small text changes on views, since these are visible right after a module upgrade, not requiring a server restart. For instance, try changing some string attributes on account\partner_view.xml.

Upvotes: 3

Related Questions