Move base_transaction_id from __unported__ to root folder

This commit is contained in:
Guewen Baconnier
2014-10-08 16:11:06 +02:00
parent 91826727b0
commit 043b2cb1d2
10 changed files with 0 additions and 0 deletions

View File

@@ -1,25 +0,0 @@
# -*- 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
from . import stock
from . import account_move

View File

@@ -1,57 +0,0 @@
# -*- 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',
'depends': [
'account',
'sale',
'stock'
],
'description': """
Adds transaction id to invoice and sale models and views.
On Sales order, you can specify the transaction ID used
for the payment and it will be propagated to the invoice
(even if made from packing).
This is mostly used for e-commerce handling.
You can then add a mapping on that SO field to save
the e-commerce financial Transaction ID into the
OpenERP sale order field.
The main purpose is to ease the reconciliation process and
be able to find the partner when importing the bank statement.
""",
'website': 'http://www.openerp.com',
'init_xml': [],
'update_xml': [
'invoice_view.xml',
'sale_view.xml'
],
'demo_xml': [],
'test': [],
'installable': False,
'images': [],
'auto_install': False,
'license': 'AGPL-3',
}

View File

@@ -1,37 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2014 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 openerp.osv import orm, fields
class account_move_line(orm.Model):
_inherit = 'account.move.line'
_columns = {
'transaction_ref': fields.char('Transaction Ref.',
select=True),
}
def copy_data(self, cr, uid, id, default=None, context=None):
if default is None:
default = {}
default['transaction_ref'] = False
return super(account_move_line, self).\
copy_data(cr, uid, id, default=default, context=context)

View File

@@ -1,58 +0,0 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_transaction_id
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-01-21 12:03+0000\n"
"PO-Revision-Date: 2014-01-21 12:03+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: base_transaction_id
#: field:account.invoice,transaction_id:0
#: field:sale.order,transaction_id:0
msgid "Transaction id"
msgstr ""
#. module: base_transaction_id
#: view:account.invoice:0
msgid "Transactions datas"
msgstr ""
#. module: base_transaction_id
#: help:sale.order,transaction_id:0
msgid "Transaction id from the financial institute"
msgstr ""
#. module: base_transaction_id
#: help:account.invoice,transaction_id:0
msgid "Transction id from the financial institute"
msgstr ""
#. module: base_transaction_id
#: model:ir.actions.act_window,name:base_transaction_id.prm_act
msgid "Packing"
msgstr ""
#. module: base_transaction_id
#: model:ir.model,name:base_transaction_id.model_account_invoice
msgid "Invoice"
msgstr ""
#. module: base_transaction_id
#: model:ir.model,name:base_transaction_id.model_stock_picking
msgid "Picking List"
msgstr ""
#. module: base_transaction_id
#: model:ir.model,name:base_transaction_id.model_sale_order
msgid "Sales Order"
msgstr ""

View File

@@ -1,59 +0,0 @@
# Spanish translation for banking-addons
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
# This file is distributed under the same license as the banking-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: banking-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2014-01-21 12:03+0000\n"
"PO-Revision-Date: 2014-06-05 22:52+0000\n"
"Last-Translator: Pedro Manuel Baeza <pedro.baeza@gmail.com>\n"
"Language-Team: Spanish <es@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-06-06 06:36+0000\n"
"X-Generator: Launchpad (build 17031)\n"
#. module: base_transaction_id
#: field:account.invoice,transaction_id:0
#: field:sale.order,transaction_id:0
msgid "Transaction id"
msgstr "Id de transacción"
#. module: base_transaction_id
#: view:account.invoice:0
msgid "Transactions datas"
msgstr "Datos de la transacción"
#. module: base_transaction_id
#: help:sale.order,transaction_id:0
msgid "Transaction id from the financial institute"
msgstr "Id de la transacción de la institución financiera"
#. module: base_transaction_id
#: help:account.invoice,transaction_id:0
msgid "Transction id from the financial institute"
msgstr "Id de la transacción de la institución financiera"
#. module: base_transaction_id
#: model:ir.actions.act_window,name:base_transaction_id.prm_act
msgid "Packing"
msgstr "Empaquetado"
#. module: base_transaction_id
#: model:ir.model,name:base_transaction_id.model_account_invoice
msgid "Invoice"
msgstr "Factura"
#. module: base_transaction_id
#: model:ir.model,name:base_transaction_id.model_stock_picking
msgid "Picking List"
msgstr "Albarán"
#. module: base_transaction_id
#: model:ir.model,name:base_transaction_id.model_sale_order
msgid "Sales Order"
msgstr "Pedido de venta"

View File

@@ -1,50 +0,0 @@
# -*- 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 openerp.osv.orm import Model
from openerp.osv import fields
class AccountInvoice(Model):
_inherit = 'account.invoice'
_columns = {
'transaction_id': fields.char(
'Transaction id',
select=1,
help="Transaction id from the financial institute"),
}
def copy_data(self, cr, uid, id, default=None, context=None):
if default is None:
default = {}
default['transaction_id'] = False
return super(AccountInvoice, self).\
copy_data(cr, uid, id, default=default, context=context)
def finalize_invoice_move_lines(self, cr, uid, invoice_browse, move_lines):
if invoice_browse.transaction_id:
invoice_account_id = invoice_browse.account_id.id
for line in move_lines:
# tuple (0, 0, {values})
if invoice_account_id == line[2]['account_id']:
line[2]['transaction_ref'] = invoice_browse.transaction_id
return move_lines

View File

@@ -1,28 +0,0 @@
<?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="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="arch" type="xml">
<field name="origin" position="after">
<field name="transaction_id" select="2"/>
</field>
</field>
</record>
</data>
</openerp>

View File

@@ -1,43 +0,0 @@
# -*- 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 openerp.osv.orm import Model
from openerp.osv import fields
class SaleOrder(Model):
_inherit = 'sale.order'
_columns = {
'transaction_id': fields.char(
'Transaction id',
size=128,
required=False,
help="Transaction id from the financial institute"),
}
def _prepare_invoice(self, cr, uid, order, lines, context=None):
# we put the transaction id in the generated invoices
invoice_vals = super(SaleOrder, self)._prepare_invoice(
cr, uid, order, lines, context=context)
invoice_vals.update({
'transaction_id': order.transaction_id})
return invoice_vals

View File

@@ -1,20 +0,0 @@
<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="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>

View File

@@ -1,42 +0,0 @@
# -*- 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 openerp.osv.orm import Model
class StockPicking(Model):
_inherit = "stock.picking"
def action_invoice_create(
self, cr, uid, ids, journal_id=False, group=False,
type='out_invoice', context=None):
res = super(StockPicking, self).action_invoice_create(
cr, uid, ids, journal_id, group, type, context)
for pick_id in res:
pick = self.browse(cr, uid, pick_id, context=context)
if pick.sale_id and pick.sale_id.transaction_id:
self.pool.get('account.invoice').write(
cr,
uid,
res[pick_id],
{'transaction_id': pick.sale_id.transaction_id},
context=context)
return res