[ADD] mod base_transaction_id

(lp:c2c-financial-addons/6.1 rev 24.1.5)
pull/821/head
Yannick Vaucher 2012-05-15 13:52:10 +02:00 committed by Bhavesh Heliconia
parent 43a9ce7a17
commit 1c6e11b071
6 changed files with 188 additions and 0 deletions

View File

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Vaucher (Camptocamp)
# Copyright 2012 Camptocamp SA
#
# 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 . import invoice
from . import sale

View File

@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Vaucher (Camptocamp)
# Copyright 2012 Camptocamp SA
#
# 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': 'Base transaction id for financial institutes',
'version': '1.0',
'author': 'Camptocamp',
'maintainer': 'Camptocamp',
'category': 'Hidden/Dependency',
'complexity': 'easy', #easy, normal, expert
'depends': ['account', 'sale'],
'description': """Adds transaction id to invoice and sale models and views""",
'website': 'http://www.openerp.com',
'init_xml': [],
'update_xml': ['invoice_view.xml', 'sale_view.xml'],
'demo_xml': [],
'test': [],
'installable': True,
'images': [],
'auto_install': False,
'license': 'AGPL-3',
'active': False,
}

View File

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2011-2012 Camptocamp SA
#
# 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 fields, osv
from tools.translate import _
class AccountInvoice(osv.osv):
_inherit = 'account.invoice'
_columns = {
'transaction_id':fields.char(
'Transaction id',
size=128,
required=False,
select=1,
help="Transction id from the financial institute"
),
}

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="invoice_view_custom">
<field name="name">customer.invoice.transaction.inherit</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="type">form</field>
<field name="arch" type="xml">
<notebook position="inside">
<page string="Transactions datas">
<field name="transaction_id" select="2"/>
</page>
</notebook>
</field>
</record>
<record model="ir.ui.view" id="invoice_tree_custom">
<field name="name">account.invoice.tree.inherit</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_tree"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="origin" position="after">
<field name="transaction_id" select="2"/>
</field>
</field>
</record>
</data>
</openerp>

View File

@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2011-2012 Camptocamp SA
#
# 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 fields, osv
class SaleOrder(osv.osv):
_inherit = 'sale.order'
_columns = {
'transaction_id':fields.char('Transaction id', size=128,required=False,
help="Transction id from the financial institute"),
}
def _prepare_invoice(self, cursor, uid, order, lines, context=None):
#we put the transaction id in the generated invoices
if context is None:
context = {}
invoice_vals = super(SaleOrder, self)._prepare_invoice(cursor, uid, order, lines, context)
invoice_vals.update({
'transaction_id': order.transaction_id})
return invoice_vals

View File

@ -0,0 +1,21 @@
<openerp>
<data>
<record id="view_order_form_transaction" model="ir.ui.view">
<field name="name">sale.order.form.transaction</field>
<field name="model">sale.order</field>
<field name="type">form</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<field name="payment_term" position="after">
<field name="transaction_id" select="2"/>
</field>
</field>
</record>
<act_window
domain="[('origin', '=', name)]"
id="prm_act"
name="Packing"
res_model="stock.picking"
src_model="sale.order"/>
</data>
</openerp>