diff --git a/account_asset_management/__manifest__.py b/account_asset_management/__manifest__.py index c429a0a44d3b..05473c3d0c76 100644 --- a/account_asset_management/__manifest__.py +++ b/account_asset_management/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Assets Management", - "version": "15.0.1.0.1", + "version": "16.0.1.0.0", "license": "AGPL-3", "depends": ["account", "report_xlsx_helper"], "excludes": ["account_asset"], diff --git a/account_asset_management/models/account_asset.py b/account_asset_management/models/account_asset.py index 57826f37ef8f..c43080b517ae 100644 --- a/account_asset_management/models/account_asset.py +++ b/account_asset_management/models/account_asset.py @@ -32,7 +32,7 @@ def __init__(self, *args, **argv): class AccountAsset(models.Model): _name = "account.asset" - _inherit = ["mail.thread", "mail.activity.mixin"] + _inherit = ["mail.thread", "mail.activity.mixin", "analytic.mixin"] _description = "Asset" _order = "date_start desc, code, name" _check_company_auto = True @@ -268,20 +268,6 @@ class AccountAsset(models.Model): store=True, readonly=True, ) - account_analytic_id = fields.Many2one( - comodel_name="account.analytic.account", - string="Analytic account", - compute="_compute_account_analytic_id", - readonly=False, - store=True, - ) - analytic_tag_ids = fields.Many2many( - comodel_name="account.analytic.tag", - string="Analytic tags", - compute="_compute_analytic_tag_ids", - readonly=False, - store=True, - ) carry_forward_missed_depreciations = fields.Boolean( string="Accumulate missed depreciations", help="""If create an asset in a fiscal period that is now closed @@ -392,9 +378,9 @@ def _compute_account_analytic_id(self): asset.account_analytic_id = asset.profile_id.account_analytic_id @api.depends("profile_id") - def _compute_analytic_tag_ids(self): + def _compute_analytic_distribution(self): for asset in self: - asset.analytic_tag_ids = asset.profile_id.analytic_tag_ids + asset.analytic_distribution = asset.profile_id.analytic_distribution @api.constrains("method", "method_time") def _check_method(self): @@ -441,14 +427,18 @@ def _onchange_purchase_salvage_value(self): {"amount": self.depreciation_base, "line_date": self.date_start} ) - @api.model - def create(self, vals): - asset = super().create(vals) - if self.env.context.get("create_asset_from_move_line"): - # Trigger compute of depreciation_base - asset.salvage_value = 0.0 - asset._create_first_asset_line() - return asset + @api.model_create_multi + def create(self, vals_list): + asset_ids = super().create(vals_list) + create_asset_from_move_line = self.env.context.get( + "create_asset_from_move_line" + ) + for asset_id in asset_ids: + if create_asset_from_move_line: + # Trigger compute of depreciation_base + asset_id.salvage_value = 0.0 + asset_id._create_first_asset_line() + return asset_ids def write(self, vals): res = super().write(vals) diff --git a/account_asset_management/models/account_asset_group.py b/account_asset_management/models/account_asset_group.py index 10ec693c654d..0263cd38152c 100644 --- a/account_asset_management/models/account_asset_group.py +++ b/account_asset_management/models/account_asset_group.py @@ -16,7 +16,7 @@ class AccountAssetGroup(models.Model): name = fields.Char(size=64, required=True, index=True) code = fields.Char(index=True) - parent_path = fields.Char(index=True) + parent_path = fields.Char(index=True, unaccent=False) company_id = fields.Many2one( comodel_name="res.company", string="Company", diff --git a/account_asset_management/models/account_asset_line.py b/account_asset_management/models/account_asset_line.py index 80dba7461ba2..087b49f88019 100644 --- a/account_asset_management/models/account_asset_line.py +++ b/account_asset_management/models/account_asset_line.py @@ -229,16 +229,14 @@ def _setup_move_line_data(self, depreciation_date, account, ml_type, move): """Prepare data to be propagated to account.move.line""" asset = self.asset_id amount = self.amount - analytic_id = False - analytic_tags = self.env["account.analytic.tag"] + analytic_distribution = False if ml_type == "depreciation": debit = amount < 0 and -amount or 0.0 credit = amount > 0 and amount or 0.0 elif ml_type == "expense": debit = amount > 0 and amount or 0.0 credit = amount < 0 and -amount or 0.0 - analytic_id = asset.account_analytic_id.id - analytic_tags = asset.analytic_tag_ids + analytic_distribution = asset.analytic_distribution move_line_data = { "name": asset.name, "ref": self.name, @@ -248,8 +246,7 @@ def _setup_move_line_data(self, depreciation_date, account, ml_type, move): "debit": debit, "journal_id": asset.profile_id.journal_id.id, "partner_id": asset.partner_id.id, - "analytic_account_id": analytic_id, - "analytic_tag_ids": [(4, tag.id) for tag in analytic_tags], + "analytic_distribution": analytic_distribution, "date": depreciation_date, "asset_id": asset.id, } diff --git a/account_asset_management/models/account_asset_profile.py b/account_asset_management/models/account_asset_profile.py index 1c9a0036c7ff..a6be523fb93f 100644 --- a/account_asset_management/models/account_asset_profile.py +++ b/account_asset_management/models/account_asset_profile.py @@ -7,18 +7,13 @@ class AccountAssetProfile(models.Model): _name = "account.asset.profile" + _inherit = "analytic.mixin" _check_company_auto = True _description = "Asset profile" _order = "name" name = fields.Char(size=64, required=True, index=True) note = fields.Text() - account_analytic_id = fields.Many2one( - comodel_name="account.analytic.account", string="Analytic account" - ) - analytic_tag_ids = fields.Many2many( - comodel_name="account.analytic.tag", string="Analytic tags" - ) account_asset_id = fields.Many2one( comodel_name="account.account", domain="[('deprecated', '=', False), ('company_id', '=', company_id)]", @@ -207,17 +202,22 @@ def _compute_prorrata(self): if profile.method_time != "year": profile.prorata = True - @api.model - def create(self, vals): - if vals.get("method_time") != "year" and not vals.get("prorata"): - vals["prorata"] = True - profile = super().create(vals) - acc_id = vals.get("account_asset_id") - if acc_id: - account = self.env["account.account"].browse(acc_id) - if not account.asset_profile_id: - account.write({"asset_profile_id": profile.id}) - return profile + @api.model_create_multi + def create(self, vals_list): + for vals in vals_list: + if vals.get("method_time") != "year" and not vals.get("prorata"): + vals["prorata"] = True + profile_ids = super().create(vals_list) + account_dict = {} + for profile_id in profile_ids.filtered( + lambda x: not x.account_asset_id.asset_profile_id + ): + account_dict.setdefault(profile_id.account_asset_id, []).append( + profile_id.id + ) + for account, profile_list in account_dict.items(): + account.write({"asset_profile_id": profile_list[-1]}) + return profile_ids def write(self, vals): if vals.get("method_time"): diff --git a/account_asset_management/models/account_move.py b/account_asset_management/models/account_move.py index 9ad4b4c565fb..1748fbc4819d 100644 --- a/account_asset_management/models/account_move.py +++ b/account_asset_management/models/account_move.py @@ -81,7 +81,7 @@ def _prepare_asset_vals(self, aml): "purchase_value": depreciation_base, "partner_id": aml.partner_id, "date_start": self.date, - "account_analytic_id": aml.analytic_account_id, + "analytic_distribution": aml.analytic_distribution, } def action_post(self): @@ -105,7 +105,6 @@ def action_post(self): for key, val in vals.items(): setattr(asset_form, key, val) asset = asset_form.save() - asset.analytic_tag_ids = aml.analytic_tag_ids aml.with_context( allow_asset=True, allow_asset_removal=True ).asset_id = asset.id @@ -256,7 +255,5 @@ def _expand_asset_line(self): qty = self.quantity name = self.name aml.write({"quantity": 1, "name": "{} {}".format(name, 1)}) - aml._onchange_price_subtotal() for i in range(1, int(qty)): aml.copy({"name": "{} {}".format(name, i + 1)}) - aml.move_id._onchange_invoice_line_ids() diff --git a/account_asset_management/report/account_asset_report_xls.py b/account_asset_management/report/account_asset_report_xls.py index 063e491d763b..64550cb95ecc 100644 --- a/account_asset_management/report/account_asset_report_xls.py +++ b/account_asset_management/report/account_asset_report_xls.py @@ -5,7 +5,6 @@ from odoo import _, models from odoo.exceptions import UserError -from odoo.tools.translate import translate from odoo.addons.report_xlsx_helper.report.report_xlsx_format import ( FORMATS, @@ -23,11 +22,6 @@ class AssetReportXlsx(models.AbstractModel): _description = "Dynamic XLS asset report generator" _inherit = "report.report_xlsx.abstract" - def _(self, src): - lang = self.env.context.get("lang", "en_US") - val = translate(self.env.cr, IR_TRANSLATION_NAME, "report", lang, src) or src - return val - def _get_ws_params(self, wb, data, wiz): self._get_assets(wiz, data) s1 = self._get_acquisition_ws_params(wb, data, wiz) @@ -39,18 +33,18 @@ def _get_asset_template(self): asset_template = { "account": { - "header": {"type": "string", "value": self._("Account")}, + "header": {"type": "string", "value": _("Account")}, "asset": { "type": "string", "value": self._render( "asset.profile_id.account_asset_id.code or ''" ), }, - "totals": {"type": "string", "value": self._("Totals")}, + "totals": {"type": "string", "value": _("Totals")}, "width": 20, }, "name": { - "header": {"type": "string", "value": self._("Name")}, + "header": {"type": "string", "value": _("Name")}, "asset_group": { "type": "string", "value": self._render("group.name or ''"), @@ -59,7 +53,7 @@ def _get_asset_template(self): "width": 40, }, "code": { - "header": {"type": "string", "value": self._("Reference")}, + "header": {"type": "string", "value": _("Reference")}, "asset_group": { "type": "string", "value": self._render("group.code or ''"), @@ -68,7 +62,7 @@ def _get_asset_template(self): "width": 20, }, "date_start": { - "header": {"type": "string", "value": self._("Asset Start Date")}, + "header": {"type": "string", "value": _("Asset Start Date")}, "asset": { "value": self._render("asset.date_start or ''"), "format": FORMATS["format_tcell_date_left"], @@ -76,7 +70,7 @@ def _get_asset_template(self): "width": 20, }, "date_remove": { - "header": {"type": "string", "value": self._("Asset Removal Date")}, + "header": {"type": "string", "value": _("Asset Removal Date")}, "asset": { "value": self._render("asset.date_remove or ''"), "format": FORMATS["format_tcell_date_left"], @@ -86,7 +80,7 @@ def _get_asset_template(self): "depreciation_base": { "header": { "type": "string", - "value": self._("Depreciation Base"), + "value": _("Depreciation Base"), "format": FORMATS["format_theader_yellow_right"], }, "asset_group": { @@ -109,7 +103,7 @@ def _get_asset_template(self): "salvage_value": { "header": { "type": "string", - "value": self._("Salvage Value"), + "value": _("Salvage Value"), "format": FORMATS["format_theader_yellow_right"], }, "asset_group": { @@ -132,7 +126,7 @@ def _get_asset_template(self): "purchase_value": { "header": { "type": "string", - "value": self._("Purchase Value"), + "value": _("Purchase Value"), "format": FORMATS["format_theader_yellow_right"], }, "asset_group": { @@ -155,7 +149,7 @@ def _get_asset_template(self): "period_start_value": { "header": { "type": "string", - "value": self._("Period Start Value"), + "value": _("Period Start Value"), "format": FORMATS["format_theader_yellow_right"], }, "asset_group": { @@ -178,7 +172,7 @@ def _get_asset_template(self): "period_depr": { "header": { "type": "string", - "value": self._("Period Depreciation"), + "value": _("Period Depreciation"), "format": FORMATS["format_theader_yellow_right"], }, "asset_group": { @@ -201,7 +195,7 @@ def _get_asset_template(self): "period_end_value": { "header": { "type": "string", - "value": self._("Period End Value"), + "value": _("Period End Value"), "format": FORMATS["format_theader_yellow_right"], }, "asset_group": { @@ -224,7 +218,7 @@ def _get_asset_template(self): "period_end_depr": { "header": { "type": "string", - "value": self._("Tot. Depreciation"), + "value": _("Tot. Depreciation"), "format": FORMATS["format_theader_yellow_right"], }, "asset_group": { @@ -247,7 +241,7 @@ def _get_asset_template(self): "method": { "header": { "type": "string", - "value": self._("Comput. Method"), + "value": _("Comput. Method"), "format": FORMATS["format_theader_yellow_center"], }, "asset": { @@ -260,7 +254,7 @@ def _get_asset_template(self): "method_number": { "header": { "type": "string", - "value": self._("Number of Years"), + "value": _("Number of Years"), "format": FORMATS["format_theader_yellow_center"], }, "asset": { @@ -273,7 +267,7 @@ def _get_asset_template(self): "prorata": { "header": { "type": "string", - "value": self._("Prorata Temporis"), + "value": _("Prorata Temporis"), "format": FORMATS["format_theader_yellow_center"], }, "asset": { @@ -286,7 +280,7 @@ def _get_asset_template(self): "state": { "header": { "type": "string", - "value": self._("Status"), + "value": _("Status"), "format": FORMATS["format_theader_yellow_center"], }, "asset": { diff --git a/account_asset_management/tests/test_account_asset_management.py b/account_asset_management/tests/test_account_asset_management.py index c65f74fcd2e3..2a3a4405b359 100644 --- a/account_asset_management/tests/test_account_asset_management.py +++ b/account_asset_management/tests/test_account_asset_management.py @@ -83,19 +83,20 @@ def setUpClass(cls): ) # analytic configuration - cls.env.user.write( - { - "groups_id": [ - (4, cls.env.ref("analytic.group_analytic_accounting").id), - (4, cls.env.ref("analytic.group_analytic_tags").id), - ], - } + cls.env.user.groups_id += cls.env.ref("analytic.group_analytic_accounting") + + cls.default_plan = cls.env["account.analytic.plan"].create( + {"name": "Default", "company_id": False} ) cls.analytic_account = cls.env["account.analytic.account"].create( - {"name": "test_analytic_account"} + {"name": "test_analytic_account", "plan_id": cls.default_plan.id} ) - cls.analytic_tag = cls.env["account.analytic.tag"].create( - {"name": "test_analytic_tag"} + + cls.distribution = cls.env["account.analytic.distribution.model"].create( + { + "partner_id": cls.partner.id, + "analytic_distribution": {cls.analytic_account.id: 100}, + } ) # Asset Profile 1 @@ -130,8 +131,12 @@ def setUpClass(cls): "method_time": "year", "method_number": 5, "method_period": "year", - "account_analytic_id": cls.analytic_account.id, - "analytic_tag_ids": [(4, cls.analytic_tag.id)], + "analytic_distribution": cls.distribution._get_distribution( + { + "partner_id": cls.partner.id, + } + ), + # "account_analytic_id": cls.analytic_account.id, } ) @@ -181,7 +186,7 @@ def test_00_fiscalyear_lock_date_month(self): } ) asset.compute_depreciation_board() - asset.refresh() + asset.invalidate_recordset() self.assertTrue(asset.depreciation_line_ids[0].init_entry) for i in range(1, 36): self.assertFalse(asset.depreciation_line_ids[i].init_entry) @@ -199,7 +204,7 @@ def test_00_fiscalyear_lock_date_year(self): } ) asset.compute_depreciation_board() - asset.refresh() + asset.invalidate_recordset() self.assertTrue(asset.depreciation_line_ids[0].init_entry) for i in range(1, 4): self.assertFalse(asset.depreciation_line_ids[i].init_entry) @@ -249,17 +254,17 @@ def test_01_nonprorata_basic(self): self.assertEqual(len(vehicle0.depreciation_line_ids), 1) # Compute the depreciation boards ict0.compute_depreciation_board() - ict0.refresh() + ict0.invalidate_recordset() self.assertEqual(len(ict0.depreciation_line_ids), 4) self.assertEqual(ict0.depreciation_line_ids[1].amount, 500) vehicle0.compute_depreciation_board() - vehicle0.refresh() + vehicle0.invalidate_recordset() self.assertEqual(len(vehicle0.depreciation_line_ids), 6) self.assertEqual(vehicle0.depreciation_line_ids[1].amount, 2000) # Post the first depreciation line ict0.validate() ict0.depreciation_line_ids[1].create_move() - ict0.refresh() + ict0.invalidate_recordset() self.assertEqual(ict0.state, "open") self.assertEqual(ict0.value_depreciated, 500) self.assertEqual(ict0.value_residual, 1000) @@ -271,11 +276,15 @@ def test_01_nonprorata_basic(self): lambda line: line.account_id.internal_group == "expense" ) self.assertEqual( - expense_line.analytic_account_id.id, - self.analytic_account.id, + expense_line.analytic_distribution, + self.distribution._get_distribution( + { + "partner_id": self.partner.id, + } + ) + or False, ) - self.assertEqual(expense_line.analytic_tag_ids.id, self.analytic_tag.id) - vehicle0.refresh() + vehicle0.invalidate_recordset() self.assertEqual(vehicle0.state, "open") self.assertEqual(vehicle0.value_depreciated, 2000) self.assertEqual(vehicle0.value_residual, 8000) @@ -296,7 +305,7 @@ def test_02_prorata_basic(self): } ) asset.compute_depreciation_board() - asset.refresh() + asset.invalidate_recordset() if calendar.isleap(date.today().year): self.assertAlmostEqual( asset.depreciation_line_ids[1].amount, 46.44, places=2 @@ -347,7 +356,7 @@ def test_03_proprata_init_prev_year(self): ) self.assertEqual(len(asset.depreciation_line_ids), 2) asset.compute_depreciation_board() - asset.refresh() + asset.invalidate_recordset() # check the depreciated value is the initial value self.assertAlmostEqual(asset.value_depreciated, 325.08, places=2) # check computed values in the depreciation board @@ -399,7 +408,7 @@ def test_04_prorata_init_cur_year(self): ) self.assertEqual(len(asset.depreciation_line_ids), 2) asset.compute_depreciation_board() - asset.refresh() + asset.invalidate_recordset() # check the depreciated value is the initial value self.assertAlmostEqual(asset.value_depreciated, 279.44, places=2) # check computed values in the depreciation board @@ -440,7 +449,7 @@ def test_05_degressive_linear(self): } ) asset.compute_depreciation_board() - asset.refresh() + asset.invalidate_recordset() # check values in the depreciation board self.assertEqual(len(asset.depreciation_line_ids), 5) self.assertAlmostEqual(asset.depreciation_line_ids[1].amount, 400.00, places=2) @@ -464,7 +473,7 @@ def test_05_degressive_linear(self): } ) asset.compute_depreciation_board() - asset.refresh() + asset.invalidate_recordset() # check values in the depreciation board self.assertEqual(len(asset.depreciation_line_ids), 15) # lines prior to asset start period are grouped in the first entry @@ -491,7 +500,7 @@ def test_06_degressive_limit(self): } ) asset.compute_depreciation_board() - asset.refresh() + asset.invalidate_recordset() # check values in the depreciation board self.assertEqual(len(asset.depreciation_line_ids), 6) self.assertAlmostEqual(asset.depreciation_line_ids[1].amount, 400.00, places=2) @@ -517,7 +526,7 @@ def test_07_linear_limit(self): } ) asset.compute_depreciation_board() - asset.refresh() + asset.invalidate_recordset() # check values in the depreciation board self.assertEqual(len(asset.depreciation_line_ids), 6) self.assertAlmostEqual(asset.depreciation_line_ids[1].amount, 200.00, places=2) @@ -553,7 +562,7 @@ def test_08_asset_removal(self): } ) wiz.remove() - asset.refresh() + asset.invalidate_recordset() self.assertEqual(len(asset.depreciation_line_ids), 3) self.assertAlmostEqual(asset.depreciation_line_ids[1].amount, 81.46, places=2) self.assertAlmostEqual(asset.depreciation_line_ids[2].amount, 4918.54, places=2) @@ -569,7 +578,6 @@ def test_09_asset_from_invoice(self): invoice.invoice_line_ids[0].write( {"quantity": 2, "asset_profile_id": asset_profile.id} ) - invoice._onchange_invoice_line_ids() invoice.action_post() # get all asset after invoice validation current_asset = self.env["account.asset"].search([]) @@ -648,7 +656,7 @@ def test_12_prorata_days_calc(self): } ) asset.compute_depreciation_board() - asset.refresh() + asset.invalidate_recordset() day_rate = 3333 / 1827 # 3333 / 1827 depreciation days for i in range(1, 10): self.assertAlmostEqual( @@ -680,7 +688,7 @@ def test_13_use_leap_year(self): } ) asset.compute_depreciation_board() - asset.refresh() + asset.invalidate_recordset() for i in range(2, 11): self.assertAlmostEqual( asset.depreciation_line_ids[i].amount, 166.58, places=2 @@ -709,7 +717,7 @@ def test_14_not_use_leap_year(self): } ) asset.compute_depreciation_board() - asset.refresh() + asset.invalidate_recordset() for _i in range(1, 11): self.assertAlmostEqual( asset.depreciation_line_ids[1].amount, 166.67, places=2 @@ -781,7 +789,7 @@ def test_16_use_number_of_depreciations(self): } ) asset.compute_depreciation_board() - asset.refresh() + asset.invalidate_recordset() for _i in range(1, 11): self.assertAlmostEqual( asset.depreciation_line_ids[1].amount, 166.67, places=2 @@ -813,7 +821,7 @@ def test_17_carry_forward_missed_depreciations(self): self.company_data["company"].fiscalyear_lock_date = time.strftime("2021-05-31") # Compute the depreciation board asset.compute_depreciation_board() - asset.refresh() + asset.invalidate_recordset() d_lines = asset.depreciation_line_ids init_lines = d_lines[1:6] # Jan to May entries are before the lock date -> marked as init @@ -850,12 +858,12 @@ def test_18_reverse_entries(self): ict0.profile_id.allow_reversal = True # compute the depreciation boards ict0.compute_depreciation_board() - ict0.refresh() + ict0.invalidate_recordset() # post the first depreciation line ict0.validate() ict0.depreciation_line_ids[1].create_move() original_move = ict0.depreciation_line_ids[1].move_id - ict0.refresh() + ict0.invalidate_recordset() self.assertEqual(ict0.state, "open") self.assertEqual(ict0.value_depreciated, 500) self.assertEqual(ict0.value_residual, 1000) @@ -876,7 +884,7 @@ def test_18_reverse_entries(self): reverse_wizard = wiz.save() reverse_wizard.write({"journal_id": depreciation_line.move_id.journal_id.id}) reverse_wizard.reverse_move() - ict0.refresh() + ict0.invalidate_recordset() self.assertEqual(ict0.value_depreciated, 0) self.assertEqual(ict0.value_residual, 1500) self.assertEqual(len(original_move.reversal_move_id), 1) @@ -899,17 +907,17 @@ def test_19_unlink_entries(self): ) # compute the depreciation boards ict0.compute_depreciation_board() - ict0.refresh() + ict0.invalidate_recordset() # post the first depreciation line ict0.validate() ict0.depreciation_line_ids[1].create_move() original_move_id = ict0.depreciation_line_ids[1].move_id.id - ict0.refresh() + ict0.invalidate_recordset() self.assertEqual(ict0.state, "open") self.assertEqual(ict0.value_depreciated, 500) self.assertEqual(ict0.value_residual, 1000) ict0.depreciation_line_ids[1].unlink_move() - ict0.refresh() + ict0.invalidate_recordset() self.assertEqual(ict0.value_depreciated, 0) self.assertEqual(ict0.value_residual, 1500) move = self.env["account.move"].search([("id", "=", original_move_id)]) diff --git a/account_asset_management/views/account_account.xml b/account_asset_management/views/account_account.xml index dec4cc503ce8..62379426c767 100644 --- a/account_asset_management/views/account_account.xml +++ b/account_asset_management/views/account_account.xml @@ -5,7 +5,7 @@ account.account - + diff --git a/account_asset_management/views/account_asset.xml b/account_asset_management/views/account_asset.xml index 377bce2518ef..f0181adddaa5 100644 --- a/account_asset_management/views/account_asset.xml +++ b/account_asset_management/views/account_asset.xml @@ -56,36 +56,40 @@ - - - - - - - - - - + + + + + + + + + + + + + + @@ -94,7 +98,7 @@ - - - - - - + + + + + + + + + @@ -257,11 +261,6 @@ - @@ -298,7 +297,6 @@ - @@ -372,12 +370,6 @@ domain="" context="{'group_by': 'state'}" /> - + account.asset.group.form @@ -7,6 +8,7 @@ + @@ -25,10 +27,15 @@ account.asset.group + - + diff --git a/account_asset_management/views/account_asset_profile.xml b/account_asset_management/views/account_asset_profile.xml index 0268f534b685..07a9fe22462f 100644 --- a/account_asset_management/views/account_asset_profile.xml +++ b/account_asset_management/views/account_asset_profile.xml @@ -12,72 +12,72 @@ bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}" /> - - - - - - - + + + + + + - - - - + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + - - - - + + + - - - - + + - - + - - - + + @@ -96,7 +96,6 @@ - - account.move.form.account.asset.management account.move - @@ -30,11 +30,12 @@ name="asset_profile_id" attrs="{'column_invisible': [('parent.move_type', 'not in', ('in_invoice', 'in_refund'))]}" optional="show" + groups="account.group_account_invoice" /> @@ -46,10 +47,11 @@ name="asset_profile_id" domain="[('company_id','=', parent.company_id)]" optional="hide" + groups="account.group_account_invoice" /> diff --git a/account_asset_management/views/account_move_line.xml b/account_asset_management/views/account_move_line.xml index 73a2a1691fe8..fafedd65a53d 100644 --- a/account_asset_management/views/account_move_line.xml +++ b/account_asset_management/views/account_move_line.xml @@ -5,7 +5,7 @@ account.move.line - + 0 and balance or 0.0, "partner_id": partner_id, diff --git a/account_asset_management/wizard/account_asset_remove.xml b/account_asset_management/wizard/account_asset_remove.xml index 4c885a208afd..027e77b12ba3 100644 --- a/account_asset_management/wizard/account_asset_remove.xml +++ b/account_asset_management/wizard/account_asset_remove.xml @@ -5,30 +5,35 @@ account.asset.remove - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 000000000000..e69de29bb2d1