diff --git a/account_payment_force_maturity_date/__init__.py b/account_payment_force_maturity_date/__init__.py new file mode 100644 index 0000000..c46e425 --- /dev/null +++ b/account_payment_force_maturity_date/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Account Payment Force Maturity Date module for Odoo +# Copyright (C) 2015 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# 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 payment_line diff --git a/account_payment_force_maturity_date/__openerp__.py b/account_payment_force_maturity_date/__openerp__.py new file mode 100644 index 0000000..6d419a8 --- /dev/null +++ b/account_payment_force_maturity_date/__openerp__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Account Payment Force Maturity Date module for Odoo +# Copyright (C) 2015 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# 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 . +# +############################################################################## + +{ + 'name': 'Account Payment Force Maturity Date', + 'version': '1.0', + 'category': 'Accounting & Finance', + 'license': 'AGPL-3', + 'summary': 'Add a Force Maturity Date field on payment lines', + 'description': """ +Account Payment Force Maturity Date +=================================== + +This module adds a field *Force Maturity Date* on payment lines. If this field is set, the maturity date of the payment line will take the value of this field instead of taking the value of the maturity date of the related account move line. + +This module has been written by Alexis de Lattre from Akretion . +""", + 'author': 'Akretion', + 'depends': ['account_payment'], + 'data': ['payment_view.xml'], +} diff --git a/account_payment_force_maturity_date/i18n/account_payment_force_maturity_date.pot b/account_payment_force_maturity_date/i18n/account_payment_force_maturity_date.pot new file mode 100644 index 0000000..57bce82 --- /dev/null +++ b/account_payment_force_maturity_date/i18n/account_payment_force_maturity_date.pot @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_force_maturity_date +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-05-06 15:02+0000\n" +"PO-Revision-Date: 2015-05-06 15:02+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: account_payment_force_maturity_date +#: field:payment.line,force_maturity_date:0 +msgid "Force Due Date" +msgstr "" + +#. module: account_payment_force_maturity_date +#: model:ir.model,name:account_payment_force_maturity_date.model_payment_line +msgid "Payment Line" +msgstr "" + diff --git a/account_payment_force_maturity_date/i18n/fr.po b/account_payment_force_maturity_date/i18n/fr.po new file mode 100644 index 0000000..e9172cb --- /dev/null +++ b/account_payment_force_maturity_date/i18n/fr.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_force_maturity_date +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-05-06 15:03+0000\n" +"PO-Revision-Date: 2015-05-06 15: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: account_payment_force_maturity_date +#: field:payment.line,force_maturity_date:0 +msgid "Force Due Date" +msgstr "Force la date d'échéance" + +#. module: account_payment_force_maturity_date +#: model:ir.model,name:account_payment_force_maturity_date.model_payment_line +msgid "Payment Line" +msgstr "Ligne de paiement" + diff --git a/account_payment_force_maturity_date/payment_line.py b/account_payment_force_maturity_date/payment_line.py new file mode 100644 index 0000000..6963374 --- /dev/null +++ b/account_payment_force_maturity_date/payment_line.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Account Payment Force Maturity Date module for Odoo +# Copyright (C) 2015 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# 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 import models, fields, api + + +class PaymentLine(models.Model): + _inherit = 'payment.line' + + @api.one + @api.depends( + 'move_line_id', 'move_line_id.date_maturity', 'force_maturity_date') + def _compute_ml_maturity_date(self): + ml_maturity_date = False + if self.force_maturity_date: + ml_maturity_date = self.force_maturity_date + elif self.move_line_id: + ml_maturity_date = self.move_line_id.date_maturity + self.ml_maturity_date = ml_maturity_date + + ml_maturity_date = fields.Date(compute='_compute_ml_maturity_date') + force_maturity_date = fields.Date(string='Force Due Date') diff --git a/account_payment_force_maturity_date/payment_view.xml b/account_payment_force_maturity_date/payment_view.xml new file mode 100644 index 0000000..857f45b --- /dev/null +++ b/account_payment_force_maturity_date/payment_view.xml @@ -0,0 +1,23 @@ + + + + + + + + hide.communication2.on.payment.line.form + payment.order + + + + + + + + + + diff --git a/account_payment_hide_communication2/payment_view.xml b/account_payment_hide_communication2/payment_view.xml index ff3cfc5..5314779 100644 --- a/account_payment_hide_communication2/payment_view.xml +++ b/account_payment_hide_communication2/payment_view.xml @@ -13,7 +13,9 @@ payment.order - + + 1 +