Skip to content

Commit

Permalink
fix: create portal user for customer from shopping cart
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure committed Jan 17, 2024
1 parent fa960d8 commit 8fdd2a8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
10 changes: 4 additions & 6 deletions .github/helper/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ git clone https://github.com/frappe/frappe --branch "$BRANCH_TO_CLONE" --depth 1
bench init --skip-assets --frappe-path ~/frappe --python "$(which python)" frappe-bench

mkdir ~/frappe-bench/sites/test_site
cp -r "${GITHUB_WORKSPACE}/.github/helper/site_config.json" ~/frappe-bench/sites/test_site/
cp -r "${GITHUB_WORKSPACE}/.github/helper/site_config_mariadb.json" ~/frappe-bench/sites/test_site/

mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL character_set_server = 'utf8mb4'"
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"
Expand Down Expand Up @@ -42,13 +42,11 @@ sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile

bench get-app payments --branch ${BRANCH_TO_CLONE%"-hotfix"}
bench get-app https://github.com/frappe/erpnext --branch "$BRANCH_TO_CLONE" --resolve-deps
bench get-app webshop "${GITHUB_WORKSPACE}"
bench setup requirements --dev

bench start &> bench_run_logs.txt &
bench start &>> ~/frappe-bench/bench_start.log &
CI=Yes bench build --app frappe &
bench --site test_site reinstall --yes

bench get-app webshop "${GITHUB_WORKSPACE}"
bench --site test_site install-app webshop
bench --site test_site set-config allow_tests true
bench setup requirements --dev
bench --verbose --site test_site install-app webshop
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"host_name": "http://test_site:8000",
"install_apps": ["payments", "erpnext"],
"throttle_user_limit": 100
}
}
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
# Run everday at midnight UTC / 5:30 IST
- cron: "0 0 * * *"
env:
_BRANCH: ${{ github.base_ref || github.ref_name }}
WEBSHOP_BRANCH: ${{ github.base_ref || github.ref_name }}

concurrency:
group: develop-${{ github.event.number }}
Expand Down Expand Up @@ -91,17 +91,18 @@ jobs:
run: |
bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
env:
BRANCH_TO_CLONE: ${{ env._BRANCH }}
BRANCH_TO_CLONE: ${{ env.WEBSHOP_BRANCH }}


- name: Run Tests
run: cd ~/frappe-bench/ && bench --site test_site run-tests --app webshop --coverage
env:
TYPE: server
CI_BUILD_ID: ${{ github.run_id }}
ORCHESTRATOR_URL: http://test-orchestrator.frappe.io

- name: Upload coverage data
uses: codecov/codecov-action@v2
uses: actions/upload-artifact@v3
with:
fail_ci_if_error: true
files: /home/runner/frappe-bench/sites/coverage.xml
verbose: true
name: coverage-${{ matrix.container }}
path: /home/runner/frappe-bench/sites/coverage.xml
2 changes: 1 addition & 1 deletion webshop/setup/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def run_patches():

try:
for patch in patches:
frappe.get_attr(f"webshop.patches.after_install.{patch}.execute")()
frappe.get_attr(f"webshop.patches.{patch}.execute")()

finally:
frappe.flags.in_patch = False
Expand Down
2 changes: 2 additions & 0 deletions webshop/webshop/shopping_cart/cart.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,8 @@ def get_party(user=None):
}
)

customer.append("portal_users", {"user": user})

if debtors_account:
customer.update(
{
Expand Down

0 comments on commit 8fdd2a8

Please sign in to comment.