diff --git a/account_sale_stock_report_non_billed/models/stock_move.py b/account_sale_stock_report_non_billed/models/stock_move.py index a0203ec2c0c3..9f421336e981 100644 --- a/account_sale_stock_report_non_billed/models/stock_move.py +++ b/account_sale_stock_report_non_billed/models/stock_move.py @@ -127,6 +127,8 @@ def _compute_not_invoiced_values(self): moves_in_date = invoices_not_cancel.mapped("move_line_ids").filtered( lambda m: m.date_done >= date_start and m.date_done <= date_end ) + if not self.env.context.get("date_check_iterval_restrict", False): + date_start = False inv_lines = moves_in_date.mapped("invoice_line_ids").filtered( lambda l: l.check_invoice_line_in_date( date_end, diff --git a/account_sale_stock_report_non_billed/wizard/account_sale_stock_report_non_billed_wiz.py b/account_sale_stock_report_non_billed/wizard/account_sale_stock_report_non_billed_wiz.py index 0424a0c8148f..e69e9158d85c 100644 --- a/account_sale_stock_report_non_billed/wizard/account_sale_stock_report_non_billed_wiz.py +++ b/account_sale_stock_report_non_billed/wizard/account_sale_stock_report_non_billed_wiz.py @@ -118,11 +118,15 @@ def open_at_date(self): search_view_id = self.env.ref( "account_sale_stock_report_non_billed.view_move_search" ).id - context = dict(self.env.context, date_check_invoiced_moves=self.date_check) + context = dict( + self.env.context, + date_check_invoiced_moves=self.date_check, + date_check_invoiced_moves_start=self.stock_move_non_billed_threshold, + ) if self.interval_restrict_invoices: context = dict( context, - date_check_invoiced_moves_start=self.stock_move_non_billed_threshold, + date_check_iterval_restrict=self.interval_restrict_invoices, ) action = { "type": "ir.actions.act_window",