Odoo Help


How to make a journal information in openerp ?

on 9/19/13, 6:35 AM 698 views


I have two objects :

class location_location(osv.osv):

    _name = 'location.location'
    _columns = {
        'name': fields.char('ID',size=32,required=True),
        'vehicule_id': fields.many2one('vehicule.vehicule','Véhicule',required=True),
        'rentaldate': fields.date('Rental date'),
        'returndate': fields.date('Return date'),

class vehicule_vehicule(osv.osv):

    _name = 'vehicule.vehicule'
    _columns = {
        'name': fields.char('ID', size=32, required=True),
    'modele_id': fields.many2one('vehicule.modele','Model'),
        'carburant': fields.char('Carburant', size=32),
        'cost': fields.integer('Cost',size=64),
        'color': fields.char('Color', size=32),
        'matricule': fields.char('Matricule', size=32),
        'brand': fields.char('Brand', size=32),


My question is : how to calculate the number of rental days of a vehicule ?

a vehicule may be rent many times.

on 9/19/13, 6:36 AM

Your model can only model ONE rental per location, but MANY cars per location. I don't think you should be changing a location to relate to cars and dates. You should create a new model to manage cars and dates LINKED to locations. RENTAL = {location, vehicle_id, start, end, status [reserved, completed, cancelled]} perhaps?

Bista Solutions US, Ray Carnes
on 9/19/13, 4:33 PM

Could you please show me how ? Thank you

on 9/21/13, 1:32 PM
On 9/23/13, 8:23 PM

any help ! please !

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 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

0 follower(s)


Asked: 9/19/13, 6:35 AM
Seen: 698 times
Last updated: 3/16/15, 8:10 AM