(cr, registry)
Set the intrastat field of the private fiscal position records.
    This is necessary for the intrastat report generation
Set the intrastat field of the private fiscal position records.
    This is necessary for the intrastat report generation
Set the intrastat field of the private fiscal position records . This is necessary for the intrastat report generation
def post_init_hook(cr, registry):
    """Set the intrastat field of the private fiscal position records.
    This is necessary for the intrastat report generation
    """
    env = api.Environment(cr, SUPERUSER_ID, {})
    items = env["ir.model.data"].search(
        [
            ("model", "=", "account.fiscal.position"),
            ("name", "like", "%_fp_intra_private"),
            ("module", "=", "l10n_es"),
        ]
    )
    env["account.fiscal.position"].browse(items.mapped("res_id")).write(
        {"intrastat": True}
    )
def post_init_hook ( cr , registry ) : env = api . Environment ( cr , SUPERUSER_ID , { } ) items = env [ "ir.model.data" ] . search ( [ ( "model" , "=" , "account.fiscal.position" ) , ( "name" , "like" , "%_fp_intra_private" ) , ( "module" , "=" , "l10n_es" ) , ] ) env [ "account.fiscal.position" ] . browse ( items . mapped ( "res_id" ) ) . write ( { "intrastat" : True } )