Skip to content

Commit

Permalink
Merge branch '14.0' into 14.0-pms_api_rest
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelpadin committed Nov 24, 2021
2 parents acdb6a4 + 50366ac commit e8f3120
Show file tree
Hide file tree
Showing 80 changed files with 5,279 additions and 610 deletions.
6 changes: 3 additions & 3 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.1.4
_commit: v1.3.6
_src_path: https://github.com/OCA/oca-addons-repo-template.git
ci: Travis
dependency_installation_mode: OCA
generate_requirements_txt: true
include_wkhtmltopdf: false
odoo_version: 14.0
rebel_module_groups: []
repo_description:
All-in-One Property Management System (PMS) focused on medium-sizeations.
repo_description: All-in-One Property Management System (PMS) focused on medium-sizeations.
repo_name: Property Management System
repo_slug: pms
travis_apt_packages: []
Expand Down
9 changes: 8 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
env:
browser: true
es6: true

# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
parserOptions:
ecmaVersion: 2017

overrides:
- files:
- "**/*.esm.js"
parserOptions:
sourceType: module

# Globals available in Odoo that shouldn't produce errorings
globals:
_: readonly
Expand All @@ -14,7 +21,7 @@ globals:
moment: readonly
odoo: readonly
openerp: readonly
Promise: readonly
owl: readonly

# Styling is handled by Prettier, so we only need to enable AST rules;
# see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
# The pylint-odoo version we use here does not support python 3.10
# https://github.com/OCA/oca-addons-repo-template/issues/80
# We also need to pin to an older version of python for older odoo versions
# where we are not using black > 21. Older black versions won't work with
# Python 3.9.8+, and we can't bump black without reformatting.
python-version: "3.9.7"
- uses: pre-commit/action@v2.0.0
69 changes: 69 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: "0 12 * * 0"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- name: Stale PRs and issues policy
uses: actions/stale@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# General settings.
ascending: true
remove-stale-when-updated: true
# Pull Requests settings.
# 120+30 day stale policy for PRs
# * Except PRs marked as "no stale"
days-before-pr-stale: 120
days-before-pr-close: 30
exempt-pr-labels: "no stale"
stale-pr-label: "stale"
stale-pr-message: >
There hasn't been any activity on this pull request in the past 4 months, so
it has been marked as stale and it will be closed automatically if no
further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply
the "no stale" label.
# Issues settings.
# 180+30 day stale policy for open issues
# * Except Issues marked as "no stale"
days-before-issue-stale: 180
days-before-issue-close: 30
exempt-issue-labels: "no stale,needs more information"
stale-issue-label: "stale"
stale-issue-message: >
There hasn't been any activity on this issue in the past 6 months, so it has
been marked as stale and it will be closed automatically if no further
activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to
apply the "no stale" label.
# 15+30 day stale policy for issues pending more information
# * Issues that are pending more information
# * Except Issues marked as "no stale"
- name: Needs more information stale issues policy
uses: actions/stale@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
ascending: true
only-labels: "needs more information"
exempt-issue-labels: "no stale"
days-before-stale: 15
days-before-close: 30
days-before-pr-stale: -1
days-before-pr-close: -1
remove-stale-when-updated: true
stale-issue-label: "stale"
stale-issue-message: >
This issue needs more information and there hasn't been any activity
recently, so it has been marked as stale and it will be closed automatically
if no further activity occurs in the next 30 days.
If you think this is a mistake, please ask a PSC member to remove the "needs
more information" label.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exclude: |
# Files and folders generated by bots, to avoid loops
^setup/|/static/description/index\.html$|
# We don't want to mess with tool-generated files
.svg$|/tests/([^/]+/)?cassettes/|
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
# Maybe reactivate this when all README files include prettier ignore tags?
^README\.md$|
# Library files can have extraneous formatting (even minimized)
Expand Down
10 changes: 0 additions & 10 deletions CONTRIBUTING.md

This file was deleted.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ Available addons
addon | version | maintainers | summary
--- | --- | --- | ---
[multi_pms_properties](multi_pms_properties/) | 14.0.1.0.0 | | Multi Properties Manager
[pms](pms/) | 14.0.2.18.4 | | A property management system
[payment_acquirer_multi_pms_properties](payment_acquirer_multi_pms_properties/) | 14.0.1.0.1 | | Payment Acquirer Multiproperty
[pms](pms/) | 14.0.2.21.0 | | A property management system
[pms_housekeeping](pms_housekeeping/) | 14.0.1.0.1 | | Housekeeping
[pms_l10n_es](pms_l10n_es/) | 14.0.2.0.1 | | PMS Spanish Adaptation
[pms_l10n_es](pms_l10n_es/) | 14.0.2.2.0 | | PMS Spanish Adaptation
[pms_rooming_xls](pms_rooming_xls/) | 14.0.1.0.0 | | Rooming xlsx Management

