diff --git a/.travis.yml b/.travis.yml index 3dd73edf..d0f63084 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,9 +8,12 @@ cache: pip addons: apt: + sources: + - pov-wkhtmltopdf packages: - expect-dev # provides unbuffer utility - python-lxml # because pip installation is slow + - wkhtmltopdf env: global: diff --git a/README.md b/README.md index b42acf31..44084244 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,12 @@ __Version 7.0 and earlier :__ [//]: # (addons) +Available addons +---------------- +addon | version | summary +--- | --- | --- +[base_transaction_id](base_transaction_id/) | 9.0.1.0.0 | Base transaction id for financial institutes + Unported addons --------------- addon | version | summary @@ -53,6 +59,5 @@ addon | version | summary [account_statement_so_completion](account_statement_so_completion/) | 0.1 (unported) | Bank statement Sale Order completion [account_statement_transactionid_completion](account_statement_transactionid_completion/) | 1.0 (unported) | Bank statement completion from transaction ID [account_statement_transactionid_import](account_statement_transactionid_import/) | 1.0 (unported) | Bank statement transactionID import -[base_transaction_id](base_transaction_id/) | 8.0.1.0.0 (unported) | Base transaction id for financial institutes [//]: # (end addons) diff --git a/base_transaction_id/README.rst b/base_transaction_id/README.rst new file mode 100644 index 00000000..9ea40ae0 --- /dev/null +++ b/base_transaction_id/README.rst @@ -0,0 +1,55 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============================================ +Base transaction id for financial institutes +============================================ + +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 Odoo sale order field. + +The main purpose is to ease the reconciliation process and be able to find the partner +when importing the bank statement. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. + +Credits +======= + +Contributors +------------ + +* Yannick Vaucher +* Joël Grand-Guillaume +* Alexandre Fayolle +* Guewen Baconnier +* Pedro Baeza +* Lorenzo Battistini + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/base_transaction_id/__init__.py b/base_transaction_id/__init__.py index 7241064a..038f720f 100644 --- a/base_transaction_id/__init__.py +++ b/base_transaction_id/__init__.py @@ -1,26 +1,4 @@ -# -*- 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 . -# -############################################################################## - -from . import invoice -from . import sale -from . import stock -from . import account_move -from . import account_bank_statement +# -*- coding: utf-8 -*# -*- coding: utf-8 -*- +# © 2012-2015 Yannick Vaucher (Camptocamp) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import models diff --git a/base_transaction_id/__openerp__.py b/base_transaction_id/__openerp__.py index 234158d3..cfe25a12 100644 --- a/base_transaction_id/__openerp__.py +++ b/base_transaction_id/__openerp__.py @@ -1,26 +1,8 @@ -# -*- 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 . -# -############################################################################## - +# -*- coding: utf-8 -*# -*- coding: utf-8 -*- +# © 2012 Yannick Vaucher (Camptocamp) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). {'name': 'Base transaction id for financial institutes', - 'version': '8.0.1.0.0', + 'version': '9.0.1.0.0', 'author': "Camptocamp,Odoo Community Association (OCA)", 'maintainer': 'Camptocamp', 'category': 'Hidden/Dependency', @@ -30,27 +12,15 @@ 'stock_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', 'data': [ - 'invoice_view.xml', - 'sale_view.xml', - 'account_move_line_view.xml', + 'views/invoice.xml', + 'views/sale.xml', + 'views/account_move_line.xml', 'views/base_transaction_id.xml', ], 'test': [], - 'installable': False, + 'installable': True, 'images': [], 'auto_install': False, 'license': 'AGPL-3', diff --git a/base_transaction_id/account_bank_statement.py b/base_transaction_id/account_bank_statement.py deleted file mode 100644 index e9d6346b..00000000 --- a/base_transaction_id/account_bank_statement.py +++ /dev/null @@ -1,61 +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 . -# -############################################################################## - -from openerp.osv import orm - - -class account_bank_statement_line(orm.Model): - - _inherit = 'account.bank.statement.line' - - def _domain_move_lines_for_reconciliation(self, cr, uid, st_line, - excluded_ids=None, str=False, - additional_domain=None, - context=None): - _super = super(account_bank_statement_line, self) - _get_domain = _super._domain_move_lines_for_reconciliation - domain = _get_domain(cr, uid, st_line, excluded_ids=excluded_ids, - str=str, additional_domain=additional_domain, - context=context) - if not str and str != '/': - return domain - domain = domain[:] - domain.insert(-1, '|') - domain.append(('transaction_ref', 'ilike', str)) - return domain - - def _domain_reconciliation_proposition(self, cr, uid, st_line, - excluded_ids=None, context=None): - _super = super(account_bank_statement_line, self) - _get_domain = _super._domain_reconciliation_proposition - domain = _get_domain(cr, uid, st_line, excluded_ids=excluded_ids, - context=context) - new_domain = [] - for criterion in domain: - if len(criterion) == 3: - field, op, value = criterion - if (field, op) == ('ref', '='): - new_domain += [ - '|', - ('transaction_ref', '=', value), - ] - new_domain.append(criterion) - return new_domain diff --git a/base_transaction_id/account_move.py b/base_transaction_id/account_move.py deleted file mode 100644 index 77b73366..00000000 --- a/base_transaction_id/account_move.py +++ /dev/null @@ -1,56 +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 . -# -############################################################################## -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 - _super = super(account_move_line, self) - return _super.copy_data(cr, uid, id, default=default, context=context) - - def prepare_move_lines_for_reconciliation_widget(self, cr, uid, lines, - target_currency=False, - target_date=False, - context=None): - _super = super(account_move_line, self) - prepare = _super.prepare_move_lines_for_reconciliation_widget - prepared_lines = [] - for line in lines: - # The super method loop over the lines and returns a list of - # prepared lines. Here we'll have 1 line per call to super. - # If we called super on the whole list, we would need to - # browse again the lines, or match the 'lines' vs - # 'prepared_lines' to update the transaction_ref. - vals = prepare(cr, uid, [line], target_currency=target_currency, - target_date=target_date, context=context)[0] - vals['transaction_ref'] = line.transaction_ref - prepared_lines.append(vals) - return prepared_lines diff --git a/base_transaction_id/i18n/de.po b/base_transaction_id/i18n/de.po new file mode 100644 index 00000000..08705fba --- /dev/null +++ b/base_transaction_id/i18n/de.po @@ -0,0 +1,69 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * base_transaction_id +# +# Translators: +# Rudolf Schnapka , 2015 +msgid "" +msgstr "" +"Project-Id-Version: bank-statement-reconcile (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-14 09:25+0000\n" +"PO-Revision-Date: 2015-11-25 08:30+0000\n" +"Last-Translator: Rudolf Schnapka \n" +"Language-Team: German (http://www.transifex.com/oca/OCA-bank-statement-reconcile-8-0/language/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: base_transaction_id +#: model:ir.model,name:base_transaction_id.model_account_bank_statement_line +msgid "Bank Statement Line" +msgstr "Kontoauszugzeile" + +#. module: base_transaction_id +#: model:ir.model,name:base_transaction_id.model_account_invoice +msgid "Invoice" +msgstr "Rechnung" + +#. module: base_transaction_id +#: model:ir.model,name:base_transaction_id.model_account_move_line +msgid "Journal Items" +msgstr "Journalposten" + +#. module: base_transaction_id +#: model:ir.model,name:base_transaction_id.model_stock_picking +msgid "Picking List" +msgstr "Kommissionierschein" + +#. module: base_transaction_id +#: view:account.move.line:base_transaction_id.view_move_line_form +msgid "Reconciliation" +msgstr "Ausgleich" + +#. module: base_transaction_id +#: model:ir.model,name:base_transaction_id.model_sale_order +msgid "Sales Order" +msgstr "Verkaufsauftrag" + +#. module: base_transaction_id +#: field:account.invoice,transaction_id:0 field:sale.order,transaction_id:0 +msgid "Transaction ID" +msgstr "Transaktionskennung" + +#. module: base_transaction_id +#: help:account.invoice,transaction_id:0 +msgid "Transaction ID from the financial institute" +msgstr "Transaktionskennung des Kreditinstituts" + +#. module: base_transaction_id +#: field:account.move.line,transaction_ref:0 +msgid "Transaction Ref." +msgstr "Transaktionsreferenz" + +#. module: base_transaction_id +#: help:sale.order,transaction_id:0 +msgid "Transaction id from the financial institute" +msgstr "Transaktionskennung des Kreditinstituts" diff --git a/base_transaction_id/i18n/it.po b/base_transaction_id/i18n/it.po new file mode 100644 index 00000000..7fd8134f --- /dev/null +++ b/base_transaction_id/i18n/it.po @@ -0,0 +1,68 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * base_transaction_id +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: bank-statement-reconcile (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-14 09:25+0000\n" +"PO-Revision-Date: 2015-07-22 06:46+0000\n" +"Last-Translator: <>\n" +"Language-Team: Italian (http://www.transifex.com/oca/OCA-bank-statement-reconcile-8-0/language/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: base_transaction_id +#: model:ir.model,name:base_transaction_id.model_account_bank_statement_line +msgid "Bank Statement Line" +msgstr "Linea estratto conto" + +#. 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_account_move_line +msgid "Journal Items" +msgstr "" + +#. module: base_transaction_id +#: model:ir.model,name:base_transaction_id.model_stock_picking +msgid "Picking List" +msgstr "" + +#. module: base_transaction_id +#: view:account.move.line:base_transaction_id.view_move_line_form +msgid "Reconciliation" +msgstr "" + +#. module: base_transaction_id +#: model:ir.model,name:base_transaction_id.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: base_transaction_id +#: field:account.invoice,transaction_id:0 field:sale.order,transaction_id:0 +msgid "Transaction ID" +msgstr "" + +#. module: base_transaction_id +#: help:account.invoice,transaction_id:0 +msgid "Transaction ID from the financial institute" +msgstr "" + +#. module: base_transaction_id +#: field:account.move.line,transaction_ref:0 +msgid "Transaction Ref." +msgstr "" + +#. module: base_transaction_id +#: help:sale.order,transaction_id:0 +msgid "Transaction id from the financial institute" +msgstr "" diff --git a/base_transaction_id/models/__init__.py b/base_transaction_id/models/__init__.py new file mode 100644 index 00000000..f4d17648 --- /dev/null +++ b/base_transaction_id/models/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*# -*- coding: utf-8 -*- +# © 2012-2015 Yannick Vaucher (Camptocamp) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import invoice +from . import sale +from . import account_move +from . import account_bank_statement_line diff --git a/base_transaction_id/models/account_bank_statement_line.py b/base_transaction_id/models/account_bank_statement_line.py new file mode 100644 index 00000000..49dc9618 --- /dev/null +++ b/base_transaction_id/models/account_bank_statement_line.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# © 2016 Yannick Vaucher (Camptocamp) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from openerp import api, models + + +class AccountBankStatementLine(models.Model): + + _inherit = 'account.bank.statement.line' + + @api.multi + def get_reconciliation_proposition(self, excluded_ids=None): + """ Look for transaction_ref to give them as proposition move line """ + if self.name: + # If the transaction has no partner, look for match in payable and + # receivable account anyway + overlook_partner = not self.partner_id + domain = [('transaction_ref', 'ilike', self.name)] + match_recs = self.get_move_lines_for_reconciliation( + excluded_ids=excluded_ids, limit=2, additional_domain=domain, + overlook_partner=overlook_partner) + if match_recs and len(match_recs) == 1: + return match_recs + _super = super(AccountBankStatementLine, self) + return _super.get_reconciliation_proposition(excluded_ids=excluded_ids) diff --git a/base_transaction_id/models/account_move.py b/base_transaction_id/models/account_move.py new file mode 100644 index 00000000..45ddf7c2 --- /dev/null +++ b/base_transaction_id/models/account_move.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# © 2014 Guewen Baconnier (Camptocamp) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from openerp import models, fields, api +from openerp.osv import expression + + +class AccountMoveLine(models.Model): + _inherit = 'account.move.line' + + transaction_ref = fields.Char( + 'Transaction Ref.', + index=True, + copy=False + ) + + @api.multi + def prepare_move_lines_for_reconciliation_widget(self, + target_currency=False, + target_date=False): + prepared_lines = [] + for line in self: + _super = super(AccountMoveLine, line) + # The super method loop over the lines and returns a list of + # prepared lines. Here we'll have 1 line per call to super. + # If we called super on the whole list, we would need to + # browse again the lines, or match the 'lines' vs + # 'prepared_lines' to update the transaction_ref. + vals = _super.prepare_move_lines_for_reconciliation_widget( + target_currency=target_currency, + target_date=target_date)[0] + vals['transaction_ref'] = line.transaction_ref + prepared_lines.append(vals) + return prepared_lines + + @api.model + def domain_move_lines_for_reconciliation(self, excluded_ids=None, + str=False): + """ Add transaction_ref in search of move lines""" + _super = super(AccountMoveLine, self) + _get_domain = _super.domain_move_lines_for_reconciliation + domain = _get_domain(excluded_ids=excluded_ids, str=str) + if not str and str != '/': + return domain + domain_trans_ref = [('transaction_ref', 'ilike', str)] + return expression.OR([domain, domain_trans_ref]) diff --git a/base_transaction_id/invoice.py b/base_transaction_id/models/invoice.py similarity index 56% rename from base_transaction_id/invoice.py rename to base_transaction_id/models/invoice.py index 4b3745c5..1594adba 100644 --- a/base_transaction_id/invoice.py +++ b/base_transaction_id/models/invoice.py @@ -1,24 +1,7 @@ # -*- 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 . -# -############################################################################## - +# © 2011-2012 Nicolas Bessi (Camptocamp) +# © 2012-2015 Yannick Vaucher (Camptocamp) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import models, fields, api diff --git a/base_transaction_id/models/sale.py b/base_transaction_id/models/sale.py new file mode 100644 index 00000000..45b8a102 --- /dev/null +++ b/base_transaction_id/models/sale.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# © 2011-2012 Nicolas Bessi (Camptocamp) +# © 2012-2015 Yannick Vaucher (Camptocamp) +from openerp import models, fields, api + + +class SaleOrder(models.Model): + _inherit = 'sale.order' + + transaction_id = fields.Char( + 'Transaction ID', + required=False, + copy=False, + help="Transaction id from the financial institute" + ) + + @api.multi + def _prepare_invoice(self): + """ Propagate the transaction_id from the sale order to the invoice """ + invoice_vals = super(SaleOrder, self)._prepare_invoice() + invoice_vals['transaction_id'] = self.transaction_id + return invoice_vals diff --git a/base_transaction_id/sale.py b/base_transaction_id/sale.py deleted file mode 100644 index 159414fb..00000000 --- a/base_transaction_id/sale.py +++ /dev/null @@ -1,48 +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 . -# -############################################################################## - -from openerp.osv import orm, fields - - -class SaleOrder(orm.Model): - _inherit = 'sale.order' - - _columns = { - 'transaction_id': fields.char( - 'Transaction ID', - required=False, - 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 - _super = super(SaleOrder, self) - return _super.copy_data(cr, uid, id, default=default, context=context) - - def _prepare_invoice(self, cr, uid, order, lines, context=None): - """ Propagate the transaction_id from the sale order to the invoice """ - _super = super(SaleOrder, self) - invoice_vals = _super._prepare_invoice(cr, uid, order, lines, - context=context) - invoice_vals['transaction_id'] = order.transaction_id - return invoice_vals diff --git a/base_transaction_id/static/src/js/account_widgets.js b/base_transaction_id/static/src/js/account_widgets.js index 277c9c2c..c47dbc71 100644 --- a/base_transaction_id/static/src/js/account_widgets.js +++ b/base_transaction_id/static/src/js/account_widgets.js @@ -1,11 +1,14 @@ -openerp.base_transaction_id = function (instance) { +odoo.define('base_transaction_id.base_transaction_id', function (require) { - instance.web.account.bankStatementReconciliationLine.include({ - decorateMoveLine: function(line, currency_id) { - this._super(line, currency_id); + var AccountReconciliation = require('account.reconciliation'); + + AccountReconciliation.bankStatementReconciliation.include({ + decorateMoveLine: function(line) { + this._super(line); if (line.transaction_ref) { line.q_label += ' (' + line.transaction_ref + ')'; } }, }); -}; + +}); diff --git a/base_transaction_id/stock.py b/base_transaction_id/stock.py deleted file mode 100644 index 840aedf1..00000000 --- a/base_transaction_id/stock.py +++ /dev/null @@ -1,34 +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 . -# -############################################################################## - -from openerp.osv import orm - - -class StockPicking(orm.Model): - _inherit = "stock.picking" - - def _create_invoice_from_picking(self, cr, uid, picking, vals, - context=None): - """ Propagate the transaction ID from sale to invoice """ - vals['transaction_id'] = picking.sale_id.transaction_id - _super = super(StockPicking, self) - return _super._create_invoice_from_picking(cr, uid, picking, vals, - context=context) diff --git a/base_transaction_id/account_move_line_view.xml b/base_transaction_id/views/account_move_line.xml similarity index 83% rename from base_transaction_id/account_move_line_view.xml rename to base_transaction_id/views/account_move_line.xml index 488968af..f7d3887b 100644 --- a/base_transaction_id/account_move_line_view.xml +++ b/base_transaction_id/views/account_move_line.xml @@ -6,9 +6,9 @@ account.move.line - + - + diff --git a/base_transaction_id/invoice_view.xml b/base_transaction_id/views/invoice.xml similarity index 100% rename from base_transaction_id/invoice_view.xml rename to base_transaction_id/views/invoice.xml diff --git a/base_transaction_id/sale_view.xml b/base_transaction_id/views/sale.xml similarity index 100% rename from base_transaction_id/sale_view.xml rename to base_transaction_id/views/sale.xml