Skip to content

Commit

Permalink
Merge pull request #189 from dibik96/17.0-develop
Browse files Browse the repository at this point in the history
G2P-1830, G2P-1818, G2P-1803: Setting menu opening issue, Import registrant issue, Added name to external link
  • Loading branch information
shibu-narayanan authored Feb 7, 2024
2 parents aa87299 + 2a101fa commit 4fac1f6
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 70 deletions.
45 changes: 21 additions & 24 deletions g2p_entitlement_differential/views/entitlement_manager_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,29 @@ Part of OpenG2P. See LICENSE file for full copyright and licensing details.
-->
<odoo>

<record id="view_entitlement_manager_cash_form_diff_inherit" model="ir.ui.view">
<field name="name">view_entitlement_manager_cash_form_diff_inherit</field>
<field name="model">g2p.program.entitlement.manager.cash</field>
<field name="inherit_id" ref="g2p_entitlement_cash.view_entitlement_manager_cash_form" />
<field name="priority">100</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='max_amount']" position="after">
<div colspan="2">
<field name="enable_inflation" />
<label for="enable_inflation" string="Enable Inflation" />
</div>
<field name="inflation_rate" invisible="not enable_inflation" />
<record id="view_entitlement_manager_cash_form_diff_inherit" model="ir.ui.view">
<field name="name">view_entitlement_manager_cash_form_diff_inherit</field>
<field name="model">g2p.program.entitlement.manager.cash</field>
<field name="inherit_id" ref="g2p_entitlement_cash.view_entitlement_manager_cash_form" />
<field name="priority">100</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='max_amount']" position="after">
<div colspan="2">
<field name="enable_inflation" />
<label for="enable_inflation" string="Enable Inflation" />
</div>
<field name="inflation_rate" invisible="not enable_inflation" />

</xpath>
<xpath
</xpath>
<xpath
expr="//field[@name='entitlement_item_ids']/tree/field[@name='sequence']"
position="replace"
>
<field name="name" />
</xpath>
<xpath
expr="//field[@name='entitlement_item_ids']/form/group/field"
position="before"
>
<field name="name" />
</xpath>
</field>
</record>
<field name="name" />
</xpath>
<xpath expr="//field[@name='entitlement_item_ids']/form/group/field" position="before">
<field name="name" />
</xpath>
</field>
</record>
</odoo>
2 changes: 1 addition & 1 deletion g2p_entitlement_voucher/views/entitlement_manager_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
type="object"
icon="fa-external-link"
class="oe_stat_button"
titile="open voucher config form"
title="Open voucher config form"
/>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion g2p_payment_phee/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
],
"data": [
"security/ir.model.access.csv",
"views/res_config_settings_view.xml",
"views/payment_manager_view.xml",
"views/res_config_settings_view.xml",
],
"assets": {},
"demo": [],
Expand Down
45 changes: 32 additions & 13 deletions g2p_payment_phee/views/res_config_settings_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,46 @@ Part of OpenG2P. See LICENSE file for full copyright and licensing details.
<xpath expr="//form" position="inside">
<app
string="Payment Hub EE API"
data-key="g2p_payment_phee"
name="g2p_payment_phee"
data-string="Payment Hub EE API"
id="g2p_payment_phee"
logo="/g2p_payment_phee/static/description/icon.png"
groups="base.group_system,g2p_registry_base.group_g2p_admin"
>
<block title="Payment Hub EE API Endpoint URLs">
<setting
name="default_auth_endpoint_url"
title="Default authentication endpoint URL"
/>
<setting name="default_payment_endpoint_url" title="Default payment endpoint URL" />
<setting name="default_status_endpoint_url" title="Default status endpoint URL" />
<setting name="default_details_endpoint_url" title="Default details endpoint URL" />
<setting title="Default authentication endpoint URL">
<field name="default_auth_endpoint_url" />
</setting>
<setting title="Default payment endpoint URL">
<field name="default_payment_endpoint_url" />
</setting>
<setting title="Default status endpoint URL">
<field name="default_status_endpoint_url" />
</setting>
<setting title="Default details endpoint URL">
<field name="default_details_endpoint_url" />
</setting>
</block>

<block title="Authentication Parameters">
<setting name="default_tenant_id" title="Default tenant ID" />
<setting name="default_username" title="Default username" />
<setting name="default_password" title="Default password" password="True" />
<setting name="default_grant_type" title="Default grant type" password="True" />
<setting name="default_authorization" title="Default authorization" />
<setting title="Default tenant ID">
<field name="default_tenant_id" />
</setting>
<setting title="Default username">
<field name="default_username" />
</setting>
<setting title="Default password">
<field name="default_password" password="True" />
</setting>
<setting title="Default grant type">
<field name="default_grant_type" password="True" />
</setting>
<setting title="Default authorization">
<field name="default_authorization" />
</setting>
</block>
</app>

