Link the tasks with project in Materilas request

In order to monitor the budget for each tasks I have added the Tasks as an accounting Dimensions, and I need to show only the tasks related to the selected project.

Is that possible?

And Also do you think it will work or do you have a better idea than this?

Possible, you have to apply the Overriding Link Query By Custom Script

Sample code(Client script):

frappe.ui.form.on('DocType', {
    refresh: function(frm) {
        frm.set_query("task", function() {
            return {
                "filters": {
                    "project": frm.doc.project
                }
            };
        });
    },
});