From 177229189e766f00018eaeec911301c8242b886e Mon Sep 17 00:00:00 2001 From: Rahul Ramesh Date: Tue, 14 May 2024 08:55:22 +0530 Subject: [PATCH 1/2] [Rahul] | BAH-3786 | Refactor. Mount Metadata From Bahmni-Config --- package/docker/odoo/Dockerfile | 8 +++- package/resources/data/address.seed.csv | 51 ----------------------- package/resources/data/order_type.xml | 33 --------------- package/resources/data/sale_shop.xml | 11 ----- package/resources/data/uom_seed.xml | 54 ------------------------- 5 files changed, 7 insertions(+), 150 deletions(-) delete mode 100644 package/resources/data/address.seed.csv delete mode 100644 package/resources/data/order_type.xml delete mode 100644 package/resources/data/sale_shop.xml delete mode 100644 package/resources/data/uom_seed.xml diff --git a/package/docker/odoo/Dockerfile b/package/docker/odoo/Dockerfile index ef4fdd0..75c95c7 100644 --- a/package/docker/odoo/Dockerfile +++ b/package/docker/odoo/Dockerfile @@ -22,4 +22,10 @@ COPY package/resources/data/order_type.xml ${ADDON_PATH}/bahmni_initializer/data COPY package/resources/data/sale_shop.xml ${ADDON_PATH}/bahmni_initializer/data/ RUN pip3 install python-decouple -CMD ["odoo", "-u", "all", "-i", "sale_management,purchase,stock,point_of_sale,l10n_generic_coa,bahmni_account,bahmni_product,bahmni_api_feed,bahmni_stock,bahmni_purchase,bahmni_address_mapping,bahmni_sale,restful_api,bahmni_reports,bahmni_auto_payment_reconciliation", "--without-demo", "-d odoo"] +# Setting Soft Links from bahmni_config +RUN ln -s /etc/bahmni_config/odoo/16 ${ADDON_PATH}/bahmni_initializer/data/ + +# Setting Soft Links from bahmni_config +RUN ln -s /etc/bahmni_config/odoo/16 ${ADDON_PATH}/bahmni_initializer/data/ + +CMD ["odoo", "-u", "all", "-i", "sale_management,purchase,stock,point_of_sale,l10n_generic_coa,bahmni_account,bahmni_product,bahmni_api_feed,bahmni_stock,bahmni_purchase,bahmni_address_mapping,bahmni_sale,restful_api,bahmni_reports,bahmni_auto_payment_reconciliation,bahmni_auto_payment_reconciliation", "--without-demo", "-d odoo"] diff --git a/package/resources/data/address.seed.csv b/package/resources/data/address.seed.csv deleted file mode 100644 index 303a8db..0000000 --- a/package/resources/data/address.seed.csv +++ /dev/null @@ -1,51 +0,0 @@ -city_village,sub_district,district,state,country -Kodungallur,Mukundapuram,Thrissur,Kerala,India -Chalakudy,Mukundapuram,Thrissur,Kerala,India -Nadavaramba,Mukundapuram,Thrissur,Kerala,India -Vellangallur,Mukundapuram,Thrissur,Kerala,India -Irinjalakuda,Mukundapuram,Thrissur,Kerala,India -Guruvayur,Chavakkad,Thrissur,Kerala,India -Kochi,Ernakulam,Ernakulam,Kerala,India -Egmore,Chennai City North,Chennai,Tamil Nadu,India -Ganapathy,Coimbatore North,Coimbatore,Tamil Nadu,India -Adambakkam,Chennai City North,Chennai,Tamil Nadu,India -Adyar,Chennai City North,Chennai,Tamil Nadu,India -Alwarpet,Chennai City North,Chennai,Tamil Nadu,India -Alwarthirunagar,Chennai City North,Chennai,Tamil Nadu,India -Aminjikarai,Chennai City North,Chennai,Tamil Nadu,India -Anna Nagar,Chennai City North,Chennai,Tamil Nadu,India -Arumbakkam,Chennai City North,Chennai,Tamil Nadu,India -Ashok Nagar,Chennai City North,Chennai,Tamil Nadu,India -Ayanavaram,Chennai City North,Chennai,Tamil Nadu,India -Basin Bridge,Chennai City North,Chennai,Tamil Nadu,India -Besant Nagar,Chennai City North,Chennai,Tamil Nadu,India -Chetpauk,Chennai City North,Chennai,Tamil Nadu,India -Chintadripet,Chennai City North,Chennai,Tamil Nadu,India -Choolai,Chennai City North,Chennai,Tamil Nadu,India -Choolaimedu,Chennai City North,Chennai,Tamil Nadu,India -Chrompet,Chennai City North,Chennai,Tamil Nadu,India -Ekkaduthangal,Chennai City North,Chennai,Tamil Nadu,India -Fort St. George,Chennai City North,Chennai,Tamil Nadu,India -George Town,Chennai City North,Chennai,Tamil Nadu,India -Guindy,Chennai City North,Chennai,Tamil Nadu,India -ICF,Chennai City North,Chennai,Tamil Nadu,India -IIT Madras,Chennai City North,Chennai,Tamil Nadu,India -Iyappathangal,Chennai City North,Chennai,Tamil Nadu,India -Jafferkhanpet,Chennai City North,Chennai,Tamil Nadu,India -K.K. Nagar,Chennai City North,Chennai,Tamil Nadu,India -Keelkattalai,Chennai City North,Chennai,Tamil Nadu,India -Kilpauk,Chennai City North,Chennai,Tamil Nadu,India -Kodambakkam,Chennai City North,Chennai,Tamil Nadu,India -Kodungaiyur,Chennai City North,Chennai,Tamil Nadu,India -Kolathur,Chennai City North,Chennai,Tamil Nadu,India -Korattur,Chennai City North,Chennai,Tamil Nadu,India -Korukkupet,Chennai City North,Chennai,Tamil Nadu,India -Kottivakkam,Chennai City North,Chennai,Tamil Nadu,India -Kotturpuram,Chennai City North,Chennai,Tamil Nadu,India -Shakar Pur Bramad,Gandhi Nagar,Delhi East,Delhi,India -Shakar Pur Khas,Gandhi Nagar,Delhi East,Delhi,India -Chilla Saroda Banger,Preet Vihar,Delhi East,Delhi,India -Chilla Saroda Khadar,Preet Vihar,Delhi East,Delhi,India -Dalu Pura,Preet Vihar,Delhi East,Delhi,India -Gazi Pur,Preet Vihar,Delhi East,Delhi,India -Gharauli,Preet Vihar,Delhi East,Delhi,India \ No newline at end of file diff --git a/package/resources/data/order_type.xml b/package/resources/data/order_type.xml deleted file mode 100644 index 8aec0a8..0000000 --- a/package/resources/data/order_type.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - Drug Order - This order type is used for prescribing medications to patients. It includes details such as the name of the medication, dosage, frequency, and duration of treatment. - - - Lab Order - Lab orders are used to request various laboratory tests and investigations for patients. They specify the type of test required, along with any specific instructions or details for the lab to follow. - - - Radiology Order - Radiology orders are used to request imaging studies such as X-rays, CT scans, MRI scans, and ultrasound examinations for patients. These orders provide details about the type of imaging study needed, the body part to be examined, and any relevant clinical information. - - - - - General Ward - 8 - - - - - General Ward - 8 - - - - - General Ward - 8 - - \ No newline at end of file diff --git a/package/resources/data/sale_shop.xml b/package/resources/data/sale_shop.xml deleted file mode 100644 index 443845c..0000000 --- a/package/resources/data/sale_shop.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Pharmacy - 1 - 8 - 1 - - - \ No newline at end of file diff --git a/package/resources/data/uom_seed.xml b/package/resources/data/uom_seed.xml deleted file mode 100644 index 9696274..0000000 --- a/package/resources/data/uom_seed.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - Bahmni - - - Unit(s) - - 1.0 - 0.01 - reference - - - - Tablet(s) - - 1.0 - 0.01 - bigger - - - - Capsule(s) - - 1.0 - 0.01 - bigger - - - - International Unit - - 1.0 - 0.01 - smaller - - - - Unit(s) - - - - Tablet(s) - - - - Capsule(s) - - - - International Unit - - - \ No newline at end of file From 63e381f19cc9da99ce45774d8cca430006b71d1c Mon Sep 17 00:00:00 2001 From: Rahul Ramesh Date: Sun, 19 May 2024 11:05:43 +0530 Subject: [PATCH 2/2] [Rahul] | BAH-3786 | Fix. Remove bahmni_seed_setup Module --- bahmni_seed_setup/__init__.py | 1 - bahmni_seed_setup/__manifest__.py | 26 ---------------------- bahmni_seed_setup/data/district.tehsil.csv | 4 ---- bahmni_seed_setup/data/state.district.csv | 6 ----- bahmni_seed_setup/data/village.village.csv | 7 ------ package/docker/odoo/Dockerfile | 12 +++------- 6 files changed, 3 insertions(+), 53 deletions(-) delete mode 100644 bahmni_seed_setup/__init__.py delete mode 100644 bahmni_seed_setup/__manifest__.py delete mode 100644 bahmni_seed_setup/data/district.tehsil.csv delete mode 100644 bahmni_seed_setup/data/state.district.csv delete mode 100644 bahmni_seed_setup/data/village.village.csv diff --git a/bahmni_seed_setup/__init__.py b/bahmni_seed_setup/__init__.py deleted file mode 100644 index 21b4102..0000000 --- a/bahmni_seed_setup/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import data diff --git a/bahmni_seed_setup/__manifest__.py b/bahmni_seed_setup/__manifest__.py deleted file mode 100644 index 43863bb..0000000 --- a/bahmni_seed_setup/__manifest__.py +++ /dev/null @@ -1,26 +0,0 @@ -{ - 'name': 'Bahmni Seed Setup', - 'version': '1.0', - 'summary': 'Custom csv data seed setup bahmni requirement', - 'sequence': 1, - 'description': """ - Bahmni Seed Setup - ==================== - """, - 'author': "Karthikeyan", - 'category': 'Customizations', - 'website': '', - 'images': [], - 'depends': ['base','bahmni_sale'], - 'data': [ - 'data/state.district.csv', - 'data/district.tehsil.csv', - 'data/village.village.csv', - ], - 'demo': [], - 'qweb': [], - 'license': 'LGPL-3', - 'installable': True, - 'application': True, - 'auto_install': False, -} diff --git a/bahmni_seed_setup/data/district.tehsil.csv b/bahmni_seed_setup/data/district.tehsil.csv deleted file mode 100644 index ea193c3..0000000 --- a/bahmni_seed_setup/data/district.tehsil.csv +++ /dev/null @@ -1,4 +0,0 @@ -id,name,district_id,state_id,country_id -T1,Anthiyur,Erode,Tamil Nadu,India -T2,Bhavani,Erode,Tamil Nadu,India -T3,Kancheepuram,Kanchipuram,Tamil Nadu,India diff --git a/bahmni_seed_setup/data/state.district.csv b/bahmni_seed_setup/data/state.district.csv deleted file mode 100644 index c83b4db..0000000 --- a/bahmni_seed_setup/data/state.district.csv +++ /dev/null @@ -1,6 +0,0 @@ -id,name,state_id,country_id -D1,Coimbatore,Tamil Nadu,India -D2,Erode,Tamil Nadu,India -D3,Chennai,Tamil Nadu,India -D4,Dharmapuri,Tamil Nadu,India -D5,Kanchipuram,Tamil Nadu,India diff --git a/bahmni_seed_setup/data/village.village.csv b/bahmni_seed_setup/data/village.village.csv deleted file mode 100644 index 9c588c4..0000000 --- a/bahmni_seed_setup/data/village.village.csv +++ /dev/null @@ -1,7 +0,0 @@ -id,name,district_id,tehsil_id,state_id,country_id,zip -V1,Angambakkam,Kanchipuram,Kancheepuram,Tamil Nadu,India,223994 -V2,Ariyaperumpakkam,Kanchipuram,Kancheepuram,Tamil Nadu,India,223995 -V3,Arpaakkam,Kanchipuram,Kancheepuram,Tamil Nadu,India,223996 -V4,Asoor,Kanchipuram,Kancheepuram,Tamil Nadu,India,223997 -V5,Avalur,Kanchipuram,Kancheepuram,Tamil Nadu,India,223998 -V6,Ayyangarkulam,Kanchipuram,Kancheepuram,Tamil Nadu,India,223999 diff --git a/package/docker/odoo/Dockerfile b/package/docker/odoo/Dockerfile index 75c95c7..96d64f6 100644 --- a/package/docker/odoo/Dockerfile +++ b/package/docker/odoo/Dockerfile @@ -2,6 +2,8 @@ FROM odoo:16.0 ENV ADDON_PATH=/opt/bahmni-erp/bahmni-addons +USER root + COPY package/docker/odoo/odoo.conf /etc/odoo/odoo.conf COPY bahmni_account ${ADDON_PATH}/bahmni_account/ COPY bahmni_address_mapping ${ADDON_PATH}/bahmni_address_mapping/ @@ -16,16 +18,8 @@ COPY bahmni_auto_payment_reconciliation ${ADDON_PATH}/bahmni_auto_payment_reconc COPY openerp7_data_import ${ADDON_PATH}/openerp7_data_import/ COPY bahmni_reports ${ADDON_PATH}/bahmni_reports COPY community_modules ${ADDON_PATH}/community_modules/ -COPY package/resources/data/address.seed.csv ${ADDON_PATH}/bahmni_initializer/data/ -COPY package/resources/data/uom_seed.xml ${ADDON_PATH}/bahmni_initializer/data/ -COPY package/resources/data/order_type.xml ${ADDON_PATH}/bahmni_initializer/data/ -COPY package/resources/data/sale_shop.xml ${ADDON_PATH}/bahmni_initializer/data/ RUN pip3 install python-decouple -# Setting Soft Links from bahmni_config -RUN ln -s /etc/bahmni_config/odoo/16 ${ADDON_PATH}/bahmni_initializer/data/ - -# Setting Soft Links from bahmni_config -RUN ln -s /etc/bahmni_config/odoo/16 ${ADDON_PATH}/bahmni_initializer/data/ +RUN ln -s /etc/bahmni_config/odoo/data/ ${ADDON_PATH}/bahmni_initializer CMD ["odoo", "-u", "all", "-i", "sale_management,purchase,stock,point_of_sale,l10n_generic_coa,bahmni_account,bahmni_product,bahmni_api_feed,bahmni_stock,bahmni_purchase,bahmni_address_mapping,bahmni_sale,restful_api,bahmni_reports,bahmni_auto_payment_reconciliation,bahmni_auto_payment_reconciliation", "--without-demo", "-d odoo"]