← Back to team overview

account-payment-team team mailing list archive

lp:~therp-nl/account-payment/6.1-account_voucher_display_writeoff into lp:account-payment

 

Stefan Rijnhart (Therp) has proposed merging lp:~therp-nl/account-payment/6.1-account_voucher_display_writeoff into lp:account-payment.

Requested reviews:
  Account Payment (account-payment-team)

For more details, see:
https://code.launchpad.net/~therp-nl/account-payment/6.1-account_voucher_display_writeoff/+merge/134906

Display write off options on sale or purchase vouchers. Without setting these options explicitely, if a payment difference is encountered on vouchers of these types, it is booked on the account payable or account receivable which can pose problems for automatic reconciliation.

This addon also enables setting the voucher type as a selection criterium for default values, so that you can set different default values for write off settings for different voucher types.

At Therp, we use this functionality to write off small rounding differences when applying an inclusive tax on purchase vouchers. Note that usiung inclusive taxes on vouchers is currently depending on lp:827649 for which we are proposing a fix.


-- 
https://code.launchpad.net/~therp-nl/account-payment/6.1-account_voucher_display_writeoff/+merge/134906
Your team Account Payment is requested to review the proposed merge of lp:~therp-nl/account-payment/6.1-account_voucher_display_writeoff into lp:account-payment.
=== added directory 'account_voucher_display_writeoff'
=== added file 'account_voucher_display_writeoff/__init__.py'
--- account_voucher_display_writeoff/__init__.py	1970-01-01 00:00:00 +0000
+++ account_voucher_display_writeoff/__init__.py	2012-11-19 13:32:34 +0000
@@ -0,0 +1,1 @@
+import model

=== added file 'account_voucher_display_writeoff/__openerp__.py'
--- account_voucher_display_writeoff/__openerp__.py	1970-01-01 00:00:00 +0000
+++ account_voucher_display_writeoff/__openerp__.py	2012-11-19 13:32:34 +0000
@@ -0,0 +1,49 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    This module copyright (C) 2012 Therp BV (<http://therp.nl>).
+#
+#    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 voucher display writeoff",
+    "version": "1.0r086",
+    "author": "Therp BV",
+    "category": 'Accounting & Finance',
+    'complexity': "normal",
+    "description": """
+Display writeoff options on sale or purchase vouchers. Without setting these
+options explicitely, if a payment difference is encountered on vouchers of these
+types, it is booked on the account payable or account receivable which can pose
+problems for automatic reconciliation.
+
+This addon also enables setting the voucher type as a selection criterium for
+default values, so that you can set different default values for writeoff
+settings for different voucher types.
+
+At Therp, we use this functionality to write off small rounding differences
+when applying an inclusive tax on purchase vouchers. This is currently
+depending on lp:827649 for which we are proposing a fix.
+    """,
+    'website': 'http://therp.nl',
+    'images': [],
+    'depends': ['account_voucher'],
+    'data': [
+        'view/account_voucher.xml',
+    ],
+    "license": 'AGPL-3',
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added directory 'account_voucher_display_writeoff/model'
=== added file 'account_voucher_display_writeoff/model/__init__.py'
--- account_voucher_display_writeoff/model/__init__.py	1970-01-01 00:00:00 +0000
+++ account_voucher_display_writeoff/model/__init__.py	2012-11-19 13:32:34 +0000
@@ -0,0 +1,1 @@
+import account_voucher

=== added file 'account_voucher_display_writeoff/model/account_voucher.py'
--- account_voucher_display_writeoff/model/account_voucher.py	1970-01-01 00:00:00 +0000
+++ account_voucher_display_writeoff/model/account_voucher.py	2012-11-19 13:32:34 +0000
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    This module Copyright (C) 2012 Therp BV (<http://therp.nl>).
+#
+#    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_voucher(osv.osv):
+    """
+    Add the voucher's type as a selection criterium for 
+    default values by setting change_default to True.
+    Now you can use appropriate defaults
+    for e.g. write off settings per voucher type.
+    """
+    _inherit = 'account.voucher'
+    _columns = {
+        'type':fields.selection(
+            [
+            ('sale','Sale'),
+            ('purchase','Purchase'),
+            ('payment','Payment'),
+            ('receipt','Receipt'),
+            ],'Default Type', readonly=True, states={'draft':[('readonly',False)]},
+            change_default=1),
+        }

=== added directory 'account_voucher_display_writeoff/view'
=== added file 'account_voucher_display_writeoff/view/account_voucher.xml'
--- account_voucher_display_writeoff/view/account_voucher.xml	1970-01-01 00:00:00 +0000
+++ account_voucher_display_writeoff/view/account_voucher.xml	2012-11-19 13:32:34 +0000
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <record id="view_voucher_form" model="ir.ui.view">
+            <field name="name">Voucher form: enable writeoff on sale/purchase vouchers</field>
+            <field name="model">account.voucher</field>
+            <field name="type">form</field>
+            <field name="inherit_id" ref="account_voucher.view_voucher_form"/>
+            <field name="priority" eval="100"/>
+            <field name="arch" type="xml">
+                <field name="account_id" position="after">
+                    <field name="payment_option" required="1"/>
+                    <field name="writeoff_acc_id"
+                           attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
+                           domain="[('type','=','other')]"/>
+                    <field name="comment"
+                           attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
+                </field>
+            </field>
+        </record>
+    </data>
+</openerp>


Follow ups