def METHOD_NAME(self):
    # Assertion on the constraints to ensure the consistency
    # for company dependent fields
    with self.assertRaises(UserError):
        self.payment_mode_c1.write({"fixed_journal_id": self.journal_c2.id})
    with self.assertRaises(UserError):
        self.payment_mode_c1.write(
            {
                "variable_journal_ids": [
                    (
                        6,
                        0,
                        [
                            self.journal_c1.id,
                            self.journal_c2.id,
                            self.journal_c3.id,
                        ],
                    )
                ]
            }
        )
    with self.assertRaises(ValidationError):
        self.journal_c1.write({"company_id": self.company_2.id})