(self)
return True
Computes the records in report.
Computes the records in report.
Computes the records in report .
def calculate(self):
        """Computes the records in report."""
        self.ensure_one()
        with self.env.norecompute():
            self._cleanup_report()
            taxes = self._get_taxes()
            # Get all the account moves
            move_lines = self.env["account.move.line"].search(
                self._account_move_line_domain(taxes)
            )
            # If the type of presentation is complementary, remove records that
            # already exist in other presentations
            if self.statement_type == "C":
                prev_details = self.partner_record_detail_ids.search(
                    [
                        ("move_line_id", "in", move_lines.ids),
                        ("report_id", "!=", self.id),
                    ]
                )
                move_lines -= prev_details.mapped("move_line_id")
                prev_details = self.partner_refund_detail_ids.search(
                    [
                        ("refund_line_id", "in", move_lines.ids),
                        ("report_id", "!=", self.id),
                    ]
                )
                move_lines -= prev_details.mapped("refund_line_id")
            self._create_349_details(move_lines)
            self._create_349_invoice_records()
            self._create_349_refund_records()
        # Recompute all pending computed fields
        self.recompute()
        return True
def calculate ( self ) : self . ensure_one ( ) with self . env . norecompute ( ) : self . _cleanup_report ( ) taxes = self . _get_taxes ( ) # Get all the account moves move_lines = self . env [ "account.move.line" ] . search ( self . _account_move_line_domain ( taxes ) ) # If the type of presentation is complementary, remove records that # already exist in other presentations if self . statement_type == "C" : prev_details = self . partner_record_detail_ids . search ( [ ( "move_line_id" , "in" , move_lines . ids ) , ( "report_id" , "!=" , self . id ) , ] ) move_lines -= prev_details . mapped ( "move_line_id" ) prev_details = self . partner_refund_detail_ids . search ( [ ( "refund_line_id" , "in" , move_lines . ids ) , ( "report_id" , "!=" , self . id ) , ] ) move_lines -= prev_details . mapped ( "refund_line_id" ) self . _create_349_details ( move_lines ) self . _create_349_invoice_records ( ) self . _create_349_refund_records ( ) # Recompute all pending computed fields self . recompute ( ) return True