Merge pull request #5191 from expsa/test
Test odex_takaful: view updates
This commit is contained in:
commit
a0e7cf975a
|
|
@ -74,6 +74,7 @@
|
|||
'reports/transfer_deduction_report.xml',
|
||||
'reports/transfer_deduction_report_templates.xml',
|
||||
],
|
||||
'images': ['static/description/icon5.png'],
|
||||
# 'installable': True,
|
||||
# 'application': True,
|
||||
# 'auto_install': False,
|
||||
|
|
|
|||
|
|
@ -3226,7 +3226,7 @@ msgstr "عمليات الكفالة"
|
|||
#: model:ir.ui.menu,name:odex_takaful.kafalat_main_menu
|
||||
#: model_terms:ir.ui.view,arch_db:odex_takaful.view_takaful_sponsor_form
|
||||
msgid "Kafalat"
|
||||
msgstr "الكفالات ونقاط البيع"
|
||||
msgstr "كفالة ونقاط بيع"
|
||||
|
||||
#. module: odex_takaful
|
||||
#: model:ir.model,name:odex_takaful.model_takaful_wizard_report_kafalat_cancel
|
||||
|
|
@ -7055,6 +7055,11 @@ msgstr ""
|
|||
msgid "report.odex_takaful.benefit_month_payment_report_pdf"
|
||||
msgstr ""
|
||||
|
||||
#. module: odex_takaful
|
||||
#: model:ir.model.fields,field_description:odex_takaful.field_donations_details_lines__journal_id
|
||||
msgid "Journal"
|
||||
msgstr "بنك الجمعية"
|
||||
|
||||
#. module: odex_takaful
|
||||
#: model:ir.model,name:odex_takaful.model_report_odex_takaful_benefit_month_payment_report_xlsx
|
||||
msgid "report.odex_takaful.benefit_month_payment_report_xlsx"
|
||||
|
|
@ -7243,7 +7248,7 @@ msgstr "اسم الكافل/المتبرع"
|
|||
#. module: odex_takaful
|
||||
#: model:ir.model.fields,field_description:odex_takaful.field_donations_details_lines__direct_debit_partner_bank_id
|
||||
msgid "Direct Debit Partner Bank"
|
||||
msgstr "البنك المستلم"
|
||||
msgstr "البنك المتبرع"
|
||||
|
||||
#. module: odex_takaful
|
||||
#: code:addons/odex_takaful/models/takaful_sponorship_model.py:0
|
||||
|
|
|
|||
|
|
@ -16,6 +16,11 @@ class DonationsDetailsLines(models.Model):
|
|||
_inherit = ['mail.thread']
|
||||
_rec_name = 'sequence_no'
|
||||
|
||||
@api.model
|
||||
def _default_journal_id(self):
|
||||
journal_id = self.env.company.sponsorship_direct_debit_journal_id.id
|
||||
return journal_id if journal_id else False
|
||||
|
||||
name = fields.Text(string="Note")
|
||||
display_type = fields.Selection([
|
||||
('line_section', "Section"),
|
||||
|
|
@ -82,6 +87,7 @@ class DonationsDetailsLines(models.Model):
|
|||
hide_beneficiary_group = fields.Boolean(compute='_compute_hide_beneficiary_group')
|
||||
debit_payment_file_attachment = fields.Binary(string='Debit Payment Attachment', attachment=True)
|
||||
debit_payment_attachment_file_name = fields.Char('Debit Payment File Name', required=False)
|
||||
journal_id = fields.Many2one('account.journal', string="Journal",domain="[('type','=','bank')]",default=_default_journal_id)
|
||||
# cheque_number = fields.Integer(string="Cheque Number")
|
||||
# cheque_due_date = fields.Date(string="Cheque Due Date")
|
||||
# cheque_file_attachment = fields.Binary(string='Cheque Attachment', attachment=True)
|
||||
|
|
@ -89,6 +95,7 @@ class DonationsDetailsLines(models.Model):
|
|||
# bank_transfer_file_attachment = fields.Binary(string='Bank Transfer Attachment', attachment=True)
|
||||
# bank_transfer_attachment_file_name = fields.Char('Bank Transfer File Name', required=False)
|
||||
|
||||
|
||||
@api.depends('extension_history_ids')
|
||||
def _compute_extension_count(self):
|
||||
for rec in self:
|
||||
|
|
@ -423,6 +430,8 @@ class DonationsDetailsLines(models.Model):
|
|||
if rec.sponsorship_duration == 'temporary' and not rec.direct_debit:
|
||||
rec.start_date = fields.Date.context_today(rec)
|
||||
|
||||
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields):
|
||||
res = super(DonationsDetailsLines, self).default_get(fields)
|
||||
|
|
|
|||
|
|
@ -1071,9 +1071,9 @@ class TakafulSponsorship(models.Model):
|
|||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
if vals.get('code', 'New') == 'New':
|
||||
vals['code'] = self.env['ir.sequence'].sudo().next_by_code('sponsorship.sequence')
|
||||
|
||||
# if vals.get('code', 'New') == 'New':
|
||||
# vals['code'] = self.env['ir.sequence'].sudo().next_by_code('sponsorship.sequence')
|
||||
|
||||
sponsor_phone = vals.get('sponsor_phone', False)
|
||||
if sponsor_phone:
|
||||
self._check_phone_numbers(sponsor_phone)
|
||||
|
|
@ -1181,9 +1181,13 @@ class TakafulSponsorship(models.Model):
|
|||
raise ValidationError(
|
||||
_("Please add at least one line in donation details!")
|
||||
)
|
||||
|
||||
all_donation_lines = (self.donations_details_lines + self.donations_details_lines_mechanism_ids).filtered(lambda r: r.display_type == False)
|
||||
|
||||
|
||||
all_donation_lines = (self.donations_details_lines + self.donations_details_lines_mechanism_ids).filtered(
|
||||
lambda r: r.display_type == False)
|
||||
|
||||
if not self.code:
|
||||
self.code = self.env['ir.sequence'].sudo().next_by_code('sponsorship.sequence')
|
||||
|
||||
for line in all_donation_lines.filtered(lambda r: r.record_type == 'sponsorship'):
|
||||
for benefit in (line.benefit_id | line.benefit_ids):
|
||||
if benefit.sponsor_related_id:
|
||||
|
|
@ -1652,7 +1656,6 @@ class TakafulSponsorship(models.Model):
|
|||
'dont_redirect_to_payments': True,
|
||||
'sponsorship_line_ids': sponsorship_line_ids.ids,
|
||||
'sponsorship_payment': True,
|
||||
'sponsorship_payment_skip_compute_amount': True,
|
||||
'default_sponsorship_payment': True,
|
||||
'force_sponsorship_line_partner_id': self.sponsor_id.id,
|
||||
},
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
|
|
@ -1,6 +1,10 @@
|
|||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<<<<<<< HEAD
|
||||
<menuitem id="takaful_kufula_app_top_menu" sequence="15" name="Kafalat System" web_icon="odex_takaful,static/description/icon5.png" groups="odex_takaful.group_kufula_user"/>
|
||||
=======
|
||||
<menuitem id="takaful_kufula_app_top_menu" sequence="15" name="Kafalat System" web_icon="odex_takaful,static/description/icon.png" groups="odex_takaful.donation_officer_group"/>
|
||||
>>>>>>> bb335d757bca524e6bc8e1cc47f6327baa672c63
|
||||
|
||||
<!-- Main Kafalat-->
|
||||
<menuitem id="kafalat_main_menu" parent="takaful_kufula_app_top_menu"
|
||||
|
|
|
|||
|
|
@ -218,6 +218,9 @@
|
|||
attrs="{'required': [('display_type', '=', False)]}"/>
|
||||
<field name="name" widget="section_and_note_text" optional="show"/>
|
||||
<field name="direct_debit"/>
|
||||
<field name="journal_id"
|
||||
attrs="{'invisible': [('direct_debit', '=', False)], 'required': [('direct_debit', '=', True)]}"/>
|
||||
|
||||
<!-- <field name="cheque_number"
|
||||
attrs="{'required': [('payment_method', '=', 'check')], 'invisible': [('payment_method', '!=', 'check')]}"/>
|
||||
<field name="cheque_due_date"
|
||||
|
|
@ -416,6 +419,9 @@
|
|||
<field name="sponsor_id" invisible="1"/>
|
||||
<field name="direct_debit_partner_bank_id" context="{'form_view_ref': 'odex_takaful.res_partner_bank_view_form_quick_create', 'default_partner_id': sponsor_id}"
|
||||
attrs="{'invisible': [('direct_debit', '=', False)], 'required': [('direct_debit', '=', True)]}"/>
|
||||
<field name="journal_id"
|
||||
attrs="{'invisible': [('direct_debit', '=', False)], 'required': [('direct_debit', '=', True)]}"/>
|
||||
|
||||
<field name="debit_payment_file_attachment" widget="binary"
|
||||
filename="debit_payment_attachment_file_name"
|
||||
attrs="{'required': [('direct_debit', '=', True)], 'invisible': [('direct_debit', '=', False)]}"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue