Odoo Help

Welcome!

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.

0

How to make a journal information in openerp ?

By
jean44
on 9/19/13, 6:35 AM 633 views

Hi,

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'),
    }
location_location()


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),
        }

vehicule_vehicule()

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

a vehicule may be rent many times.

jean44
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

jean44
on 9/21/13, 1:32 PM
0
jean44
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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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