Odoo Help


Costumize module account.asset without new addons

Aldi Sugandi
on 8/31/15, 4:02 AM 637 views

Hi , i'm using odoo 8

i want to costumize account.asset form in depretiation date field , i want to make a new way to set a depretiation date from manual date , not from purchase date or early year date.

i was add manual date field on account.asset.form by activating developer mode on odoo 8 , and i want to input python code on it, i was change source code on account_asset.py file in account.asset module , but i got no changes on it.

My questions is :

1. Can i costumize account_asset.py file as i want without make an addons ?

2. And how to apply the changes to odoo ?

Thank you


Tarek Mohamed Ibrahim

--Tarek Mohamed Ibrahim--
| 5 3 7
Gîza, Egypt
--Tarek Mohamed Ibrahim--

I am an old VFP developer on ERP

I have moved to 2p since Nov-2014 and started developing with Python on Odoo.



Tarek Mohamed Ibrahim
On 8/31/15, 4:51 AM

You can't. You have to create a new module to do your changes. Otherwise you will lose all your changes in the first upgrade.

To change a field from 'must required' to 'not must required' you have to create a new custom class with the same name of the original class but provide it with the _inherit variable to override the required field properties

Suppose you need to change the required property of the field 'journal_id' in the class account_asset_category to be required=False , you have to write the following code in your custom module

class account_asset_category(osv.osv): 
_name = 'account.asset.category'
_inherit = 'account.asset.category'

_columns = {
'journal_id': fields.many2one('account.journal', 'Journal', required=False), }

Pls try this and see

On 8/31/15, 6:25 AM

Hi, you can override the field in columns with required = False .

Aldi Sugandi
On 8/31/15, 5:10 AM

thank you for your answer Tarek Mohamed Ibrahim.

Sorry i'm use answer for comment your answer , because i haven't enough karma to use comment features.

but if it cant , how i can custom field "must required" change to be "not must reqruired" ?

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 8/31/15, 4:02 AM
Seen: 637 times
Last updated: 10/26/16, 12:14 AM