Ujjvala Collins (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-account_currency_provisioning-uco into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-account_currency_provisioning-uco/+merge/72144

[ADD] account_currency_provisioning:
-----------------------------------------------------------
* Developed a new module in trunk, called account_currency_provisioning, that 
will provide currency provision functionality on Account and Account types. You 
can defined your own accounts for currency provision. Currently providing loss 
currency exchange, loss currency exchange provisioning, benefit currency 
exchange, benefit exchange provisioning.
* Added an analysis report called Currency Risk Analysis: that shows the 
account.move.line belonging to accounts with currency provisioning accounts.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-account_currency_provisioning-uco/+merge/72144
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-account_currency_provisioning-uco.
=== modified file 'account/account_menuitem.xml'
--- account/account_menuitem.xml	2011-08-01 10:08:23 +0000
+++ account/account_menuitem.xml	2011-08-19 07:09:25 +0000
@@ -28,6 +28,7 @@
         <menuitem id="menu_journals" sequence="9" name="Journals" parent="menu_finance_accounting" groups="group_account_manager"/>
         <menuitem id="menu_configuration_misc" name="Miscellaneous" parent="menu_finance_configuration" sequence="30"/>
         <menuitem id="base.menu_action_currency_form" parent="menu_configuration_misc" sequence="20"/>
+        <menuitem id="base.menu_action_currency_rate_type_form" parent="menu_configuration_misc" sequence="25"/>
         <menuitem id="menu_finance_generic_reporting" name="Generic Reporting" parent="menu_finance_reporting" sequence="100"/>
         <menuitem id="menu_finance_entries" name="Journal Entries" parent="menu_finance" sequence="5" groups="group_account_user,group_account_manager"/>
 

=== added directory 'account_currency_provisioning'
=== added file 'account_currency_provisioning/__init__.py'
--- account_currency_provisioning/__init__.py	1970-01-01 00:00:00 +0000
+++ account_currency_provisioning/__init__.py	2011-08-19 07:09:25 +0000
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import account_currency_provisioning
+import report
+import wizard
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added file 'account_currency_provisioning/__openerp__.py'
--- account_currency_provisioning/__openerp__.py	1970-01-01 00:00:00 +0000
+++ account_currency_provisioning/__openerp__.py	2011-08-19 07:09:25 +0000
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+{
+    "name" : "Account Currency Provisioning",
+    "version" : "1.0",
+    "author" : "OpenERP SA",
+    "category": 'Finance',
+    "description": """
+Module provides currency provision functionality on Account and Account types.\nYou can defined your own accounts for currency provision.
+Currently providing loss currency exchange, loss currency exchange provisioning, benefit currency exchange, benefit exchange provisioning.
+    """,
+    'website': 'http://www.openerp.com',
+    'init_xml': [],
+    "depends" : ["account"],
+    'update_xml': [
+        'account_currency_provisioning_view.xml',
+        'report/report_currency_risk_analysis_view.xml',
+        'wizard/provisioning_process_view.xml',
+    ],
+    'demo_xml': [],
+    'installable': True,
+    'active': False,
+    'certificate': '',
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added file 'account_currency_provisioning/account_currency_provisioning.py'
--- account_currency_provisioning/account_currency_provisioning.py	1970-01-01 00:00:00 +0000
+++ account_currency_provisioning/account_currency_provisioning.py	2011-08-19 07:09:25 +0000
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import osv, fields
+
+class account_account_type(osv.osv):
+    _inherit = 'account.account.type'
+    _columns = {
+        'loss_currency_exchange_id': fields.many2one('account.account', 'Loss Currency Exchange', help='Account for lost currency exchange'),
+        'loss_currency_exchange_provision_id': fields.many2one('account.account', 'Loss Currency Exchange Provision', help='Account for lost currency exchange provision'),
+        'benefit_currency_exchange_id': fields.many2one('account.account', 'Benefit Currency Exchange', help='Account for benefit currency exchange'),
+        'benefit_currency_exchange_provision_id': fields.many2one('account.account', 'Benefit Currency Exchange Provision', help='Account for benefit currency exchange provision'),
+        'currency_provision': fields.boolean('Currency Provision', help='Check if you want to provide currency provisions'),
+    }
+
+account_account_type()
+
+class account_account(osv.osv):
+    _inherit = 'account.account'
+    _columns = {
+        'loss_currency_exchange_id': fields.many2one('account.account', 'Loss Currency Exchange', help='Account for lost currency exchange'),
+        'loss_currency_exchange_provision_id': fields.many2one('account.account', 'Loss Currency Exchange Provision', help='Account for lost currency exchange provision'),
+        'benefit_currency_exchange_id': fields.many2one('account.account', 'Benefit Currency Exchange', help='Account for benefit currency exchange'),
+        'benefit_currency_exchange_provision_id': fields.many2one('account.account', 'Benefit Currency Exchange Provision', help='Account for benefit currency exchange provision'),
+        'currency_provision': fields.boolean('Currency Provision', help='Check if you want to provide currency provisions'),
+    }
+
+account_account()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added file 'account_currency_provisioning/account_currency_provisioning_view.xml'
--- account_currency_provisioning/account_currency_provisioning_view.xml	1970-01-01 00:00:00 +0000
+++ account_currency_provisioning/account_currency_provisioning_view.xml	2011-08-19 07:09:25 +0000
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <!--
+            Account Type
+        -->
+
+        <record id="view_account_type_provision_form_inherit" model="ir.ui.view">
+            <field name="name">account.account.type.form.inherit</field>
+            <field name="model">account.account.type</field>
+            <field name="type">form</field>
+            <field name="inherit_id" ref="account.view_account_type_form"/>
+            <field name="arch" type="xml">
+                <xpath expr="//form/separator[@string='Description']" position="before">
+                    <separator string="Currency Exchange" colspan="4"/>
+                    <field name="currency_provision" colspan="2"/>
+                    <group col="4" colspan="4" attrs="{'invisible': [('currency_provision','=',False)]}">
+                        <field name="loss_currency_exchange_id"/>
+                        <field name="benefit_currency_exchange_id"/>
+                        <field name="loss_currency_exchange_provision_id"/>
+                        <field name="benefit_currency_exchange_provision_id"/>
+                    </group>
+                </xpath>
+            </field>
+        </record>
+
+        <!--
+            Account
+        -->
+
+        <record id="view_account_form_provision_inherit" model="ir.ui.view">
+            <field name="name">account.account.form.inherit</field>
+            <field name="model">account.account</field>
+            <field name="type">form</field>
+            <field name="inherit_id" ref="account.view_account_form"/>
+            <field name="arch" type="xml">
+                <xpath expr="//form/notebook/page[@string='General Information']/group/field[@name='currency_mode']" position="after">
+                    <separator string="Currency Exchange" colspan="2"/>
+                    <field name="currency_provision" colspan="2"/>
+                    <group col="4" colspan="2" attrs="{'invisible': [('currency_provision','=',False)]}">
+                        <field name="loss_currency_exchange_id"/>
+                        <field name="benefit_currency_exchange_id"/>
+                        <field name="loss_currency_exchange_provision_id"/>
+                        <field name="benefit_currency_exchange_provision_id"/>
+                    </group>
+                </xpath>
+            </field>
+        </record>
+
+    </data>
+</openerp>

=== added directory 'account_currency_provisioning/report'
=== added file 'account_currency_provisioning/report/__init__.py'
--- account_currency_provisioning/report/__init__.py	1970-01-01 00:00:00 +0000
+++ account_currency_provisioning/report/__init__.py	2011-08-19 07:09:25 +0000
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import report_currency_risk_analysis
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added file 'account_currency_provisioning/report/report_currency_risk_analysis.py'
--- account_currency_provisioning/report/report_currency_risk_analysis.py	1970-01-01 00:00:00 +0000
+++ account_currency_provisioning/report/report_currency_risk_analysis.py	2011-08-19 07:09:25 +0000
@@ -0,0 +1,62 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import tools
+from osv import fields, osv
+
+class currency_risk_analysis_report(osv.osv):
+    _name = "currency.risk.analysis.report"
+    _description = "Currency Risk Analysis"
+    _auto = False
+    _columns = {
+        'account_id': fields.many2one('account.account','Account', readonly=True),
+        'debit': fields.float('Debit', readonly=True),
+        'credit': fields.float('Credit', readonly=True),
+        'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
+        'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
+        'reconcile_id': fields.many2one('account.move.reconcile', 'Reconcile', readonly=True),
+    }
+
+    def init(self, cr):
+        tools.drop_view_if_exists(cr, 'currency_risk_analysis_report')
+        cr.execute("""
+            create or replace view currency_risk_analysis_report as (
+                select
+                    min(m.id) as id,
+                    m.debit as debit,
+                    m.credit as credit,
+                    m.account_id as account_id,
+                    m.currency_id as currency_id,
+                    m.partner_id as partner_id,
+                    m.reconcile_id as reconcile_id
+                from account_move_line m
+                    left join account_account a on m.account_id=a.id
+                    left join account_account_type t on a.user_type=t.id
+                where
+                    t.currency_provision or a.currency_provision
+                group by
+                    m.debit, m.credit, m.account_id, m.currency_id, m.partner_id,
+                    m.reconcile_id
+        )""")
+
+currency_risk_analysis_report()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added file 'account_currency_provisioning/report/report_currency_risk_analysis_view.xml'
--- account_currency_provisioning/report/report_currency_risk_analysis_view.xml	1970-01-01 00:00:00 +0000
+++ account_currency_provisioning/report/report_currency_risk_analysis_view.xml	2011-08-19 07:09:25 +0000
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record model="ir.ui.view" id="view_currency_risk_analysis_report_tree">
+            <field name="name">currency.risk.analysis.report.tree</field>
+            <field name="model">currency.risk.analysis.report</field>
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+                <tree string="Currency Risk Analysis">
+                    <field name="account_id" invisible="1"/>
+                    <field name="debit"/>
+                    <field name="credit"/>
+                    <field name="currency_id" invisible="1"/>
+                    <field name="partner_id" invisible="1"/>
+                    <field name="reconcile_id" invisible="1"/>
+                </tree>
+            </field>
+        </record>
+
+        <record id="view_currency_risk_analysis_report_search" model="ir.ui.view">
+            <field name="name">currency.risk.analysis.report.search</field>
+            <field name="model">currency.risk.analysis.report</field>
+            <field name="type">search</field>
+            <field name="arch" type="xml">
+                <search string="Currency Risk Analysis">
+                    <group col="10" colspan="12">
+                       <filter string="Reconciled" icon="terp-dolar" domain="[('reconcile_id','!=',False)]" help="Reconciled entries"/>
+                       <filter string="Currency" icon="terp-dolar" domain="[('currency_id','!=',False)]" help="Currency"/>
+                       <separator orientation="vertical"/>
+                       <field name="currency_id"/>
+                       <field name="partner_id"/>
+                    </group>
+                    <newline/>
+                    <group expand="1" string="Group By...">
+                        <filter string="Parnter" icon="terp-partner" context="{'group_by':'partner_id'}"/>
+                        <separator orientation="vertical"/>
+                        <filter string="Currency" icon="terp-dolar" name="currency" context="{'group_by':'currency_id'}"/>
+                        <filter string="Account" name="account" icon="terp-folder-green" context="{'group_by':'account_id'}"/>
+                    </group>
+	            </search>
+            </field>
+        </record>
+
+        <record model="ir.actions.act_window" id="action_currency_risk_analysis_report">
+            <field name="name">Currency Risk Analysis</field>
+            <field name="res_model">currency.risk.analysis.report</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree</field>
+            <field name="search_view_id" ref="view_currency_risk_analysis_report_search"/>
+            <field name="context">{'search_default_account': 1, 'group_by':[], 'group_by_no_leaf':1}</field>
+            <field name="help">From this view, have an analysis of your currency risk</field>
+        </record>
+
+        <menuitem action="action_currency_risk_analysis_report"
+                  id="menu_action_currency_risk_analysis_report"
+                  parent="account.menu_finance_statistic_report_statement"/>
+
+    </data>
+</openerp>

=== added directory 'account_currency_provisioning/wizard'
=== added file 'account_currency_provisioning/wizard/__init__.py'
--- account_currency_provisioning/wizard/__init__.py	1970-01-01 00:00:00 +0000
+++ account_currency_provisioning/wizard/__init__.py	2011-08-19 07:09:25 +0000
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import provisioning_process
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added file 'account_currency_provisioning/wizard/provisioning_process.py'
--- account_currency_provisioning/wizard/provisioning_process.py	1970-01-01 00:00:00 +0000
+++ account_currency_provisioning/wizard/provisioning_process.py	2011-08-19 07:09:25 +0000
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import osv, fields
+
+class provision_process(osv.osv_memory):
+    _name = 'provision.process'
+    _description = 'Provisioning Process'
+
+    def _get_currency_rate_type(self, cr, uid, context=None):
+        rate_type_obj = self.pool.get('res.currency.rate.type')
+        type_ids = rate_type_obj.search(cr, uid, [], context=context)
+        res = rate_type_obj.read(cr, uid, type_ids, ['id', 'name'], context=context)
+        return [(str(r['id']), r['name']) for r in res] + [(False, 'Spot')]
+
+    _columns = {
+        'journal_id': fields.many2one('account.journal', 'Journal', required=True),
+        'date': fields.date('Date'),
+        'period_id': fields.many2one('account.period', 'Period'),
+        'currency_rate_type': fields.selection(_get_currency_rate_type, 'Currency Rate Type', required=False),
+    }
+
+    def process_provision(self, cr, uid, ids, context=None):
+        #To do: Make the process
+        print "Hello OpenERP"
+        return {'type': 'ir.actions.act_window_close'}
+
+provision_process()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file

=== added file 'account_currency_provisioning/wizard/provisioning_process_view.xml'
--- account_currency_provisioning/wizard/provisioning_process_view.xml	1970-01-01 00:00:00 +0000
+++ account_currency_provisioning/wizard/provisioning_process_view.xml	2011-08-19 07:09:25 +0000
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record id="view_provisioning_process_form" model="ir.ui.view">
+            <field name="name">provision.process.form</field>
+            <field name="model">provision.process</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <form string="Provisioning Process">
+                    <separator string="Currency Provisioning Process" colspan="4"/>
+                    <label colspan="4" nolabel="1" string="Find me a nice tooltip."/>
+                    <newline/>
+                    <group>
+                        <field name="journal_id"/>
+                        <field name="period_id"/>
+                        <field name="date"/>
+                        <field name="currency_rate_type"/>
+                    </group>
+                    <separator string="" colspan="4"/>
+                    <group col="4" colspan="4">
+                        <button special="cancel" string="Cancel" icon="gtk-cancel"/>
+                        <button name="process_provision" string="Process" type="object" icon="gtk-execute" />
+                    </group>
+                </form>
+            </field>
+        </record>
+
+        <record id="action_provisioning_process_form" model="ir.actions.act_window">
+            <field name="name">Provision Process</field>
+            <field name="res_model">provision.process</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+            <field name="view_id" ref="view_provisioning_process_form"/>
+            <field name="target">new</field>
+        </record>
+
+        <menuitem name="Currency Provision"
+            id="menu_action_provisioning_process"
+            parent="account.menu_finance_periodical_processing" />
+
+        <menuitem action="action_provisioning_process_form"
+            id="menu_action_provisioning_process_form"
+            parent="menu_action_provisioning_process" />
+
+    </data>
+</openerp>
\ No newline at end of file

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to