generated from OCA/oca-addons-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #412 from ecosoft-odoo/14.0-add-budget_control_job
[14.0][ADD] budget_control_job
- Loading branch information
Showing
17 changed files
with
207 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import models | ||
from . import wizards |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright 2023 Ecosoft Co., Ltd. (http://ecosoft.co.th) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Budget Control - Queue Job", | ||
"version": "14.0.1.0.0", | ||
"category": "Accounting", | ||
"license": "AGPL-3", | ||
"author": "Ecosoft, Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/account-budgeting", | ||
"depends": ["budget_control", "queue_job"], | ||
"data": [ | ||
"wizards/budget_commit_forward_info_view.xml", | ||
"wizards/budget_balance_forward_info_view.xml", | ||
"views/budget_commit_forward_view.xml", | ||
"views/budget_balance_forward_view.xml", | ||
], | ||
"installable": True, | ||
"maintainers": ["Saran440"], | ||
"development_status": "Alpha", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import budget_balance_forward | ||
from . import budget_commit_forward |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2023 Ecosoft Co., Ltd. (http://ecosoft.co.th) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import _, fields, models | ||
|
||
|
||
class BudgetBalanceForward(models.Model): | ||
_inherit = "budget.balance.forward" | ||
|
||
job_uuid = fields.Char( | ||
string="Job UUID", | ||
readonly=True, | ||
) | ||
|
||
def action_budget_balance_forward_job(self): | ||
description = _("Creating forward balance budget with id %s") % (self.id,) | ||
job = self.with_delay(description=description).action_budget_balance_forward() | ||
# Update UUID in forward commit | ||
self.job_uuid = job.uuid | ||
return "Job created with uuid {}".format(job.uuid) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import _, fields, models | ||
|
||
|
||
class BudgetCommitForward(models.Model): | ||
_inherit = "budget.commit.forward" | ||
|
||
job_uuid = fields.Char( | ||
string="Job UUID", | ||
readonly=True, | ||
) | ||
|
||
def action_budget_commit_forward_job(self): | ||
description = _("Creating forward commit budget with id %s") % (self.id,) | ||
job = self.with_delay(description=description).action_budget_commit_forward() | ||
# Update UUID in forward commit | ||
self.job_uuid = job.uuid | ||
return "Job created with uuid {}".format(job.uuid) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Saran Lim. <saranl@ecosoft.co.th> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This module add job queue for run carry forward with many records. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Create forward balance/commit > review > Forward Budget Balance/Commitment with will select forward with job queue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
<record id="view_budget_balance_forward_form" model="ir.ui.view"> | ||
<field name="name">view.budget.balance.forward.form</field> | ||
<field name="model">budget.balance.forward</field> | ||
<field | ||
name="inherit_id" | ||
ref="budget_control.view_budget_balance_forward_form" | ||
/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//group/group[2]" position="inside"> | ||
<field name="job_uuid" /> | ||
</xpath> | ||
<xpath | ||
expr="//button[@name='preview_budget_balance_forward_info']" | ||
position="attributes" | ||
> | ||
<attribute name="states" /> | ||
<attribute | ||
name="attrs" | ||
>{'invisible': ['|', ('state', '!=', 'review'), ('job_uuid', '!=', False)]}</attribute> | ||
</xpath> | ||
|
||
</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
<record id="view_budget_commit_forward_form" model="ir.ui.view"> | ||
<field name="name">view.budget.commit.forward.form</field> | ||
<field name="model">budget.commit.forward</field> | ||
<field name="inherit_id" ref="budget_control.view_budget_commit_forward_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//group/group[2]" position="inside"> | ||
<field name="job_uuid" /> | ||
</xpath> | ||
<xpath | ||
expr="//button[@name='preview_budget_commit_forward_info']" | ||
position="attributes" | ||
> | ||
<attribute name="states" /> | ||
<attribute | ||
name="attrs" | ||
>{'invisible': ['|', ('state', '!=', 'review'), ('job_uuid', '!=', False)]}</attribute> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import budget_commit_forward_info | ||
from . import budget_balance_forward_info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright 2023 Ecosoft Co., Ltd. (http://ecosoft.co.th) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import models | ||
|
||
|
||
class BudgetBalanceForwardInfo(models.TransientModel): | ||
_inherit = "budget.balance.forward.info" | ||
|
||
def action_budget_balance_forward_job(self): | ||
self.ensure_one() | ||
self.forward_id.action_budget_balance_forward_job() |
26 changes: 26 additions & 0 deletions
26
budget_control_job/wizards/budget_balance_forward_info_view.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- Copyright 2023 Ecosoft - (http://ecosoft.co.th) | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
<odoo> | ||
<record id="view_budget_balance_forward_info_form" model="ir.ui.view"> | ||
<field name="name">budget.balance.forward.info.form</field> | ||
<field name="model">budget.balance.forward.info</field> | ||
<field | ||
name="inherit_id" | ||
ref="budget_control.view_budget_balance_forward_info_form" | ||
/> | ||
<field name="arch" type="xml"> | ||
<xpath | ||
expr="//footer/button[@name='action_budget_balance_forward']" | ||
position="after" | ||
> | ||
<button | ||
name="action_budget_balance_forward_job" | ||
string="Forward Budget Balance with job queue" | ||
class="btn-primary" | ||
type="object" | ||
/> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright 2023 Ecosoft Co., Ltd. (http://ecosoft.co.th) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import models | ||
|
||
|
||
class BudgetCommitForwardInfo(models.TransientModel): | ||
_inherit = "budget.commit.forward.info" | ||
|
||
def action_budget_commit_forward_job(self): | ||
self.ensure_one() | ||
self.forward_id.action_budget_commit_forward_job() |
26 changes: 26 additions & 0 deletions
26
budget_control_job/wizards/budget_commit_forward_info_view.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- Copyright 2023 Ecosoft - (http://ecosoft.co.th) | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
<odoo> | ||
<record id="view_budget_commit_forward_info_form" model="ir.ui.view"> | ||
<field name="name">budget.commit.forward.info.form</field> | ||
<field name="model">budget.commit.forward.info</field> | ||
<field | ||
name="inherit_id" | ||
ref="budget_control.view_budget_commit_forward_info_form" | ||
/> | ||
<field name="arch" type="xml"> | ||
<xpath | ||
expr="//footer/button[@name='action_budget_commit_forward']" | ||
position="after" | ||
> | ||
<button | ||
name="action_budget_commit_forward_job" | ||
string="Forward Budget Commitment with job queue" | ||
class="btn-primary" | ||
type="object" | ||
/> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../budget_control_job |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |