Change on Facility definition
This commit is contained in:
@@ -13,6 +13,7 @@ from . import (
|
|||||||
fx,
|
fx,
|
||||||
operational,
|
operational,
|
||||||
facility,
|
facility,
|
||||||
|
constraint_type,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -36,7 +37,9 @@ def register():
|
|||||||
fx.FxFeeder,
|
fx.FxFeeder,
|
||||||
operational.BlockingReason,
|
operational.BlockingReason,
|
||||||
operational.ChargeType,
|
operational.ChargeType,
|
||||||
|
facility.FacilityStatus,
|
||||||
facility.Facility,
|
facility.Facility,
|
||||||
|
facility.FacilityCurrency,
|
||||||
facility.FacilityCovenant,
|
facility.FacilityCovenant,
|
||||||
facility.FacilityLimit,
|
facility.FacilityLimit,
|
||||||
facility.FacilityLimitHaircut,
|
facility.FacilityLimitHaircut,
|
||||||
@@ -48,6 +51,7 @@ def register():
|
|||||||
facility.FacilityCap,
|
facility.FacilityCap,
|
||||||
facility.FacilityCapHaircut,
|
facility.FacilityCapHaircut,
|
||||||
facility.FacilityConstraint,
|
facility.FacilityConstraint,
|
||||||
|
constraint_type.ConstraintType,
|
||||||
module='trade_finance', type_='model')
|
module='trade_finance', type_='model')
|
||||||
Pool.register(
|
Pool.register(
|
||||||
fx.PriceCalendar,
|
fx.PriceCalendar,
|
||||||
|
|||||||
24
modules/trade_finance/constraint_type.py
Normal file
24
modules/trade_finance/constraint_type.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# This file is part of Tradon. The COPYRIGHT file at the top level of
|
||||||
|
# this repository contains the full copyright notices and license terms.
|
||||||
|
|
||||||
|
from trytond.model import ModelSQL, ModelView, fields
|
||||||
|
from trytond.pyson import Eval
|
||||||
|
|
||||||
|
__all__ = ['ConstraintType']
|
||||||
|
|
||||||
|
|
||||||
|
class ConstraintType(ModelSQL, ModelView):
|
||||||
|
'Constraint Type'
|
||||||
|
__name__ = 'trade_finance.constraint_type'
|
||||||
|
_rec_name = 'name'
|
||||||
|
|
||||||
|
name = fields.Char('Type', required=True, size=50)
|
||||||
|
model = fields.Many2One('ir.model', 'Table', ondelete='RESTRICT')
|
||||||
|
value_field = fields.Many2One('ir.model.field', 'Value Field',
|
||||||
|
ondelete='RESTRICT',
|
||||||
|
domain=[('model', '=', Eval('model'))],
|
||||||
|
depends=['model'])
|
||||||
|
label_field = fields.Many2One('ir.model.field', 'Label Field',
|
||||||
|
ondelete='RESTRICT',
|
||||||
|
domain=[('model', '=', Eval('model'))],
|
||||||
|
depends=['model'])
|
||||||
66
modules/trade_finance/constraint_type.xml
Normal file
66
modules/trade_finance/constraint_type.xml
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<tryton>
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<!-- ================================================================ -->
|
||||||
|
<!-- CONSTRAINT TYPE -->
|
||||||
|
<!-- ================================================================ -->
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="constraint_type_view_tree">
|
||||||
|
<field name="model">trade_finance.constraint_type</field>
|
||||||
|
<field name="type">tree</field>
|
||||||
|
<field name="priority" eval="10"/>
|
||||||
|
<field name="name">constraint_type_tree</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.ui.view" id="constraint_type_view_form">
|
||||||
|
<field name="model">trade_finance.constraint_type</field>
|
||||||
|
<field name="type">form</field>
|
||||||
|
<field name="name">constraint_type_form</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.action.act_window" id="act_constraint_type">
|
||||||
|
<field name="name">Constraint Types</field>
|
||||||
|
<field name="res_model">trade_finance.constraint_type</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.action.act_window.view" id="act_constraint_type_view1">
|
||||||
|
<field name="sequence" eval="10"/>
|
||||||
|
<field name="view" ref="constraint_type_view_tree"/>
|
||||||
|
<field name="act_window" ref="act_constraint_type"/>
|
||||||
|
</record>
|
||||||
|
<record model="ir.action.act_window.view" id="act_constraint_type_view2">
|
||||||
|
<field name="sequence" eval="20"/>
|
||||||
|
<field name="view" ref="constraint_type_view_form"/>
|
||||||
|
<field name="act_window" ref="act_constraint_type"/>
|
||||||
|
</record>
|
||||||
|
<menuitem
|
||||||
|
name="Constraint Types"
|
||||||
|
sequence="10"
|
||||||
|
id="menu_constraint_type"
|
||||||
|
parent="menu_trade_finance_configuration"
|
||||||
|
action="act_constraint_type"/>
|
||||||
|
|
||||||
|
<record model="ir.model.access" id="access_constraint_type">
|
||||||
|
<field name="model">trade_finance.constraint_type</field>
|
||||||
|
<field name="perm_read" eval="False"/>
|
||||||
|
<field name="perm_write" eval="False"/>
|
||||||
|
<field name="perm_create" eval="False"/>
|
||||||
|
<field name="perm_delete" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record model="ir.model.access" id="access_constraint_type_user">
|
||||||
|
<field name="model">trade_finance.constraint_type</field>
|
||||||
|
<field name="group" ref="group_trade_finance_user"/>
|
||||||
|
<field name="perm_read" eval="True"/>
|
||||||
|
<field name="perm_write" eval="False"/>
|
||||||
|
<field name="perm_create" eval="False"/>
|
||||||
|
<field name="perm_delete" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record model="ir.model.access" id="access_constraint_type_admin">
|
||||||
|
<field name="model">trade_finance.constraint_type</field>
|
||||||
|
<field name="group" ref="group_trade_finance_admin"/>
|
||||||
|
<field name="perm_read" eval="True"/>
|
||||||
|
<field name="perm_write" eval="True"/>
|
||||||
|
<field name="perm_create" eval="True"/>
|
||||||
|
<field name="perm_delete" eval="True"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</data>
|
||||||
|
</tryton>
|
||||||
@@ -1,14 +1,16 @@
|
|||||||
# This file is part of Tradon. The COPYRIGHT file at the top level of
|
# This file is part of Tradon. The COPYRIGHT file at the top level of
|
||||||
# this repository contains the full copyright notices and license terms.
|
# this repository contains the full copyright notices and license terms.
|
||||||
|
|
||||||
from trytond.model import ModelSQL, ModelView, Workflow, fields
|
from trytond.model import ModelSQL, ModelView, fields
|
||||||
from trytond.model import sequence_ordered
|
from trytond.model import sequence_ordered
|
||||||
from trytond.pool import Pool
|
from trytond.pool import Pool
|
||||||
from trytond.pyson import Eval, If, Bool
|
from trytond.pyson import Eval, Bool
|
||||||
from trytond.exceptions import UserError
|
from trytond.exceptions import UserError
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
'FacilityStatus',
|
||||||
'Facility',
|
'Facility',
|
||||||
|
'FacilityCurrency',
|
||||||
'FacilityCovenant',
|
'FacilityCovenant',
|
||||||
'FacilityLimit',
|
'FacilityLimit',
|
||||||
'FacilityLimitHaircut',
|
'FacilityLimitHaircut',
|
||||||
@@ -43,20 +45,30 @@ ATTRIBUTE_TYPES = [
|
|||||||
('receivable_category', 'Receivable Category'),
|
('receivable_category', 'Receivable Category'),
|
||||||
]
|
]
|
||||||
|
|
||||||
FACILITY_STATES = [
|
|
||||||
('draft', 'Draft'),
|
# ---------------------------------------------------------------------------
|
||||||
('active', 'Active'),
|
# Facility Status (configurable reference)
|
||||||
('blocked', 'Blocked'),
|
# ---------------------------------------------------------------------------
|
||||||
('cancelled', 'Cancelled'),
|
|
||||||
('closed', 'Closed'),
|
class FacilityStatus(ModelSQL, ModelView):
|
||||||
]
|
'Facility Status'
|
||||||
|
__name__ = 'trade_finance.facility_status'
|
||||||
|
_rec_name = 'name'
|
||||||
|
|
||||||
|
code = fields.Char('Code', required=True)
|
||||||
|
name = fields.Char('Name', required=True)
|
||||||
|
active = fields.Boolean('Active')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def default_active():
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Facility Header
|
# Facility Header
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
class Facility(Workflow, ModelSQL, ModelView):
|
class Facility(ModelSQL, ModelView):
|
||||||
'TF Facility'
|
'TF Facility'
|
||||||
__name__ = 'trade_finance.facility'
|
__name__ = 'trade_finance.facility'
|
||||||
_rec_name = 'name'
|
_rec_name = 'name'
|
||||||
@@ -67,8 +79,8 @@ class Facility(Workflow, ModelSQL, ModelView):
|
|||||||
help='Bank or fund providing this facility')
|
help='Bank or fund providing this facility')
|
||||||
description = fields.Text('Description')
|
description = fields.Text('Description')
|
||||||
|
|
||||||
status = fields.Selection(FACILITY_STATES, 'Status', required=True,
|
status = fields.Many2One('trade_finance.facility_status', 'Status',
|
||||||
readonly=True)
|
ondelete='RESTRICT')
|
||||||
commitment_status = fields.Selection([
|
commitment_status = fields.Selection([
|
||||||
('uncommitted', 'Uncommitted'),
|
('uncommitted', 'Uncommitted'),
|
||||||
('committed', 'Committed'),
|
('committed', 'Committed'),
|
||||||
@@ -94,6 +106,8 @@ class Facility(Workflow, ModelSQL, ModelView):
|
|||||||
|
|
||||||
limits = fields.One2Many('trade_finance.facility_limit', 'facility',
|
limits = fields.One2Many('trade_finance.facility_limit', 'facility',
|
||||||
'Limits')
|
'Limits')
|
||||||
|
currencies = fields.One2Many('trade_finance.facility_currency', 'facility',
|
||||||
|
'Accepted Currencies')
|
||||||
caps = fields.One2Many('trade_finance.facility_cap', 'facility', 'Caps')
|
caps = fields.One2Many('trade_finance.facility_cap', 'facility', 'Caps')
|
||||||
covenants = fields.One2Many('trade_finance.facility_covenant', 'facility',
|
covenants = fields.One2Many('trade_finance.facility_covenant', 'facility',
|
||||||
'Covenants')
|
'Covenants')
|
||||||
@@ -101,10 +115,6 @@ class Facility(Workflow, ModelSQL, ModelView):
|
|||||||
'facility', 'Facility Constraints',
|
'facility', 'Facility Constraints',
|
||||||
domain=[('limit', '=', None)])
|
domain=[('limit', '=', None)])
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def default_status():
|
|
||||||
return 'draft'
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def default_commitment_status():
|
def default_commitment_status():
|
||||||
return 'uncommitted'
|
return 'uncommitted'
|
||||||
@@ -113,48 +123,23 @@ class Facility(Workflow, ModelSQL, ModelView):
|
|||||||
def default_is_tpa():
|
def default_is_tpa():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Workflow transitions
|
|
||||||
_transitions = {
|
|
||||||
('draft', 'active'),
|
|
||||||
('active', 'blocked'),
|
|
||||||
('blocked', 'active'),
|
|
||||||
('active', 'cancelled'),
|
|
||||||
('active', 'closed'),
|
|
||||||
('blocked', 'cancelled'),
|
|
||||||
('blocked', 'closed'),
|
|
||||||
}
|
|
||||||
_buttons = {
|
|
||||||
'activate': {'invisible': Eval('status') != 'draft'},
|
|
||||||
'block': {'invisible': Eval('status') != 'active'},
|
|
||||||
'unblock': {'invisible': Eval('status') != 'blocked'},
|
|
||||||
'cancel': {'invisible': ~Eval('status').in_(['active', 'blocked'])},
|
|
||||||
'close': {'invisible': ~Eval('status').in_(['active', 'blocked'])},
|
|
||||||
}
|
|
||||||
|
|
||||||
@classmethod
|
# ---------------------------------------------------------------------------
|
||||||
@Workflow.transition('active')
|
# Facility Accepted Currency
|
||||||
def activate(cls, facilities):
|
# ---------------------------------------------------------------------------
|
||||||
pass
|
|
||||||
|
|
||||||
@classmethod
|
class FacilityCurrency(ModelSQL, ModelView):
|
||||||
@Workflow.transition('blocked')
|
'Facility Currency'
|
||||||
def block(cls, facilities):
|
__name__ = 'trade_finance.facility_currency'
|
||||||
pass
|
|
||||||
|
|
||||||
@classmethod
|
facility = fields.Many2One('trade_finance.facility', 'Facility',
|
||||||
@Workflow.transition('active')
|
required=True, ondelete='CASCADE')
|
||||||
def unblock(cls, facilities):
|
currency = fields.Many2One('currency.currency', 'Currency',
|
||||||
pass
|
required=True, ondelete='RESTRICT')
|
||||||
|
fx_haircut_formula = fields.Many2One('trade_finance.haircut_formula',
|
||||||
@classmethod
|
'FX Haircut Formula', ondelete='RESTRICT')
|
||||||
@Workflow.transition('cancelled')
|
fx_feeder = fields.Many2One('trade_finance.fx_feeder', 'FX Rate Feeder',
|
||||||
def cancel(cls, facilities):
|
ondelete='RESTRICT')
|
||||||
pass
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
@Workflow.transition('closed')
|
|
||||||
def close(cls, facilities):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
@@ -204,6 +189,7 @@ class FacilityLimit(ModelSQL, ModelView):
|
|||||||
'Sub-Limits')
|
'Sub-Limits')
|
||||||
|
|
||||||
name = fields.Char('Name', required=True)
|
name = fields.Char('Name', required=True)
|
||||||
|
alternative_name = fields.Char('Limit Alternative Name')
|
||||||
financing_type = fields.Many2One('trade_finance.financing_type',
|
financing_type = fields.Many2One('trade_finance.financing_type',
|
||||||
'Financing Type', ondelete='RESTRICT')
|
'Financing Type', ondelete='RESTRICT')
|
||||||
amount = fields.Numeric('Amount', digits=(16, 2), required=True)
|
amount = fields.Numeric('Amount', digits=(16, 2), required=True)
|
||||||
@@ -213,13 +199,6 @@ class FacilityLimit(ModelSQL, ModelView):
|
|||||||
|
|
||||||
_order = [('sequence', 'ASC'), ('id', 'ASC')]
|
_order = [('sequence', 'ASC'), ('id', 'ASC')]
|
||||||
|
|
||||||
is_global = fields.Function(
|
|
||||||
fields.Boolean('Global Limit',
|
|
||||||
states={'invisible': Bool(Eval('parent'))},
|
|
||||||
depends=['parent']),
|
|
||||||
'get_is_global')
|
|
||||||
display_name = fields.Function(fields.Char('Name'), 'get_display_name')
|
|
||||||
|
|
||||||
haircuts = fields.One2Many('trade_finance.facility_limit_haircut', 'limit',
|
haircuts = fields.One2Many('trade_finance.facility_limit_haircut', 'limit',
|
||||||
'Haircuts')
|
'Haircuts')
|
||||||
currencies = fields.One2Many('trade_finance.facility_limit_currency',
|
currencies = fields.One2Many('trade_finance.facility_limit_currency',
|
||||||
@@ -247,25 +226,27 @@ class FacilityLimit(ModelSQL, ModelView):
|
|||||||
values['facility'] = parent.facility.id
|
values['facility'] = parent.facility.id
|
||||||
return super().create(vlist)
|
return super().create(vlist)
|
||||||
|
|
||||||
def get_is_global(self, name):
|
|
||||||
return self.parent is None
|
|
||||||
|
|
||||||
def get_display_name(self, name):
|
|
||||||
level = 0
|
|
||||||
current = self
|
|
||||||
while current.parent:
|
|
||||||
level += 1
|
|
||||||
current = current.parent
|
|
||||||
prefix = '— ' * level
|
|
||||||
return prefix + (self.name or '')
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def validate(cls, limits):
|
def validate(cls, limits):
|
||||||
super().validate(limits)
|
super().validate(limits)
|
||||||
for limit in limits:
|
for limit in limits:
|
||||||
|
limit.check_single_root()
|
||||||
limit.check_amount_vs_parent()
|
limit.check_amount_vs_parent()
|
||||||
limit.check_children_amounts()
|
limit.check_children_amounts()
|
||||||
|
|
||||||
|
def check_single_root(self):
|
||||||
|
if self.parent is None:
|
||||||
|
roots = self.__class__.search([
|
||||||
|
('facility', '=', self.facility.id),
|
||||||
|
('parent', '=', None),
|
||||||
|
('id', '!=', self.id),
|
||||||
|
])
|
||||||
|
if roots:
|
||||||
|
raise UserError(
|
||||||
|
f"Facility '{self.facility.name}' already has a Global "
|
||||||
|
f"Limit ('{roots[0].name}'). Only one root limit is "
|
||||||
|
f"allowed per facility.")
|
||||||
|
|
||||||
def check_amount_vs_parent(self):
|
def check_amount_vs_parent(self):
|
||||||
if self.parent and self.amount > self.parent.amount:
|
if self.parent and self.amount > self.parent.amount:
|
||||||
raise UserError(
|
raise UserError(
|
||||||
@@ -491,9 +472,7 @@ class FacilityConstraint(ModelSQL, ModelView):
|
|||||||
cap = fields.Many2One('trade_finance.facility_cap', 'Cap',
|
cap = fields.Many2One('trade_finance.facility_cap', 'Cap',
|
||||||
ondelete='CASCADE')
|
ondelete='CASCADE')
|
||||||
|
|
||||||
constraint_type = fields.Selection([
|
constraint_type = fields.Many2One('trade_finance.constraint_type',
|
||||||
('inclusion', 'Inclusion'),
|
'Constraint Type', required=True, ondelete='RESTRICT')
|
||||||
('exclusion', 'Exclusion'),
|
is_exclusion = fields.Boolean('Exclusion',
|
||||||
], 'Type', required=True)
|
help='Checked = Exclusion constraint, unchecked = Inclusion constraint')
|
||||||
attribute = fields.Selection(ATTRIBUTE_TYPES, 'Attribute', required=True)
|
|
||||||
value = fields.Char('Value', required=True)
|
|
||||||
|
|||||||
@@ -15,6 +15,66 @@
|
|||||||
<field name="group" ref="group_trade_finance_user"/>
|
<field name="group" ref="group_trade_finance_user"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<!-- ================================================================ -->
|
||||||
|
<!-- FACILITY STATUS -->
|
||||||
|
<!-- ================================================================ -->
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="facility_status_view_tree">
|
||||||
|
<field name="model">trade_finance.facility_status</field>
|
||||||
|
<field name="type">tree</field>
|
||||||
|
<field name="priority" eval="10"/>
|
||||||
|
<field name="name">facility_status_tree</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.ui.view" id="facility_status_view_form">
|
||||||
|
<field name="model">trade_finance.facility_status</field>
|
||||||
|
<field name="type">form</field>
|
||||||
|
<field name="name">facility_status_form</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.action.act_window" id="act_facility_status">
|
||||||
|
<field name="name">Facility Statuses</field>
|
||||||
|
<field name="res_model">trade_finance.facility_status</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.action.act_window.view" id="act_facility_status_view1">
|
||||||
|
<field name="sequence" eval="10"/>
|
||||||
|
<field name="view" ref="facility_status_view_tree"/>
|
||||||
|
<field name="act_window" ref="act_facility_status"/>
|
||||||
|
</record>
|
||||||
|
<record model="ir.action.act_window.view" id="act_facility_status_view2">
|
||||||
|
<field name="sequence" eval="20"/>
|
||||||
|
<field name="view" ref="facility_status_view_form"/>
|
||||||
|
<field name="act_window" ref="act_facility_status"/>
|
||||||
|
</record>
|
||||||
|
<menuitem
|
||||||
|
name="Facility Statuses"
|
||||||
|
sequence="5"
|
||||||
|
id="menu_facility_status"
|
||||||
|
parent="menu_trade_finance_configuration"
|
||||||
|
action="act_facility_status"/>
|
||||||
|
|
||||||
|
<record model="ir.model.access" id="access_facility_status">
|
||||||
|
<field name="model">trade_finance.facility_status</field>
|
||||||
|
<field name="perm_read" eval="False"/>
|
||||||
|
<field name="perm_write" eval="False"/>
|
||||||
|
<field name="perm_create" eval="False"/>
|
||||||
|
<field name="perm_delete" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record model="ir.model.access" id="access_facility_status_user">
|
||||||
|
<field name="model">trade_finance.facility_status</field>
|
||||||
|
<field name="group" ref="group_trade_finance_user"/>
|
||||||
|
<field name="perm_read" eval="True"/>
|
||||||
|
<field name="perm_write" eval="False"/>
|
||||||
|
<field name="perm_create" eval="False"/>
|
||||||
|
<field name="perm_delete" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record model="ir.model.access" id="access_facility_status_admin">
|
||||||
|
<field name="model">trade_finance.facility_status</field>
|
||||||
|
<field name="group" ref="group_trade_finance_admin"/>
|
||||||
|
<field name="perm_read" eval="True"/>
|
||||||
|
<field name="perm_write" eval="True"/>
|
||||||
|
<field name="perm_create" eval="True"/>
|
||||||
|
<field name="perm_delete" eval="True"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
<!-- ================================================================ -->
|
<!-- ================================================================ -->
|
||||||
<!-- FACILITY -->
|
<!-- FACILITY -->
|
||||||
<!-- ================================================================ -->
|
<!-- ================================================================ -->
|
||||||
@@ -75,6 +135,32 @@
|
|||||||
<field name="perm_delete" eval="True"/>
|
<field name="perm_delete" eval="True"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<!-- ================================================================ -->
|
||||||
|
<!-- FACILITY CURRENCY -->
|
||||||
|
<!-- ================================================================ -->
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="facility_currency_view_tree">
|
||||||
|
<field name="model">trade_finance.facility_currency</field>
|
||||||
|
<field name="type">tree</field>
|
||||||
|
<field name="priority" eval="10"/>
|
||||||
|
<field name="name">facility_currency_tree</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.model.access" id="access_facility_currency">
|
||||||
|
<field name="model">trade_finance.facility_currency</field>
|
||||||
|
<field name="perm_read" eval="False"/>
|
||||||
|
<field name="perm_write" eval="False"/>
|
||||||
|
<field name="perm_create" eval="False"/>
|
||||||
|
<field name="perm_delete" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record model="ir.model.access" id="access_facility_currency_user">
|
||||||
|
<field name="model">trade_finance.facility_currency</field>
|
||||||
|
<field name="group" ref="group_trade_finance_user"/>
|
||||||
|
<field name="perm_read" eval="True"/>
|
||||||
|
<field name="perm_write" eval="True"/>
|
||||||
|
<field name="perm_create" eval="True"/>
|
||||||
|
<field name="perm_delete" eval="True"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
<!-- ================================================================ -->
|
<!-- ================================================================ -->
|
||||||
<!-- FACILITY COVENANT -->
|
<!-- FACILITY COVENANT -->
|
||||||
<!-- ================================================================ -->
|
<!-- ================================================================ -->
|
||||||
|
|||||||
@@ -9,3 +9,4 @@ depends:
|
|||||||
xml:
|
xml:
|
||||||
reference.xml
|
reference.xml
|
||||||
facility.xml
|
facility.xml
|
||||||
|
constraint_type.xml
|
||||||
|
|||||||
12
modules/trade_finance/view/constraint_type_form.xml
Normal file
12
modules/trade_finance/view/constraint_type_form.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<form col="4">
|
||||||
|
<group id="main" col="4" colspan="4">
|
||||||
|
<label name="name"/>
|
||||||
|
<field name="name" colspan="3"/>
|
||||||
|
<label name="model"/>
|
||||||
|
<field name="model" colspan="3"/>
|
||||||
|
<label name="value_field"/>
|
||||||
|
<field name="value_field" colspan="3"/>
|
||||||
|
<label name="label_field"/>
|
||||||
|
<field name="label_field" colspan="3"/>
|
||||||
|
</group>
|
||||||
|
</form>
|
||||||
6
modules/trade_finance/view/constraint_type_tree.xml
Normal file
6
modules/trade_finance/view/constraint_type_tree.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<tree>
|
||||||
|
<field name="name"/>
|
||||||
|
<field name="model"/>
|
||||||
|
<field name="value_field"/>
|
||||||
|
<field name="label_field"/>
|
||||||
|
</tree>
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
<tree>
|
<tree>
|
||||||
<field name="constraint_type"/>
|
<field name="constraint_type"/>
|
||||||
<field name="attribute"/>
|
<field name="is_exclusion"/>
|
||||||
<field name="value"/>
|
|
||||||
</tree>
|
</tree>
|
||||||
|
|||||||
5
modules/trade_finance/view/facility_currency_tree.xml
Normal file
5
modules/trade_finance/view/facility_currency_tree.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<tree>
|
||||||
|
<field name="currency"/>
|
||||||
|
<field name="fx_haircut_formula"/>
|
||||||
|
<field name="fx_feeder"/>
|
||||||
|
</tree>
|
||||||
@@ -30,8 +30,13 @@
|
|||||||
<field name="description" colspan="5"/>
|
<field name="description" colspan="5"/>
|
||||||
</group>
|
</group>
|
||||||
<notebook colspan="6">
|
<notebook colspan="6">
|
||||||
|
<page string="Accepted Currencies" id="currencies">
|
||||||
|
<field name="currencies" colspan="6"/>
|
||||||
|
</page>
|
||||||
<page string="Limits" id="limits">
|
<page string="Limits" id="limits">
|
||||||
<field name="limits" colspan="6"/>
|
<field name="limits" colspan="6"
|
||||||
|
domain="[('parent', '=', None)]"
|
||||||
|
mode="tree"/>
|
||||||
</page>
|
</page>
|
||||||
<page string="Caps" id="caps">
|
<page string="Caps" id="caps">
|
||||||
<field name="caps" colspan="6"/>
|
<field name="caps" colspan="6"/>
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
<group id="header" col="4" colspan="4">
|
<group id="header" col="4" colspan="4">
|
||||||
<label name="name"/>
|
<label name="name"/>
|
||||||
<field name="name" colspan="3"/>
|
<field name="name" colspan="3"/>
|
||||||
|
<label name="alternative_name"/>
|
||||||
|
<field name="alternative_name" colspan="3"/>
|
||||||
<label name="financing_type"/>
|
<label name="financing_type"/>
|
||||||
<field name="financing_type" colspan="3"/>
|
<field name="financing_type" colspan="3"/>
|
||||||
<label name="amount"/>
|
<label name="amount"/>
|
||||||
@@ -10,8 +12,7 @@
|
|||||||
<field name="tenor"/>
|
<field name="tenor"/>
|
||||||
<label name="sequence"/>
|
<label name="sequence"/>
|
||||||
<field name="sequence"/>
|
<field name="sequence"/>
|
||||||
<label name="is_global"/>
|
<newline/>
|
||||||
<field name="is_global"/>
|
|
||||||
<label name="parent"/>
|
<label name="parent"/>
|
||||||
<field name="parent" colspan="3"/>
|
<field name="parent" colspan="3"/>
|
||||||
<label name="facility"/>
|
<label name="facility"/>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<tree>
|
<tree>
|
||||||
<field name="display_name" string="Name"/>
|
<field name="name"/>
|
||||||
<field name="financing_type"/>
|
<field name="financing_type"/>
|
||||||
<field name="amount"/>
|
<field name="amount"/>
|
||||||
<field name="tenor"/>
|
<field name="tenor"/>
|
||||||
<field name="is_global"/>
|
|
||||||
</tree>
|
</tree>
|
||||||
|
|||||||
10
modules/trade_finance/view/facility_status_form.xml
Normal file
10
modules/trade_finance/view/facility_status_form.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<form col="4">
|
||||||
|
<group id="main" col="4" colspan="4">
|
||||||
|
<label name="code"/>
|
||||||
|
<field name="code"/>
|
||||||
|
<label name="active"/>
|
||||||
|
<field name="active"/>
|
||||||
|
<label name="name"/>
|
||||||
|
<field name="name" colspan="3"/>
|
||||||
|
</group>
|
||||||
|
</form>
|
||||||
5
modules/trade_finance/view/facility_status_tree.xml
Normal file
5
modules/trade_finance/view/facility_status_tree.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<tree>
|
||||||
|
<field name="code"/>
|
||||||
|
<field name="name"/>
|
||||||
|
<field name="active"/>
|
||||||
|
</tree>
|
||||||
Reference in New Issue
Block a user