From e7eff2881836374a4cd8c9c83eec66d51b53d9c3 Mon Sep 17 00:00:00 2001 From: Kitti U Date: Fri, 10 Sep 2021 20:38:12 +0700 Subject: [PATCH 1/6] [14.0][ADD] account_asset_compute_batch --- account_asset_compute_batch/__init__.py | 2 + account_asset_compute_batch/__manifest__.py | 19 ++ .../data/service_cron.xml | 19 ++ .../models/__init__.py | 4 + .../models/account_asset.py | 16 ++ .../models/account_asset_compute_batch.py | 249 ++++++++++++++++++ .../models/account_asset_line.py | 16 ++ .../models/account_move.py | 25 ++ .../readme/CONTRIBUTORS.rst | 3 + .../readme/DESCRIPTION.rst | 1 + account_asset_compute_batch/readme/USAGE.rst | 14 + .../security/account_asset_security.xml | 12 + .../security/ir.model.access.csv | 3 + .../static/description/icon.png | Bin 0 -> 9455 bytes account_asset_compute_batch/tests/__init__.py | 1 + .../tests/test_account_asset_compute_batch.py | 165 ++++++++++++ .../views/account_asset_compute_batch.xml | 147 +++++++++++ .../wizard/__init__.py | 1 + .../wizard/account_asset_compute.py | 43 +++ .../wizard/account_asset_compute.xml | 41 +++ 20 files changed, 781 insertions(+) create mode 100644 account_asset_compute_batch/__init__.py create mode 100644 account_asset_compute_batch/__manifest__.py create mode 100644 account_asset_compute_batch/data/service_cron.xml create mode 100644 account_asset_compute_batch/models/__init__.py create mode 100644 account_asset_compute_batch/models/account_asset.py create mode 100644 account_asset_compute_batch/models/account_asset_compute_batch.py create mode 100644 account_asset_compute_batch/models/account_asset_line.py create mode 100644 account_asset_compute_batch/models/account_move.py create mode 100644 account_asset_compute_batch/readme/CONTRIBUTORS.rst create mode 100644 account_asset_compute_batch/readme/DESCRIPTION.rst create mode 100644 account_asset_compute_batch/readme/USAGE.rst create mode 100644 account_asset_compute_batch/security/account_asset_security.xml create mode 100644 account_asset_compute_batch/security/ir.model.access.csv create mode 100644 account_asset_compute_batch/static/description/icon.png create mode 100644 account_asset_compute_batch/tests/__init__.py create mode 100644 account_asset_compute_batch/tests/test_account_asset_compute_batch.py create mode 100644 account_asset_compute_batch/views/account_asset_compute_batch.xml create mode 100644 account_asset_compute_batch/wizard/__init__.py create mode 100644 account_asset_compute_batch/wizard/account_asset_compute.py create mode 100644 account_asset_compute_batch/wizard/account_asset_compute.xml diff --git a/account_asset_compute_batch/__init__.py b/account_asset_compute_batch/__init__.py new file mode 100644 index 000000000..9b4296142 --- /dev/null +++ b/account_asset_compute_batch/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizard diff --git a/account_asset_compute_batch/__manifest__.py b/account_asset_compute_batch/__manifest__.py new file mode 100644 index 000000000..094058e77 --- /dev/null +++ b/account_asset_compute_batch/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Assets - Compute Depre. in Batch", + "version": "14.0.1.0.0", + "license": "AGPL-3", + "depends": ["account_asset_management"], + "author": "Ecosoft, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/account-financial-tools", + "category": "Accounting & Finance", + "data": [ + "data/service_cron.xml", + "security/account_asset_security.xml", + "security/ir.model.access.csv", + "wizard/account_asset_compute.xml", + "views/account_asset_compute_batch.xml", + ], +} diff --git a/account_asset_compute_batch/data/service_cron.xml b/account_asset_compute_batch/data/service_cron.xml new file mode 100644 index 000000000..0dffc9de6 --- /dev/null +++ b/account_asset_compute_batch/data/service_cron.xml @@ -0,0 +1,19 @@ + + + + Asset Compute Batch; Post draft batches with auto_compute set to True up to today + 1 + days + -1 + + + + model._autocompute_draft_batches() + code + + diff --git a/account_asset_compute_batch/models/__init__.py b/account_asset_compute_batch/models/__init__.py new file mode 100644 index 000000000..d2fa61daf --- /dev/null +++ b/account_asset_compute_batch/models/__init__.py @@ -0,0 +1,4 @@ +from . import account_asset +from . import account_asset_line +from . import account_move +from . import account_asset_compute_batch diff --git a/account_asset_compute_batch/models/account_asset.py b/account_asset_compute_batch/models/account_asset.py new file mode 100644 index 000000000..081290cb2 --- /dev/null +++ b/account_asset_compute_batch/models/account_asset.py @@ -0,0 +1,16 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class AccountAsset(models.Model): + _inherit = "account.asset" + + def _get_asset_line_domain(self, date_end): + domain = super()._get_asset_line_domain(date_end) + if self.env.context.get("compute_profile_ids"): + domain.append( + ("asset_id.profile_id", "in", self.env.context["compute_profile_ids"]) + ) + return domain diff --git a/account_asset_compute_batch/models/account_asset_compute_batch.py b/account_asset_compute_batch/models/account_asset_compute_batch.py new file mode 100644 index 000000000..ed27749be --- /dev/null +++ b/account_asset_compute_batch/models/account_asset_compute_batch.py @@ -0,0 +1,249 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +import logging +from sys import exc_info +from traceback import format_exception + +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError + +_logger = logging.getLogger(__name__) + + +class AssetComputeBatch(models.Model): + _name = "account.asset.compute.batch" + _inherit = ["mail.thread", "mail.activity.mixin"] + _description = "Compute Depreciation Batch" + _check_company_auto = True + + name = fields.Char( + string="Name", + required=True, + readonly=True, + states={"draft": [("readonly", False)]}, + ) + description = fields.Char( + string="Description", + required=True, + readonly=True, + states={"draft": [("readonly", False)]}, + ) + date_end = fields.Date( + string="Date", + required=True, + default=fields.Date.today, + readonly=True, + states={"draft": [("readonly", False)]}, + help="All depreciation lines prior to this date will be computed", + ) + note = fields.Text(string="Exception Error") + profile_ids = fields.Many2many( + comodel_name="account.asset.profile", + string="Profiles", + readonly=True, + states={"draft": [("readonly", False)]}, + help="Selected asset to run depreciation. Run all profiles if left blank.", + ) + company_id = fields.Many2one( + comodel_name="res.company", + string="Company", + readonly=True, + default=lambda self: self.env.company, + ) + delay_post = fields.Boolean( + string="Delay Posting", + readonly=True, + states={"draft": [("readonly", False)]}, + help="Dalay account posting of newly created journaly entries, " + "by setting auto_post=True, to be posted by cron job", + ) + auto_compute = fields.Boolean( + string="Auto Compute", + readonly=True, + states={"draft": [("readonly", False)]}, + help="Auto compute draft batches with 'Date' up to today, by cron job", + ) + move_line_ids = fields.One2many( + comodel_name="account.move.line", + inverse_name="compute_batch_id", + readonly=True, + ) + state = fields.Selection( + selection=[ + ("draft", "Draft"), + ("computed", "Computed"), + ("exception", "Exception"), + ], + default="draft", + tracking=True, + index=True, + required=True, + readonly=True, + ) + profile_report = fields.One2many( + comodel_name="account.asset.compute.batch.profile.report", + inverse_name="compute_batch_id", + ) + currency_id = fields.Many2one( + comodel_name="res.currency", + default=lambda self: self.env.company.currency_id, + ) + depre_amount = fields.Monetary( + string="Depreciation Amount", + compute="_compute_depre_amount", + ) + _sql_constraints = [ + ("name_uniq", "UNIQUE(name)", "Batch name must be unique!"), + ] + + @api.depends("state") + def _compute_depre_amount(self): + res = self.env["account.move.line"].read_group( + [("compute_batch_id", "in", self.ids)], + ["compute_batch_id", "debit"], + ["compute_batch_id"], + ) + res = {x["compute_batch_id"][0]: x["debit"] for x in res} + for rec in self: + rec.depre_amount = res.get(rec.id) + + def unlink(self): + if self.filtered(lambda l: l.state != "draft"): + raise ValidationError(_("Only draft batch can be deleted!")) + return super().unlink() + + def action_compute(self): + for batch in self: + assets = self.env["account.asset"].search([("state", "=", "open")]) + created_move_ids, error_log = assets.with_context( + compute_batch_id=batch.id, + compute_profile_ids=batch.profile_ids.ids, + delay_post=batch.delay_post, + )._compute_entries(self.date_end, check_triggers=True) + if error_log: + batch.note = _("Compute Assets errors") + ":\n" + error_log + batch.state = "exception" + else: + batch.state = "computed" + + def open_move_lines(self): + self.ensure_one() + action = { + "name": _("Journal Items"), + "view_type": "tree", + "view_mode": "list,form", + "res_model": "account.move.line", + "type": "ir.actions.act_window", + "context": {"search_default_group_by_account": True}, + "domain": [("id", "in", self.move_line_ids.ids)], + } + return action + + def open_moves(self): + self.ensure_one() + action = { + "name": _("Journal Entries"), + "view_type": "tree", + "view_mode": "list,form", + "res_model": "account.move", + "type": "ir.actions.act_window", + "context": {}, + "domain": [("id", "in", self.move_line_ids.mapped("move_id").ids)], + } + return action + + @api.model + def _autocompute_draft_batches(self): + """This method is called from a cron job. + It is used to auto compute account.asset.compute.batch with auto_compute=True + """ + records = self.search( + [ + ("state", "=", "draft"), + ("date_end", "<=", fields.Date.context_today(self)), + ("auto_compute", "=", True), + ] + ) + for ids in self.env.cr.split_for_in_conditions(records.ids, size=1000): + batches = self.browse(ids) + try: + with self.env.cr.savepoint(): + batches.action_compute() + except Exception: + exc_info()[0] + tb = "".join(format_exception(*exc_info())) + batch_ref = ", ".join(batches.mapped("name")) + error_msg = _("Error while processing batches '%s': \n\n%s") % ( + batch_ref, + tb, + ) + _logger.error("%s, %s", self._name, error_msg) + + +class AccountAssetComputeBatchProfileReport(models.Model): + _name = "account.asset.compute.batch.profile.report" + _description = "Depreciation Amount by Profile" + _auto = False + _order = "profile_id desc" + + compute_batch_id = fields.Many2one( + comodel_name="account.asset.compute.batch", + readonly=True, + ) + profile_id = fields.Many2one( + string="Asset Profile", + comodel_name="account.asset.profile", + readonly=True, + ) + currency_id = fields.Many2one( + comodel_name="res.currency", + readonly=True, + ) + amount = fields.Monetary( + string="Amount", + readonly=True, + ) + + @property + def _table_query(self): + return "%s %s %s %s" % ( + self._select(), + self._from(), + self._where(), + self._group_by(), + ) + + @api.model + def _select(self): + return """ + SELECT + min(ml.id) as id, + compute_batch_id, + p.id as profile_id, + currency_id, + sum(debit) as amount + """ + + @api.model + def _from(self): + return """ + FROM account_move_line ml + JOIN account_asset a on a.id = ml.asset_id + JOIN account_asset_profile p on p.id = a.profile_id + """ + + @api.model + def _where(self): + return """ + WHERE + compute_batch_id IS NOT NULL + """ + + @api.model + def _group_by(self): + return """ + GROUP BY + compute_batch_id, + p.id, + currency_id + """ diff --git a/account_asset_compute_batch/models/account_asset_line.py b/account_asset_compute_batch/models/account_asset_line.py new file mode 100644 index 000000000..53de914a7 --- /dev/null +++ b/account_asset_compute_batch/models/account_asset_line.py @@ -0,0 +1,16 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class AccountAssetLine(models.Model): + _inherit = "account.asset.line" + + def _setup_move_line_data(self, depreciation_date, account, ml_type, move): + move_line_data = super()._setup_move_line_data( + depreciation_date, account, ml_type, move + ) + if self.env.context.get("compute_batch_id"): + move_line_data["compute_batch_id"] = self.env.context["compute_batch_id"] + return move_line_data diff --git a/account_asset_compute_batch/models/account_move.py b/account_asset_compute_batch/models/account_move.py new file mode 100644 index 000000000..ced1219ea --- /dev/null +++ b/account_asset_compute_batch/models/account_move.py @@ -0,0 +1,25 @@ +# Copyright 2021 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 AccountMove(models.Model): + _inherit = "account.move" + + def action_post(self): + if self.env.context.get("delay_post"): + self.write({"auto_post": True}) + return False + return super().action_post() + + +class AccountMoveLine(models.Model): + _inherit = "account.move.line" + + compute_batch_id = fields.Many2one( + comodel_name="account.asset.compute.batch", + index=True, + ondelete="set null", + readonly=True, + ) diff --git a/account_asset_compute_batch/readme/CONTRIBUTORS.rst b/account_asset_compute_batch/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..28f80dc65 --- /dev/null +++ b/account_asset_compute_batch/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Ecosoft `_: + + * Kitti U. diff --git a/account_asset_compute_batch/readme/DESCRIPTION.rst b/account_asset_compute_batch/readme/DESCRIPTION.rst new file mode 100644 index 000000000..2609328fe --- /dev/null +++ b/account_asset_compute_batch/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module extend existing "Compute Asset" feature by allowing to create an Compute Asset Batch (record) to track the computation. diff --git a/account_asset_compute_batch/readme/USAGE.rst b/account_asset_compute_batch/readme/USAGE.rst new file mode 100644 index 000000000..a1b73ab7a --- /dev/null +++ b/account_asset_compute_batch/readme/USAGE.rst @@ -0,0 +1,14 @@ +There are 2 ways to create "Compute Asset Batch" + +1. On the Compute Assets wizards, choose "Create Batch" option, + 1.1 Type in batch name and description. + 1.2 Select asset profiles, to limit only some profiles to get computed. + 1.3 Option to "Delay Compute Asset", will only create Batch record for user to execute it later. + +2. Create Compute Asset Batch directly + 2.1 Select date for depreciation + 2.2 Type in batch name and descripton + 2.3 Select asset profiles, to limit only some profiles to get computed. + 2.4 Option to "Auto Compute" if you want to compute this batch by cron job. + 2.4 Option to "Delay Post" if you want to post journal entry by cron job. + 2.5 Click "Compute" button to compute asset. diff --git a/account_asset_compute_batch/security/account_asset_security.xml b/account_asset_compute_batch/security/account_asset_security.xml new file mode 100644 index 000000000..5115213c9 --- /dev/null +++ b/account_asset_compute_batch/security/account_asset_security.xml @@ -0,0 +1,12 @@ + + + + Asset Compute Batch multi-company + + + ['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] + + + diff --git a/account_asset_compute_batch/security/ir.model.access.csv b/account_asset_compute_batch/security/ir.model.access.csv new file mode 100644 index 000000000..f3b696d42 --- /dev/null +++ b/account_asset_compute_batch/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_account_asset_compute_batch_invoice,account.asset.compute.batch,model_account_asset_compute_batch,account.group_account_invoice,1,1,1,1 +access_account_asset_compute_batch_profile_report,access_account_asset_compute_batch_profile_report,model_account_asset_compute_batch_profile_report,base.group_user,1,0,0,0 diff --git a/account_asset_compute_batch/static/description/icon.png b/account_asset_compute_batch/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0tem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b zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4 z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/account_asset_compute_batch/tests/__init__.py b/account_asset_compute_batch/tests/__init__.py new file mode 100644 index 000000000..a8f856b8c --- /dev/null +++ b/account_asset_compute_batch/tests/__init__.py @@ -0,0 +1 @@ +from . import test_account_asset_compute_batch diff --git a/account_asset_compute_batch/tests/test_account_asset_compute_batch.py b/account_asset_compute_batch/tests/test_account_asset_compute_batch.py new file mode 100644 index 000000000..0d48c7eb6 --- /dev/null +++ b/account_asset_compute_batch/tests/test_account_asset_compute_batch.py @@ -0,0 +1,165 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +import time + +from freezegun import freeze_time + +from odoo.tests import tagged +from odoo.tests.common import Form + +from odoo.addons.account_asset_management.tests.test_account_asset_management import ( + TestAssetManagement, +) + + +@tagged("post_install", "-at_install") +class TestAssetComputeBatch(TestAssetManagement): + @classmethod + def setUpClass(cls): + super().setUpClass() + # Create 3 assets from 2 profiles + cls.ict0 = cls.asset_model.create( + { + "state": "draft", + "method_time": "year", + "method_number": 3, + "method_period": "year", + "name": "Laptop", + "code": "PI00101", + "purchase_value": 1500.0, + "profile_id": cls.ict3Y.id, + "date_start": time.strftime("2000-01-01"), + } + ) + cls.ict1 = cls.asset_model.create( + { + "state": "draft", + "method_time": "year", + "method_number": 3, + "method_period": "year", + "name": "Monitor", + "code": "PI00102", + "purchase_value": 2100.0, + "profile_id": cls.ict3Y.id, + "date_start": time.strftime("2000-01-01"), + } + ) + # 2nd asset + cls.vehicle0 = cls.asset_model.create( + { + "state": "draft", + "method_time": "year", + "method_number": 5, + "method_period": "year", + "name": "CEO's Car", + "purchase_value": 12000.0, + "salvage_value": 2000.0, + "profile_id": cls.car5y.id, + "date_start": time.strftime("2000-01-01"), + } + ) + + def _create_compute_wizard(self, use_batch=False, delay_compute=False): + with Form(self.env["account.asset.compute"]) as f: + f.batch_name = "Test Batch" + f.description = "Compute asset with 2 profiles" + f.profile_ids.add(self.ict3Y) + f.profile_ids.add(self.car5y) + f.use_batch = use_batch + f.delay_compute = delay_compute + wiz = f.save() + return wiz + + @freeze_time("2000-12-31") + def test_01_asset_compute_batch_normal(self): + # Confirm 3 assets + self.ict0.validate() + self.assertEqual(self.ict0.depreciation_line_ids[1].amount, 500) + self.ict1.validate() + self.assertEqual(self.ict1.depreciation_line_ids[1].amount, 700) + self.vehicle0.validate() + self.assertEqual(self.vehicle0.depreciation_line_ids[1].amount, 2000) + # Compute Asset, no delay + wiz = self._create_compute_wizard(use_batch=True) + res = wiz.asset_compute() + batch = self.env["account.asset.compute.batch"].browse(res["res_id"]) + self.assertEqual(batch.state, "computed") + self.assertEqual(batch.depre_amount, 3200) + # Test summary amount by profile + batch.invalidate_cache() + self.assertEqual( + {x.profile_id: x.amount for x in batch.profile_report}, + {self.ict3Y: 1200, self.car5y: 2000}, + ) + # Test view moves + # 3 account.move + res = batch.open_moves() + self.assertEqual(len(res["domain"][0][2]), 3) + # 6 account.move.line + res = batch.open_move_lines() + self.assertEqual(len(res["domain"][0][2]), 6) + + @freeze_time("2000-12-31") + def test_02_asset_compute_batch_delay_compute(self): + # Confirm 2 assets + self.ict0.validate() + self.assertEqual(self.ict0.depreciation_line_ids[1].amount, 500) + self.vehicle0.validate() + self.assertEqual(self.vehicle0.depreciation_line_ids[1].amount, 2000) + # Compute Asset, with delay + wiz = self._create_compute_wizard(use_batch=True, delay_compute=True) + res = wiz.asset_compute() + batch = self.env["account.asset.compute.batch"].browse(res["res_id"]) + self.assertEqual(batch.state, "draft") + self.assertEqual(batch.depre_amount, 0) + # Batch is still draft, require to click compute + batch.action_compute() + self.assertEqual(batch.state, "computed") + self.assertEqual(batch.depre_amount, 2500) + + @freeze_time("2000-12-31") + def test_03_asset_compute_batch_delay_compute_delay_post(self): + # Confirm 2 assets + self.ict0.validate() + self.assertEqual(self.ict0.depreciation_line_ids[1].amount, 500) + self.vehicle0.validate() + self.assertEqual(self.vehicle0.depreciation_line_ids[1].amount, 2000) + # Compute Asset, with delay + wiz = self._create_compute_wizard(use_batch=True, delay_compute=True) + res = wiz.asset_compute() + batch = self.env["account.asset.compute.batch"].browse(res["res_id"]) + self.assertEqual(batch.state, "draft") + self.assertEqual(batch.depre_amount, 0) + batch.delay_post = True + # Batch is still draft, require to click compute + batch.action_compute() + self.assertEqual(batch.state, "computed") + self.assertEqual(batch.depre_amount, 2500) + # All account.move is flag as auto_post = True, and state in draft + self.assertTrue(all(batch.move_line_ids.mapped("move_id.auto_post"))) + self.assertTrue( + all( + state == "draft" + for state in batch.move_line_ids.mapped("move_id.state") + ) + ) + + @freeze_time("2000-12-31") + def test_04_asset_compute_batch_auto_compute(self): + # Confirm 2 assets + self.ict0.validate() + self.assertEqual(self.ict0.depreciation_line_ids[1].amount, 500) + self.vehicle0.validate() + self.assertEqual(self.vehicle0.depreciation_line_ids[1].amount, 2000) + # Compute Asset, with delay + wiz = self._create_compute_wizard(use_batch=True, delay_compute=True) + res = wiz.asset_compute() + batch = self.env["account.asset.compute.batch"].browse(res["res_id"]) + self.assertEqual(batch.state, "draft") + self.assertEqual(batch.depre_amount, 0) + batch.auto_compute = True + # Batch will be posted by cron job + batch._autocompute_draft_batches() + self.assertEqual(batch.state, "computed") + self.assertEqual(batch.depre_amount, 2500) diff --git a/account_asset_compute_batch/views/account_asset_compute_batch.xml b/account_asset_compute_batch/views/account_asset_compute_batch.xml new file mode 100644 index 000000000..1216a21e9 --- /dev/null +++ b/account_asset_compute_batch/views/account_asset_compute_batch.xml @@ -0,0 +1,147 @@ + + + account.asset.compute.batch.form + account.asset.compute.batch + 10 + +
+
+
+ +
+
+
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+
+ + + account.asset.compute.batch.tree + account.asset.compute.batch + + + + + + + + + + + + + + search.account.asset.compute.batch.filter + account.asset.compute.batch + + + + + + + + + Compute Asset Batch + account.asset.compute.batch + tree,form + + + + + +
diff --git a/account_asset_compute_batch/wizard/__init__.py b/account_asset_compute_batch/wizard/__init__.py new file mode 100644 index 000000000..07bfe6b38 --- /dev/null +++ b/account_asset_compute_batch/wizard/__init__.py @@ -0,0 +1 @@ +from . import account_asset_compute diff --git a/account_asset_compute_batch/wizard/account_asset_compute.py b/account_asset_compute_batch/wizard/account_asset_compute.py new file mode 100644 index 000000000..32bbf34c6 --- /dev/null +++ b/account_asset_compute_batch/wizard/account_asset_compute.py @@ -0,0 +1,43 @@ +# Copyright 2021 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 AccountAssetCompute(models.TransientModel): + _inherit = "account.asset.compute" + + use_batch = fields.Boolean(string="Create Batch", help="Use batch opton") + batch_name = fields.Char( + string="Batch Name", + help="If batch name is specified, computation will be tracked by a batch", + ) + description = fields.Char( + string="Description", + ) + profile_ids = fields.Many2many( + comodel_name="account.asset.profile", + string="Profiles", + ) + delay_compute = fields.Boolean(string="Delay Compute Asset") + + def asset_compute(self): + if self.use_batch: + vals = { + "date_end": self.date_end, + "name": self.batch_name, + "description": self.description, + "profile_ids": [(4, x.id) for x in self.profile_ids], + } + batch = self.env["account.asset.compute.batch"].create(vals) + if not self.delay_compute: + batch.action_compute() + return { + "name": _("Asset Compute Batch"), + "type": "ir.actions.act_window", + "view_type": "form", + "view_mode": "form", + "res_model": "account.asset.compute.batch", + "res_id": batch.id, + } + return super().asset_compute() diff --git a/account_asset_compute_batch/wizard/account_asset_compute.xml b/account_asset_compute_batch/wizard/account_asset_compute.xml new file mode 100644 index 000000000..c0339052c --- /dev/null +++ b/account_asset_compute_batch/wizard/account_asset_compute.xml @@ -0,0 +1,41 @@ + + + account.asset.compute + account.asset.compute + + + + + + + + + + + + + + + + + + + + + + From be8300c131cfd0adc419260e38b24918e9cbb199 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Thu, 16 Feb 2023 11:20:33 +0000 Subject: [PATCH 2/6] [UPD] Update account_asset_compute_batch.pot --- .../i18n/account_asset_compute_batch.pot | 518 ++++++++++++++++++ 1 file changed, 518 insertions(+) create mode 100644 account_asset_compute_batch/i18n/account_asset_compute_batch.pot diff --git a/account_asset_compute_batch/i18n/account_asset_compute_batch.pot b/account_asset_compute_batch/i18n/account_asset_compute_batch.pot new file mode 100644 index 000000000..4712779ff --- /dev/null +++ b/account_asset_compute_batch/i18n/account_asset_compute_batch.pot @@ -0,0 +1,518 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_asset_compute_batch +# +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: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__message_needaction +msgid "Action Needed" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__activity_ids +msgid "Activities" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__activity_exception_decoration +msgid "Activity Exception Decoration" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__activity_state +msgid "Activity State" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__activity_type_icon +msgid "Activity Type Icon" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute_batch__date_end +msgid "All depreciation lines prior to this date will be computed" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch_profile_report__amount +msgid "Amount" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model,name:account_asset_compute_batch.model_account_asset +msgid "Asset" +msgstr "" + +#. module: account_asset_compute_batch +#: code:addons/account_asset_compute_batch/wizard/account_asset_compute.py:0 +#: model_terms:ir.ui.view,arch_db:account_asset_compute_batch.search_account_asset_compute_batch_filter +#: model_terms:ir.ui.view,arch_db:account_asset_compute_batch.view_account_asset_compute_batch_form +#: model_terms:ir.ui.view,arch_db:account_asset_compute_batch.view_account_asset_compute_batch_tree +#, python-format +msgid "Asset Compute Batch" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.actions.server,name:account_asset_compute_batch.ir_cron_auto_compute_draft_batch_ir_actions_server +#: model:ir.cron,cron_name:account_asset_compute_batch.ir_cron_auto_compute_draft_batch +#: model:ir.cron,name:account_asset_compute_batch.ir_cron_auto_compute_draft_batch +msgid "" +"Asset Compute Batch; Post draft batches with auto_compute set to True up to " +"today" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch_profile_report__profile_id +msgid "Asset Profile" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model,name:account_asset_compute_batch.model_account_asset_line +msgid "Asset depreciation table line" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__message_attachment_count +msgid "Attachment Count" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__auto_compute +msgid "Auto Compute" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute_batch__auto_compute +msgid "Auto compute draft batches with 'Date' up to today, by cron job" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute__batch_name +msgid "Batch Name" +msgstr "" + +#. module: account_asset_compute_batch +#: model_terms:ir.ui.view,arch_db:account_asset_compute_batch.search_account_asset_compute_batch_filter +msgid "Batch Number" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.constraint,message:account_asset_compute_batch.constraint_account_asset_compute_batch_name_uniq +msgid "Batch name must be unique!" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__company_id +msgid "Company" +msgstr "" + +#. module: account_asset_compute_batch +#: model_terms:ir.ui.view,arch_db:account_asset_compute_batch.view_account_asset_compute_batch_form +msgid "Compute" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.actions.act_window,name:account_asset_compute_batch.account_asset_compute_batch_action +#: model:ir.ui.menu,name:account_asset_compute_batch.account_asset_compute_batch_menu +msgid "Compute Asset Batch" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model,name:account_asset_compute_batch.model_account_asset_compute +msgid "Compute Assets" +msgstr "" + +#. module: account_asset_compute_batch +#: code:addons/account_asset_compute_batch/models/account_asset_compute_batch.py:0 +#, python-format +msgid "Compute Assets errors" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch_profile_report__compute_batch_id +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_move_line__compute_batch_id +msgid "Compute Batch" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model,name:account_asset_compute_batch.model_account_asset_compute_batch +msgid "Compute Depreciation Batch" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields.selection,name:account_asset_compute_batch.selection__account_asset_compute_batch__state__computed +msgid "Computed" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute__use_batch +msgid "Create Batch" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__create_uid +msgid "Created by" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__create_date +msgid "Created on" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__currency_id +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch_profile_report__currency_id +msgid "Currency" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute_batch__delay_post +msgid "" +"Dalay account posting of newly created journaly entries, by setting " +"auto_post=True, to be posted by cron job" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__date_end +msgid "Date" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute__delay_compute +msgid "Delay Compute Asset" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__delay_post +msgid "Delay Posting" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__depre_amount +msgid "Depreciation Amount" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model,name:account_asset_compute_batch.model_account_asset_compute_batch_profile_report +msgid "Depreciation Amount by Profile" +msgstr "" + +#. module: account_asset_compute_batch +#: model_terms:ir.ui.view,arch_db:account_asset_compute_batch.view_account_asset_compute_batch_form +msgid "Depreciation By Profile" +msgstr "" + +#. module: account_asset_compute_batch +#: model_terms:ir.ui.view,arch_db:account_asset_compute_batch.view_account_asset_compute_batch_form +msgid "Depreciations" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute__description +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__description +msgid "Description" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset__display_name +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute__display_name +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__display_name +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch_profile_report__display_name +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_line__display_name +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_move__display_name +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_move_line__display_name +msgid "Display Name" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields.selection,name:account_asset_compute_batch.selection__account_asset_compute_batch__state__draft +msgid "Draft" +msgstr "" + +#. module: account_asset_compute_batch +#: code:addons/account_asset_compute_batch/models/account_asset_compute_batch.py:0 +#, python-format +msgid "" +"Error while processing batches '%s': \n" +"\n" +"%s" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields.selection,name:account_asset_compute_batch.selection__account_asset_compute_batch__state__exception +#: model_terms:ir.ui.view,arch_db:account_asset_compute_batch.view_account_asset_compute_batch_form +msgid "Exception" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__note +msgid "Exception Error" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__message_follower_ids +msgid "Followers" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__message_channel_ids +msgid "Followers (Channels)" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__message_partner_ids +msgid "Followers (Partners)" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute_batch__activity_type_icon +msgid "Font awesome icon e.g. fa-tasks" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset__id +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute__id +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__id +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch_profile_report__id +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_line__id +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_move__id +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_move_line__id +msgid "ID" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__activity_exception_icon +msgid "Icon" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute_batch__activity_exception_icon +msgid "Icon to indicate an exception activity." +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute__batch_name +msgid "If batch name is specified, computation will be tracked by a batch" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute_batch__message_needaction +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute_batch__message_unread +msgid "If checked, new messages require your attention." +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute_batch__message_has_error +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute_batch__message_has_sms_error +msgid "If checked, some messages have a delivery error." +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__message_is_follower +msgid "Is Follower" +msgstr "" + +#. module: account_asset_compute_batch +#: code:addons/account_asset_compute_batch/models/account_asset_compute_batch.py:0 +#: model_terms:ir.ui.view,arch_db:account_asset_compute_batch.view_account_asset_compute_batch_form +#, python-format +msgid "Journal Entries" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model,name:account_asset_compute_batch.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model,name:account_asset_compute_batch.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: account_asset_compute_batch +#: code:addons/account_asset_compute_batch/models/account_asset_compute_batch.py:0 +#, python-format +msgid "Journal Items" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset____last_update +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute____last_update +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch____last_update +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch_profile_report____last_update +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_line____last_update +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_move____last_update +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_move_line____last_update +msgid "Last Modified on" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__write_date +msgid "Last Updated on" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__message_main_attachment_id +msgid "Main Attachment" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__message_has_error +msgid "Message Delivery error" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__message_ids +msgid "Messages" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__move_line_ids +msgid "Move Line" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__my_activity_date_deadline +msgid "My Activity Deadline" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__name +msgid "Name" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__activity_date_deadline +msgid "Next Activity Deadline" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__activity_summary +msgid "Next Activity Summary" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__activity_type_id +msgid "Next Activity Type" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__message_needaction_counter +msgid "Number of Actions" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__message_has_error_counter +msgid "Number of errors" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute_batch__message_needaction_counter +msgid "Number of messages which requires an action" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute_batch__message_has_error_counter +msgid "Number of messages with delivery error" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute_batch__message_unread_counter +msgid "Number of unread messages" +msgstr "" + +#. module: account_asset_compute_batch +#: code:addons/account_asset_compute_batch/models/account_asset_compute_batch.py:0 +#, python-format +msgid "Only draft batch can be deleted!" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__profile_report +msgid "Profile Report" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute__profile_ids +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__profile_ids +msgid "Profiles" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__activity_user_id +msgid "Responsible User" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__message_has_sms_error +msgid "SMS Delivery error" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute_batch__profile_ids +msgid "Selected asset to run depreciation. Run all profiles if left blank." +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__state +msgid "State" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute_batch__activity_state +msgid "" +"Status based on activities\n" +"Overdue: Due date is already passed\n" +"Today: Activity date is today\n" +"Planned: Future activities." +msgstr "" + +#. module: account_asset_compute_batch +#: model_terms:ir.ui.view,arch_db:account_asset_compute_batch.view_account_asset_compute_batch_tree +msgid "Total" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute_batch__activity_exception_decoration +msgid "Type of the exception activity on record." +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__message_unread +msgid "Unread Messages" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__message_unread_counter +msgid "Unread Messages Counter" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute__use_batch +msgid "Use batch opton" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,field_description:account_asset_compute_batch.field_account_asset_compute_batch__website_message_ids +msgid "Website Messages" +msgstr "" + +#. module: account_asset_compute_batch +#: model:ir.model.fields,help:account_asset_compute_batch.field_account_asset_compute_batch__website_message_ids +msgid "Website communication history" +msgstr "" From 0754a2c33478c1da73bbab5e82cf7e142cb358a1 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Thu, 16 Feb 2023 11:29:30 +0000 Subject: [PATCH 3/6] [UPD] README.rst --- account_asset_compute_batch/README.rst | 93 ++++ .../static/description/index.html | 446 ++++++++++++++++++ 2 files changed, 539 insertions(+) create mode 100644 account_asset_compute_batch/README.rst create mode 100644 account_asset_compute_batch/static/description/index.html diff --git a/account_asset_compute_batch/README.rst b/account_asset_compute_batch/README.rst new file mode 100644 index 000000000..3467a97c0 --- /dev/null +++ b/account_asset_compute_batch/README.rst @@ -0,0 +1,93 @@ +================================ +Assets - Compute Depre. in Batch +================================ + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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%2Faccount--financial--tools-lightgray.png?logo=github + :target: https://github.com/OCA/account-financial-tools/tree/14.0/account_asset_compute_batch + :alt: OCA/account-financial-tools +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-financial-tools-14-0/account-financial-tools-14-0-account_asset_compute_batch + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/92/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extend existing "Compute Asset" feature by allowing to create an Compute Asset Batch (record) to track the computation. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +There are 2 ways to create "Compute Asset Batch" + +1. On the Compute Assets wizards, choose "Create Batch" option, + 1.1 Type in batch name and description. + 1.2 Select asset profiles, to limit only some profiles to get computed. + 1.3 Option to "Delay Compute Asset", will only create Batch record for user to execute it later. + +2. Create Compute Asset Batch directly + 2.1 Select date for depreciation + 2.2 Type in batch name and descripton + 2.3 Select asset profiles, to limit only some profiles to get computed. + 2.4 Option to "Auto Compute" if you want to compute this batch by cron job. + 2.4 Option to "Delay Post" if you want to post journal entry by cron job. + 2.5 Click "Compute" button to compute asset. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Ecosoft + +Contributors +~~~~~~~~~~~~ + +* `Ecosoft `_: + + * Kitti U. + +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/account-financial-tools `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_asset_compute_batch/static/description/index.html b/account_asset_compute_batch/static/description/index.html new file mode 100644 index 000000000..8bfefbca0 --- /dev/null +++ b/account_asset_compute_batch/static/description/index.html @@ -0,0 +1,446 @@ + + + + + + +Assets - Compute Depre. in Batch + + + +
+

Assets - Compute Depre. in Batch

+ + +

Beta License: AGPL-3 OCA/account-financial-tools Translate me on Weblate Try me on Runbot

+

This module extend existing “Compute Asset” feature by allowing to create an Compute Asset Batch (record) to track the computation.

+

Table of contents

+ +
+

Usage

+

There are 2 ways to create “Compute Asset Batch”

+
    +
  1. +
    On the Compute Assets wizards, choose “Create Batch” option,
    +
    1.1 Type in batch name and description. +1.2 Select asset profiles, to limit only some profiles to get computed. +1.3 Option to “Delay Compute Asset”, will only create Batch record for user to execute it later.
    +
    +
  2. +
  3. +
    Create Compute Asset Batch directly
    +
    2.1 Select date for depreciation +2.2 Type in batch name and descripton +2.3 Select asset profiles, to limit only some profiles to get computed. +2.4 Option to “Auto Compute” if you want to compute this batch by cron job. +2.4 Option to “Delay Post” if you want to post journal entry by cron job. +2.5 Click “Compute” button to compute asset.
    +
    +
  4. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Ecosoft
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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/account-financial-tools project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + From c481f0c3e4468473dd6cb69774d15b731b5d9678 Mon Sep 17 00:00:00 2001 From: ps-tubtim Date: Fri, 17 Feb 2023 11:44:21 +0700 Subject: [PATCH 4/6] [IMP] account_asset_compute_batch: black, isort, prettier --- .../odoo/addons/account_asset_compute_batch | 1 + setup/account_asset_compute_batch/setup.py | 6 ++++++ 2 files changed, 7 insertions(+) create mode 120000 setup/account_asset_compute_batch/odoo/addons/account_asset_compute_batch create mode 100644 setup/account_asset_compute_batch/setup.py diff --git a/setup/account_asset_compute_batch/odoo/addons/account_asset_compute_batch b/setup/account_asset_compute_batch/odoo/addons/account_asset_compute_batch new file mode 120000 index 000000000..191cbfbab --- /dev/null +++ b/setup/account_asset_compute_batch/odoo/addons/account_asset_compute_batch @@ -0,0 +1 @@ +../../../../account_asset_compute_batch \ No newline at end of file diff --git a/setup/account_asset_compute_batch/setup.py b/setup/account_asset_compute_batch/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/account_asset_compute_batch/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) From db6733913fb47757c975bdd14ba14349737c53ed Mon Sep 17 00:00:00 2001 From: ps-tubtim Date: Fri, 17 Feb 2023 13:38:35 +0700 Subject: [PATCH 5/6] [MIG] account_asset_compute_batch: Migration to 15.0 --- account_asset_compute_batch/README.rst | 15 +++++++------- account_asset_compute_batch/__manifest__.py | 2 +- .../models/account_asset_compute_batch.py | 11 +++------- .../readme/CONTRIBUTORS.rst | 1 + .../security/account_asset_security.xml | 20 +++++++++---------- .../static/description/index.html | 9 +++++---- .../views/account_asset_compute_batch.xml | 2 +- .../wizard/account_asset_compute.py | 5 +---- 8 files changed, 29 insertions(+), 36 deletions(-) diff --git a/account_asset_compute_batch/README.rst b/account_asset_compute_batch/README.rst index 3467a97c0..3675a9814 100644 --- a/account_asset_compute_batch/README.rst +++ b/account_asset_compute_batch/README.rst @@ -14,14 +14,14 @@ Assets - Compute Depre. in Batch :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github - :target: https://github.com/OCA/account-financial-tools/tree/14.0/account_asset_compute_batch + :target: https://github.com/OCA/account-financial-tools/tree/15.0/account_asset_compute_batch :alt: OCA/account-financial-tools .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/account-financial-tools-14-0/account-financial-tools-14-0-account_asset_compute_batch + :target: https://translation.odoo-community.org/projects/account-financial-tools-15-0/account-financial-tools-15-0-account_asset_compute_batch :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/92/14.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/account-financial-tools&target_branch=15.0 + :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -56,7 +56,7 @@ Bug Tracker Bugs are tracked on `GitHub 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -74,6 +74,7 @@ Contributors * `Ecosoft `_: * Kitti U. + * Pimolnat Suntian Maintainers ~~~~~~~~~~~ @@ -88,6 +89,6 @@ 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/account-financial-tools `_ project on GitHub. +This module is part of the `OCA/account-financial-tools `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_asset_compute_batch/__manifest__.py b/account_asset_compute_batch/__manifest__.py index 094058e77..fc6ce9a50 100644 --- a/account_asset_compute_batch/__manifest__.py +++ b/account_asset_compute_batch/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Assets - Compute Depre. in Batch", - "version": "14.0.1.0.0", + "version": "15.0.1.0.0", "license": "AGPL-3", "depends": ["account_asset_management"], "author": "Ecosoft, Odoo Community Association (OCA)", diff --git a/account_asset_compute_batch/models/account_asset_compute_batch.py b/account_asset_compute_batch/models/account_asset_compute_batch.py index ed27749be..60482ce7d 100644 --- a/account_asset_compute_batch/models/account_asset_compute_batch.py +++ b/account_asset_compute_batch/models/account_asset_compute_batch.py @@ -17,13 +17,11 @@ class AssetComputeBatch(models.Model): _check_company_auto = True name = fields.Char( - string="Name", required=True, readonly=True, states={"draft": [("readonly", False)]}, ) description = fields.Char( - string="Description", required=True, readonly=True, states={"draft": [("readonly", False)]}, @@ -58,7 +56,6 @@ class AssetComputeBatch(models.Model): "by setting auto_post=True, to be posted by cron job", ) auto_compute = fields.Boolean( - string="Auto Compute", readonly=True, states={"draft": [("readonly", False)]}, help="Auto compute draft batches with 'Date' up to today, by cron job", @@ -173,10 +170,9 @@ class AssetComputeBatch(models.Model): exc_info()[0] tb = "".join(format_exception(*exc_info())) batch_ref = ", ".join(batches.mapped("name")) - error_msg = _("Error while processing batches '%s': \n\n%s") % ( - batch_ref, - tb, - ) + error_msg = _( + "Error while processing batches %(batch_ref)s: \n\n%(tb)s" + ) % {"batch_ref": batch_ref, "tb": tb} _logger.error("%s, %s", self._name, error_msg) @@ -200,7 +196,6 @@ class AccountAssetComputeBatchProfileReport(models.Model): readonly=True, ) amount = fields.Monetary( - string="Amount", readonly=True, ) diff --git a/account_asset_compute_batch/readme/CONTRIBUTORS.rst b/account_asset_compute_batch/readme/CONTRIBUTORS.rst index 28f80dc65..3348ede9d 100644 --- a/account_asset_compute_batch/readme/CONTRIBUTORS.rst +++ b/account_asset_compute_batch/readme/CONTRIBUTORS.rst @@ -1,3 +1,4 @@ * `Ecosoft `_: * Kitti U. + * Pimolnat Suntian diff --git a/account_asset_compute_batch/security/account_asset_security.xml b/account_asset_compute_batch/security/account_asset_security.xml index 5115213c9..cba72449a 100644 --- a/account_asset_compute_batch/security/account_asset_security.xml +++ b/account_asset_compute_batch/security/account_asset_security.xml @@ -1,12 +1,10 @@ - - - - Asset Compute Batch multi-company - - - ['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] - - + + + Asset Compute Batch multi-company + + + ['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] + diff --git a/account_asset_compute_batch/static/description/index.html b/account_asset_compute_batch/static/description/index.html index 8bfefbca0..5034e9cdb 100644 --- a/account_asset_compute_batch/static/description/index.html +++ b/account_asset_compute_batch/static/description/index.html @@ -3,7 +3,7 @@ - + Assets - Compute Depre. in Batch