mirror of
https://github.com/bringout/odoomates.git
synced 2026-04-18 04:11:59 +02:00
Initial commit: Odoomates Odoo packages (12 packages)
This commit is contained in:
commit
3b38c49bf0
526 changed files with 34983 additions and 0 deletions
46
odoo-bringout-odoomates-om_recurring_payments/README.md
Normal file
46
odoo-bringout-odoomates-om_recurring_payments/README.md
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
# Odoo 16 Recurring Payment
|
||||
|
||||
Odoo 16 Recurring Payment, Recurring Payment In Odoo, Odoo 16 Accounting
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
pip install odoo-bringout-odoomates-om_recurring_payments
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
This addon depends on:
|
||||
- account
|
||||
|
||||
## Manifest Information
|
||||
|
||||
- **Name**: Odoo 16 Recurring Payment
|
||||
- **Version**: 1.0.0
|
||||
- **Category**: Accounting
|
||||
- **License**: LGPL-3
|
||||
- **Installable**: False
|
||||
|
||||
## Source
|
||||
|
||||
Custom addon from bringout-odoomates vendor, addon `om_recurring_payments`.
|
||||
|
||||
## License
|
||||
|
||||
This package maintains the original LGPL-3 license from the addon.
|
||||
|
||||
## Documentation
|
||||
|
||||
- Overview: doc/OVERVIEW.md
|
||||
- Architecture: doc/ARCHITECTURE.md
|
||||
- Models: doc/MODELS.md
|
||||
- Controllers: doc/CONTROLLERS.md
|
||||
- Wizards: doc/WIZARDS.md
|
||||
- Reports: doc/REPORTS.md
|
||||
- Security: doc/SECURITY.md
|
||||
- Install: doc/INSTALL.md
|
||||
- Usage: doc/USAGE.md
|
||||
- Configuration: doc/CONFIGURATION.md
|
||||
- Dependencies: doc/DEPENDENCIES.md
|
||||
- Troubleshooting: doc/TROUBLESHOOTING.md
|
||||
- FAQ: doc/FAQ.md
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
# Architecture
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
U[Users] -->|HTTP| V[Views and QWeb Templates]
|
||||
V --> C[Controllers]
|
||||
V --> W[Wizards – Transient Models]
|
||||
C --> M[Models and ORM]
|
||||
W --> M
|
||||
M --> R[Reports]
|
||||
DX[Data XML] --> M
|
||||
S[Security – ACLs and Groups] -. enforces .-> M
|
||||
|
||||
subgraph Om_recurring_payments Module - om_recurring_payments
|
||||
direction LR
|
||||
M:::layer
|
||||
W:::layer
|
||||
C:::layer
|
||||
V:::layer
|
||||
R:::layer
|
||||
S:::layer
|
||||
DX:::layer
|
||||
end
|
||||
|
||||
classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px
|
||||
```
|
||||
|
||||
Notes
|
||||
- Views include tree/form/kanban templates and report templates.
|
||||
- Controllers provide website/portal routes when present.
|
||||
- Wizards are UI flows implemented with `models.TransientModel`.
|
||||
- Data XML loads data/demo records; Security defines groups and access.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Configuration
|
||||
|
||||
Refer to Odoo settings for om_recurring_payments. Configure related models, access rights, and options as needed.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Controllers
|
||||
|
||||
This module does not define custom HTTP controllers.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# Dependencies
|
||||
|
||||
This addon depends on:
|
||||
|
||||
- [account](../../odoo-bringout-oca-ocb-account)
|
||||
4
odoo-bringout-odoomates-om_recurring_payments/doc/FAQ.md
Normal file
4
odoo-bringout-odoomates-om_recurring_payments/doc/FAQ.md
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# FAQ
|
||||
|
||||
- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged).
|
||||
- Q: How to enable? A: Start server with --addon om_recurring_payments or install in UI.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# Install
|
||||
|
||||
```bash
|
||||
pip install odoo-bringout-odoomates-om_recurring_payments"
|
||||
# or
|
||||
uv pip install odoo-bringout-odoomates-om_recurring_payments"
|
||||
```
|
||||
14
odoo-bringout-odoomates-om_recurring_payments/doc/MODELS.md
Normal file
14
odoo-bringout-odoomates-om_recurring_payments/doc/MODELS.md
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Models
|
||||
|
||||
Detected core models and extensions in om_recurring_payments.
|
||||
|
||||
```mermaid
|
||||
classDiagram
|
||||
class account_recurring_template
|
||||
class recurring_payment
|
||||
class recurring_payment_line
|
||||
```
|
||||
|
||||
Notes
|
||||
- Classes show model technical names; fields omitted for brevity.
|
||||
- Items listed under _inherit are extensions of existing models.
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# Overview
|
||||
|
||||
Packaged Odoo addon: om_recurring_payments. Provides features documented in upstream Odoo 16 under this addon.
|
||||
|
||||
- Source: OCA/OCB 16.0, addon om_recurring_payments
|
||||
- License: LGPL-3
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Reports
|
||||
|
||||
This module does not define custom reports.
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
# Security
|
||||
|
||||
Access control and security definitions in om_recurring_payments.
|
||||
|
||||
## Access Control Lists (ACLs)
|
||||
|
||||
Model access permissions defined in:
|
||||
- **[ir.model.access.csv](../om_recurring_payments/security/ir.model.access.csv)**
|
||||
- 3 model access rules
|
||||
|
||||
## Record Rules
|
||||
|
||||
Row-level security rules defined in:
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
subgraph "Security Layers"
|
||||
A[Users] --> B[Groups]
|
||||
B --> C[Access Control Lists]
|
||||
C --> D[Models]
|
||||
B --> E[Record Rules]
|
||||
E --> F[Individual Records]
|
||||
end
|
||||
```
|
||||
|
||||
Security files overview:
|
||||
- **[ir.model.access.csv](../om_recurring_payments/security/ir.model.access.csv)**
|
||||
- Model access permissions (CRUD rights)
|
||||
|
||||
Notes
|
||||
- Access Control Lists define which groups can access which models
|
||||
- Record Rules provide row-level security (filter records by user/group)
|
||||
- Security groups organize users and define permission sets
|
||||
- All security is enforced at the ORM level by Odoo
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# Troubleshooting
|
||||
|
||||
- Ensure Python and Odoo environment matches repo guidance.
|
||||
- Check database connectivity and logs if startup fails.
|
||||
- Validate that dependent addons listed in DEPENDENCIES.md are installed.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# Usage
|
||||
|
||||
Start Odoo including this addon (from repo root):
|
||||
|
||||
```bash
|
||||
python3 scripts/nix_odoo_web_server.py --db-name mydb --addon om_recurring_payments
|
||||
```
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Wizards
|
||||
|
||||
This module does not include UI wizards.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import models
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
{
|
||||
'name': 'Odoo 16 Recurring Payment',
|
||||
'author': 'Odoo Mates',
|
||||
'category': 'Accounting',
|
||||
'version': '1.0.0',
|
||||
'description': """Odoo 16 Recurring Payment, Recurring Payment In Odoo, Odoo 16 Accounting""",
|
||||
'summary': 'Use recurring payments to handle periodically repeated payments',
|
||||
'sequence': 11,
|
||||
'website': 'https://www.odoomates.tech',
|
||||
'depends': ['account'],
|
||||
'license': 'LGPL-3',
|
||||
'data': [
|
||||
'data/sequence.xml',
|
||||
'data/recurring_cron.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'views/recurring_template_view.xml',
|
||||
'views/recurring_payment_view.xml'
|
||||
],
|
||||
'images': ['static/description/banner.png'],
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<record id="action_generate_recurring_payment" model="ir.cron">
|
||||
<field name="name">Generate Recurring Payments</field>
|
||||
<field name="model_id" ref="model_recurring_payment"/>
|
||||
<field name="state">code</field>
|
||||
<field name="active" eval="True"/>
|
||||
<field name="code">model.action_generate_payment()</field>
|
||||
<field name='interval_number'>1</field>
|
||||
<field name='interval_type'>days</field>
|
||||
<field name="numbercall">-1</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="seq_recurring_payment" model="ir.sequence">
|
||||
<field name="name">Recurring Payments</field>
|
||||
<field name="code">recurring.payment</field>
|
||||
<field name="prefix">RP</field>
|
||||
<field name="padding">3</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
## Module <om_fiscal_year>
|
||||
|
||||
#### 22.07.2022
|
||||
#### Version 16.0.1.0.0
|
||||
##### ADD
|
||||
- initial release
|
||||
|
||||
|
|
@ -0,0 +1,316 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * om_recurring_payments
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-04-26 14:55+0000\n"
|
||||
"PO-Revision-Date: 2024-04-26 14:55+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: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__amount
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__amount
|
||||
msgid "Amount"
|
||||
msgstr "Iznos"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#. odoo-python
|
||||
#: code:addons/om_recurring_payments/models/recurring_payment.py:0
|
||||
#, python-format
|
||||
msgid "Amount Must Be Non-Zero Positive Number"
|
||||
msgstr "Iznos Mora Be Non-Zero Positive Broj"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#. odoo-python
|
||||
#: code:addons/om_recurring_payments/models/recurring_payment.py:0
|
||||
#, python-format
|
||||
msgid "Cannot delete done records !"
|
||||
msgstr "Cannot Obriši Završeno records !"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__company_id
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__company_id
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__company_id
|
||||
msgid "Company"
|
||||
msgstr "Preduzeće"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_template_form
|
||||
msgid "Confirm"
|
||||
msgstr "Potvrdi"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_payment_form
|
||||
msgid "Create Payment"
|
||||
msgstr "Kreiraj plaćanje"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__create_uid
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__create_uid
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Kreirao"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__create_date
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__create_date
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__create_date
|
||||
msgid "Created on"
|
||||
msgstr "Kreirano"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__currency_id
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__currency_id
|
||||
msgid "Currency"
|
||||
msgstr "Valuta"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__date
|
||||
msgid "Date"
|
||||
msgstr "Datum"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__account_recurring_template__recurring_period__days
|
||||
msgid "Days"
|
||||
msgstr "Dani"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__description
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__description
|
||||
msgid "Description"
|
||||
msgstr "Opis"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_payment_form
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_template_form
|
||||
msgid "Description..."
|
||||
msgstr "Opis ..."
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__display_name
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__display_name
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Prikazani naziv"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__account_recurring_template__state__done
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__recurring_payment__state__done
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__recurring_payment_line__state__done
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_payment_form
|
||||
msgid "Done"
|
||||
msgstr "Gotovo"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__account_recurring_template__state__draft
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__recurring_payment__state__draft
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__recurring_payment_line__state__draft
|
||||
msgid "Draft"
|
||||
msgstr "U pripremi"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__date_end
|
||||
msgid "End Date"
|
||||
msgstr "Datum završetka"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__journal_state
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__journal_state
|
||||
msgid "Generate Journal As"
|
||||
msgstr "Generate Dnevnik As"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.actions.server,name:om_recurring_payments.action_generate_recurring_payment_ir_actions_server
|
||||
#: model:ir.cron,cron_name:om_recurring_payments.action_generate_recurring_payment
|
||||
msgid "Generate Recurring Payments"
|
||||
msgstr "Generate Recurring Plaćanja"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__id
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__id
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__id
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__journal_id
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__journal_id
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__journal_id
|
||||
msgid "Journal"
|
||||
msgstr "Vrsta naloga"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template____last_update
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment____last_update
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Zadnje mijenjano"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__write_uid
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__write_uid
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr "Zadnji ažurirao"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__write_date
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__write_date
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr "Zadnje ažurirano"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__account_recurring_template__recurring_period__months
|
||||
msgid "Months"
|
||||
msgstr "Mjeseci"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__name
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__name
|
||||
msgid "Name"
|
||||
msgstr "Naziv:"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#. odoo-python
|
||||
#: code:addons/om_recurring_payments/models/recurring_payment.py:0
|
||||
#: code:addons/om_recurring_payments/models/recurring_payment.py:0
|
||||
#, python-format
|
||||
msgid "New"
|
||||
msgstr "Novi"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__partner_id
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__partner_id
|
||||
msgid "Partner"
|
||||
msgstr "Partner"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__payment_id
|
||||
msgid "Payment"
|
||||
msgstr "Plaćanje"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__payment_type
|
||||
msgid "Payment Type"
|
||||
msgstr "Tip plaćanja"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__account_recurring_template__journal_state__posted
|
||||
msgid "Posted"
|
||||
msgstr "Proknjižen"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__recurring_payment__payment_type__inbound
|
||||
msgid "Receive Money"
|
||||
msgstr "Primi novac"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_payment_form
|
||||
msgid "Recurring Entries"
|
||||
msgstr "Recurring Stavke"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__recurring_interval
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__recurring_interval
|
||||
msgid "Recurring Interval"
|
||||
msgstr "Recurring Interval"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__line_ids
|
||||
msgid "Recurring Lines"
|
||||
msgstr "Recurring Lines"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.actions.act_window,name:om_recurring_payments.action_account_recurring_payment
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__recurring_payment_id
|
||||
#: model:ir.ui.menu,name:om_recurring_payments.menu_recurring_payment
|
||||
#: model:ir.ui.menu,name:om_recurring_payments.menu_recurring_payments
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_payment_form
|
||||
msgid "Recurring Payment"
|
||||
msgstr "Recurring Plaćanje"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model,name:om_recurring_payments.model_recurring_payment_line
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_payment_form
|
||||
msgid "Recurring Payment Line"
|
||||
msgstr "Recurring Plaćanje Line"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model,name:om_recurring_payments.model_recurring_payment
|
||||
msgid "Recurring Payment("
|
||||
msgstr "Recurring Plaćanje("
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_account_recurring_payment_tree
|
||||
msgid "Recurring Payments"
|
||||
msgstr "Recurring Plaćanja"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__recurring_period
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__recurring_period
|
||||
msgid "Recurring Period"
|
||||
msgstr "Recurring Period"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.actions.act_window,name:om_recurring_payments.action_account_recurring_template
|
||||
#: model:ir.model,name:om_recurring_payments.model_account_recurring_template
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__template_id
|
||||
#: model:ir.ui.menu,name:om_recurring_payments.menu_recurring_template
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_account_recurring_template_tree
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_template_form
|
||||
msgid "Recurring Template"
|
||||
msgstr "Recurring Šablon"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__recurring_payment__payment_type__outbound
|
||||
msgid "Send Money"
|
||||
msgstr "Slanje novca"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_payment_form
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_template_form
|
||||
msgid "Set To Draft"
|
||||
msgstr "Stavi u pripremu"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__date_begin
|
||||
msgid "Start Date"
|
||||
msgstr "Početni datum"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__state
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__state
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__state
|
||||
msgid "Status"
|
||||
msgstr "Status"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__account_recurring_template__journal_state__draft
|
||||
msgid "Un Posted"
|
||||
msgstr "Un Proknjiženo"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__account_recurring_template__recurring_period__weeks
|
||||
msgid "Weeks"
|
||||
msgstr "Sedmice"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__account_recurring_template__recurring_period__years
|
||||
msgid "Years"
|
||||
msgstr "Godine"
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#. odoo-python
|
||||
#: code:addons/om_recurring_payments/models/recurring_payment.py:0
|
||||
#, python-format
|
||||
msgid "You cannot Set to Draft as one of the line is already in done state"
|
||||
msgstr "You cannot Set to Nacrt as one of the line is already in Završeno state"
|
||||
|
|
@ -0,0 +1,316 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * om_recurring_payments
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-04-26 14:55+0000\n"
|
||||
"PO-Revision-Date: 2024-04-26 14:55+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: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__amount
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__amount
|
||||
msgid "Amount"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#. odoo-python
|
||||
#: code:addons/om_recurring_payments/models/recurring_payment.py:0
|
||||
#, python-format
|
||||
msgid "Amount Must Be Non-Zero Positive Number"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#. odoo-python
|
||||
#: code:addons/om_recurring_payments/models/recurring_payment.py:0
|
||||
#, python-format
|
||||
msgid "Cannot delete done records !"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__company_id
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__company_id
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__company_id
|
||||
msgid "Company"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_template_form
|
||||
msgid "Confirm"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_payment_form
|
||||
msgid "Create Payment"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__create_uid
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__create_uid
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__create_uid
|
||||
msgid "Created by"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__create_date
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__create_date
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__create_date
|
||||
msgid "Created on"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__currency_id
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__currency_id
|
||||
msgid "Currency"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__date
|
||||
msgid "Date"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__account_recurring_template__recurring_period__days
|
||||
msgid "Days"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__description
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__description
|
||||
msgid "Description"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_payment_form
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_template_form
|
||||
msgid "Description..."
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__display_name
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__display_name
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__account_recurring_template__state__done
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__recurring_payment__state__done
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__recurring_payment_line__state__done
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_payment_form
|
||||
msgid "Done"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__account_recurring_template__state__draft
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__recurring_payment__state__draft
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__recurring_payment_line__state__draft
|
||||
msgid "Draft"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__date_end
|
||||
msgid "End Date"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__journal_state
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__journal_state
|
||||
msgid "Generate Journal As"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.actions.server,name:om_recurring_payments.action_generate_recurring_payment_ir_actions_server
|
||||
#: model:ir.cron,cron_name:om_recurring_payments.action_generate_recurring_payment
|
||||
msgid "Generate Recurring Payments"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__id
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__id
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__journal_id
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__journal_id
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__journal_id
|
||||
msgid "Journal"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template____last_update
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment____last_update
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__write_uid
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__write_uid
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__write_date
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__write_date
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__account_recurring_template__recurring_period__months
|
||||
msgid "Months"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__name
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__name
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#. odoo-python
|
||||
#: code:addons/om_recurring_payments/models/recurring_payment.py:0
|
||||
#: code:addons/om_recurring_payments/models/recurring_payment.py:0
|
||||
#, python-format
|
||||
msgid "New"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__partner_id
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__partner_id
|
||||
msgid "Partner"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__payment_id
|
||||
msgid "Payment"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__payment_type
|
||||
msgid "Payment Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__account_recurring_template__journal_state__posted
|
||||
msgid "Posted"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__recurring_payment__payment_type__inbound
|
||||
msgid "Receive Money"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_payment_form
|
||||
msgid "Recurring Entries"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__recurring_interval
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__recurring_interval
|
||||
msgid "Recurring Interval"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__line_ids
|
||||
msgid "Recurring Lines"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.actions.act_window,name:om_recurring_payments.action_account_recurring_payment
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__recurring_payment_id
|
||||
#: model:ir.ui.menu,name:om_recurring_payments.menu_recurring_payment
|
||||
#: model:ir.ui.menu,name:om_recurring_payments.menu_recurring_payments
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_payment_form
|
||||
msgid "Recurring Payment"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model,name:om_recurring_payments.model_recurring_payment_line
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_payment_form
|
||||
msgid "Recurring Payment Line"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model,name:om_recurring_payments.model_recurring_payment
|
||||
msgid "Recurring Payment("
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_account_recurring_payment_tree
|
||||
msgid "Recurring Payments"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__recurring_period
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__recurring_period
|
||||
msgid "Recurring Period"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.actions.act_window,name:om_recurring_payments.action_account_recurring_template
|
||||
#: model:ir.model,name:om_recurring_payments.model_account_recurring_template
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__template_id
|
||||
#: model:ir.ui.menu,name:om_recurring_payments.menu_recurring_template
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_account_recurring_template_tree
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_template_form
|
||||
msgid "Recurring Template"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__recurring_payment__payment_type__outbound
|
||||
msgid "Send Money"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_payment_form
|
||||
#: model_terms:ir.ui.view,arch_db:om_recurring_payments.view_recurring_template_form
|
||||
msgid "Set To Draft"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__date_begin
|
||||
msgid "Start Date"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_account_recurring_template__state
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment__state
|
||||
#: model:ir.model.fields,field_description:om_recurring_payments.field_recurring_payment_line__state
|
||||
msgid "Status"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__account_recurring_template__journal_state__draft
|
||||
msgid "Un Posted"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__account_recurring_template__recurring_period__weeks
|
||||
msgid "Weeks"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#: model:ir.model.fields.selection,name:om_recurring_payments.selection__account_recurring_template__recurring_period__years
|
||||
msgid "Years"
|
||||
msgstr ""
|
||||
|
||||
#. module: om_recurring_payments
|
||||
#. odoo-python
|
||||
#: code:addons/om_recurring_payments/models/recurring_payment.py:0
|
||||
#, python-format
|
||||
msgid "You cannot Set to Draft as one of the line is already in done state"
|
||||
msgstr ""
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import recurring_template
|
||||
from . import recurring_payment
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from datetime import date
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class RecurringPayment(models.Model):
|
||||
_name = 'recurring.payment'
|
||||
_description = 'Recurring Payment('
|
||||
_rec_name = 'name'
|
||||
|
||||
name = fields.Char('Name', readonly=True)
|
||||
partner_id = fields.Many2one('res.partner', string="Partner", required=True)
|
||||
company_id = fields.Many2one('res.company', string='Company', default=lambda self: self.env.company.id)
|
||||
currency_id = fields.Many2one('res.currency', string='Currency', related='company_id.currency_id')
|
||||
amount = fields.Monetary(string="Amount", currency_field='currency_id')
|
||||
journal_id = fields.Many2one('account.journal', 'Journal',
|
||||
related='template_id.journal_id', readonly=False, required=True)
|
||||
payment_type = fields.Selection([
|
||||
('outbound', 'Send Money'),
|
||||
('inbound', 'Receive Money'),
|
||||
], string='Payment Type', required=True, default='inbound')
|
||||
state = fields.Selection(selection=[('draft', 'Draft'),
|
||||
('done', 'Done')], default='draft', string='Status')
|
||||
date_begin = fields.Date(string='Start Date', required=True)
|
||||
date_end = fields.Date(string='End Date', required=True)
|
||||
template_id = fields.Many2one('account.recurring.template', 'Recurring Template',
|
||||
domain=[('state', '=', 'done')],required=True)
|
||||
recurring_period = fields.Selection(related='template_id.recurring_period')
|
||||
recurring_interval = fields.Integer('Recurring Interval', required=True,
|
||||
related='template_id.recurring_interval', readonly=True)
|
||||
journal_state = fields.Selection(required=True, string='Generate Journal As',
|
||||
related='template_id.journal_state')
|
||||
|
||||
description = fields.Text('Description')
|
||||
line_ids = fields.One2many('recurring.payment.line', 'recurring_payment_id', string='Recurring Lines')
|
||||
|
||||
def compute_next_date(self, date):
|
||||
period = self.recurring_period
|
||||
interval = self.recurring_interval
|
||||
if period == 'days':
|
||||
date += relativedelta(days=interval)
|
||||
elif period == 'weeks':
|
||||
date += relativedelta(weeks=interval)
|
||||
elif period == 'months':
|
||||
date += relativedelta(months=interval)
|
||||
else:
|
||||
date += relativedelta(years=interval)
|
||||
return date
|
||||
|
||||
def action_create_lines(self, date):
|
||||
ids = self.env['recurring.payment.line']
|
||||
vals = {
|
||||
'partner_id': self.partner_id.id,
|
||||
'amount': self.amount,
|
||||
'date': date,
|
||||
'recurring_payment_id': self.id,
|
||||
'journal_id': self.journal_id.id,
|
||||
'currency_id': self.currency_id.id,
|
||||
'state': 'draft'
|
||||
}
|
||||
ids.create(vals)
|
||||
|
||||
def action_done(self):
|
||||
date_begin = self.date_begin
|
||||
while date_begin < self.date_end:
|
||||
date = date_begin
|
||||
self.action_create_lines(date)
|
||||
date_begin = self.compute_next_date(date)
|
||||
self.state = 'done'
|
||||
|
||||
def action_draft(self):
|
||||
if self.line_ids.filtered(lambda t: t.state == 'done'):
|
||||
raise ValidationError(_('You cannot Set to Draft as one of the line is already in done state'))
|
||||
else:
|
||||
for line in self.line_ids:
|
||||
line.unlink()
|
||||
self.state = 'draft'
|
||||
|
||||
def action_generate_payment(self):
|
||||
line_ids = self.env['recurring.payment.line'].search([('date', '<=', date.today()),
|
||||
('state', '!=', 'done')])
|
||||
for line in line_ids:
|
||||
line.action_create_payment()
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
for vals in vals_list:
|
||||
if 'company_id' in vals:
|
||||
vals['name'] = self.env['ir.sequence'].with_context(force_company=vals['company_id']).next_by_code(
|
||||
'recurring.payment') or _('New')
|
||||
else:
|
||||
vals['name'] = self.env['ir.sequence'].next_by_code('recurring.payment') or _('New')
|
||||
return super(RecurringPayment, self).create(vals)
|
||||
|
||||
@api.constrains('amount')
|
||||
def _check_amount(self):
|
||||
if self.amount <= 0:
|
||||
raise ValidationError(_('Amount Must Be Non-Zero Positive Number'))
|
||||
|
||||
def unlink(self):
|
||||
for rec in self:
|
||||
if rec.state == 'done':
|
||||
raise ValidationError(_('Cannot delete done records !'))
|
||||
return super(RecurringPayment, self).unlink()
|
||||
|
||||
|
||||
class RecurringPaymentLine(models.Model):
|
||||
_name = 'recurring.payment.line'
|
||||
_description = 'Recurring Payment Line'
|
||||
|
||||
recurring_payment_id = fields.Many2one('recurring.payment', string="Recurring Payment")
|
||||
partner_id = fields.Many2one('res.partner', 'Partner', required=True)
|
||||
amount = fields.Monetary('Amount', required=True, default=0.0)
|
||||
date = fields.Date('Date', required=True, default=date.today())
|
||||
journal_id = fields.Many2one('account.journal', 'Journal', required=True)
|
||||
company_id = fields.Many2one('res.company', string='Company', default=lambda self: self.env.company.id)
|
||||
currency_id = fields.Many2one('res.currency', string='Currency', related='company_id.currency_id')
|
||||
payment_id = fields.Many2one('account.payment', string='Payment')
|
||||
state = fields.Selection(selection=[('draft', 'Draft'),
|
||||
('done', 'Done')], default='draft', string='Status')
|
||||
|
||||
def action_create_payment(self):
|
||||
vals = {
|
||||
'payment_type': self.recurring_payment_id.payment_type,
|
||||
'amount': self.amount,
|
||||
'currency_id': self.currency_id.id,
|
||||
'journal_id': self.journal_id.id,
|
||||
'company_id': self.company_id.id,
|
||||
'date': self.date,
|
||||
'ref': self.recurring_payment_id.name,
|
||||
'partner_id': self.partner_id.id,
|
||||
}
|
||||
payment = self.env['account.payment'].create(vals)
|
||||
if payment:
|
||||
if self.recurring_payment_id.journal_state == 'posted':
|
||||
payment.action_post()
|
||||
self.write({'state': 'done', 'payment_id': payment.id})
|
||||
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from odoo import models, fields, api
|
||||
|
||||
|
||||
class AccountRecurringTemplate(models.Model):
|
||||
_name = 'account.recurring.template'
|
||||
_description = 'Recurring Template'
|
||||
_rec_name = 'name'
|
||||
|
||||
name = fields.Char('Name', required=True)
|
||||
# account_id = fields.Many2one('account.account', 'Account', required=True)
|
||||
journal_id = fields.Many2one('account.journal', 'Journal', required=True)
|
||||
recurring_period = fields.Selection(selection=[('days', 'Days'),
|
||||
('weeks', 'Weeks'),
|
||||
('months', 'Months'),
|
||||
('years', 'Years')], store=True, required=True)
|
||||
# date_begin = fields.Date(string='Start Date', required=True)
|
||||
# date_end = fields.Date(string='End Date', required=True)
|
||||
description = fields.Text('Description')
|
||||
state = fields.Selection(selection=[('draft', 'Draft'),
|
||||
('done', 'Done')], default='draft', string='Status')
|
||||
journal_state = fields.Selection(selection=[('draft', 'Un Posted'),
|
||||
('posted', 'Posted')],
|
||||
required=True, default='draft', string='Generate Journal As')
|
||||
recurring_interval = fields.Integer('Recurring Interval', default=1, required=True)
|
||||
company_id = fields.Many2one('res.company', string='Company', default=lambda self: self.env.company.id)
|
||||
# next_call = fields.Date(string="Next Call", compute="_compute_next_call")
|
||||
|
||||
@api.depends('date_begin', 'date_end')
|
||||
def _compute_next_call(self):
|
||||
for rec in self:
|
||||
exec_date = rec.date_begin + relativedelta(days=rec.recurring_interval)
|
||||
if exec_date <= rec.date_end:
|
||||
rec.next_call = exec_date
|
||||
else:
|
||||
rec.state = 'done'
|
||||
|
||||
def action_draft(self):
|
||||
for rec in self:
|
||||
rec.state = 'draft'
|
||||
|
||||
def action_done(self):
|
||||
for rec in self:
|
||||
rec.state = 'done'
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_account_recurring_template,access.account.recurring.template,model_account_recurring_template,account.group_account_user,1,1,1,1
|
||||
access_recurring_payment,access.recurring.payment,model_recurring_payment,account.group_account_user,1,1,1,1
|
||||
access_recurring_payment_line,recurring.payment.line,model_recurring_payment_line,account.group_account_invoice,1,1,1,1
|
||||
|
Binary file not shown.
|
After Width: | Height: | Size: 85 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
|
|
@ -0,0 +1,60 @@
|
|||
<section class="oe_container oe_dark">
|
||||
<div class="col-md-12">
|
||||
<h2 class="oe_slogan" style="font-size: 35px;color:#2C0091"><b>Odoo 16 Recurring Payment</b></h2>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<h3 class="oe_slogan" style="color:#332c3c;font-size: 28px;">Recurring Payment</h3>
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="recurring_payment.png" style="height:400px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<h3 class="oe_slogan" style="color:#332c3c;font-size: 28px;">Recurring Template</h3>
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="recurring_template.png" style="height:400px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<hr style="width: 100%;height: 4px;background: #2C0091;margin: 0px 0px;">
|
||||
<hr style="width: 100%;height: 4px;background: #148963;margin: 0px 0px;">
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row ">
|
||||
<div class="oe_slogan text-center">
|
||||
<img src="odoo_mates.png"/>
|
||||
<div style="color:#269900;">
|
||||
<h3 style="color:#2C0091;font-size: 25px;">If you need any help or want more features, just contact us:</h3><br>
|
||||
<h3 style="color:#2C0091;font-size: 20px;">Email: <a href="odoomates@gmail.com">odoomates@gmail.com</a> <br></h3>
|
||||
</div>
|
||||
<div class="oe_slogan">
|
||||
<h2>
|
||||
<a target="_blank" href="https://www.facebook.com/odoomate/" target="new">
|
||||
<i class="fa fa-facebook-square" style="font-size:38px;"></i>
|
||||
</a>
|
||||
<a target="_blank" href="https://twitter.com/odoomates/" target="new">
|
||||
<i class="fa fa-twitter" style="font-size:38px;"></i>
|
||||
</a>
|
||||
<a href="#" target="_blank">
|
||||
<i class="fa fa-linkedin" style="font-size:38px;"></i>
|
||||
</a>
|
||||
<a target="_blank" href="https://www.youtube.com/channel/UCVKlUZP7HAhdQgs-9iTJklQ">
|
||||
<i class="fa fa-youtube-play" style="font-size:38px;"></i>
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<hr style="width: 100%;height: 4px;background: #148963;margin: 0px 0px;">
|
||||
<hr style="width: 100%;height: 4px;background: #2C0091;margin: 0px 0px;">
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 7.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 154 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 87 KiB |
|
|
@ -0,0 +1,107 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="view_recurring_payment_form" model="ir.ui.view">
|
||||
<field name="name">recurring.payment.form</field>
|
||||
<field name="model">recurring.payment</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Recurring Payment">
|
||||
<header>
|
||||
<button name="action_done" states="draft" string="Done" type="object"
|
||||
class="oe_highlight"/>
|
||||
<button name="action_draft" states="done" string="Set To Draft"
|
||||
type="object"/>
|
||||
<field name="state" widget="statusbar"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<h1>
|
||||
<field name="name" attrs="{'invisible': [('name','=', False)]}"/>
|
||||
</h1>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<group>
|
||||
<field name="template_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="payment_type"/>
|
||||
<field name="amount" widget="monetary"/>
|
||||
<field name="journal_id" domain="[('type', 'in', ('bank', 'cash'))]"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="date_begin" widget="daterange"
|
||||
options="{'related_end_date': 'date_end'}"/>
|
||||
<field name="date_end" widget="daterange"
|
||||
options="{'related_start_date': 'date_begin'}"/>
|
||||
<field name="recurring_period"/>
|
||||
<field name="recurring_interval"/>
|
||||
<field name="journal_state"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Recurring Entries">
|
||||
<field name="line_ids">
|
||||
<tree create="0" delete="0" edit="0" decoration-success="state == 'done'">
|
||||
<field name="date"/>
|
||||
<field name="amount"/>
|
||||
<field name="journal_id" domain="[('type', 'in', ('bank', 'cash'))]"/>
|
||||
<field name="currency_id" groups="base.group_multi_company"/>
|
||||
<field name="state" widget="badge"/>
|
||||
<button name="action_create_payment" type="object"
|
||||
string="Create Payment"
|
||||
attrs="{'invisible': [('state', '=', 'done')]}"/>
|
||||
</tree>
|
||||
<form string="Recurring Payment Line" edit="0">
|
||||
<group>
|
||||
<group>
|
||||
<field name="date"/>
|
||||
<field name="amount"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="journal_id"
|
||||
domain="[('type', 'in', ('bank', 'cash'))]"/>
|
||||
<field name="currency_id" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
<group>
|
||||
<field name="description" placeholder="Description..." nolabel="1" colspan="4"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_recurring_payment_tree" model="ir.ui.view">
|
||||
<field name="name">recurring.payment.tree</field>
|
||||
<field name="model">recurring.payment</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Recurring Payments">
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_recurring_payment" model="ir.actions.act_window">
|
||||
<field name="name">Recurring Payment</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">recurring.payment</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_account_recurring_payment_tree"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_recurring_payment"
|
||||
name="Recurring Payment"
|
||||
sequence="10"
|
||||
action="action_account_recurring_payment"
|
||||
groups="account.group_account_user,account.group_account_manager"
|
||||
parent="menu_recurring_payments"/>
|
||||
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="view_recurring_template_form" model="ir.ui.view">
|
||||
<field name="name">account.recurring.template.form</field>
|
||||
<field name="model">account.recurring.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Recurring Template">
|
||||
<header>
|
||||
<button name="action_done" states="draft" string="Confirm" type="object" class="oe_highlight"/>
|
||||
<button name="action_draft" states="done" string="Set To Draft" type="object"/>
|
||||
<field name="state" widget="statusbar"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="journal_id" domain="[('type', 'in', ('bank', 'cash'))]"/>
|
||||
<field name="recurring_period"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="recurring_interval"/>
|
||||
<field name="journal_state"/>
|
||||
<field name="company_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="description" placeholder="Description..." nolabel="1" colspan="4"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_recurring_template_tree" model="ir.ui.view">
|
||||
<field name="name">account.recurring.template.tree</field>
|
||||
<field name="model">account.recurring.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Recurring Template">
|
||||
<field name="name"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_account_recurring_template" model="ir.actions.act_window">
|
||||
<field name="name">Recurring Template</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">account.recurring.template</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_account_recurring_template_tree"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_recurring_payments"
|
||||
name="Recurring Payment"
|
||||
sequence="10"
|
||||
groups="account.group_account_user,account.group_account_manager"
|
||||
parent="account.menu_finance_configuration"/>
|
||||
|
||||
<menuitem id="menu_recurring_template"
|
||||
name="Recurring Template"
|
||||
sequence="20"
|
||||
action="action_account_recurring_template"
|
||||
groups="account.group_account_user,account.group_account_manager"
|
||||
parent="menu_recurring_payments"/>
|
||||
|
||||
</odoo>
|
||||
42
odoo-bringout-odoomates-om_recurring_payments/pyproject.toml
Normal file
42
odoo-bringout-odoomates-om_recurring_payments/pyproject.toml
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
[project]
|
||||
name = "odoo-bringout-odoomates-om_recurring_payments"
|
||||
version = "16.0.0"
|
||||
description = "Odoo 16 Recurring Payment - Use recurring payments to handle periodically repeated payments"
|
||||
authors = [
|
||||
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
|
||||
]
|
||||
dependencies = [
|
||||
"odoo-bringout-oca-ocb-account>=16.0.0",
|
||||
"requests>=2.25.1"
|
||||
]
|
||||
readme = "README.md"
|
||||
requires-python = ">= 3.11"
|
||||
classifiers = [
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Topic :: Office/Business",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
homepage = "https://github.com/bringout/0"
|
||||
repository = "https://github.com/bringout/0"
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[tool.hatch.metadata]
|
||||
allow-direct-references = true
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["om_recurring_payments"]
|
||||
|
||||
[tool.rye]
|
||||
managed = true
|
||||
dev-dependencies = [
|
||||
"pytest>=8.4.1",
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue