Merge pull request #5448 from expsa/replace_between_replace_wating
Replace between replace wating
This commit is contained in:
commit
eb71f405b0
|
|
@ -243,6 +243,11 @@ msgstr "<strong>تاريخ الدفع:</strong>"
|
|||
msgid "<strong>Payment Method:</strong>"
|
||||
msgstr "<strong>طريقة الدفع:</strong>"
|
||||
|
||||
#. module: enasan_geidea_sponsorship
|
||||
#: model_terms:ir.ui.view,arch_db:enasan_geidea_sponsorship.view_account_payment_register_form_geidea
|
||||
msgid "Process on Terminal"
|
||||
msgstr "الدفع على المنصة"
|
||||
|
||||
#. module: odex_takaful
|
||||
#: model_terms:ir.ui.view,arch_db:odex_takaful.report_transfer_deduction_document
|
||||
msgid "<strong>Payment Method</strong>"
|
||||
|
|
|
|||
|
|
@ -99,6 +99,34 @@ class DonationsDetailsLines(models.Model):
|
|||
journal_id = fields.Many2one('account.journal', string="Journal",domain="[('type','=','bank')]",default=_default_journal_id)
|
||||
benefit_status = fields.Selection(related='benefit_id.member_status')
|
||||
ages = fields.Integer(compute='_compute_get_age_range' , store=True)
|
||||
waiting_date = fields.Date(
|
||||
string="تاريخ الانتظار",
|
||||
compute="_compute_dates",
|
||||
store=True
|
||||
)
|
||||
|
||||
replace_date = fields.Date(
|
||||
string="تاريخ الاستبدال",
|
||||
compute="_compute_dates",
|
||||
store=True
|
||||
)
|
||||
|
||||
@api.depends('state')
|
||||
def _compute_dates(self):
|
||||
"""Automatically set waiting_date or replace_date based on state."""
|
||||
for rec in self:
|
||||
if rec.state == 'waiting':
|
||||
print(date.today())
|
||||
rec.waiting_date = date.today()
|
||||
rec.replace_date = False
|
||||
elif rec.state == 'replace':
|
||||
rec.replace_date = date.today()
|
||||
rec.waiting_date = False
|
||||
else:
|
||||
rec.waiting_date = False
|
||||
rec.replace_date = False
|
||||
|
||||
|
||||
# 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)
|
||||
|
|
@ -881,6 +909,20 @@ class DonationsDetailsLines(models.Model):
|
|||
if sponsorship and len(sponsorship) == 1:
|
||||
message = _("Benefit IDs changed in a donation item:<br/>%s") % "<br/>".join(changes)
|
||||
sponsorship.message_post(body=message)
|
||||
|
||||
# if 'state' in vals:
|
||||
# print('In Vals')
|
||||
# print("vals['state'] >>> " , vals['state'])
|
||||
# if vals['state'] == 'waiting':
|
||||
# vals['waiting_date'] = date.today()
|
||||
# print("vals['waiting_date'] >>> " , vals['waiting_date'])
|
||||
# vals['replace_date'] = False
|
||||
# elif vals['state'] == 'replace':
|
||||
# vals['replace_date'] = date.today()
|
||||
# vals['waiting_date'] = False
|
||||
# else:
|
||||
# vals['waiting_date'] = False
|
||||
# vals['replace_date'] = False
|
||||
self.onset_benefit_id()
|
||||
|
||||
return res
|
||||
|
|
|
|||
|
|
@ -281,6 +281,14 @@ class ResPartner(models.Model):
|
|||
if 'mobile' in vals:
|
||||
self._check_phone_numbers(vals['mobile'])
|
||||
vals['mobile'] = self.phone_format(vals['mobile'])
|
||||
if 'name' in vals :
|
||||
if self.kafel_id:
|
||||
self.kafel_id.name = vals['name']
|
||||
|
||||
if 'mobile' in vals :
|
||||
if self.kafel_id:
|
||||
self.kafel_id.login = vals['mobile']
|
||||
|
||||
res = super(ResPartner, self).write(vals)
|
||||
return res
|
||||
|
||||
|
|
|
|||
|
|
@ -61,11 +61,12 @@
|
|||
<field name="name">donations.details.lines.view.tree</field>
|
||||
<field name="model">donations.details.lines</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree default_order="create_date asc" create="0" edit="0">
|
||||
<tree default_order="create_date asc , waiting_date asc , replace_date asc" create="0" edit="0" >
|
||||
<field name="sponsorship_scheduling_line_ids" invisible="1" />
|
||||
<field name="direct_debit" invisible="1" />
|
||||
<field name="sequence_no" />
|
||||
<field name="sponsor_id" />
|
||||
|
||||
<field name="sponsor_phone" widget="phone"/>
|
||||
<field name="donation_type" optional="show"/>
|
||||
<field name="sponsorship_duration" optional="hide"/>
|
||||
|
|
@ -84,6 +85,8 @@
|
|||
<field name="benefit_id" optional="hide" />
|
||||
<field name="sponsorship_creation_date" />
|
||||
<field name="create_date" optional="hide"/>
|
||||
<field name="waiting_date" widget="date" optional="hide"/>
|
||||
<field name="replace_date" widget="date" optional="hide"/>
|
||||
<field name="state" widget="badge"
|
||||
decoration-muted="state == 'draft'"
|
||||
decoration-warning="state == 'waiting'"
|
||||
|
|
@ -179,6 +182,7 @@
|
|||
<group>
|
||||
<group string="Donation Information">
|
||||
<field name="ages" invisible="1" />
|
||||
<field name="waiting_date" widget="date" />
|
||||
<field name="donation_type" invisible="1"/>
|
||||
<field name="donation_types"
|
||||
attrs="{'invisible': [('donation_type', '!=', 'donation')], 'readonly': [('parent_state', '!=', 'draft')]}" />
|
||||
|
|
@ -362,16 +366,18 @@
|
|||
<field name="name">Donations Details Lines waiting</field>
|
||||
<field name="res_model">donations.details.lines</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('state', '=', 'waiting')]</field>
|
||||
<field name="search_view_id" ref="donations_details_lines_view_search"/>
|
||||
<field name="context">{'create': False, 'delete': False, 'search_default_filter_waiting': 1}</field>
|
||||
<field name="context">{'create': False, 'delete': False}</field>
|
||||
</record>
|
||||
|
||||
<record id="donations_details_lines_replace_action" model="ir.actions.act_window">
|
||||
<field name="name">Donations Details Lines Replacement</field>
|
||||
<field name="res_model">donations.details.lines</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('state', '=', 'replace')]</field>
|
||||
<field name="search_view_id" ref="donations_details_lines_view_search"/>
|
||||
<field name="context">{'create': False, 'delete': False, 'search_default_filter_replace': 1}</field>
|
||||
<field name="context">{'create': False, 'delete': False}</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -13,11 +13,13 @@
|
|||
<menuitem id="donations_details_lines_app_menu" parent="kafalat_main_menu"
|
||||
name="Donations Details Lines" action="donations_details_lines_action" sequence="2"/>
|
||||
|
||||
<menuitem id="donations_details_lines_waiting_app_menu" parent="menu_replacement_root"
|
||||
name="Donations Details Lines Waiting Benefit" action="donations_details_lines_waiting_action" sequence="3"/>
|
||||
|
||||
<menuitem id="donations_details_lines_to_replace_app_menu" parent="menu_replacement_root"
|
||||
name="Donations Details Lines To Replace Benefit" action="donations_details_lines_replace_action" sequence="4"/>
|
||||
name="Donations Details Lines To Replace Benefit" action="donations_details_lines_replace_action" sequence="3"/>
|
||||
|
||||
<menuitem id="donations_details_lines_waiting_app_menu" parent="menu_replacement_root"
|
||||
name="Donations Details Lines Waiting Benefit" action="donations_details_lines_waiting_action" sequence="4"/>
|
||||
|
||||
|
||||
|
||||
<!-- TODO WE WILL USE IT LATER DON'T REMOVE THIS -->
|
||||
<!-- START OF THE BLOCK -->
|
||||
|
|
|
|||
|
|
@ -514,6 +514,7 @@
|
|||
<group>
|
||||
<group>
|
||||
<field name="ages" invisible="1"/>
|
||||
<field name="waiting_date" invisible="1" widget="date"/>
|
||||
<field name="family_id"
|
||||
attrs="{'invisible': [('sponsorship_type','=','group'), ('parent.record_type','=','sponsorship')],
|
||||
'readonly': ['|', ('sponsorship_type', '!=', 'group'), ('parent.record_type','!=','donation')],
|
||||
|
|
|
|||
|
|
@ -90,11 +90,11 @@
|
|||
</div>
|
||||
</group>
|
||||
<group>
|
||||
<field name="kafel_id" readonly="1"/>
|
||||
<field name="kafel_id" readonly="1" invisible="1"/>
|
||||
</group>
|
||||
<group name="group_top">
|
||||
<group name="group_main" colspan="2">
|
||||
<field name="mobile" string="رقم الجوال" widget="phone" placeholder="05xxxxxxxx" attrs="{'required': [('parent_id', '=', False)]}"/>
|
||||
<field name="mobile" string="رقم الجوال" widget="phone" placeholder="05xxxxxxxx" attrs="{'required': [('parent_id', '=', False)]}" />
|
||||
<field name="preferred_communication" string="طريقة التواصل المفضلة" required="1"/>
|
||||
<field name="gender" attrs="{'required': [('company_type', '=', 'person')],'invisible': [('company_type', '!=', 'person')]}"/>
|
||||
<field name="street" attrs="{'invisible': [('company_type', '=', 'person')]}"/>
|
||||
|
|
|
|||
|
|
@ -30,11 +30,17 @@ class AccountRegisterPayment(models.TransientModel):
|
|||
transaction_file_attachment = fields.Binary(string='Transaction Attachment', attachment=False)
|
||||
transaction_attachment_file_name = fields.Char('Transaction File Name', required=False)
|
||||
payment_method = fields.Selection(selection=[("cash", "Cash"), ("bank", "Bank Transfer"), ("check", "Check")], string="Payment Method", required=True, default="cash")
|
||||
|
||||
machine_id = fields.Many2one('geidea.terminals' , 'الماكينة')
|
||||
check_number = fields.Char(string='Check Number')
|
||||
check_due_date = fields.Date(string='Check Due Date')
|
||||
sponsorship_payment = fields.Boolean(string='Sponsorship Payment', default=False)
|
||||
|
||||
|
||||
@api.onchange("machine_id")
|
||||
def onchange_machine_id(self):
|
||||
for rec in self:
|
||||
if rec.machine_id:
|
||||
rec.journal_id = rec.machine_id.journal_id
|
||||
@api.onchange("takaful_payment_method_id")
|
||||
def onchange_takaful_payment_method_id(self):
|
||||
for rec in self:
|
||||
|
|
@ -49,6 +55,7 @@ class AccountRegisterPayment(models.TransientModel):
|
|||
if j_type:
|
||||
return {"domain": {"journal_id": [("type", "=", j_type)]}}
|
||||
|
||||
|
||||
@api.depends('source_amount', 'source_amount_currency', 'source_currency_id', 'company_id', 'currency_id', 'payment_date')
|
||||
def _compute_amount(self):
|
||||
if self.env.context.get('sponsorship_payment_skip_compute_amount'):
|
||||
|
|
@ -67,6 +74,7 @@ class AccountRegisterPayment(models.TransientModel):
|
|||
else:
|
||||
rec.takaful_payment_method = "cash"
|
||||
|
||||
|
||||
def _create_payments(self):
|
||||
sponsorship_line_ids = self.env.context.get('sponsorship_line_ids')
|
||||
sponsorship_lines = self.env['donations.details.lines'].browse(sponsorship_line_ids).filtered(lambda r: r.display_type == False)
|
||||
|
|
|
|||
|
|
@ -51,6 +51,71 @@
|
|||
attrs="{'invisible': ['|', ('sponsorship_payment', '=', False), ('takaful_payment_method','not in',['bank', 'check'])], 'required': [('sponsorship_payment', '=', True), ('takaful_payment_method','=','bank')]}"/>
|
||||
<field name="transaction_attachment_file_name" invisible="1"/>
|
||||
</xpath>
|
||||
<!--<xpath expr="//group" position="after">-->
|
||||
<!-- <notebook>-->
|
||||
<!-- <page string="Sub Payments" attrs="{'invisible': [('group_payment', '=', False)]}">-->
|
||||
<!-- <field name="account_payment_register_ids" attrs="{'invisible': [('group_payment', '=', False)]}" nolabel="1">-->
|
||||
<!-- <tree editable="bottom" delete="true" create="true">-->
|
||||
<!-- <field name="sponsorship_payment" invisible="1"/>-->
|
||||
<!-- <field name="takaful_payment_method" invisible="1"/>-->
|
||||
<!-- <field name="available_partner_bank_ids" invisible="1"/>-->
|
||||
<!-- <field name="company_id" invisible="1"/>-->
|
||||
<!-- <field name="takaful_payment_method_id" options="{'no_create': True, 'no_create_edit': True}"/>-->
|
||||
<!-- <field name="journal_id" string="Association Journal"/>-->
|
||||
<!-- <field name="amount"/>-->
|
||||
<!-- <field name="check_number"-->
|
||||
<!-- attrs="{-->
|
||||
<!-- 'invisible': [-->
|
||||
<!-- ('takaful_payment_method','!=','check')-->
|
||||
<!-- ],-->
|
||||
<!-- 'required': [-->
|
||||
<!-- ('takaful_payment_method','=','check')-->
|
||||
<!-- ]-->
|
||||
<!-- }"-->
|
||||
<!-- optional="hide"/>-->
|
||||
<!-- <field name="check_due_date"-->
|
||||
<!-- attrs="{-->
|
||||
<!-- 'invisible': [-->
|
||||
<!-- ('takaful_payment_method','!=','check')-->
|
||||
<!-- ],-->
|
||||
<!-- 'required': [-->
|
||||
<!-- ('takaful_payment_method','=','check')-->
|
||||
<!-- ]-->
|
||||
<!-- }"-->
|
||||
<!-- optional="hide"/>-->
|
||||
<!-- <field name="partner_bank_id"-->
|
||||
<!-- context="{-->
|
||||
<!-- 'form_view_ref': 'odex_takaful.res_partner_bank_view_form_quick_create',-->
|
||||
<!-- 'default_partner_id': context.get('force_sponsorship_line_partner_id')-->
|
||||
<!-- }"-->
|
||||
<!-- attrs="{-->
|
||||
<!-- 'required': [-->
|
||||
<!-- ('takaful_payment_method','=','bank')-->
|
||||
<!-- ],-->
|
||||
<!-- 'invisible': [-->
|
||||
<!-- ('takaful_payment_method','!=','bank')-->
|
||||
<!-- ]-->
|
||||
<!-- }"-->
|
||||
<!-- readonly="0"-->
|
||||
<!-- optional="hide"/>-->
|
||||
<!-- <field name="transaction_file_attachment"-->
|
||||
<!-- widget="binary"-->
|
||||
<!-- filename="transaction_attachment_file_name"-->
|
||||
<!-- attrs="{-->
|
||||
<!-- 'invisible': [-->
|
||||
<!-- ('takaful_payment_method','not in',['bank', 'check'])-->
|
||||
<!-- ],-->
|
||||
<!-- 'required': ['|',-->
|
||||
<!-- ('takaful_payment_method','=','bank'),-->
|
||||
<!-- ('takaful_payment_method','=','check')-->
|
||||
<!-- ]-->
|
||||
<!-- }"-->
|
||||
<!-- optional="hide"/>-->
|
||||
<!-- </tree>-->
|
||||
<!-- </field>-->
|
||||
<!-- </page>-->
|
||||
<!-- </notebook>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- <xpath expr="//footer/button[@name='action_create_payments']" position="after">-->
|
||||
<!-- <button name="action_register_all_lines"-->
|
||||
<!-- type="object"-->
|
||||
|
|
|
|||
Loading…
Reference in New Issue