Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


how overwrite a py file with installing a new module

on 3/12/13, 12:58 PM 847 views

hello , i trying to overwrite a py file , can i do that when install of a new specifique module ?

i need to overwrite .py file ( in /tools directory ) i try to use f= open(filename,"w") ....

but an error appear

thks , if someone have an idea

You should write your own python classes that inherit and override the classes you want to change. Which file are you trying to replace and why?

Bista Solutions US, Ray Carnes
on 3/12/13, 8:23 PM

What Ray suggest is correct

on 3/13/13, 3:45 AM

thks for ur replay, i am trying to overwrite ( amount_to_text.py , you can find it in /tools/amount_to_text ) i would overwrite it when installing a module , not to do it manually

can i use read and write file like that : fichier = open("fichier.py", 'w')...


on 3/13/13, 11:04 AM

No. You should not do this (and I don't know how to do it anyway). Other parts of the product that need these functions will act unpredictably if you make any changes. If your module needs different functions, write them in your module. If you are trying to fix something, submit a bug.

Bista Solutions US, Ray Carnes
on 3/13/13, 7:34 PM
On 3/13/13, 3:19 AM

your question is not clear would you explain your scenario more clearer ?


Ray Carnes

--Ray Carnes--
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

Ray Carnes
On 3/12/13, 8:23 PM

You should write your own python classes that inherit and override the classes you want to change. Which file are you trying to replace and why?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


Asked: 3/12/13, 12:58 PM
Seen: 847 times
Last updated: 3/16/15, 8:10 AM