diff --git a/setup/sustainability_account_accountant/odoo/addons/sustainability_account_accountant b/setup/sustainability_account_accountant/odoo/addons/sustainability_account_accountant deleted file mode 120000 index 379bf9c8..00000000 --- a/setup/sustainability_account_accountant/odoo/addons/sustainability_account_accountant +++ /dev/null @@ -1 +0,0 @@ -../../../../sustainability_account_accountant \ No newline at end of file diff --git a/setup/sustainability_account_accountant/setup.py b/setup/sustainability_account_accountant/setup.py deleted file mode 100644 index 28c57bb6..00000000 --- a/setup/sustainability_account_accountant/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -import setuptools - -setuptools.setup( - setup_requires=['setuptools-odoo'], - odoo_addon=True, -) diff --git a/setup/sustainability_account_asset/odoo/addons/sustainability_account_asset b/setup/sustainability_account_asset/odoo/addons/sustainability_account_asset deleted file mode 120000 index 58d02342..00000000 --- a/setup/sustainability_account_asset/odoo/addons/sustainability_account_asset +++ /dev/null @@ -1 +0,0 @@ -../../../../sustainability_account_asset \ No newline at end of file diff --git a/setup/sustainability_account_asset/setup.py b/setup/sustainability_account_asset/setup.py deleted file mode 100644 index 28c57bb6..00000000 --- a/setup/sustainability_account_asset/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -import setuptools - -setuptools.setup( - setup_requires=['setuptools-odoo'], - odoo_addon=True, -) diff --git a/sustainability_account_accountant/__init__.py b/sustainability_account_accountant/__init__.py deleted file mode 100644 index 5cb1c491..00000000 --- a/sustainability_account_accountant/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import wizards diff --git a/sustainability_account_accountant/__manifest__.py b/sustainability_account_accountant/__manifest__.py deleted file mode 100644 index c8009915..00000000 --- a/sustainability_account_accountant/__manifest__.py +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "Sustainability Accounting (enterprise)", - "category": "Accounting/Sustainability", - "version": "16.0.1.0.0", - "installable": True, - "auto_install": True, - "application": False, - "license": "AGPL-3", - "author": "Open Net Sàrl, Gautier Casabona", - "website": "https://github.com/sustainability-suite/sustainability-odoo", - "depends": ["sustainability", "account_accountant"], - "assets": { - "web.assets_backend": [], - }, - "data": [ - "wizards/account_change_lock_date.xml", - ], - "qweb": [], -} diff --git a/sustainability_account_accountant/wizards/__init__.py b/sustainability_account_accountant/wizards/__init__.py deleted file mode 100644 index f224ba2b..00000000 --- a/sustainability_account_accountant/wizards/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import account_change_lock_date diff --git a/sustainability_account_accountant/wizards/account_change_lock_date.py b/sustainability_account_accountant/wizards/account_change_lock_date.py deleted file mode 100644 index 37e2b083..00000000 --- a/sustainability_account_accountant/wizards/account_change_lock_date.py +++ /dev/null @@ -1,20 +0,0 @@ -import logging - -from odoo import fields, models - -_logger = logging.getLogger(__name__) - - -class AccountChangeLockDate(models.TransientModel): - _inherit = "account.change.lock.date" - - carbon_lock_date = fields.Date( - string="CO2e Computation Lock Date", - default=lambda self: self.env.company.carbon_lock_date, - help="Prevents CO2e computation on entries prior to the defined date.", - ) - - def _prepare_lock_date_values(self): - res = super()._prepare_lock_date_values() - res.update({"carbon_lock_date": self.carbon_lock_date}) - return res diff --git a/sustainability_account_accountant/wizards/account_change_lock_date.xml b/sustainability_account_accountant/wizards/account_change_lock_date.xml deleted file mode 100644 index 15ff4bfd..00000000 --- a/sustainability_account_accountant/wizards/account_change_lock_date.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - view_account_change_lock_date - account.change.lock.date - - - - - - - Prevent CO2 - e - computation for journal entries - - - - - - - - - diff --git a/sustainability_account_asset/__init__.py b/sustainability_account_asset/__init__.py deleted file mode 100644 index 0650744f..00000000 --- a/sustainability_account_asset/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import models diff --git a/sustainability_account_asset/__manifest__.py b/sustainability_account_asset/__manifest__.py deleted file mode 100644 index bc494d29..00000000 --- a/sustainability_account_asset/__manifest__.py +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "Open Net Productivity: Carbon for assets ", - "summary": "Glue module to make Sustainability module compatible with account_asset from Odoo", - "version": "16.0.1.0.0", - "author": "Open Net Sàrl, Gautier Casabona", - "category": "Accounting/Sustainability", - "website": "https://github.com/sustainability-suite/sustainability-odoo", - "depends": ["account_asset", "sustainability"], - "data": [ - "views/account_asset.xml", - ], - "installable": True, - "auto_install": False, - "application": False, - "license": "AGPL-3", -} diff --git a/sustainability_account_asset/models/__init__.py b/sustainability_account_asset/models/__init__.py deleted file mode 100644 index 5e6c81c1..00000000 --- a/sustainability_account_asset/models/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from . import account_asset -from . import account_move diff --git a/sustainability_account_asset/models/account_asset.py b/sustainability_account_asset/models/account_asset.py deleted file mode 100644 index 47c5fb3c..00000000 --- a/sustainability_account_asset/models/account_asset.py +++ /dev/null @@ -1,22 +0,0 @@ -from odoo import api, fields, models - - -class AccountAsset(models.Model): - _inherit = "account.asset" - - carbon_debt = fields.Float(compute="_compute_carbon_debt", string="CO2", store=True) - carbon_currency_id = fields.Many2one( - "res.currency", - compute="_compute_carbon_currency_id", - ) - - def _compute_carbon_currency_id(self): - for asset in self: - asset.carbon_currency_id = self.env.ref( - "sustainability.carbon_kilo", raise_if_not_found=False - ) - - @api.depends("original_move_line_ids.carbon_debt") - def _compute_carbon_debt(self): - for asset in self: - asset.carbon_debt = sum(asset.original_move_line_ids.mapped("carbon_debt")) diff --git a/sustainability_account_asset/models/account_move.py b/sustainability_account_asset/models/account_move.py deleted file mode 100644 index bc802143..00000000 --- a/sustainability_account_asset/models/account_move.py +++ /dev/null @@ -1,27 +0,0 @@ -from odoo import api, models - - -class AccountMove(models.Model): - _inherit = "account.move" - - @api.model - def _prepare_move_for_asset_depreciation(self, vals): - res = super()._prepare_move_for_asset_depreciation(vals) - - """ This method should be called only in draft mode, so we will use original_value """ - asset = self.env["account.asset"].browse(res["asset_id"]) - total_carbon_debt = asset.carbon_debt - total_amount = asset.original_value - - for _dum, _my, line_vals in res["line_ids"]: - carbon_value = ( - total_carbon_debt * line_vals["amount_currency"] / total_amount - ) - sign = ( - -1 if asset.account_depreciation_id.id == line_vals["account_id"] else 1 - ) - line_vals.update( - {"carbon_debt": carbon_value * sign, "carbon_is_locked": True} - ) - - return res diff --git a/sustainability_account_asset/views/account_asset.xml b/sustainability_account_asset/views/account_asset.xml deleted file mode 100644 index 8095c43c..00000000 --- a/sustainability_account_asset/views/account_asset.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - view_account_asset_form - account.asset - - - - - - - - - -