Skip to content

vmac-odoo/training_modules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

TRAINING MODULES FOR INTERNSHIP

Python 3.10 Code style: black Code style: black

This is part of the intership to develop skills to develop and test odoo modules.

Solutions T05:

  • Create one record from the Motorcycle Registry Model. This Registry should have more than 1000 miles and no license plate.

    >>> env['motorcycle.registry'].create({'registry_number': 'SAMPLE', 'vin': 'SAMPLEVIN', 'first_name': 'John', 'last_name': 'Doe', 'current_mileage': 1200})
  • Search for all Motorcycles Registries with less than 1000 miles.

    >>> env['motorcycle.registry'].search_read([('current_mileage', '>', '1000')], [])
  • Search for all Motorcycle Registries with a VIN Number but no License Plate. Only show the fields: registry_number, vin, license_plate, and lastname

    >>> env['motorcycle.registry'].search_read([('vin', '!=', None), ('license_plate', '=', None)], ['registry_number', 'vin', 'license_plate', 'last_name'])
  • Search for all Motorcycle Registries with a VIN Number or a License Plate.

    >>> env['motorcycle.registry'].search_read(['|', ('vin', '!=', None), ('license_plate','!=', None)], ['registry_number', 'vin', 'license_plate', 'last_name'])
  • Update the Name and Lastname of the record you created to John Wick

    >>> moto = env['motorcycle.registry'].browse(6)
    >>> moto
    motorcycle.registry(6,)
    >>> moto.write({'first_name': 'John', 'last_name': 'Wick'})
    True
    >>> env.cr.commit()
  • Delete the Record.

    >>> moto.unlink()
    2023-07-18 19:40:14,720 27184 INFO odoo16 odoo.models.unlink: User #1 deleted motorcycle.registry records with IDs: [6] 
    True
    >>> env.cr.commit()

About

Training Modules of Odoo Internship

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages