Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: create portal user for customer from shopping cart #59

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
}
15 changes: 8 additions & 7 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 @@ -49,7 +49,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
check-latest: true

- name: Add to Hosts
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
Loading