Commit IFRS adjustments

This commit is contained in:
AzureAD\SylvainDUVERNAY
2026-03-29 18:34:54 +02:00
parent 43c62607a8
commit ad2f7e6f78
6 changed files with 150 additions and 28 deletions

View File

@@ -4,6 +4,7 @@
from trytond.pool import Pool
from . import (
account,
purchase,
sale,
global_reporting,
@@ -30,10 +31,10 @@ from . import (
valuation,
dimension,
weight_report,
backtoback,
service,
invoice,
)
backtoback,
service,
invoice,
)
def register():
Pool.register(
@@ -75,8 +76,8 @@ def register():
dashboard.Incoming,
dashboard.BotAction,
dashboard.News,
dashboard.Demos,
party.Party,
dashboard.Demos,
party.Party,
party.PartyExecution,
party.PartyExecutionSla,
party.PartyExecutionPlace,
@@ -178,16 +179,19 @@ def register():
purchase.PenaltyRule,
purchase.PenaltyRuleTier,
purchase.ConcentrateTerm,
backtoback.Backtoback,
dimension.AnalyticDimension,
dimension.AnalyticDimensionValue,
dimension.AnalyticDimensionAssignment,
weight_report.WeightReport,
module='purchase', type_='model')
Pool.register(
invoice.Invoice,
invoice.InvoiceLine,
module='account_invoice', type_='model')
backtoback.Backtoback,
dimension.AnalyticDimension,
dimension.AnalyticDimensionValue,
dimension.AnalyticDimensionAssignment,
weight_report.WeightReport,
module='purchase', type_='model')
Pool.register(
account.PhysicalTradeIFRS,
module='purchase_trade', type_='model')
Pool.register(
invoice.Invoice,
invoice.InvoiceLine,
module='account_invoice', type_='model')
Pool.register(
forex.Forex,
forex.ForexCoverFees,

View File

@@ -0,0 +1,30 @@
# account.py
from trytond.model import ModelSQL, ModelView, fields
from trytond.pool import PoolMeta
from trytond.pyson import Eval
__all__ = ['PhysicalTradeIFRS']
__metaclass__ = PoolMeta
class PhysicalTradeIFRS(ModelSQL, ModelView):
'Physical Trade - IFRS Adjustment'
__name__ = 'account.physical_trade_ifrs'
date = fields.Date('Date', required=True)
comment = fields.Text('Comment', required=True)
currency = fields.Many2One('currency.currency', 'Currency', required=True)
currency_digits = fields.Function(
fields.Integer('Currency Digits'),
'on_change_with_currency_digits')
amount = fields.Numeric(
'Amount',
digits=(16, Eval('currency_digits', 2)),
depends=['currency_digits'],
required=True)
@fields.depends('currency')
def on_change_with_currency_digits(self, name=None):
if self.currency:
return self.currency.digits
return 2

View File

@@ -0,0 +1,70 @@
<?xml version="1.0"?>
<tryton>
<data>
<record model="res.group" id="group_physical_trade_ifrs">
<field name="name">Physical Trade IFRS</field>
</record>
<record model="res.group" id="group_physical_trade_ifrs_admin">
<field name="name">Physical Trade IFRS Administration</field>
<field name="parent" ref="group_physical_trade_ifrs"/>
</record>
<record model="res.user-res.group" id="user_admin_group_physical_trade_ifrs">
<field name="user" ref="res.user_admin"/>
<field name="group" ref="group_physical_trade_ifrs"/>
</record>
<record model="res.user-res.group" id="user_admin_group_physical_trade_ifrs_admin">
<field name="user" ref="res.user_admin"/>
<field name="group" ref="group_physical_trade_ifrs_admin"/>
</record>
<record model="ir.ui.view" id="view_physical_trade_ifrs_form">
<field name="model">account.physical_trade_ifrs</field>
<field name="type">form</field>
<field name="name">physical_trade_IFRS_form</field>
</record>
<record model="ir.ui.view" id="view_physical_trade_ifrs_tree">
<field name="model">account.physical_trade_ifrs</field>
<field name="type">tree</field>
<field name="name">physical_trade_IFRS_tree</field>
</record>
<record model="ir.action.act_window" id="act_physical_trade_ifrs_form">
<field name="name">Physical Trade - IFRS Adjustment</field>
<field name="res_model">account.physical_trade_ifrs</field>
</record>
<record model="ir.action.act_window.view" id="act_physical_trade_ifrs_view_tree">
<field name="sequence" eval="10"/>
<field name="view" ref="view_physical_trade_ifrs_tree"/>
<field name="act_window" ref="act_physical_trade_ifrs_form"/>
</record>
<record model="ir.action.act_window.view" id="act_physical_trade_ifrs_view_form">
<field name="sequence" eval="20"/>
<field name="view" ref="view_physical_trade_ifrs_form"/>
<field name="act_window" ref="act_physical_trade_ifrs_form"/>
</record>
<menuitem
name="Physical Trade - IFRS Adjustment"
parent="account.menu_processing"
action="act_physical_trade_ifrs_form"
sequence="30"
id="menu_physical_trade_ifrs"
groups="group_physical_trade_ifrs"/>
<record model="ir.model.access" id="access_physical_trade_ifrs">
<field name="model">account.physical_trade_ifrs</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_physical_trade_ifrs_group">
<field name="model">account.physical_trade_ifrs</field>
<field name="group" ref="group_physical_trade_ifrs"/>
<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>

View File

@@ -1,12 +1,12 @@
[tryton]
version=7.2.7
depends:
ir
purchase
sale
account_invoice
stock
res
depends:
ir
purchase
sale
account_invoice
stock
res
lot
document_incoming
incoterm
@@ -29,8 +29,9 @@ xml:
party.xml
forex.xml
global_reporting.xml
derivative.xml
valuation.xml
weight_report.xml
dimension.xml
backtoback.xml
derivative.xml
valuation.xml
weight_report.xml
dimension.xml
backtoback.xml
account.xml

View File

@@ -0,0 +1,11 @@
<form col="4">
<label name="date"/>
<field name="date"/>
<label name="currency"/>
<field name="currency"/>
<label name="amount"/>
<field name="amount"/>
<newline/>
<label name="comment"/>
<field name="comment" colspan="4"/>
</form>

View File

@@ -0,0 +1,6 @@
<tree>
<field name="date"/>
<field name="currency"/>
<field name="amount"/>
<field name="comment"/>
</tree>