Skip to content

Commit

Permalink
Merge PR #236 into 12.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Sep 30, 2019
2 parents 316bc77 + c871e2b commit b5600b1
Show file tree
Hide file tree
Showing 43 changed files with 1,626 additions and 0 deletions.
97 changes: 97 additions & 0 deletions contract_payment_mode/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
=====================
Contract Payment Mode
=====================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github
:target: https://github.com/OCA/contract/tree/12.0/contract_payment_mode
:alt: OCA/contract
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-contract_payment_mode
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/110/12.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to set a payment mode on contract for creating the invoices
with this payment mode.

**Table of contents**

.. contents::
:local:

Configuration
=============

Your user should be a Sales Manager or Accountant.

Usage
=====

#. Go to *Accounting > Sales > Contracts*.
#. Create one.
#. Select a partner to which invoice.
#. If the partner has a payment mode, this payment mode is selected here.
#. If not, or if you want another payment mode, you can change it in the
corresponding field.
#. Click on **Generate recurring invoices automatically** checkbox.
#. Add a product to invoice.
#. If you create an invoice, new invoice will have the selected payment mode.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/contract/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 <https://github.com/OCA/contract/issues/new?body=module:%20contract_payment_mode%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Domatix
* Tecnativa

Contributors
~~~~~~~~~~~~

* Ángel Moya <angel.moya@domatix.com>
* Antonio Espinosa <antonioea@antiun.com>
* Vicent Cubells <vicent.cubells@tecnativa.com>
* David Vidal <david.vidal@tecnativa.com>
* Carlos Dauden <carlos.dauden@tecnativa.com>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/12.0/contract_payment_mode>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions contract_payment_mode/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
from .hooks import post_init_hook
28 changes: 28 additions & 0 deletions contract_payment_mode/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2015 Domatix (<www.domatix.com>)
# Copyright 2016 Antiun Ingenieria S.L. - Antonio Espinosa
# Copyright 2017 Tecnativa - David Vidal
# Copyright 2017 Tecnativa - Carlos Dauden <carlos.dauden@tecnativa.com>
# Copyright 2017-2018 Tecnativa - Vicent Cubells <vicent.cubells@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
'name': 'Contract Payment Mode',
'summary': 'Payment mode in contracts and their invoices',
'version': '12.0.1.0.0',
'author': 'Domatix, '
'Tecnativa, '
'Odoo Community Association (OCA)',
'website': 'https://github.com/OCA/contract',
'depends': [
'contract',
'account_payment_partner'
],
'category': 'Sales Management',
'license': 'AGPL-3',
'data': [
'views/contract_view.xml',
],
'post_init_hook': 'post_init_hook',
'installable': True,
'auto_install': True,
}
25 changes: 25 additions & 0 deletions contract_payment_mode/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2016 Antiun Ingenieria S.L. - Antonio Espinosa
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import api, SUPERUSER_ID
import logging

_logger = logging.getLogger(__name__)


def post_init_hook(cr, registry):
"""Copy payment mode from partner to the new field at contract."""
with api.Environment.manage():
env = api.Environment(cr, SUPERUSER_ID, {})
m_contract = env['contract.contract']
contracts = m_contract.search([
('payment_mode_id', '=', False),
])
if contracts:
_logger.info('Setting payment mode: %d contracts' %
len(contracts))
for contract in contracts:
payment_mode = contract.partner_id.customer_payment_mode_id
if payment_mode:
contract.payment_mode_id = payment_mode.id
_logger.info('Setting payment mode: Done')
33 changes: 33 additions & 0 deletions contract_payment_mode/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * contract_payment_mode
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
# Marc Tormo i Bochaca <mtbochaca@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
"PO-Revision-Date: 2017-04-01 02:46+0000\n"
"Last-Translator: Marc Tormo i Bochaca <mtbochaca@gmail.com>, 2017\n"
"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: contract_payment_mode
#: model:ir.model.fields,field_description:contract_payment_mode.field_contract_contract__payment_mode_id
msgid "Payment Mode"
msgstr "Forma de pagament "

#. module: contract_payment_mode
#: model:ir.model,name:contract_payment_mode.model_contract_contract
msgid "contract.contract"
msgstr ""

