Skip to content

Commit

Permalink
[MIG] contract_commission: Migration to 12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelsavegnago committed Feb 1, 2021
1 parent 9760ed1 commit 150cfa2
Show file tree
Hide file tree
Showing 16 changed files with 586 additions and 86 deletions.
89 changes: 51 additions & 38 deletions contract_commission/README.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,40 @@
.. 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

=======================
Commission in contracts
=======================
================================
Commissions in contract invoices
================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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%2Fcommission-lightgray.png?logo=github
:target: https://github.com/OCA/commission/tree/12.0/contract_commission
:alt: OCA/commission
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/commission-12-0/commission-12-0-contract_commission
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/165/12.0
:alt: Try me on Runbot

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

This module allows to get default commissions for partner in the recurring
invoices generated from contracts.

Installation
============
**Table of contents**

.. contents::
:local:

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

This module is auto-installed when you have *contract* and *sale_commission*
modules installed.
Expand All @@ -21,55 +45,44 @@ Usage
When invoicing contracts, the agents assigned to the partner of the contract
will now be assigned to the generated invoices.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/110/9.0

Known issues / Roadmap
======================

* Allow to set specific commissions for each contract instead of taking the
ones set at partner level.

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

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/commission/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.
Bugs are tracked on `GitHub Issues <https://github.com/OCA/commission/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/commission/issues/new?body=module:%20contract_commission%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
=======

Images
------
Authors
~~~~~~~

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
* Tecnativa

Contributors
------------
~~~~~~~~~~~~

* Pedro M. Baeza <[email protected]>
* Vicent Cubells <[email protected]>
* Marcel Savegnago <[email protected]>

Icon
----
* http://commons.wikimedia.org/wiki/File:Percent_18e.svg
* https://openclipart.org/detail/43969/pile-of-golden-coins-by-j_alves
* Subicon made by `Freepik from www.flaticon.com
<http://www.flaticon.com/authors/freepik>`_
Maintainers
~~~~~~~~~~~

Maintainer
----------
This module is maintained by the OCA.

.. 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 https://odoo-community.org.
This module is part of the `OCA/commission <https://github.com/OCA/commission/tree/12.0/contract_commission>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 0 additions & 1 deletion contract_commission/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2015 Tecnativa - Pedro M. Baeza
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# -*- coding: utf-8 -*-
# Copyright 2015 Tecnativa - Pedro M. Baeza
# Copyright 2017 Tecnativa - Vicent Cubells
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

{
'name': 'Commissions in contract invoices',
'version': '9.0.1.0.0',
'version': '12.0.1.0.0',
'author': 'Tecnativa, '
'Odoo Community Association (OCA)',
"website": "https://www.tecnativa.com/",
"category": "Generic Modules/Sales & Purchases",
'website': 'https://www.tecnativa.com/',
'category': 'Generic Modules/Sales & Purchases',
'images': ['static/description/banner.png'],
'license': 'AGPL-3',
'depends': [
'contract',
'sale_commission',
],
"installable": True,
"auto_install": True,
'installable': True,
'auto_install': True,
}
4 changes: 3 additions & 1 deletion contract_commission/i18n/contract_commission.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-09-12 17:23+0000\n"
"PO-Revision-Date: 2020-09-12 17:23+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand Down
3 changes: 1 addition & 2 deletions contract_commission/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# Copyright 2015 Tecnativa - Pedro M. Baeza
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from . import analytic
from . import contract_line
19 changes: 0 additions & 19 deletions contract_commission/models/analytic.py

This file was deleted.

19 changes: 19 additions & 0 deletions contract_commission/models/contract_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2015 Tecnativa - Pedro M. Baeza
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from odoo import api, models


class ContractLine(models.Model):
_inherit = 'contract.line'

@api.model
def _prepare_invoice_line(self, invoice_id=False, invoice_values=False):
vals = super(ContractLine, self)._prepare_invoice_line(
invoice_id=invoice_id, invoice_values=invoice_values)
invoice_line_model = self.env['account.invoice.line'].with_context({
'partner_id': self.contract_id.partner_id.id
})
vals = {} if vals is None else vals
vals['agents'] = invoice_line_model._default_agents()
return vals
2 changes: 2 additions & 0 deletions contract_commission/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module is auto-installed when you have *contract* and *sale_commission*
modules installed.
3 changes: 3 additions & 0 deletions contract_commission/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Pedro M. Baeza <[email protected]>
* Vicent Cubells <[email protected]>
* Marcel Savegnago <[email protected]>
2 changes: 2 additions & 0 deletions contract_commission/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allows to get default commissions for partner in the recurring
invoices generated from contracts.
2 changes: 2 additions & 0 deletions contract_commission/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
When invoicing contracts, the agents assigned to the partner of the contract
will now be assigned to the generated invoices.
Binary file added contract_commission/static/description/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 150cfa2

Please sign in to comment.