</xpath>
</field>
</record>
Expand Down
4 changes: 1 addition & 3 deletions g2p_program_assessment/wizard/create_entitlement_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ def open_entitlement_form_wizard(self, beneficiary):

def create_entitlement(self):
if not self.initial_amount or self.initial_amount <= 0:
raise ValidationError(
_("Amount cannot be zero or empty or negative.")
)
raise ValidationError(_("Amount cannot be zero or empty or negative."))

existing_entitlements_count = self.env["g2p.entitlement"].search_count(
[
Expand Down
8 changes: 1 addition & 7 deletions g2p_program_assessment/wizard/create_entitlement_wizard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@ Part of OpenG2P. See LICENSE file for full copyright and licensing details.
</group>
</sheet>
<footer>
<button
name="create_entitlement"
type="object"
string="Create"
class="btn-primary"

/>
<button name="create_entitlement" type="object" string="Create" class="btn-primary" />
<button string="Cancel" class="btn-secondary" special="cancel" />
</footer>
</form>
Expand Down
17 changes: 8 additions & 9 deletions g2p_program_documents/static/src/js/preview_document.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
/** @odoo-module **/
import { useFileViewer } from "@web/core/file_viewer/file_viewer_hook";
import { Component, xml } from "@odoo/owl";
import { registry } from "@web/core/registry";
import { useService } from "@web/core/utils/hooks";
import {useFileViewer} from "@web/core/file_viewer/file_viewer_hook";
import {Component, xml} from "@odoo/owl";
import {registry} from "@web/core/registry";
import {useService} from "@web/core/utils/hooks";

class Widgetpreview extends Component {

static template = xml`<button class="btn btn-primary" icon="fa-file-text-o" t-on-click="clickPreview">Preview</button>`;

setup(){
setup() {
super.setup();
this.fileViewer = useFileViewer();
this.store = useService("mail.store");
this.rpc = useService("rpc");
}

clickPreview(ev){
const currentRow = ev.target.closest('.o_data_row');
clickPreview(ev) {
const currentRow = ev.target.closest(".o_data_row");
if (currentRow) {
const slugElement = currentRow.querySelector('.o_data_cell[name="slug"]');
if (slugElement) {
Expand All @@ -39,7 +38,7 @@ class Widgetpreview extends Component {
}

async _onPreviewButtonClick(recordID) {
const result = await this.rpc("/web/dataset/call_kw/storage.file/get_binary",{
const result = await this.rpc("/web/dataset/call_kw/storage.file/get_binary", {
model: "storage.file",
method: "get_binary",
args: [[recordID]],
Expand Down
2 changes: 1 addition & 1 deletion g2p_program_documents/views/program_membership_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<field name="slug" string="Name" />
<field name="file_size" />
<field name="file_type" />
<widget name="action_preview"/>
<widget name="action_preview" />
</tree>
</field>
</page>
Expand Down
17 changes: 9 additions & 8 deletions g2p_program_registrant_info/models/program_membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ def _compute_latest_registrant_info(self):

@api.constrains("partner_id", "program_id")
def _onchange_program_registrant_info(self):
old_prog_reg_infos = self.env["g2p.program.registrant_info"].search(
[
("registrant_id", "=", self.partner_id.id),
("program_id", "=", self.program_id.id),
("program_membership_id", "!=", self.id),
]
)
old_prog_reg_infos.write({"program_membership_id": self.id})
for rec in self:
old_prog_reg_infos = self.env["g2p.program.registrant_info"].search(
[
("registrant_id", "=", rec.partner_id.id),
("program_id", "=", rec.program_id.id),
("program_membership_id", "!=", rec.id),
]
)
old_prog_reg_infos.write({"program_membership_id": rec.id})

def create_program_registrant_info(self):
self.ensure_one()
Expand Down
6 changes: 3 additions & 3 deletions g2p_programs/views/registrant_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Part of OpenG2P. See LICENSE file for full copyright and licensing details.
<button
name="open_beneficiaries_form"
type="object"
title="Open beneficiaries form"
icon="fa-external-link"
title="Open beneficiaries form"
class="btn-success"
/>
<field name="partner_id" column_invisible="1" />
Expand Down Expand Up @@ -49,9 +49,9 @@ Part of OpenG2P. See LICENSE file for full copyright and licensing details.
<tree>
<button
name="open_entitlement_form"
title="Open entitlement form"
type="object"
icon="fa-external-link"
title="Open entitlement form"
class="btn-success"
/>
<field name="name" />
Expand Down Expand Up @@ -115,9 +115,9 @@ Part of OpenG2P. See LICENSE file for full copyright and licensing details.
<tree>
<button
name="open_entitlement_form"
title="Open entitlement form"
type="object"
icon="fa-external-link"
title="Open entitlement form"
class="btn-success"
/>
<field name="name" />
Expand Down

0 comments on commit 4fac1f6

Please sign in to comment.