[//]: # (end addons)
Expand Down
81 changes: 81 additions & 0 deletions payment_acquirer_multi_pms_properties/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
==============================
Payment Acquirer Multiproperty
==============================

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

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

Set the pms property in the payment acquirer to filter on website payments

**Table of contents**

.. contents::
:local:

Usage
=====

Sets one or more properties in the payment acquirer so that payment method is only available for documents of those properties.
If you leave it blank, it will be available to everyone.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/pms/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/pms/issues/new?body=module:%20payment_acquirer_multi_pms_properties%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
~~~~~~~

* Commit [Sun]

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

* `Commit [Sun] <https://www.commitsun.com>`:

* Dario Lodeiros

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/pms <https://github.com/OCA/pms/tree/14.0/payment_acquirer_multi_pms_properties>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions payment_acquirer_multi_pms_properties/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import controllers
18 changes: 18 additions & 0 deletions payment_acquirer_multi_pms_properties/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2009-2020 Noviat.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Payment Acquirer Multiproperty",
"author": "Commit [Sun], Odoo Community Association (OCA)",
"website": "https://github.com/OCA/pms",
"category": "Generic Modules/Property Management System",
"version": "14.0.1.0.1",
"license": "AGPL-3",
"depends": [
"pms",
],
"data": [
"views/payment_acquirer.xml",
],
"installable": True,
}
3 changes: 3 additions & 0 deletions payment_acquirer_multi_pms_properties/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from . import portal
23 changes: 23 additions & 0 deletions payment_acquirer_multi_pms_properties/controllers/portal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo.addons.account.controllers.portal import PortalAccount


class PortalAccount(PortalAccount):
def _invoice_get_page_view_values(self, invoice, access_token, **kwargs):
"""
Override to add the pms property filter
"""
values = super(PortalAccount, self)._invoice_get_page_view_values(
invoice, access_token, **kwargs
)
for acquirer in values["acquirers"]:
if (
acquirer.pms_property_ids
and invoice.pms_property_id.id not in acquirer.pms_property_ids.ids
):
values["acquirers"] -= acquirer
for pms in values["pms"]:
if pms.acquirer_id not in values["acquirers"].ids:
values["pms"] -= pms
return values
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * payment_acquirer_multi_pms_properties
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \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: payment_acquirer_multi_pms_properties
#: model:ir.model.fields,field_description:payment_acquirer_multi_pms_properties.field_payment_acquirer__display_name
msgid "Display Name"
msgstr ""

#. module: payment_acquirer_multi_pms_properties
#: model:ir.model.fields,field_description:payment_acquirer_multi_pms_properties.field_payment_acquirer__id
msgid "ID"
msgstr ""

#. module: payment_acquirer_multi_pms_properties
#: model:ir.model.fields,field_description:payment_acquirer_multi_pms_properties.field_payment_acquirer____last_update
msgid "Last Modified on"
msgstr ""

#. module: payment_acquirer_multi_pms_properties
#: model:ir.model,name:payment_acquirer_multi_pms_properties.model_payment_acquirer
msgid "Payment Acquirer"
msgstr ""

#. module: payment_acquirer_multi_pms_properties
#: model:ir.model.fields,field_description:payment_acquirer_multi_pms_properties.field_payment_acquirer__pms_property_ids
msgid "Properties"
msgstr ""

#. module: payment_acquirer_multi_pms_properties
#: model:ir.model.fields,help:payment_acquirer_multi_pms_properties.field_payment_acquirer__pms_property_ids
msgid ""
"Properties with access to the element; if not set, all properties can access"
msgstr ""
1 change: 1 addition & 0 deletions payment_acquirer_multi_pms_properties/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import payment_acquirer
21 changes: 21 additions & 0 deletions payment_acquirer_multi_pms_properties/models/payment_acquirer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2009-2020 Noviat
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class PaymentAcquirer(models.Model):
_inherit = "payment.acquirer"
_check_pms_properties_auto = True

pms_property_ids = fields.Many2many(
string="Properties",
help="Properties with access to the element;"
" if not set, all properties can access",
required=False,
comodel_name="pms.property",
relation="pms_acquirer_property_rel",
column1="acquirer_id",
column2="property_id",
check_pms_properties=True,
)
3 changes: 3 additions & 0 deletions payment_acquirer_multi_pms_properties/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `Commit [Sun] <https://www.commitsun.com>`:

* Dario Lodeiros
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Set the pms property in the payment acquirer to filter on website payments
2 changes: 2 additions & 0 deletions payment_acquirer_multi_pms_properties/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Sets one or more properties in the payment acquirer so that payment method is only available for documents of those properties.
If you leave it blank, it will be available to everyone.
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 e8f3120

Please sign in to comment.