Odoo Help


Creating module problem

on 7/8/15, 8:00 AM 1,087 views

Hi In Odoo 8 I am trying to build a module.

I have this:


from . import vrijeme_racun



'name': 'Vrijeme Racun',

'version': '1.0',

'category': 'Tools',

'summary': 'Vrijeme, Racun',

'description': """

Vrijeme za racune


Dodaje vrijeme na racun.


'depends' : ['base'],

'data' : [],

'images': [],

'demo': [],

'installable' : True,

'application': True,



from openerp import models, fields, api

class override_date_invoice(models.Model):

_inherit = 'account.invoice'

date_invoice = fields.Datetime(string = 'Invoice Date', readonly = True, states = {'draft': [('readonly', False)]}, index=True,help=’Keep empty to use the current date’,copy = False)

When trying to install I get error:

File "/var/lib/odoo/.local/share/Odoo/addons/8.0/vrijeme_racun/__init__.py", line 1, in <module>

from . import vrijeme_racun

ImportError: cannot import name vrijeme_racun


I am new at this so if you can help.Thanks




| 5 4 6
Zagreb | Karlovac, Croatia

there is only 10 kind of people the ones that understand binary ... and others

On 7/8/15, 8:10 AM

in __init__ try:
import vrijeme_racun   (instead from . import ...)

check file name : vrijeme_racun.pj should be vrijeme_racun.py (this might be a typo here)

also.. in file class should be account_invoice , not override_date_invoice

in __openerp__.py :
application: False  (cause this is just a modification not a real app module!)

and a suggestion... 
leave date_invoice as is, and simply add new field date_validate : fields.datetime

(HR lokalizacija trazi jos dosta toga ..) 

It works but it does not add date to invoice as it should?

on 7/8/15, 8:26 AM

it ads datetime, but time is all zeroes :) ? well then you need to override one more method in account_invoice class in order to write current time of validating the invoice or add new method to confirm_invoice workflow...

on 7/8/15, 8:49 AM

Can you maybe help with this? Because I am not sure what to do next

on 7/8/15, 9:05 AM

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: 7/8/15, 8:00 AM
Seen: 1087 times
Last updated: 7/8/15, 8:10 AM