-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
174 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,52 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
==================== | ||
Fixed Asset Disposal | ||
==================== | ||
|
||
|
||
Installation | ||
============ | ||
|
||
To install this module, you need to: | ||
|
||
1. Clone the branch 11.0 of the repository https://github.com/open-synergy/opnsynid-fixed-asset | ||
2. Add the path to this repository in your configuration (addons-path) | ||
3. Update the module list | ||
4. Go to menu *Apps -> Apps* | ||
5. Search For *Fixed Asset Disposal* | ||
6. Install the module | ||
|
||
Roadmap | ||
======= | ||
|
||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/open-synergy/opnsynid-fixed-asset/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. | ||
|
||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Michael Viriyananda <[email protected]> | ||
* Andhitia Rama <[email protected]> | ||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: https://simetri-sinergi.id/logo.png | ||
:alt: PT. Simetri Sinergi Indonesia | ||
:target: https://simetri-sinergi.id.com | ||
|
||
This module is maintained by the PT. Simetri Sinergi Indonesia. |
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,7 @@ | ||
# Copyright 2022 OpenSynergy Indonesia | ||
# Copyright 2022 PT. Simetri Sinergi Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
from . import ( | ||
models, | ||
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,20 @@ | ||
# Copyright 2022 OpenSynergy Indonesia | ||
# Copyright 2022 PT. Simetri Sinergi Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
# pylint: disable=locally-disabled, manifest-required-author | ||
{ | ||
"name": "Fixed Asset + Queue Integration", | ||
"version": "11.0.1.0.0", | ||
"website": "https://simetri-sinergi.id", | ||
"author": "OpenSynergy Indonesia", | ||
"license": "AGPL-3", | ||
"installable": True, | ||
"depends": [ | ||
"fixed_asset", | ||
"queue_job_batch", | ||
], | ||
"data": [ | ||
"wizards/mass_depreciation_views.xml", | ||
], | ||
"demo": [], | ||
} |
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,7 @@ | ||
# Copyright 2022 OpenSynergy Indonesia | ||
# Copyright 2022 PT. Simetri Sinergi Indonesia | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import ( | ||
fixed_asset_depreciation_line, | ||
) |
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,19 @@ | ||
# Copyright 2022 OpenSynergy Indonesia | ||
# Copyright 2022 PT. Simetri Sinergi Indonesia | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
|
||
from odoo import api, models | ||
|
||
from odoo.addons.queue_job.job import job | ||
|
||
|
||
class FixedAssetDepreciationLine(models.Model): | ||
_name = "fixed.asset.depreciation.line" | ||
_inherit = "fixed.asset.depreciation.line" | ||
|
||
@api.multi | ||
@job | ||
def create_move(self): | ||
_super = super(FixedAssetDepreciationLine, self) | ||
_super.create_move() |
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,7 @@ | ||
# Copyright 2022 OpenSynergy Indonesia | ||
# Copyright 2022 PT. Simetri Sinergi Indonesia | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import ( | ||
mass_depreciation, | ||
) |
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,36 @@ | ||
# Copyright 2022 OpenSynergy Indonesia | ||
# Copyright 2022 PT. Simetri Sinergi Indonesia | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from odoo import _, api, models | ||
|
||
|
||
class AccountMassDepreciation(models.TransientModel): | ||
_name = "account.mass_depreciation" | ||
_inherit = "account.mass_depreciation" | ||
|
||
@api.multi | ||
def action_confirm_queue(self): | ||
for wizard in self: | ||
wizard._mass_depreciate_queue() | ||
|
||
@api.multi | ||
def _mass_depreciate_queue(self): | ||
self.ensure_one() | ||
obj_line = self.env["fixed.asset.depreciation.line"] | ||
criteria = [ | ||
("asset_id.state", "=", "open"), | ||
("type", "=", "depreciate"), | ||
("init_entry", "=", False), | ||
("move_id", "=", False), | ||
("line_date", "=", self.date), | ||
] | ||
if self.category_ids: | ||
criteria.append(("asset_id.category_id", "in", self.category_ids.ids)) | ||
|
||
for line in obj_line.search(criteria): | ||
description = "Fixed asset depreciation ID %s %s" % ( | ||
line.asset_id.id, | ||
self.date, | ||
) | ||
line.with_context().with_delay(description=_(description)).create_move() |
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="account_mass_depreciation_view_form" model="ir.ui.view"> | ||
<field name="name">Mass Depreciation + Queue</field> | ||
<field name="model">account.mass_depreciation</field> | ||
<field name="inherit_id" ref="fixed_asset.account_mass_depreciation_view_form" /> | ||
<field name="arch" type="xml"> | ||
<data> | ||
<xpath expr="//button[@name='action_confirm']" position="after"> | ||
or | ||
<button | ||
string="Confirm with queue" | ||
name="action_confirm_queue" | ||
type="object" | ||
class="oe_highlight" | ||
confirm="Are you sure?" | ||
/> | ||
</xpath> | ||
</data> | ||
</field> | ||
</record> | ||
|
||
|
||
|
||
</odoo> |