diff --git a/modules/purchase_trade/__init__.py b/modules/purchase_trade/__init__.py index 0919bda..d3bae59 100755 --- a/modules/purchase_trade/__init__.py +++ b/modules/purchase_trade/__init__.py @@ -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, diff --git a/modules/purchase_trade/account.py b/modules/purchase_trade/account.py new file mode 100644 index 0000000..b686fa6 --- /dev/null +++ b/modules/purchase_trade/account.py @@ -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 diff --git a/modules/purchase_trade/account.xml b/modules/purchase_trade/account.xml new file mode 100644 index 0000000..bbd3a23 --- /dev/null +++ b/modules/purchase_trade/account.xml @@ -0,0 +1,70 @@ + + + + + Physical Trade IFRS + + + Physical Trade IFRS Administration + + + + + + + + + + + + + account.physical_trade_ifrs + form + physical_trade_IFRS_form + + + account.physical_trade_ifrs + tree + physical_trade_IFRS_tree + + + + Physical Trade - IFRS Adjustment + account.physical_trade_ifrs + + + + + + + + + + + + + + + + account.physical_trade_ifrs + + + + + + + account.physical_trade_ifrs + + + + + + + + diff --git a/modules/purchase_trade/tryton.cfg b/modules/purchase_trade/tryton.cfg index e125de5..8f43cba 100755 --- a/modules/purchase_trade/tryton.cfg +++ b/modules/purchase_trade/tryton.cfg @@ -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 diff --git a/modules/purchase_trade/view/physical_trade_IFRS_form.xml b/modules/purchase_trade/view/physical_trade_IFRS_form.xml new file mode 100644 index 0000000..19ca656 --- /dev/null +++ b/modules/purchase_trade/view/physical_trade_IFRS_form.xml @@ -0,0 +1,11 @@ +
+