#~ msgid "Analytic Account"
#~ msgstr "Compte analític"
27 changes: 27 additions & 0 deletions contract_payment_mode/i18n/contract_payment_mode.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * contract_payment_mode
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
"PO-Revision-Date: 2019-05-29 10:30+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: contract_payment_mode
#: model:ir.model.fields,field_description:contract_payment_mode.field_contract_contract__payment_mode_id
msgid "Payment Mode"
msgstr ""

#. module: contract_payment_mode
#: model:ir.model,name:contract_payment_mode.model_contract_contract
msgid "contract.contract"
msgstr ""

32 changes: 32 additions & 0 deletions contract_payment_mode/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * contract_payment_mode
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
"PO-Revision-Date: 2017-04-01 02:46+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: contract_payment_mode
#: model:ir.model.fields,field_description:contract_payment_mode.field_contract_contract__payment_mode_id
msgid "Payment Mode"
msgstr "Zahlweise"

#. module: contract_payment_mode
#: model:ir.model,name:contract_payment_mode.model_contract_contract
msgid "contract.contract"
msgstr ""

#~ msgid "Analytic Account"
#~ msgstr "Kostenstelle"
32 changes: 32 additions & 0 deletions contract_payment_mode/i18n/el_GR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * contract_payment_mode
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: contract (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
"PO-Revision-Date: 2015-11-07 12:33+0000\n"
"Last-Translator: <>\n"
"Language-Team: Greek (Greece) (http://www.transifex.com/oca/OCA-contract-8-0/"
"language/el_GR/)\n"
"Language: el_GR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: contract_payment_mode
#: model:ir.model.fields,field_description:contract_payment_mode.field_contract_contract__payment_mode_id
msgid "Payment Mode"
msgstr ""

#. module: contract_payment_mode
#: model:ir.model,name:contract_payment_mode.model_contract_contract
msgid "contract.contract"
msgstr ""

#~ msgid "Analytic Account"
#~ msgstr "Αναλυτικός Λογαριασμός"
32 changes: 32 additions & 0 deletions contract_payment_mode/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * contract_payment_mode
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
"PO-Revision-Date: 2017-04-01 02:46+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: contract_payment_mode
#: model:ir.model.fields,field_description:contract_payment_mode.field_contract_contract__payment_mode_id
msgid "Payment Mode"
msgstr "Modo de pago"

#. module: contract_payment_mode
#: model:ir.model,name:contract_payment_mode.model_contract_contract
msgid "contract.contract"
msgstr ""

#~ msgid "Analytic Account"
#~ msgstr "Cuenta analítica"
32 changes: 32 additions & 0 deletions contract_payment_mode/i18n/es_MX.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * contract_payment_mode
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: contract (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
"PO-Revision-Date: 2015-11-07 12:33+0000\n"
"Last-Translator: <>\n"
"Language-Team: Spanish (Mexico) (http://www.transifex.com/oca/OCA-"
"contract-8-0/language/es_MX/)\n"
"Language: es_MX\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: contract_payment_mode
#: model:ir.model.fields,field_description:contract_payment_mode.field_contract_contract__payment_mode_id
msgid "Payment Mode"
msgstr ""

#. module: contract_payment_mode
#: model:ir.model,name:contract_payment_mode.model_contract_contract
msgid "contract.contract"
msgstr ""

#~ msgid "Analytic Account"
#~ msgstr "Cuenta analítica"
32 changes: 32 additions & 0 deletions contract_payment_mode/i18n/fi.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * contract_payment_mode
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-29 10:30+0000\n"
"PO-Revision-Date: 2017-04-01 02:46+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n"
"Language: fi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: contract_payment_mode
#: model:ir.model.fields,field_description:contract_payment_mode.field_contract_contract__payment_mode_id
msgid "Payment Mode"
msgstr "Maksutapa"

#. module: contract_payment_mode
#: model:ir.model,name:contract_payment_mode.model_contract_contract
msgid "contract.contract"
msgstr ""

#~ msgid "Analytic Account"
#~ msgstr "Analyyttinen tili"
Loading

0 comments on commit b5600b1

Please sign in to comment.