Skip to content

Commit

Permalink
[ADD] settlement_commission
Browse files Browse the repository at this point in the history
  • Loading branch information
AungKoKoLin1997 committed Oct 10, 2024
1 parent 7d81f42 commit 6f6cd09
Show file tree
Hide file tree
Showing 10 changed files with 549 additions and 0 deletions.
56 changes: 56 additions & 0 deletions settlement_commission/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
=====================
Settlement Commission
=====================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4b31183fac7a4538d7c62ca00c06cb2471e199ddcf21af91733ddc49f5f4d262
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-qrtl%2Frmm--custom-lightgray.png?logo=github
:target: https://github.com/qrtl/rmm-custom/tree/15.0/settlement_commission
:alt: qrtl/rmm-custom

|badge1| |badge2| |badge3|

This module adds the commission_ids field to the settlement and includes
it in the views.

**Table of contents**

.. contents::
:local:

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

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

* Quartile

Maintainers
-----------

This module is part of the `qrtl/rmm-custom <https://github.com/qrtl/rmm-custom/tree/15.0/settlement_commission>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions settlement_commission/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions settlement_commission/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2024 Quartile
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Settlement Commission",
"category": "commission",
"version": "15.0.1.0.0",
"author": "Quartile",
"website": "https://www.quartile.co",
"license": "AGPL-3",
"depends": ["commission"],
"data": [
"views/commission_settlement_views.xml",
],
"installable": True,
}
1 change: 1 addition & 0 deletions settlement_commission/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import commission_settlement
17 changes: 17 additions & 0 deletions settlement_commission/models/commission_settlement.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 Quartile
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class CommissionSettlement(models.Model):
_inherit = "commission.settlement"

commission_ids = fields.Many2many(
comodel_name="commission", compute="_compute_commission_ids", store=True
)

@api.depends("line_ids.commission_id")
def _compute_commission_ids(self):
for rec in self:
rec.commission_ids = rec.line_ids.mapped("commission_id")
2 changes: 2 additions & 0 deletions settlement_commission/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module adds the commission_ids field to the settlement and includes
it in the views.
Loading

0 comments on commit 6f6cd09

Please sign in to comment.