Merge branch 'dev_odex25_takaful' of https://github.com/expsa/odex25-standard-modules into extend_donation_payment

This commit is contained in:
Nossibaelhadi 2025-11-27 17:24:16 +03:00
commit 819c4df9ba
5 changed files with 83 additions and 51 deletions

View File

@ -23,38 +23,38 @@ jobs:
#######################################################
# 🟦 1) Allowed Users List
#######################################################
ALLOWED_USERS=(
"expsa"
"moutazmuhammad"
"ronozoro"
"Abubaker-Altaib"
"altexp"
"the5abir"
"ahmadaking"
"kchyounes19"
"abdurrahman-saber"
"maltayyar2"
"esam-sermah"
"mohammed-alkhazrji"
)
# ALLOWED_USERS=(
# "expsa"
# "moutazmuhammad"
# "ronozoro"
# "Abubaker-Altaib"
# "altexp"
# "the5abir"
# "ahmadaking"
# "kchyounes19"
# "abdurrahman-saber"
# "maltayyar2"
# "esam-sermah"
# "mohammed-alkhazrji"
# )
IS_ALLOWED="false"
for user in "${ALLOWED_USERS[@]}"; do
if [[ "$CREATOR" == "$user" ]]; then
IS_ALLOWED="true"
break
fi
done
# IS_ALLOWED="false"
# for user in "${ALLOWED_USERS[@]}"; do
# if [[ "$CREATOR" == "$user" ]]; then
# IS_ALLOWED="true"
# break
# fi
# done
if [[ "$IS_ALLOWED" == "false" ]]; then
echo "❌ User '$CREATOR' is NOT allowed to create branches. Deleting..."
curl -s -X DELETE \
-H "Authorization: token $GH_TOKEN" \
https://api.github.com/repos/$REPO/git/refs/heads/$BRANCH_NAME
exit 1
fi
# if [[ "$IS_ALLOWED" == "false" ]]; then
# echo "❌ User '$CREATOR' is NOT allowed to create branches. Deleting..."
# curl -s -X DELETE \
# -H "Authorization: token $GH_TOKEN" \
# https://api.github.com/repos/$REPO/git/refs/heads/$BRANCH_NAME
# exit 1
# fi
echo "✔ User '$CREATOR' is allowed."
# echo "✔ User '$CREATOR' is allowed."
#######################################################
# 🟦 2) Reserved Branch Names (Your Existing List)

View File

@ -31,6 +31,7 @@ on:
- dev_odex25_helpdesk
- dev_odex25_donation
- dev_odex25_ensan
jobs:
check_pr_author:
runs-on: linting_odex25-standard-modules_runner
@ -74,29 +75,35 @@ jobs:
});
return;
}
core.info("All PR authors are allowed.");
// Check commit authors
const commitList = await github.rest.pulls.listCommits({
owner,
repo,
pull_number: pr.number
});
# // Check commit authors
# const commitList = await github.rest.pulls.listCommits({
# owner,
# repo,
# pull_number: pr.number
# });
for (const commit of commitList.data) {
const commitAuthor = commit.author ? commit.author.login : null;
# core.info("PR author is allowed.");
if (commitAuthor && !allowed.includes(commitAuthor)) {
core.error(`Unauthorized commit author: ${commitAuthor}. Closing PR...`);
# // Uncomment below if you want to block unauthorized commit authors also
# /*
# for (const commit of commitList.data) {
# const commitAuthor = commit.author ? commit.author.login : null;
await github.rest.pulls.update({
owner,
repo,
pull_number: pr.number,
state: "closed"
});
# if (commitAuthor && !allowed.includes(commitAuthor)) {
# core.error(`Unauthorized commit author: ${commitAuthor}. Closing PR...`);
return;
}
}
# await github.rest.pulls.update({
# owner,
# repo,
# pull_number: pr.number,
# state: "closed"
# });
core.info("All PR authors and committers are allowed.");
# return;
# }
# }
# core.info("All PR authors and committers are allowed.");
# */

View File

@ -9,6 +9,7 @@
**الموقع:** http://www.exp-sa.com
**الملخص:** موديول لإدارة نظام التكافل (الكفالة والمساهمات والتبرعات)
//test
## الاعتماديات (Dependencies)
- `base`

View File

@ -13,7 +13,8 @@ class TakafulConfigSettings(models.TransientModel):
donation_ended_sms_template_id = fields.Many2one('sms.template', string="Donation Ended SMS Template", related='company_id.donation_ended_sms_template_id', readonly=False)
restriction_period = fields.Integer(string='Restriction Period')
faal_kheer_partner_id = fields.Many2one("res.partner", string="Faal Kheer Partner", related='company_id.faal_kheer_partner_id', readonly=False)
faal_kheer_user_id = fields.Many2one("res.users",related='company_id.faal_kheer_user_id', string="Faal Kheer Partner" , readonly=False)
faal_kheer_branch_id = fields.Many2one("branch.settings",related='company_id.faal_kheer_branch_id', string="Faal Kheer branch" , readonly=False)
def set_values(self):
super(TakafulConfigSettings, self).set_values()
sudoConf = self.env['ir.config_parameter'].sudo()
@ -45,3 +46,5 @@ class ResCompany(models.Model):
donation_extension_reminder_sms_template_id = fields.Many2one('sms.template', string="Donation Extension Reminder SMS Template")
donation_ended_sms_template_id = fields.Many2one('sms.template', string="Donation Ended SMS Template")
faal_kheer_partner_id = fields.Many2one("res.partner", string="Faal Kheer Partner")
faal_kheer_user_id = fields.Many2one("res.users",string="Faal Kheer Partner")
faal_kheer_branch_id = fields.Many2one("branch.settings", string="Faal Kheer branch")

View File

@ -35,6 +35,27 @@
</div>
</div>
</div>
<h2>Faal Kheer User And branch</h2>
<div class="row mt16 o_settings_container">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_right_pane">
<label for="faal_kheer_user_id"/>
<div class="content-group">
<div class="mt16">
<field name="faal_kheer_user_id" class="o_light_label"/>
</div>
</div>
</div>
<div class="o_setting_right_pane">
<label for="faal_kheer_branch_id"/>
<div class="content-group">
<div class="mt16">
<field name="faal_kheer_branch_id" class="o_light_label"/>
</div>
</div>
</div>
</div>
</div>
<h2>Whatsapp API Integration</h2>
<div class="row mt16 o_settings_container">
@ -133,4 +154,4 @@
<!-- </record>-->
</odoo>
</odoo>