Skip to content

tate11/xlsx-to-itad-odoo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XLSX to Odoo import

The goal of this program is to parse a spreadsheet (in a particular format from one of OceanTech's customers) and then load that parsed data into and Odoo instance that has the ITAD module.

This uses a "library" of sorts that I created for various projects that involves communicating with an Odoo instance. The library is found in api.py and exceptions.py, and supports full CRUD actions.

The types of records that are created are:

  • Sellable Records - These are records that form the basis of our "inventory". They contain basic information such as make and model, as well as reimbursement values
  • Asset Catalog Lines - These records are what appear in the asset catalog table. Each one is a line item
  • Data Destruction Lines - These records are what appear in the data destruction table. Each one is a line item

Usage

This was designed to parse a very specific spreadsheet, and may work on others that are similar in layout. The ideas within this application should be able to be adapted towards processing other spreadsheets.

  1. Clone this repo
  2. Ensure that you have Pipenv installed
  3. Install the openpyxl dependency - pipenv install
  4. Edit run.sh to point to your Odoo instance, with credentials that can search and create ITAD records
  5. Edit app.py and modify the constants (all capital letters) at the top to reflect your spreadsheet and Odoo configuration
    • Spreadsheet configuration includes: Filename (relative or absolute), the Sheet to work from, as well as the rows and columns to fetch
    • Odoo configuration includes: Asset Catalog ID and Data Destruction ID. These are both the database ids of their respective forms. Used to connect the line items to specific records
  6. Enter the virtual environment - pipenv shell
  7. Start the application - ./run.sh | tee output.log - This can take a couple minutes depending on how big the spreadsheet is

About

Provides a mechanism to parse an XLSX spreadsheet and import the data into an Odoo instance with a proprietary ITAD module

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.1%
  • Shell 0.9%