[FIX] mail: activity view model domain
Steps to reproduce: - Go to activity view. - Schedule an activity for one record. (Say 8 records are available) - Schedule an activity for the second time. (Again 8 records are available) - Try to schedule an activity for the 3rd time. (Only 2 records are available) Issue: Since 7682286, the existing props of activity model are being passed as params while scheduling an activity. Currently, `["activity_ids", "!=", false]` is being pushed to the domain of activity model in order to display only those records on which activities have been set. As a result, after you schedule activities more than once, `["activity_ids", "!=", false]` domain gets applied and the list of records available for scheduling activity is restricted from the third time onwards. Fix: This commit passes the props from searchModel as params to the 'load' method while scheduling activity, instead of existing props, to ensure that the existing params are applied as well as all records are accessible for scheduling an activity, in `searchCreateDialog` (i.e.["activity_ids", "!=", false] condition is not added as domain). Task : 3721750 closes odoo/odoo#155700 X-original-commit: 339df084567206cff8a5487bbe9dec249671244a Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com> Signed-off-by: Khushi Patel (khpa) <khpa@odoo.com>
This commit is contained in:
@@ -54,6 +54,11 @@ export class ActivityController extends Component {
|
||||
});
|
||||
}
|
||||
|
||||
getSearchProps() {
|
||||
const { comparision, context, domain, groupBy, orderBy } = this.env.searchModel;
|
||||
return { comparision, context, domain, groupBy, orderBy };
|
||||
}
|
||||
|
||||
scheduleActivity() {
|
||||
this.dialog.add(SelectCreateDialog, {
|
||||
resModel: this.props.resModel,
|
||||
@@ -64,7 +69,7 @@ export class ActivityController extends Component {
|
||||
context: this.props.context,
|
||||
onSelected: async (resIds) => {
|
||||
await this.activity.schedule(this.props.resModel, resIds);
|
||||
this.model.load(this.props);
|
||||
this.model.load(this.getSearchProps());
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -86,7 +91,7 @@ export class ActivityController extends Component {
|
||||
},
|
||||
},
|
||||
{
|
||||
onClose: () => this.model.load(this.props),
|
||||
onClose: () => this.model.load(this.getSearchProps()),
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -119,7 +124,7 @@ export class ActivityController extends Component {
|
||||
archInfo: this.props.archInfo,
|
||||
groupedActivities: this.model.activityData.grouped_activities,
|
||||
scheduleActivity: this.scheduleActivity.bind(this),
|
||||
onReloadData: () => this.model.load(this.props),
|
||||
onReloadData: () => this.model.load(this.getSearchProps()),
|
||||
onEmptyCell: this.openActivityFormView.bind(this),
|
||||
onSendMailTemplate: this.sendMailTemplate.bind(this),
|
||||
openRecord: this.openRecord.bind(this),
|
||||
|
||||
Reference in New Issue
Block a user