def test_invoice_line_dimension_by_sequence(self):
        """If dimension is by sequence, I expect,
        - No duplicated sequence
        - Selection allowed by sequence, i.e., Concept then Type
        """
        invoice_line_obj = self.env["account.move.line"]
        # Test no dimension with any sequence
        values = {
            "name": "test no sequence",
            "price_unit": 1,
            "account_id": self.account.id,
            "move_id": self.invoice.id,
            "analytic_account_id": self.analytic_account.id,
        }
        line = invoice_line_obj.create(values)
        res = line._compute_analytic_tags_domain()
        self.assertFalse(res["domain"]["analytic_tag_ids"])
        # Now, user will see tags in sequence 1) Type 2) Concept
        self.dimension_1.write({"required": False, "by_sequence": True, "sequence": 1})
        with self.assertRaises(ValidationError):
            self.dimension_2.write(
                {"required": False, "by_sequence": True, "sequence": 1}
            )
        self.dimension_2.write({"required": False, "by_sequence": True, "sequence": 2})
        # Now, user will see tags in sequence 1) Type 2) Concept
        values = {
            "name": "test sequence",
            "price_unit": 1,
            "account_id": self.account.id,
            "move_id": self.invoice.id,
            "analytic_account_id": self.analytic_account.id,
        }
        line = invoice_line_obj.create(values)
        # First selection, dimension 1 tag shouldn't be in the domain
        res = line._compute_analytic_tags_domain()
        tag_ids = res["domain"]["analytic_tag_ids"][0][2]
        self.assertNotIn(self.analytic_tag_2a.id, tag_ids)
        # Select a dimension 1 tag
        line.analytic_tag_ids += self.analytic_tag_1a
        res = line._compute_analytic_tags_domain()
        tag_ids = res["domain"]["analytic_tag_ids"][0][2]
        # Test that all dimension 1 tags are not in list
        type_tag_ids = [self.analytic_tag_1a.id, self.analytic_tag_1b.id]
        for type_tag_id in type_tag_ids:
            self.assertNotIn(type_tag_id, tag_ids)