Skip to content

Commit 18a937f

Browse files
chinzourbuisson
authored andcommitted
HSC-16: Add Company and Partner loaders
* HSC-16: Add account loader * HSC-16: Add loaders and update documentation * HSC-16: Update stock location csv file
1 parent 51b7a2e commit 18a937f

File tree

17 files changed

+79
-11
lines changed

17 files changed

+79
-11
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ See below the list of supported models:
2323
- [Payment (CSV)](./readme/payment_term.md)
2424
- [Price List (CSV)](./readme/price_list.md)
2525
- [Stock (CSV)](./readme/stock_location.md)
26+
- [Company (CSV)](./readme/company.md)
27+
- [Partner (CSV)](./readme/partner.md)
2628

2729
----
2830
### Run add-on tests

odoo_initializer/activator.py

+6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import logging
22

3+
from .models.partner_loader import PartnerLoader
4+
from .models.company_loader import CompanyLoader
35
from .models.company_property_loader import CompanyPropertyLoader
46
from .models.stock_location_loader import StockLocationLoader
57
from .models.payment_term_loader import PaymentTermLoader
68
from .models.price_list_loader import PriceListLoader
9+
from .models.account_loader import AccountLoader
710
from .models.journal_loader import JournalLoader
811
from .models.fiscal_position_loader import FiscalPositionLoader
912
from .models.drug_loader import DrugLoader
@@ -14,6 +17,9 @@
1417

1518
registered_loaders = [
1619
FiscalPositionLoader,
20+
PartnerLoader,
21+
CompanyLoader,
22+
AccountLoader,
1723
JournalLoader,
1824
PaymentTermLoader,
1925
StockLocationLoader,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from .base_csv_loader import BaseCsvLoader
2+
3+
4+
class AccountLoader(BaseCsvLoader):
5+
model_name = "account.account"
6+
folder = "account"
7+
filters = {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from .base_csv_loader import BaseCsvLoader
2+
3+
4+
class CompanyLoader(BaseCsvLoader):
5+
model_name = "res.company"
6+
folder = "company"
7+
filters = {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from .base_csv_loader import BaseCsvLoader
2+
3+
4+
class PartnerLoader(BaseCsvLoader):
5+
model_name = "res.partner"
6+
folder = "partner"
7+
filters = {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"id","name","user_type_id/id","code","currency_id/id","reconcile"
2+
"init.account_account_1000","Debt","account.data_account_type_liquidity","1000","base.HTG","False"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"id","name","currency_id/id","email","fiscalyear_last_day","website"
2+
"base.main_company","Hôpital Sacré Coeur","base.HTG","[email protected]","31","http://crudem.org"
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
id,name,res_id,type,fields_id/id
2-
ir_property_114,property_stock_journal,,Many2One,stock_account.field_product_category_property_stock_journal
1+
"id","name","res_id","type","fields_id/id"
2+
"ir_property_114","property_stock_journal","","Many2One","stock_account.field_product_category_property_stock_journal"
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
id,active,company_id/id,account_ids/account_src_id/id,account_ids/account_dest_id/id,account_ids/create_date,country_id/id,country_group_id/id,auto_apply,state_ids/id,name,vat_required,zip_from,zip_to
2-
init.account_fiscal_position_1,True,,,,,,base.europe,True,,European Companies,True,0,0
1+
"id","active","company_id/id","account_ids/account_src_id/id","account_ids/account_dest_id/id","account_ids/create_date","country_id/id","country_group_id/id","auto_apply","state_ids/id","name","vat_required","zip_from","zip_to"
2+
"init.account_fiscal_position_1","True","","","","","","base.europe","True","","European Companies","True","0","0"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"id","company_id/id","company_type","is_company","lang","phone","name",
2+
"base.main_partner","base.main_company","Company","True","en_US","'+509 413-642-0450","Hôpital Sacré Coeur"
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
id,company_id/id,name,line_ids/days,line_ids/value_amount,note,line_ids/option,line_ids/value
2-
account.account_payment_term_90days,base.main_company,90 Days,90,0,Payment term: 90 Days,Day(s) after the invoice date,Balance
1+
"id","company_id/id","name","line_ids/days","line_ids/value_amount","note","line_ids/option","line_ids/value"
2+
"account.account_payment_term_90days","base.main_company","90 Days","90","0","Payment term: 90 Days","Day(s) after the invoice date","Balance"
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
id,name,discount_policy,sequence,item_ids/applied_on,item_ids/base,item_ids/compute_price,item_ids/min_quantity,item_ids/percent_price,item_ids/product_id/id,item_ids/date_start,item_ids/date_end
2-
pricelist.X,Summer Discount 2019,Discount included in the price,16,Global,Public Price,Percentage (discount),1,20,,2019-06-21,2019-09-23
1+
"id","name","discount_policy","sequence","item_ids/applied_on","item_ids/base","item_ids/compute_price","item_ids/min_quantity","item_ids/percent_price","item_ids/product_id/id","item_ids/date_start","item_ids/date_end"
2+
"pricelist.X","Summer Discount 2019","Discount included in the price","16","Global","Public Price","Percentage (discount)","1","20",,"2019-06-21","2019-09-23"
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
id,name,usage
2-
stock_location_1,Pharmacy,Internal Location
1+
"id","name","usage"
2+
"stock_location_1","Pharmacy","Internal Location"

readme/account.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Model `account`
2+
3+
The `account` subfolder allows to import chart of accounts provided as CSV files. See the example below:
4+
5+
| id | name | code | user_type_id/id | currency_id/id | reconcile |
6+
| - | - | - | - | - | - |
7+
| init.account_account_1000 | Debt | 1000 | account.data_account_type_liquidity | base.HTG | False
8+
9+
10+
See the test resources for further examples:
11+
- [odoo_csv/account/account.account.csv](../odoo_initializer/tests/resources/odoo_csv/account/account.account.csv)

readme/company.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Model `company`
2+
3+
The `company` subfolder allows to import companies provided as CSV files. See the example below:
4+
5+
| id | name | fiscalyear_last_day | currency_id/id | email | website |
6+
| - | - | - | - | - | - |
7+
| base.main_company | Hôpital Sacré Coeur | 31 | base.HTG | http://crudem.org | [email protected]
8+
9+
10+
See the test resources for further examples:
11+
- [odoo_csv/company/res.company.csv](../odoo_initializer/tests/resources/odoo_csv/company/res.company.csv)

readme/partner.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Model `partner`
2+
3+
The `partner` subfolder allows to import partners provided as CSV files. See the example below:
4+
5+
| id | name | company_id/id | is_company | lang | phone
6+
| - | - | - | - | - | - |
7+
| base.main_partner | Hôpital Sacré Coeur | base.main_company | True | en_US | +509 413-642-0450
8+
9+
10+
See the test resources for further examples:
11+
- [odoo_csv/partner/account.partner.csv](../odoo_initializer/tests/resources/odoo_csv/partner/res.partner.csv)

readme/price_list.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ The `price_list` subfolder allows to import Price Lists provided as CSV files. S
88

99

1010
See the test resources for further examples:
11-
- [odoo_csv/price_list/product.pricelist.csv](../odoo_initializer/tests/resources/odoo_csv/price_list/product.pricelist.csv)
11+
- [odoo_csv/pricelist/product.pricelist.csv](../odoo_initializer/tests/resources/odoo_csv/pricelist/product.pricelist.csv)

0 commit comments

Comments
 (0)