Skip to content

Commit

Permalink
[14.0][ADD] Added a account_payment_order_partner module.
Browse files Browse the repository at this point in the history
  • Loading branch information
AmmarOfficewalaSerpentCS committed Jul 9, 2021
1 parent 1d48c21 commit 24141df
Show file tree
Hide file tree
Showing 20 changed files with 834 additions and 0 deletions.
93 changes: 93 additions & 0 deletions account_payment_order_partner/README.rst
@@ -0,0 +1,93 @@
=============================
Account Payment Order Partner
=============================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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%2Fbank--payment-lightgray.png?logo=github
:target: https://github.com/OCA/bank-payment/tree/14.0/account_payment_order_partner
:alt: OCA/bank-payment
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/bank-payment-14-0/bank-payment-14-0-account_payment_order_partner
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/173/14.0
:alt: Try me on Runbot

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

This module adds support for payment orders and debit orders.

**Table of contents**

.. contents::
:local:

Installation
============

This module depends on:

* account_payment_order

This modules is part of the OCA/bank-payment suite.

Usage
=====

You can create a New Payment order if they already another payment already extis.


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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/bank-payment/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/bank-payment/issues/new?body=module:%20account_payment_order_partner%0Aversion:%2014.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
~~~~~~~

* Open Source Integrators

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

* Ammar Officewala <aofficewala@opensourceintegrators.com>

Other credits
~~~~~~~~~~~~~

* Open Source Integrators <https://www.opensourceintegrators.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/bank-payment <https://github.com/OCA/bank-payment/tree/14.0/account_payment_order_partner>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions account_payment_order_partner/__init__.py
@@ -0,0 +1,5 @@
# Copyright (C) 2019 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
from . import wizards
18 changes: 18 additions & 0 deletions account_payment_order_partner/__manifest__.py
@@ -0,0 +1,18 @@
# Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Account Payment Order Partner",
"summary": "Adds partner to payment orders and groups payment orders by partner.",
"version": "14.0.1.0.0",
"category": "Accounting Management",
"website": "https://github.com/OCA/bank-payment",
"author": "Open Source Integrators," "Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": ["account_payment_order"],
"data": [
"views/payment_order_view.xml",
"wizards/account_invoice_payment_line_multi_view.xml",
],
"installable": True,
}
5 changes: 5 additions & 0 deletions account_payment_order_partner/models/__init__.py
@@ -0,0 +1,5 @@
# Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import payment_order
from . import account_move
29 changes: 29 additions & 0 deletions account_payment_order_partner/models/account_move.py
@@ -0,0 +1,29 @@
# Copyright (C) 2021 - TODAY, Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models


class AccountMove(models.Model):
_inherit = "account.move"

def _prepare_new_payment_order(self, payment_mode=None):
res = super()._prepare_new_payment_order()
if self._context.get("is_pyo_as_per_customer"):
res.update({"partner_id": self.partner_id.id})
if self._context.get("is_new_order"):
res.update({"state": "new"})
return res

def get_account_payment_domain(self, payment_mode):
domain = [("payment_mode_id", "=", payment_mode.id)]
if self._context.get("is_new_order"):
domain.append(("state", "=", "new"))
else:
domain.append(("state", "=", "draft"))
if self._context.get("is_pyo_as_per_customer"):
domain.append(("partner_id", "=", self.partner_id.id))
return domain

def create_account_payment_line_new(self):
return self.create_account_payment_line()
11 changes: 11 additions & 0 deletions account_payment_order_partner/models/payment_order.py
@@ -0,0 +1,11 @@
# Copyright (C) 2021 - TODAY, Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class AccountPaymentOrder(models.Model):
_inherit = "account.payment.order"

partner_id = fields.Many2one("res.partner", string="Partner")
state = fields.Selection(selection_add=[("new", "New")])
1 change: 1 addition & 0 deletions account_payment_order_partner/readme/CONTRIBUTORS.rst
@@ -0,0 +1 @@
* Ammar Officewala <aofficewala@opensourceintegrators.com>
1 change: 1 addition & 0 deletions account_payment_order_partner/readme/CREDITS.rst
@@ -0,0 +1 @@
* Open Source Integrators <https://www.opensourceintegrators.com>
1 change: 1 addition & 0 deletions account_payment_order_partner/readme/DESCRIPTION.rst
@@ -0,0 +1 @@
This module adds support for payment orders and debit orders.
5 changes: 5 additions & 0 deletions account_payment_order_partner/readme/INSTALL.rst
@@ -0,0 +1,5 @@
This module depends on:

* account_payment_order

This modules is part of the OCA/bank-payment suite.
1 change: 1 addition & 0 deletions account_payment_order_partner/readme/USAGE.rst
@@ -0,0 +1 @@
You can create a New Payment order if they already another payment already extis.

0 comments on commit 24141df

Please sign in to comment.