Ruchir Shukla(BizzAppDev) has proposed merging lp:~ruchir.shukla/banking-addons/banking-addons-change-account_bank_transaction_line into lp:banking-addons.
Requested reviews: Banking Addons Core Editors (banking-addons-team) For more details, see: https://code.launchpad.net/~ruchir.shukla/banking-addons/banking-addons-change-account_bank_transaction_line/+merge/202409 Changing the account on a bank statement is not that easy. Now we have added a easy button to change the account on a bank statement line. -- https://code.launchpad.net/~ruchir.shukla/banking-addons/banking-addons-change-account_bank_transaction_line/+merge/202409 Your team Banking Addons Core Editors is requested to review the proposed merge of lp:~ruchir.shukla/banking-addons/banking-addons-change-account_bank_transaction_line into lp:banking-addons.
=== added directory 'change_account_bank_transaction' === added file 'change_account_bank_transaction/__init__.py' --- change_account_bank_transaction/__init__.py 1970-01-01 00:00:00 +0000 +++ change_account_bank_transaction/__init__.py 2014-01-21 08:39:39 +0000 @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright 2013 BAS Solutions +# +# 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 wizard === added file 'change_account_bank_transaction/__openerp__.py' --- change_account_bank_transaction/__openerp__.py 1970-01-01 00:00:00 +0000 +++ change_account_bank_transaction/__openerp__.py 2014-01-21 08:39:39 +0000 @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright 2013 BAS Solutions +# +# 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': 'Change Account in Banking Transaction', + 'version': '1.0', + 'license': 'AGPL-3', + 'author': '', + 'website': '', + 'category': 'Change Account in Banking Transaction', + 'depends': [ + 'account_banking', + ], + 'data': [ + 'wizard/change_account_banking_view.xml', + 'account_banking_view.xml', + ], + 'description': ''' + Change Account in Banking Transaction + ''', + 'installable': True, + 'auto_install': False, +} === added file 'change_account_bank_transaction/account_banking_view.xml' --- change_account_bank_transaction/account_banking_view.xml 1970-01-01 00:00:00 +0000 +++ change_account_bank_transaction/account_banking_view.xml 2014-01-21 08:39:39 +0000 @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<openerp> + <data> + <record id="view_account_account_banking_form" model="ir.ui.view"> + <field name="name">account.bank.statement.form</field> + <field name="model">account.bank.statement</field> + <field name="type">form</field> + <field name="priority" eval="8"/> + <field name="inherit_id" ref="account.view_bank_statement_form"/> + <field name="arch" type="xml"> + <xpath expr="//field[@name='line_ids']//field[@name='account_id']" position="after"> + <button string="Change Account" type="action" name="%(act_open_change_account_banking_view)d" icon="STOCK_ADD" states="draft"/> + </xpath> + </field> + </record> + </data> +</openerp> === added directory 'change_account_bank_transaction/i18n' === added file 'change_account_bank_transaction/i18n/change_account_bank_transaction.pot' --- change_account_bank_transaction/i18n/change_account_bank_transaction.pot 1970-01-01 00:00:00 +0000 +++ change_account_bank_transaction/i18n/change_account_bank_transaction.pot 2014-01-21 08:39:39 +0000 @@ -0,0 +1,60 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * change_account_bank_transaction +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-21 07:26+0000\n" +"PO-Revision-Date: 2014-01-21 07:26+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: change_account_bank_transaction +#: model:ir.model,name:change_account_bank_transaction.model_change_account_banking +msgid "change.account.banking" +msgstr "" + +#. module: change_account_bank_transaction +#: field:change.account.banking,company_id:0 +msgid "Company" +msgstr "" + +#. module: change_account_bank_transaction +#: view:change.account.banking:0 +msgid "or" +msgstr "" + +#. module: change_account_bank_transaction +#: view:account.bank.statement:0 +#: view:change.account.banking:0 +#: model:ir.actions.act_window,name:change_account_bank_transaction.act_open_change_account_banking_view +msgid "Change Account" +msgstr "" + +#. module: change_account_bank_transaction +#: view:change.account.banking:0 +msgid "Cancel" +msgstr "" + +#. module: change_account_bank_transaction +#: view:change.account.banking:0 +msgid "Save" +msgstr "" + +#. module: change_account_bank_transaction +#: field:change.account.banking,journal_id:0 +msgid "Journal" +msgstr "" + +#. module: change_account_bank_transaction +#: view:change.account.banking:0 +#: field:change.account.banking,account_id:0 +msgid "Select Account" +msgstr "" + === added directory 'change_account_bank_transaction/wizard' === added file 'change_account_bank_transaction/wizard/__init__.py' --- change_account_bank_transaction/wizard/__init__.py 1970-01-01 00:00:00 +0000 +++ change_account_bank_transaction/wizard/__init__.py 2014-01-21 08:39:39 +0000 @@ -0,0 +1,1 @@ +import change_account_banking === added file 'change_account_bank_transaction/wizard/change_account_banking.py' --- change_account_bank_transaction/wizard/change_account_banking.py 1970-01-01 00:00:00 +0000 +++ change_account_bank_transaction/wizard/change_account_banking.py 2014-01-21 08:39:39 +0000 @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright 2013 BAS Solutions +# +# 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 openerp.osv import osv +from openerp.osv import fields + + +class change_account_banking(osv.osv_memory): + _name = 'change.account.banking' + _description = 'Change Account' + + _columns = { + 'account_id': fields.many2one('account.account', 'Select Account'), + 'journal_id': fields.many2one('account.journal', 'Journal'), + 'company_id': fields.many2one('res.company', 'Company') + } + + def default_get(self, cr, uid, fields, context=None): + """ Get default values + @param self: The object pointer. + @param cr: A database cursor + @param uid: ID of the user currently logged in + @param fields: List of fields for default value + @param context: A standard dictionary + @return: default values of fields + """ + if context is None: + context = {} + res = super(change_account_banking, self).default_get( + cr, uid, fields, context=context) + account_pool = self.pool.get('account.bank.statement.line') + acc_st_pool = self.pool.get('account.bank.statement') + account_obj = account_pool.browse( + cr, uid, context['active_id'], context=context) + if 'journal_id' in fields: + res.update({ + 'journal_id': account_obj.statement_id.journal_id.id, + 'company_id': account_obj.statement_id.company_id.id + }) + + return res + + def get_account(self, cr, uid, ids, context): + self_obj = self.browse(cr, uid, ids, context) + active_id = context.get('active_id') + account_pool = self.pool.get('account.bank.statement.line') + account_pool.write(cr, uid, active_id, { + 'account_id': self_obj[0].account_id.id, + },context) + return {'type': 'ir.actions.act_window_close'} + +change_account_banking() === added file 'change_account_bank_transaction/wizard/change_account_banking_view.xml' --- change_account_bank_transaction/wizard/change_account_banking_view.xml 1970-01-01 00:00:00 +0000 +++ change_account_bank_transaction/wizard/change_account_banking_view.xml 2014-01-21 08:39:39 +0000 @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<openerp> + <data> + + <record id="view_change_account_banking_form" model="ir.ui.view"> + <field name="name">change.account.banking.form</field> + <field name="model">change.account.banking</field> + <field name="type">form</field> + <field name="priority" eval="8"/> + <field name="arch" type="xml"> + <form string="Change Account" version="7.0"> + <separator string="Select Account" colspan="4"/> + <field name="company_id" invisible="1"/> + <field name="journal_id" invisible="1"/> + <field name="account_id" domain="[('journal_id','=',journal_id), ('company_id', '=', company_id)]" required="1"/> + <footer> + <button string="Save" class="oe_highlight" type="object" name="get_account"/> + or + <button string="Cancel" class="oe_link" special="cancel"/> + </footer> + </form> + </field> + </record> + + <record model="ir.actions.act_window" id="act_open_change_account_banking_view"> + <field name="name">Change Account</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">change.account.banking</field> + <field name="view_type">form</field> + <field name="view_mode">form</field> + <field name="target">new</field> + <field name="domain">[]</field> + <field name="context">{}</field> + </record> + + <record model="ir.actions.act_window.view" id="act_open_change_account_banking_view_form"> + <field name="act_window_id" ref="act_open_change_account_banking_view"/> + <field name="sequence" eval="20"/> + <field name="view_mode">form</field> + <field name="view_id" ref="view_change_account_banking_form"/> + </record> + + </data> +</openerp>
-- Mailing list: https://launchpad.net/~banking-addons-team Post to : [email protected] Unsubscribe : https://launchpad.net/~banking-addons-team More help : https://help.launchpad.net/ListHelp

